Swagger v2 Standard Validation
Overview
Validation checks performed on provided Swagger v2 file to check its conformance to rules set by the Swagger v2 official standards document.
Property | Value |
---|---|
Id | swagger-v2-standards-validation |
Code | SWAGGER20STANDARDS_V |
Ruleset Type | Validation |
Default Severity of All Rules | Error |
Rule System | Semantic |
Tags | swagger2 swagger standards semantic validation |
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md
- https://docs.apimatic.io/rulesets/overview/
Categories of Rules
- Swagger Root Information (SWAGGER20STANDARDS_V001 - SWAGGER20STANDARDS_V019)
- Info (SWAGGER20STANDARDS_V020 - SWAGGER20STANDARDS_V029)
- License (SWAGGER20STANDARDS_V030 - SWAGGER20STANDARDS_V039)
- Paths (SWAGGER20STANDARDS_V040 - SWAGGER20STANDARDS_V049)
- Path Items (SWAGGER20STANDARDS_V050 - SWAGGER20STANDARDS_V064)
- Operations (SWAGGER20STANDARDS_V065 - SWAGGER20STANDARDS_V084)
- External Documentation (SWAGGER20STANDARDS_V085 - SWAGGER20STANDARDS_V094)
- Parameters (SWAGGER20STANDARDS_V095 - SWAGGER20STANDARDS_V149)
- Array Items (SWAGGER20STANDARDS_V150 - SWAGGER20STANDARDS_V179)
- Responses (SWAGGER20STANDARDS_V180 - SWAGGER20STANDARDS_V199)
- Response Examples (SWAGGER20STANDARDS_V200 - SWAGGER20STANDARDS_V219)
- Response Headers (SWAGGER20STANDARDS_V220 - SWAGGER20STANDARDS_V259)
- Tags (SWAGGER20STANDARDS_V260 - SWAGGER20STANDARDS_V279)
- References (SWAGGER20STANDARDS_V280 - SWAGGER20STANDARDS_V299)
- Schemas (SWAGGER20STANDARDS_V300 - SWAGGER20STANDARDS_V349)
- Reusable Definitions (SWAGGER20STANDARDS_V350 - SWAGGER20STANDARDS_V369)
- Security Schemes (SWAGGER20STANDARDS_V370 - SWAGGER20STANDARDS_V399)
- Scopes (SWAGGER20STANDARDS_V400 - SWAGGER20STANDARDS_V409)
- Security Requirements (SWAGGER20STANDARDS_V410 - SWAGGER20STANDARDS_V429)
- Specification Extensions (SWAGGER20STANDARDS_V430 - SWAGGER20STANDARDS_V449)
Swagger Root Information Rules
- required-swagger-version (SWAGGER20STANDARDS_V001)
- valid-swagger-version (SWAGGER20STANDARDS_V002)
- required-api-info (SWAGGER20STANDARDS_V003)
- required-paths (SWAGGER20STANDARDS_V004)
- no-schemes-sub-paths-in-host (SWAGGER20STANDARDS_V005)
- valid-api-schemes (SWAGGER20STANDARDS_V006)
Info Rules
License Rules
Paths Rules
Path Items Rules
- path-item-reference-is-a-path-item-object (SWAGGER20STANDARDS_V050)
- unique-path-item-parameter (SWAGGER20STANDARDS_V051)
- only-one-body-parameter-in-path-item-parameters (SWAGGER20STANDARDS_V052)
Operations Rules
- required-operation-responses (SWAGGER20STANDARDS_V065)
- unique-operation-id (SWAGGER20STANDARDS_V066)
- unique-operation-parameter (SWAGGER20STANDARDS_V067)
- only-one-body-parameter-in-operation-parameters (SWAGGER20STANDARDS_V068)
- valid-operation-schemes (SWAGGER20STANDARDS_V069)
External Documentation Rules
Parameters Rules
- required-parameter-name (SWAGGER20STANDARDS_V095)
- required-parameter-location (SWAGGER20STANDARDS_V096)
- valid-parameter-location (SWAGGER20STANDARDS_V097)
- required-non-body-parameter-type (SWAGGER20STANDARDS_V098)
- valid-non-body-parameter-type (SWAGGER20STANDARDS_V099)
- required-body-parameter-schema (SWAGGER20STANDARDS_V100)
- path-parameter-exists-in-path-url-template (SWAGGER20STANDARDS_V101)
- required-path-parameter-required-attribute (SWAGGER20STANDARDS_V102)
- path-parameter-cannot-be-optional (SWAGGER20STANDARDS_V103)
- body-and-form-parameters-cannot-co-exist (SWAGGER20STANDARDS_V104)
- valid-request-content-type-for-form-parameters (SWAGGER20STANDARDS_V105)
- valid-mime-types-for-file-type-parameter (SWAGGER20STANDARDS_V106)
- valid-location-for-file-type-parameter (SWAGGER20STANDARDS_V107)
- allow-empty-value-only-for-form-and-query-parameter (SWAGGER20STANDARDS_V108)
- required-items-for-array-type-parameter (SWAGGER20STANDARDS_V109)
- valid-parameter-collection-format (SWAGGER20STANDARDS_V110)
- multi-collection-format-only-for-form-and-query-parameter (SWAGGER20STANDARDS_V111)
- valid-parameter-default-value-type (SWAGGER20STANDARDS_V112)
- parameter-maximum-exists-for-exclusive-maximum (SWAGGER20STANDARDS_V113)
- parameter-minimum-exists-for-exclusive-minimum (SWAGGER20STANDARDS_V114)
- parameter-non-negative-max-length (SWAGGER20STANDARDS_V115)
- parameter-non-negative-min-length (SWAGGER20STANDARDS_V116)
- parameter-non-negative-max-items (SWAGGER20STANDARDS_V117)
- parameter-non-negative-min-items (SWAGGER20STANDARDS_V118)
- at-least-one-entry-in-parameter-enum-list (SWAGGER20STANDARDS_V119)
- unique-parameter-enum-list-entries (SWAGGER20STANDARDS_V120)
- parameter-multiple-of-greater-than-zero (SWAGGER20STANDARDS_V121)
Array Items Rules
- required-items-type (SWAGGER20STANDARDS_V150)
- valid-items-type (SWAGGER20STANDARDS_V151)
- required-items-of-array-type-items (SWAGGER20STANDARDS_V152)
- valid-items-collection-format (SWAGGER20STANDARDS_V153)
- valid-items-default-value-type (SWAGGER20STANDARDS_V154)
- items-maximum-exists-for-exclusive-maximum (SWAGGER20STANDARDS_V155)
- items-minimum-exists-for-exclusive-minimum (SWAGGER20STANDARDS_V156)
- items-non-negative-max-length (SWAGGER20STANDARDS_V157)
- items-non-negative-min-length (SWAGGER20STANDARDS_V158)
- items-non-negative-max-items (SWAGGER20STANDARDS_V159)
- items-non-negative-min-items (SWAGGER20STANDARDS_V160)
- at-least-one-entry-in-items-enum-list (SWAGGER20STANDARDS_V161)
- unique-items-enum-list-entries (SWAGGER20STANDARDS_V162)
- items-multiple-of-greater-than-zero (SWAGGER20STANDARDS_V163)
Responses Rules
- at-least-one-response-code-in-responses (SWAGGER20STANDARDS_V180)
- unique-response-http-status-code (SWAGGER20STANDARDS_V181)
- required-response-description (SWAGGER20STANDARDS_V182)
Response Examples Rules
- unique-example-mime-type (SWAGGER20STANDARDS_V200)
- example-mime-type-exists-in-operation-produces (SWAGGER20STANDARDS_V201)
Response Headers Rules
- unique-response-header (SWAGGER20STANDARDS_V220)
- required-response-header-type (SWAGGER20STANDARDS_V221)
- valid-response-header-type (SWAGGER20STANDARDS_V222)
- required-array-response-header-items (SWAGGER20STANDARDS_V223)
- valid-response-header-collection-format (SWAGGER20STANDARDS_V224)
- valid-response-header-default-value-type (SWAGGER20STANDARDS_V225)
- response-header-maximum-exists-for-exclusive-maximum (SWAGGER20STANDARDS_V226)
- response-header-minimum-exists-for-exclusive-minimum (SWAGGER20STANDARDS_V227)
- response-header-non-negative-max-length (SWAGGER20STANDARDS_V228)
- response-header-non-negative-min-length (SWAGGER20STANDARDS_V229)
- response-header-non-negative-max-items (SWAGGER20STANDARDS_V230)
- response-header-non-negative-min-items (SWAGGER20STANDARDS_V231)
- at-least-one-entry-in-response-header-enum-list (SWAGGER20STANDARDS_V232)
- unique-response-header-enum-list-entries (SWAGGER20STANDARDS_V233)
- response-header-multiple-of-greater-than-zero (SWAGGER20STANDARDS_V234)
Tags Rules
References Rules
- object-can-be-a-reference (SWAGGER20STANDARDS_V280)
- no-dollar-ref-sibling-properties (SWAGGER20STANDARDS_V281)
Schemas Rules
- valid-schema-type (SWAGGER20STANDARDS_V300)
- valid-schema-default-value-type (SWAGGER20STANDARDS_V301)
- schema-multiple-of-greater-than-zero (SWAGGER20STANDARDS_V302)
- schema-maximum-exists-for-exclusive-maximum (SWAGGER20STANDARDS_V303)
- schema-minimum-exists-for-exclusive-minimum (SWAGGER20STANDARDS_V304)
- schema-non-negative-max-length (SWAGGER20STANDARDS_V305)
- schema-non-negative-min-length (SWAGGER20STANDARDS_V306)
- schema-non-negative-max-items (SWAGGER20STANDARDS_V307)
- schema-non-negative-min-items (SWAGGER20STANDARDS_V308)
- schema-non-negative-max-properties (SWAGGER20STANDARDS_V309)
- schema-non-negative-min-properties (SWAGGER20STANDARDS_V310)
- at-least-one-property-in-schema-required-list (SWAGGER20STANDARDS_V311)
- unique-properties-in-schema-required-list (SWAGGER20STANDARDS_V312)
- at-least-one-entry-in-schema-enum-list (SWAGGER20STANDARDS_V313)
- unique-schema-enum-list-entries (SWAGGER20STANDARDS_V314)
- pre-defined-schema-property-for-discriminator (SWAGGER20STANDARDS_V315)
- discriminator-property-name-exists-in-schema-required-list (SWAGGER20STANDARDS_V316)
- no-inline-schemas-in-polymorphism (SWAGGER20STANDARDS_V317)
Reusable Definitions Rules
- unique-definition-name (SWAGGER20STANDARDS_V350)
- unique-parameter-definition-name (SWAGGER20STANDARDS_V351)
- unique-response-definition-name (SWAGGER20STANDARDS_V352)
Security Schemes Rules
- unique-security-scheme-name (SWAGGER20STANDARDS_V370)
- required-security-scheme-type (SWAGGER20STANDARDS_V371)
- valid-security-scheme-type (SWAGGER20STANDARDS_V372)
- required-api-key-security-scheme-parameter-name (SWAGGER20STANDARDS_V373)
- required-api-key-security-scheme-parameter-location (SWAGGER20STANDARDS_V374)
- valid-api-key-security-scheme-parameter-location (SWAGGER20STANDARDS_V375)
- required-oauth2-security-scheme-flow (SWAGGER20STANDARDS_V376)
- valid-oauth2-security-scheme-flow-type (SWAGGER20STANDARDS_V377)
- required-oauth2-security-scheme-authorization-url (SWAGGER20STANDARDS_V378)
- required-oauth2-security-scheme-token-url (SWAGGER20STANDARDS_V379)
- required-oauth2-security-scheme-scopes (SWAGGER20STANDARDS_V380)
Scopes Rules
Security Requirements Rules
- unique-security-requirement-name (SWAGGER20STANDARDS_V410)
- pre-defined-security-requirement-scheme (SWAGGER20STANDARDS_V411)
- empty-security-requirement-property-array-for-non-oauth2-schemes (SWAGGER20STANDARDS_V412)