Define & Validate APIsValidation RulesetsAPIMatic Rulesets
Input File Validation
Validation checks performed on the API specification and related files provided by the user.
| Property | Value |
|---|---|
| Ruleset ID | input-file-validation |
| Code prefix | INPUTFILE_V |
| Type | Validation |
| Default severity | Blocking |
| Rule system | Semantic |
| Rules | 10 |
File I/O Accessibility
| Code | Rule | Severity | What it checks |
|---|---|---|---|
INPUTFILE_V001 | valid-directory-path | Blocking | The path provided to a directory must be an absolute path and the specified directory must exist at that path. |
INPUTFILE_V002 | valid-file-path | Blocking | If a file path is provided, the file must exist at that path and be accessible. If path is relative, ensure that the file exists relative to the document/process referencing it, at the same path. If an absolute path is provided, it must be valid and accessible. |
INPUTFILE_V003 | valid-file-url | Blocking | 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. |
INPUTFILE_V004 | documentation-url-redirection | Information | The URL provided to a file must be publicly accessible and must point directly to a raw file. In some cases where the file points to a public documentation of the API instead of a raw API description file, APIMatic supports auto-redirection to the raw file. The URL may change in this case. |
File I/O Content
| Code | Rule | Severity | What it checks |
|---|---|---|---|
INPUTFILE_V100 | non-empty-file | Warning | File contents must not be empty or null or inaccessible. |
INPUTFILE_V101 | file-pre-loaded | Blocking | File must be loaded successfully into the APIMatic system for it to be processed further. |
INPUTFILE_V102 | main-file-known-format | Blocking | When providing a single or multi-file input, the input must contain a main API definition file in one of the following formats: OpenAPI/Swagger, RAML, API Blueprint, Postman, Insomnia, WSDL, WADL, Google Discovery, I/O Docs, APIMATIC. If no main API description file is found, the first recognizable data description file like JSON, JSON Schema, YAML, XML, XML Schema, etc. may be chosen as the main file. |
INPUTFILE_V103 | recognized-file-format | Warning | A file provided must be in a recognized format. The format could be an API description format like OpenAPI, Swagger, API Blueprint, RAML, Postman, Insomnia, WSDL, WADL etc. or a data description format like JSON, JSON Schema, YAML, XML, XML Schema, etc. or a documentation format like Markdown or text .txt. |
INPUTFILE_V104 | single-main-api-description-file | Warning | For multi-file upload, the files must consist of a single main API description file only while the rest of the files must be related in some way to this main file e.g. files referenced by the main file. Including multiple main API description files (e.g. multiple OpenAPI files or an OpenAPI file along with a RAML file, etc.) is not allowed. If multiple main files are discovered, only the first will be considered. |
References Rules
| Code | Rule | Severity | What it checks |
|---|---|---|---|
INPUTFILE_V200 | resolvable-reference | Blocking | If a component is referenced using a local or external reference path, the path must be resolvable. |