Define & Validate APIsValidation RulesetsAPIMatic Rulesets
APIMatic Linting for Portal Generation
APIMatic performs some preliminary linting checks on the user-provided API specification file to ensure that the docs/portal generation produces the desired output.
| Property | Value |
|---|---|
| Ruleset ID | apimatic-docs-linting |
| Code prefix | APIMATICDOCS_L |
| Type | Linting |
| Default severity | Warning |
| Rule system | Semantic |
| Rules | 13 |
Description
| Code | Rule | Severity | What it checks |
|---|---|---|---|
APIMATICDOCS_L001 | required-description-all-entities | Information | Each element in the API specification must have a non-null non-empty description. |
APIMATICDOCS_L002 | required-entity-description | Information | Component must have a non-null non-empty description. |
Examples
| Code | Rule | Severity | What it checks |
|---|---|---|---|
APIMATICDOCS_L101 | required-entity-example-value | Information | Component must have a non-null, non-empty and valid example/sample value. |
APIMATICDOCS_L102 | required-example-value-or-external-url | Warning | An example entry from the multiple examples list must have either an example value set or an alternate external URL from which the example value can be fetched. |
APIMATICDOCS_L103 | no-example-for-error-with-no-model | Warning | An example must not be set for a error response that has no error model linked to it. |
APIMATICDOCS_L104 | valid-example-value | Warning | The sample value provided must be valid according to the type definition of the component to which it belongs. |
APIMATICDOCS_L105 | example-value-restrictions | Warning | The sample value provided must obey all restrictions placed in the corresponding type definition. |
APIMATICDOCS_L106 | no-undeclared-fields-in-example-value | Warning | All undeclared fields from the component's example must be defined in the component's type definition. If any fields are extra, they should be removed from the example. |
APIMATICDOCS_L107 | unique-example-ids | Warning | The ids assigned to examples provided for a component must be unique. |
APIMATICDOCS_L108 | non-empty-non-null-example-id | Warning | All examples provided for a component must be assigned unique, non-empty and non-null ids. |
APIMATICDOCS_L109 | valid-example-external-value-url | Warning | The external URL provided for example, from which the example value is retrieved, must be a valid publicly-accessible URL. |
APIMATICDOCS_L110 | no-read-only-property-in-parameter-example | Warning | An example provided for a complex type parameter must not contain properties that are marked as read-only. Such properties may only be set in a response but should not be part of the request. |
APIMATICDOCS_L111 | no-write-only-property-in-response-example | Warning | An example provided for a complex type response must not contain properties that are marked as write-only. Such properties may only be sent as part of the request but should not be set in the response. |
Learn more
APIMatic Preliminary Linting
APIMatic performs some preliminary linting checks on the user-provided API specification to ensure that the API specification document produces desired output in any of the APIMatic products including API Transformer, SDK/Portal generation, etc.
OpenAPI Rulesets Overview
The rulesets APIMatic uses to validate and lint OpenAPI documents.