Amadeus Traveler Media · API Governance Rules

Amadeus Traveler Media API Rules

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

20 Rules error 9 warn 8 info 3
View Rules File View on GitHub

Rule Categories

error get info no operation operationid parameter query response schema servers

Rules

error
info-title-required
API title must be present.
$.info
error
info-description-required
API must have a description.
$.info
error
info-version-required
API version must be present.
$.info
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
error
operation-id-required
Every operation must have an operationId.
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have tags.
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
Parameters should have descriptions.
$.paths[*][*].parameters[*]
error
response-description-required
Responses must have descriptions.
$.paths[*][*].responses[*]
error
get-no-request-body
GET operations must not have request bodies.
$.paths[*].get
info
schema-description
Top-level schemas should have descriptions.
$.components.schemas[*]
warn
servers-expected-domain
Server URLs should be on the amadeus.com domain.
$.servers[*].url
info
query-params-casing
Query parameters should be snake_case (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
operationid-casing
Operation IDs should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].operationId
info
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
warn
schema-properties-casing
Schema properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
error-schema-defined
A shared error schema (response_error) should be defined for error payloads.
$.components.schemas
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-traveler-media — 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:
#   - servers-https-only: 100% of servers already https (error)
#   - servers-expected-domain: 2/2 servers on amadeus.com
#   - query-params-casing: snake @ 58% (n=19)
#   - operationid-casing: camel @ 83% (n=6)
#   - schema-names-casing: pascal @ 50% (n=12)
#   - schema-properties-casing: snake @ 100% (n=30)
#   - error-schema-defined: response_error
#   - operation-documents-400: 100% adherence
#   - merge: kept 12 existing, added 8 measured, upgraded 0
#   - added: servers-expected-domain, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, error-schema-defined, 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-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-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-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 tags.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  parameter-description-required:
    description: Parameters should have descriptions.
    severity: warn
    given: $.paths[*][*].parameters[*]
    then:
      field: description
      function: truthy
  response-description-required:
    description: Responses must have descriptions.
    severity: error
    given: $.paths[*][*].responses[*]
    then:
      field: description
      function: truthy
  get-no-request-body:
    description: GET operations must not have request bodies.
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  schema-description:
    description: Top-level schemas should have descriptions.
    severity: info
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  servers-expected-domain:
    description: Server URLs should be on the amadeus.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: amadeus\.com
  query-params-casing:
    description: Query parameters should be snake_case (the dominant convention in this API).
    severity: info
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: snake
  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
  schema-names-casing:
    description: Component schema names should be PascalCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  schema-properties-casing:
    description: Schema properties should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  error-schema-defined:
    description: A shared error schema (response_error) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: response_error
      function: truthy
  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