required-openapi-version
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The OpenAPI specification's root object must specify the openapi
property to indicate the version of the OpenAPI standard document you are using to define your specification.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Blocking |
Message | Version number of the OpenAPI standard document is missing. |
Code | OPENAPI3STANDARDS_V001 |
Type | Validation |
Rule System | Semantic |
Broad Category | OpenAPI Root Information |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation version |
Suggested Fixes
- Make sure that you have added the
openapi
property in the root JSON/YAML object. - Check that you are not using properties like
swagger,
swaggerVersionor
openapiVersion` to specify the version. - The value of the
openapi
property must be a valid semantic version number of the OpenAPI standard document in the 3.0.n range e.g. 3.0.0.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/