Define & Validate APIsValidation RulesetsOpenAPI Rulesets
Swagger v2 Standard Validation
Validation checks performed on provided Swagger v2 file to check its conformance to rules set by the Swagger v2 official standards document.
| Property | Value |
|---|---|
| Ruleset ID | swagger-v2-standards-validation |
| Code prefix | SWAGGER20STANDARDS_V |
| Type | Validation |
| Default severity | Error |
| Rule system | Semantic |
| Rules | 121 |
Swagger Root Information
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V001 | required-swagger-version | Blocking | The Swagger specification's root object must specify the 'swagger' property to indicate the version of the Swagger standard document you are using to define your specification. |
SWAGGER20STANDARDS_V002 | valid-swagger-version | Error | Your Swagger specification's root object must specify a valid Swagger standard document version using the 'swagger' property. The value must be a valid semantic version number of the Swagger standard document, i.e. it must be 2.0. |
SWAGGER20STANDARDS_V003 | required-api-info | Error | The Swagger root object must specify metadata about the API using the info property. |
SWAGGER20STANDARDS_V004 | required-paths | Error | The Swagger root object in a Swagger v2.0 document must specify the available paths and operations for the API using the paths property. |
SWAGGER20STANDARDS_V005 | no-schemes-sub-paths-in-host | Error | In Swagger 2.0, the host field is intended to represent the hostname (and optionally the port number) where the API is hosted. This violation occurs when the host field includes the scheme (such as http:// or https://) or sub-paths (additional path segments) that are not supported according to the Swagger 2.0 specification. |
SWAGGER20STANDARDS_V006 | valid-api-schemes | Error | The only valid transfer protocols applicable to the API, as per the Swagger v2.0 document, are: http, https, ws, wss. |
Info
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V020 | required-info-title | Error | The Info Object must specify a title of the API using the title property. If title information is missing, a default value will be assigned automatically during import/transformations in APIMatic. |
SWAGGER20STANDARDS_V021 | required-info-version | Error | The Info Object must specify a version number for the current application API using the version property. |
License
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V030 | required-license-name | Error | The License Object must specify name of the license (used for the API) using the name property. |
Paths
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V040 | unique-path | Error | Path keys are patterned fields that must have unique values within the Paths Object. |
Path Items
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V050 | path-item-reference-is-a-path-item-object | Error | When $ref is used within a Path Item Object, it must point to a valid Path Item Object defined elsewhere and which will replace the current Path Item Object with its contents. The $ref must eventually resolve into a Path Item Object (and no other type of object). The resolved object should not contain $ref as a property i.e. the references must not form an endless loop. |
SWAGGER20STANDARDS_V051 | unique-path-item-parameter | Error | The parameters list provided using the 'parameters' property in the Path Item Object must not include any duplicate parameter definitions. A unique parameter is defined by a combination of its name and location. |
SWAGGER20STANDARDS_V052 | only-one-body-parameter-in-path-item-parameters | Error | The parameters list provided using the 'parameters' property in the Path Item Object must not include more than one 'body' parameter definitions. If multiple body parameters are found, their location will be automatically updated to formData during import/transformations in APIMatic. |
Operations
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V065 | required-operation-responses | Error | The Operation Object in a Swagger 2.0 document must specify list of possible responses that can be returned from executing this operation, using the responses property. |
SWAGGER20STANDARDS_V066 | unique-operation-id | Error | The id specified in the Operation Object using the operationId property must be unique among all operations described in the current API specification document. |
SWAGGER20STANDARDS_V067 | unique-operation-parameter | Error | The parameters list provided using the parameters property in the Operation Object must not include any duplicate parameter definitions. A unique parameter is defined by a combination of its name and location. |
SWAGGER20STANDARDS_V068 | only-one-body-parameter-in-operation-parameters | Error | The parameters list provided using the 'parameters' property in the Operation Object must not include more than one 'body' parameter definitions. Body parameters with different names should also not be defined simultaneously in the Operation Object and Path Item Object. If multiple body parameters are found, their location will be automatically updated to formData during import/transformations in APIMatic. |
SWAGGER20STANDARDS_V069 | valid-operation-schemes | Error | The only valid transfer protocols applicable to the operation schemes, as per the Swagger v2.0 document, are: http, https, ws, wss. |
External Documentation
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V085 | required-external-documentation-url | Error | The External Documentation Object must specify the URL for the target documentation using the url property. |
Parameters
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V095 | required-parameter-name | Error | The Parameter Object must specify a name for the parameter using the name property. The name is API/service defined and must not be null or empty. |
SWAGGER20STANDARDS_V096 | required-parameter-location | Error | The Parameter Object must specify a location for the parameter using the in property. The location identifies where the parameter needs to be sent in the request and must not be null or empty. Possible values are 'query', 'header', 'path', 'formData' or 'body'. If parameter location is not set, query will be assumed by default automatically during import/transformations in APIMatic. |
SWAGGER20STANDARDS_V097 | valid-parameter-location | Error | Location of a parameter specified using the in property in the Parameter Object must have one of the following possible values only: query, header, path, formData or body. All other values will be treated as invalid. |
SWAGGER20STANDARDS_V098 | required-non-body-parameter-type | Error | The Parameter Object must specify a type for the non-body parameters using the type property. The type identifies the data type of the parameter and must not be null or empty. Possible values are string, number, integer, boolean, array or file. If type information is missing, type string will be assumed by default automatically during import/transformations in APIMatic. |
SWAGGER20STANDARDS_V099 | valid-non-body-parameter-type | Error | Type of a non-body parameter specified using the type property in the Parameter Object must have one of the following possible values only: string, number, integer, boolean, array or file. All other values will be treated as invalid. |
SWAGGER20STANDARDS_V100 | required-body-parameter-schema | Error | The Parameter Object must specify a schema for body parameters using the schema property. |
SWAGGER20STANDARDS_V101 | path-parameter-exists-in-path-url-template | Error | If a parameter is defined in the parameters list with location set as path, a corresponding URL segment in the path URL must exist for that parameter. A path URL can use curly braces ({}) to mark a section of a URL path as replaceable with a path parameter value. The name specified within these braces must match exactly with the name of the path parameter defined in the parameters list. |
SWAGGER20STANDARDS_V102 | required-path-parameter-required-attribute | Error | If the Parameter Object location is set to path it must specify the property required with value set to true. |
SWAGGER20STANDARDS_V103 | path-parameter-cannot-be-optional | Error | If the location is set as path, the parameter must be set as required using the property required of the Parameter Object. The value of this property must be set to true. If a path parameter is marked as optional, it will automatically be marked as required during import/transformations in APIMatic. |
SWAGGER20STANDARDS_V104 | body-and-form-parameters-cannot-co-exist | Error | Body and form parameters cannot exist together for the same operation in the payload. |
SWAGGER20STANDARDS_V105 | valid-request-content-type-for-form-parameters | Error | Content type of the request for form parameters defined in consumes list can either be application/x-www-form-urlencoded, multipart/form-data or both only. |
SWAGGER20STANDARDS_V106 | valid-mime-types-for-file-type-parameter | Error | For parameters having type file, the consumes property must be either multipart/form-data, application/x-www-form-urlencoded or both only. |
SWAGGER20STANDARDS_V107 | valid-location-for-file-type-parameter | Error | For file type parameters, the parameter's location must be formData. Form is the only parameter type that can be used to send files, thus supporting the file type. |
SWAGGER20STANDARDS_V108 | allow-empty-value-only-for-form-and-query-parameter | Error | The allowEmptyValue property sets the ability to pass empty-valued parameters. This is valid only for either query or formData parameters and allows you to send a parameter with a name only or an empty value. |
SWAGGER20STANDARDS_V109 | required-items-for-array-type-parameter | Error | The Parameter Object of type array must specify items for the parameter using items property. This property describes the type of items in the array. |
SWAGGER20STANDARDS_V110 | valid-parameter-collection-format | Error | The collectionFormat value determines the format of the array for parameters of type array. This must have one of the following possible values only: csv, ssv, tsv, pipes or multi only. |
SWAGGER20STANDARDS_V111 | multi-collection-format-only-for-form-and-query-parameter | Error | The value multi can only be assigned to the collectionFormat property if the parameter's location is either query or formData only. |
SWAGGER20STANDARDS_V112 | valid-parameter-default-value-type | Error | Default value must conform to the defined type for this parameter, which is defined by the type property. |
SWAGGER20STANDARDS_V113 | parameter-maximum-exists-for-exclusive-maximum | Error | The parameter must have the maximum property defined if the exclusiveMaximum property has been defined. |
SWAGGER20STANDARDS_V114 | parameter-minimum-exists-for-exclusive-minimum | Error | The parameter must have the minimum property defined if the exclusiveMinimum property has been defined. |
SWAGGER20STANDARDS_V115 | parameter-non-negative-max-length | Error | The numeric validation keyword maxLength for the parameter, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V116 | parameter-non-negative-min-length | Error | The numeric validation keyword minLength for the parameter, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V117 | parameter-non-negative-max-items | Error | The numeric validation keyword maxItems for the parameter, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V118 | parameter-non-negative-min-items | Error | The numeric validation keyword minItems for the parameter, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V119 | at-least-one-entry-in-parameter-enum-list | Error | If an enumeration list is declared using the enum property for the parameter, it must contain at least one element which can be used for substitution i.e. the enumeration array must not be empty. |
SWAGGER20STANDARDS_V120 | unique-parameter-enum-list-entries | Error | The enumeration list declared using the enum property for the parameter, must not contain any duplicate values i.e. they must all be unique. |
SWAGGER20STANDARDS_V121 | parameter-multiple-of-greater-than-zero | Error | The numeric validation keyword multipleOf for the parameter, must have a value that is strictly greater than zero (0). |
Array Items
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V150 | required-items-type | Error | The Items Object must specify the type of the array using the type property. |
SWAGGER20STANDARDS_V151 | valid-items-type | Error | The type of the items array specified using property type of the Items Object must have only one of the following values: string, number, integer, boolean, or array. Other types are not supported or allowed. |
SWAGGER20STANDARDS_V152 | required-items-of-array-type-items | Error | The Items Object of type array must specify items for the internal array using items property. This property describes the type of items in the internal array. |
SWAGGER20STANDARDS_V153 | valid-items-collection-format | Error | The collectionFormat value determines the format of the array for items of type array. This must have one of the following possible values only: csv, ssv, tsv, or pipes only. |
SWAGGER20STANDARDS_V154 | valid-items-default-value-type | Error | Default value must conform to the defined type for the Items Object defined at the same level in a Swagger 2.0 document. |
SWAGGER20STANDARDS_V155 | items-maximum-exists-for-exclusive-maximum | Error | The items object must have the maximum property defined if the exclusiveMaximum property has been defined. |
SWAGGER20STANDARDS_V156 | items-minimum-exists-for-exclusive-minimum | Error | The items object must have the minimum property defined if the exclusiveMinimum property has been defined. |
SWAGGER20STANDARDS_V157 | items-non-negative-max-length | Error | The numeric validation keyword maxLength for the items object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V158 | items-non-negative-min-length | Error | The numeric validation keyword minLength for the items object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V159 | items-non-negative-max-items | Error | The numeric validation keyword maxItems for the items object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V160 | items-non-negative-min-items | Error | The numeric validation keyword minItems for the items object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V161 | at-least-one-entry-in-items-enum-list | Error | If an enumeration list is declared using the enum property for the items object, it must contain at least one element which can be used for substitution i.e. the enumeration array must not be empty. |
SWAGGER20STANDARDS_V162 | unique-items-enum-list-entries | Error | The enumeration list declared using the enum property for the items object, must not contain any duplicate values i.e. they must all be unique. |
SWAGGER20STANDARDS_V163 | items-multiple-of-greater-than-zero | Error | The numeric validation keyword multipleOf for the items object, must have a value that is strictly greater than zero (0). |
Responses
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V180 | at-least-one-response-code-in-responses | Error | The Responses Object must contain at least one response code which is recommended to be the response for a successful operation call. |
SWAGGER20STANDARDS_V181 | unique-response-http-status-code | Error | Response keys are patterned fields that must have unique values within the Responses Object. The keys represent the HTTP status code for each response. |
SWAGGER20STANDARDS_V182 | required-response-description | Error | The Response Object must define a short user-friendly description of the response using the description property. The description may provide details of what the response means, why the particular response was returned etc. e.g. if the corresponding response status is an error code, the description can provide users more details about why the error occurred. |
Response Examples
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V200 | unique-example-mime-type | Error | Mime type keys are patterned fields that must have unique values within the Example Object. The keys represent the mime type for each example. |
SWAGGER20STANDARDS_V201 | example-mime-type-exists-in-operation-produces | Error | The mime type specified in the Example Object must be one of the Operation Object produces property values (either implicit or inherited). |
Response Headers
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V220 | unique-response-header | Error | Response header keys are patterned fields that must have unique values within the Headers Object. The keys represent the names of the headers for each response. |
SWAGGER20STANDARDS_V221 | required-response-header-type | Error | The Header Object must specify the type of the object using the type property. |
SWAGGER20STANDARDS_V222 | valid-response-header-type | Error | The type of the header object specified using property type of the Header Object must have only one of the following values: string, number, integer, boolean, or array. Other types are not supported or allowed. |
SWAGGER20STANDARDS_V223 | required-array-response-header-items | Error | The Header Object of type array must specify items for the array using items property. This property describes the type of items in the array. |
SWAGGER20STANDARDS_V224 | valid-response-header-collection-format | Error | The collectionFormat value determines the format of the array for headers of type array. This must have one of the following possible values only: csv, ssv, tsv, or pipes only. |
SWAGGER20STANDARDS_V225 | valid-response-header-default-value-type | Error | Default value must conform to the defined type for the Header Object defined at the same level in a Swagger 2.0 document. |
SWAGGER20STANDARDS_V226 | response-header-maximum-exists-for-exclusive-maximum | Error | The header object must have the maximum property defined if the exclusiveMaximum property has been defined. |
SWAGGER20STANDARDS_V227 | response-header-minimum-exists-for-exclusive-minimum | Error | The header object must have the minimum property defined if the exclusiveMinimum property has been defined. |
SWAGGER20STANDARDS_V228 | response-header-non-negative-max-length | Error | The numeric validation keyword maxLength for the header object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V229 | response-header-non-negative-min-length | Error | The numeric validation keyword minLength for the header object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V230 | response-header-non-negative-max-items | Error | The numeric validation keyword maxItems for the header object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V231 | response-header-non-negative-min-items | Error | The numeric validation keyword minItems for the header object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V232 | at-least-one-entry-in-response-header-enum-list | Error | If an enumeration list is declared using the enum property for the header object, it must contain at least one element which can be used for substitution i.e. the enumeration array must not be empty. |
SWAGGER20STANDARDS_V233 | unique-response-header-enum-list-entries | Error | The enumeration list declared using the enum property for the header object, must not contain any duplicate values i.e. they must all be unique. |
SWAGGER20STANDARDS_V234 | response-header-multiple-of-greater-than-zero | Error | The numeric validation keyword multipleOf for the header object, must have a value that is strictly greater than zero (0). |
Tags
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V260 | required-tag-name | Error | The Tag Object must specify a user-friendly name for the tag using the name property. |
SWAGGER20STANDARDS_V261 | unique-tag-name | Error | The list of root Swagger Object level tags must have a unique name assigned to them in the Tag Object definition using the name property. |
References
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V280 | object-can-be-a-reference | Error | A Swagger object can be replaced by a Reference Object if the Swagger v2 Specification explicitly states that the value may be a reference. You can therefore, not use $ref in objects that do not allow replacement by a Reference Object. |
SWAGGER20STANDARDS_V281 | no-dollar-ref-sibling-properties | Warning | The Reference Object can only contain the property $ref and any sibling properties are not allowed. If specified, the additional properties will be ignored. |
Schemas
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V300 | valid-schema-type | Error | The property type in a Schema Object can have only of the following values: array, object, boolean, integer, number, string. Type null and other types are not allowed. |
SWAGGER20STANDARDS_V301 | valid-schema-default-value-type | Error | Default value must conform to the defined type for this schema, which is defined by the type property. |
SWAGGER20STANDARDS_V302 | schema-multiple-of-greater-than-zero | Error | The numeric validation keyword multipleOf for the schema object, must have a value that is strictly greater than zero (0). |
SWAGGER20STANDARDS_V303 | schema-maximum-exists-for-exclusive-maximum | Error | The schemaobject must have themaximumproperty defined if theexclusiveMaximum` property has been defined. |
SWAGGER20STANDARDS_V304 | schema-minimum-exists-for-exclusive-minimum | Error | The schema object must have the minimum property defined if the exclusiveMinimum property has been defined. |
SWAGGER20STANDARDS_V305 | schema-non-negative-max-length | Error | The numeric validation keyword maxLength for the schema object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V306 | schema-non-negative-min-length | Error | The numeric validation keyword minLength for the schema object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V307 | schema-non-negative-max-items | Error | The numeric validation keyword maxItems for the schema object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V308 | schema-non-negative-min-items | Error | The numeric validation keyword minItems for the schema object, must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V309 | schema-non-negative-max-properties | Error | The numeric validation keyword maxProperties must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V310 | schema-non-negative-min-properties | Error | The numeric validation keyword minProperties must have a non-negative integer value i.e. the value must be greater than or equal to 0. |
SWAGGER20STANDARDS_V311 | at-least-one-property-in-schema-required-list | Error | If property required is specified in the Schema Object of a Swagger 2.0 document, it must be a list containing at least one schema property name that needs to be marked as mandatory. |
SWAGGER20STANDARDS_V312 | unique-properties-in-schema-required-list | Error | A property can only be marked as required once in the list of required properties, specified using property required of the Schema Object i.e. the items in this list must be unique and must be strings. |
SWAGGER20STANDARDS_V313 | at-least-one-entry-in-schema-enum-list | Error | If an enumeration list is declared using the enum property for the schema object, it must contain at least one element which can be used for substitution i.e. the enumeration array must not be empty. |
SWAGGER20STANDARDS_V314 | unique-schema-enum-list-entries | Error | The enumeration list declared using the enum property for the schema object, must not contain any duplicate values i.e. they must all be unique. |
SWAGGER20STANDARDS_V315 | pre-defined-schema-property-for-discriminator | Error | The name specified for the discriminator in the Schema Object must correspond with a schema property definition in the properties of the schema object it is part of. |
SWAGGER20STANDARDS_V316 | discriminator-property-name-exists-in-schema-required-list | Error | The name specified for the discriminator in the Schema Object must correspond with a required property name defined in the required property of the schema object it is part of. |
SWAGGER20STANDARDS_V317 | no-inline-schemas-in-polymorphism | Error | Inline schema definitions, which do not have a given id, cannot be used in polymorphism. When using the discriminator, inline schemas will not be considered. |
Reusable Definitions
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V350 | unique-definition-name | Error | The definitions keys are patterned fields that must have unique values within the Definitions Object. The keys represent the names of the definitions that can be consumed and produced by operations. |
SWAGGER20STANDARDS_V351 | unique-parameter-definition-name | Error | The parameter definitions keys are patterned fields that must have unique values within the Parameter Definitions Object. The keys represent the names of the parameter definitions that can be reused across operations. |
SWAGGER20STANDARDS_V352 | unique-response-definition-name | Error | The response definitions keys are patterned fields that must have unique values within the Response Definitions Object. The keys represent the names of the response definitions that can be reused across operations. |
Security Schemes
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V370 | unique-security-scheme-name | Error | The security definitions keys are patterned fields that must have unique values within the Security Definitions Object. The keys represent the names of the security definitions that are available to be used in the specification. |
SWAGGER20STANDARDS_V371 | required-security-scheme-type | Error | The Security Scheme Object must specify the type of the security scheme using the type property. |
SWAGGER20STANDARDS_V372 | valid-security-scheme-type | Error | The type of the security scheme specified using property type of the Security Scheme Object must have only one of the following values: apiKey, basic or oauth2. Other types are not supported or allowed. |
SWAGGER20STANDARDS_V373 | required-api-key-security-scheme-parameter-name | Error | If the security scheme type is API Key (i.e. type is set to apiKey), the Security Scheme Object must specify a name for the API Key parameter using the name property. If name information is not provided, apikey will be assumed by default automatically during import/transformations in APIMatic. |
SWAGGER20STANDARDS_V374 | required-api-key-security-scheme-parameter-location | Error | If the security scheme type is API Key (i.e. type is set to apiKey), the Security Scheme Object must specify a location for the API Key parameter using the in property. Valid values for location are query or header. If location information is missing, query will be assumed by default automatically during import/transformations in APIMatic. |
SWAGGER20STANDARDS_V375 | valid-api-key-security-scheme-parameter-location | Error | The location of the API key specified using property in of the Security Scheme Object must have only one of the following values: query, or header. Other types are not supported nor allowed. |
SWAGGER20STANDARDS_V376 | required-oauth2-security-scheme-flow | Error | If the security scheme type is OAuth 2.0 (i.e. type is set to oauth2), the Security Scheme Object must specify the flow used by the OAuth 2.0 security scheme, using the flow property. It must have only one of the following values: implicit, password, application or accessCode. |
SWAGGER20STANDARDS_V377 | valid-oauth2-security-scheme-flow-type | Error | The flow of the OAuth 2.0 security scheme specified using property flow of the Security Scheme Object must have only one of the following values: implicit, password, application or accessCode. Other types are not supported nor allowed. |
SWAGGER20STANDARDS_V378 | required-oauth2-security-scheme-authorization-url | Error | If the flow type is set as implicit or accessCode in the OAuth 2.0 Security Scheme Object, then the OAuth 2.0 Security Scheme Object must specify the authorization URL to be used for this flow, using the authorizationUrl property. |
SWAGGER20STANDARDS_V379 | required-oauth2-security-scheme-token-url | Error | If the flow type is set as password, application or accessCode in the OAuth 2.0 Security Scheme Object, then the OAuth 2.0 Security Scheme Object must specify the token URL to be used for this flow, using the tokenUrl property. |
SWAGGER20STANDARDS_V380 | required-oauth2-security-scheme-scopes | Error | For all flow types, the OAuth 2.0 Security Scheme Object must specify the available scopes for the OAuth2 security scheme token URL, using the scopes property. |
Scopes
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V400 | unique-scope-name | Error | The scope keys are patterned fields that must have unique values within the Scopes Object. The keys represent the names of the available scopes for an OAuth 2.0 security scheme. |
Security Requirements
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V410 | unique-security-requirement-name | Error | The security requirement keys are patterned fields that must have unique values within the Security Requirement Object. The keys represent the names of the security schemes which were declared under the Security Definitions Object. |
SWAGGER20STANDARDS_V411 | pre-defined-security-requirement-scheme | Error | The name specified for the security scheme in the Security Requirement Object must correspond with a Security Scheme definition in the Security Definitions Object. |
SWAGGER20STANDARDS_V412 | empty-security-requirement-property-array-for-non-oauth2-schemes | Error | In a Swagger 2.0 document, the Security Requirement Object property value allows specifying scope values for OAuth 2.0 security schemes. For all other security scheme types (i.e. for type not set as oauth2), the property value must be set as an empty array. |
Specification Extensions
| Code | Rule | Severity | What it checks |
|---|---|---|---|
SWAGGER20STANDARDS_V430 | unique-specification-extension-name | Error | Specification extensions are patterned fields that must have unique values within the object they are extending. The keys represent the names assigned to the vendor extensions that must be prefixed by 'x-'. |
Learn more
Swagger v2 Syntax Validation
Validation checks performed on provided Swagger v2 file to check its conformance to Swagger 2.n syntax rules.
OpenAPI v3 Syntax Linting
Linting checks performed on provided OpenAPI v3 file to check its conformance to recommended syntax practices by the OpenAPI v3 official standards document.