rules: # INFO / METADATA info-title-required: description: API title must be present. severity: error given: $.info then: field: title function: truthy info-title-amadeus-prefix: description: API title must reference Amadeus. severity: warn given: $.info.title then: function: pattern functionOptions: match: "Amadeus|amadeus" info-description-required: description: API must have a description. severity: error given: $.info then: field: description function: truthy info-version-required: description: API version must be present. severity: error given: $.info then: field: version function: truthy # SERVERS servers-required: description: At least one server must be defined. severity: error given: $ then: field: servers function: truthy servers-https: description: Server URLs must use HTTPS. severity: error given: $.servers[*].url then: function: pattern functionOptions: match: "^https://" # OPERATIONS operation-summary-required: description: Every operation must have a summary. severity: error given: $.paths[*][get,post,put,patch,delete] then: field: summary function: truthy operation-summary-amadeus-prefix: description: Operation summaries must start with "Amadeus". severity: warn given: $.paths[*][get,post,put,patch,delete].summary then: function: pattern functionOptions: match: "^Amadeus " operation-description-required: description: Every operation must have a description. severity: warn given: $.paths[*][get,post,put,patch,delete] then: field: description function: truthy operation-id-required: description: Every operation must have an operationId. severity: error given: $.paths[*][get,post,put,patch,delete] then: field: operationId function: truthy operation-tags-required: description: Every operation must have at least one tag. severity: error given: $.paths[*][get,post,put,patch,delete] then: field: tags function: truthy # PARAMETERS parameter-description-required: description: Every parameter must have a description. severity: warn given: $.paths[*][*].parameters[*] then: field: description function: truthy # RESPONSES response-success-required: description: Every operation must define at least one 2xx response. severity: error given: $.paths[*][get,post,put,patch,delete].responses then: function: schema functionOptions: schema: type: object minProperties: 1 response-401-booking: description: Booking operations should define a 401 response. severity: warn given: $.paths[*][post].responses then: field: '401' function: truthy response-description-required: description: Every response must have a description. severity: error given: $.paths[*][*].responses[*] then: field: description function: truthy # SCHEMAS schema-description-recommended: description: Top-level schemas should have descriptions. severity: info given: $.components.schemas[*] then: field: description function: truthy # SECURITY security-schemes-recommended: description: Security schemes should be defined in components. severity: warn given: $.components then: field: securitySchemes function: truthy # HTTP METHOD CONVENTIONS get-no-request-body: description: GET operations must not have a request body. severity: error given: $.paths[*].get then: field: requestBody function: falsy delete-returns-204: description: DELETE operations should return 204 No Content. severity: info given: $.paths[*].delete.responses then: field: '204' function: truthy post-has-request-body: description: POST operations for booking creation should have a request body. severity: warn given: $.paths[*].post then: field: requestBody function: truthy