valid-file-url
Overview
This rule belongs to the import-validation
ruleset and states that:
The URL provided to a file must be publicly accessible and must point directly to a raw file. This means that the URL must not point to some kind of file documentation like SwaggerHub, Apiary, etc. Instead, a raw file in JSON/XML/YAML/Markdown/ZIP format must exist at the URL provided. URLs like localhost are not supported.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Blocking |
Message | API specification could not be loaded from the given URL. |
Code | IMPORT_V003 |
Type | Validation |
Rule System | Semantic |
Broad Category | File I/O Accessibility |
Tags | import api specification api file validation url path absolute path read |
Suggested Fixes
- Make sure that the URL is publicly available. This means that the file is not hidden behind authentication or the URL does not use a local server (e.g. localhost).
- Make sure that the URL is valid and does not contain any forbidden characters preventing accessibility.
- Make sure that the file exists at the URL provided.
- Make sure that the URL you provide does not point to some kind of API documentation. The URL must point to a raw file in one of the supported formats.
- Ensure that you are not using the URL obtained from exporting an API from your APIMatic Dashboard. The URL provided must be a publicly accessible link.