Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityBlocking
MessageSpecification version number of the Swagger document is empty or missing.
CodeSWAGGER1_V001
TypeValidation
Rule SystemSemantic
Broad CategoryBasic Structure
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger1 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 as 1.0, 1.1 or 1.2.
  • Check that you are not using properties like swagger, openapi, or openapiVersion 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.

For More Information