required-swagger-version
Overview
This rule belongs to the swagger-v1-validation
ruleset and states that:
The Swagger specification's root object must specify the 'swaggerVersion' property to indicate the version of the Swagger standard document you are using to define your specification. Supported versions include the following: 1.0
, 1.1
, 1.2
.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Blocking |
Message | Specification version number of the Swagger document is empty or missing. |
Code | SWAGGER1_V001 |
Type | Validation |
Rule System | Semantic |
Broad Category | Basic Structure |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | swagger1 swagger semantic validation version |
Suggested Fixes
- Make sure that you have added the
swaggerVersion
property in the root JSON object. - Ensure that the value of
swaggerVersion
property is not null/empty and is set either as1.0
,1.1
or1.2
. - Check that you are not using properties like
swagger
,openapi
, oropenapiVersion
to specify the version. - This version is not to be confused with the API version or the API specification document version which is specified using the
apiVersion
property.