valid-url-format
Overview
This rule belongs to the openapi-v3-syntax-validation
ruleset and states that:
String value should be in the format of a proper URL. The URL path can be relative only if a server URL exists in the API document to help resolve the URL path into an absolute path.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | URL is invalid. |
Code | OPENAPI3SYNTAX_V220 |
Type | Validation |
Rule System | Syntax |
Broad Category | Miscellaneous |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi syntax validation url |
Suggested Fixes
- If the URL is a relative path, ensure that OpenAPI Server Object contains a server URL.
- If the OpenAPI document does not contain any servers information, ensure that the URL is an absolute path.
- Ensure that the URL does not contain any forbidden characters.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#relative-references-in-urls
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#relative-references-in-urls
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/