Define & Validate APIsValidation RulesetsAPIMatic Rulesets
Metadata File Validation
Validation checks on the APIMatic Metadata file provided with your API definition.
| Property | Value |
|---|---|
| Ruleset ID | metadata-validation |
| Code prefix | METADATA_V |
| Type | Validation |
| Default severity | Error |
| Rule system | Semantic |
| Rules | 7 |
Metadata Structure
| Code | Rule | Severity | What it checks |
|---|---|---|---|
METADATA_V001 | valid-metadata-syntax | Error | The APIMatic Metadata file must follow the metadata file syntax, with each property using its expected type. |
METADATA_V002 | no-metadata-additional-property | Error | The APIMatic Metadata file must not contain properties APIMatic does not support. Property names are case-sensitive. |
Validation Configuration
| Code | Rule | Severity | What it checks |
|---|---|---|---|
METADATA_V200 | valid-ruleset-id-or-code | Error | Each key in the Rulesets map of the validation configuration must be non-empty and unique. For a built-in ruleset, the key must match that ruleset's Id or Code. |
METADATA_V201 | valid-custom-ruleset-file-path | Error | The FilePath of a custom ruleset must be a non-empty relative path, not a URL, and must point to a readable ruleset file. |
METADATA_V202 | valid-rule-id-or-code | Error | When configuring a rule in a ruleset, the rule identifier must match the Id or Code of an existing rule in that ruleset. |
Merge Configuration
| Code | Rule | Severity | What it checks |
|---|---|---|---|
METADATA_V300 | at-least-one-api-directory-for-merging | Error | When MergeConfiguration > MergeApis is enabled, at least one API directory must exist next to the metadata file. |
METADATA_V301 | valid-merge-order-directory-path | Error | Every entry in MergeConfiguration > MergeOrderOfDirectories must be a relative path to a directory that exists next to the metadata file. |
Input File Validation
Validation checks performed on the API specification and related files provided by the user.
APIMatic Preliminary Validation
APIMatic performs some preliminary validation checks on the user-provided API specification document to ensure that it meets the basic requirements for generating a valid output from any of the APIMatic products including API Transformer, SDK/Portal generation, etc.