Amadeus Reservations · API Governance Rules

Amadeus Reservations API Rules

Spectral linting rules defining API design standards and conventions for Amadeus Reservations.

23 Rules error 11 warn 10 info 2
View Rules File View on GitHub

Rule Categories

delete get info no operation operationid parameter post response schema security servers

Rules

error
info-title-required
API title must be present.
$.info
warn
info-title-amadeus-prefix
API title must reference Amadeus.
$.info.title
error
info-description-required
API must have a description.
$.info
error
info-version-required
API version must be present.
$.info
error
servers-required
At least one server must be defined.
$
error
servers-https
Server URLs must use HTTPS.
$.servers[*].url
error
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-amadeus-prefix
Operation summaries must start with "Amadeus".
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
error
operation-id-required
Every operation must have an operationId.
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
Every parameter must have a description.
$.paths[*][*].parameters[*]
error
response-success-required
Every operation must define at least one 2xx response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-401-booking
Booking operations should define a 401 response.
$.paths[*][post].responses
error
response-description-required
Every response must have a description.
$.paths[*][*].responses[*]
info
schema-description-recommended
Top-level schemas should have descriptions.
$.components.schemas[*]
warn
security-schemes-recommended
Security schemes should be defined in components.
$.components
error
get-no-request-body
GET operations must not have a request body.
$.paths[*].get
info
delete-returns-204
DELETE operations should return 204 No Content.
$.paths[*].delete.responses
warn
post-has-request-body
POST operations for booking creation should have a request body.
$.paths[*].post
warn
operationid-casing
Operation IDs should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-documents-400
Operations should document a 400 response (documented on 100% of this API's operations).
$.paths[*][get,post,put,patch,delete].responses
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# amadeus-reservations — Spectral ruleset (strengthened)
# Plain Spectral. Existing hand-authored rules preserved; measured rules added
# from this provider's own OpenAPI conventions by strengthen_ruleset.py,
# then self-validated against the spec.
#
# Provenance:
#   - operationid-casing: camel @ 100% (n=6)
#   - operation-documents-400: 100% adherence
#   - merge: kept 20 existing, added 3 measured, upgraded 0
#   - added: operationid-casing, operation-documents-400, no-empty-descriptions
extends:
  - spectral:oas
rules:
  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-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://
  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
  parameter-description-required:
    description: Every parameter must have a description.
    severity: warn
    given: $.paths[*][*].parameters[*]
    then:
      field: description
      function: truthy
  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
  schema-description-recommended:
    description: Top-level schemas should have descriptions.
    severity: info
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  security-schemes-recommended:
    description: Security schemes should be defined in components.
    severity: warn
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  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
  operationid-casing:
    description: Operation IDs should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: camel
  operation-documents-400:
    description: Operations should document a 400 response (documented on 100% of this API's operations).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '400'
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy