Define & Validate APIsValidation RulesetsAPIMatic Rulesets

Input File Validation

Validation checks performed on the API specification and related files provided by the user.

PropertyValue
Ruleset IDinput-file-validation
Code prefixINPUTFILE_V
TypeValidation
Default severityBlocking
Rule systemSemantic
Rules10

File I/O Accessibility

CodeRuleSeverityWhat it checks
INPUTFILE_V001valid-directory-pathBlockingThe path provided to a directory must be an absolute path and the specified directory must exist at that path.
INPUTFILE_V002valid-file-pathBlockingIf 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_V003valid-file-urlBlockingThe 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_V004documentation-url-redirectionInformationThe 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

CodeRuleSeverityWhat it checks
INPUTFILE_V100non-empty-fileWarningFile contents must not be empty or null or inaccessible.
INPUTFILE_V101file-pre-loadedBlockingFile must be loaded successfully into the APIMatic system for it to be processed further.
INPUTFILE_V102main-file-known-formatBlockingWhen 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_V103recognized-file-formatWarningA 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_V104single-main-api-description-fileWarningFor 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

CodeRuleSeverityWhat it checks
INPUTFILE_V200resolvable-referenceBlockingIf a component is referenced using a local or external reference path, the path must be resolvable.

On this page