Travelers · API Governance Rules

Travelers API Rules

Spectral linting rules defining API design standards and conventions for Travelers.

11 Rules error 2 warn 7
View Rules File View on GitHub

Rule Categories

travelers

Rules

warn
travelers-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
error
travelers-operationid-required
All operations must have an operationId
$.paths[*][*]
warn
travelers-tags-required
All operations must have tags
$.paths[*][*]
warn
travelers-oauth2-required
Insurance API should use OAuth2 authentication
$.components.securitySchemes[*]
error
travelers-response-200-get
GET operations must have a 200 response
$.paths[*].get.responses
warn
travelers-response-201-post
POST operations that create resources should return 201
$.paths[*].post.responses
hint
travelers-claim-number-in-path
Claim endpoints should use claim_number as path parameter
$.paths['/claims/{claim_number}'][*].parameters[*][?(@.name=='id')]
warn
travelers-policy-type-enum
Policy types should be validated against known types
$.components.schemas[*].properties.policy_type
warn
travelers-date-format
Date fields should use ISO 8601 date format
$.components.schemas[*].properties[?(@.format=='date')]
warn
travelers-data-wrapper
Responses should wrap content in a data property
$.components.schemas[?(@property.match(/Response$/))].properties
hint
travelers-amount-format
Monetary amount fields should use number format float
$.components.schemas[*].properties[?(@.property.match(/amount|premium|incurred/i))]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  travelers-operation-summary-title-case:
    description: All operation summaries must use Title Case
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z]*(\\s[A-Z][a-zA-Z]*)*$"

  travelers-operationid-required:
    description: All operations must have an operationId
    severity: error
    given: "$.paths[*][*]"
    then:
      field: operationId
      function: truthy

  travelers-tags-required:
    description: All operations must have tags
    severity: warn
    given: "$.paths[*][*]"
    then:
      field: tags
      function: truthy

  travelers-oauth2-required:
    description: Insurance API should use OAuth2 authentication
    severity: warn
    given: "$.components.securitySchemes[*]"
    then:
      field: type
      function: enumeration
      functionOptions:
        values:
          - oauth2
          - http

  travelers-response-200-get:
    description: GET operations must have a 200 response
    severity: error
    given: "$.paths[*].get.responses"
    then:
      field: "200"
      function: truthy

  travelers-response-201-post:
    description: POST operations that create resources should return 201
    severity: warn
    given: "$.paths[*].post.responses"
    then:
      field: "201"
      function: truthy

  travelers-claim-number-in-path:
    description: Claim endpoints should use claim_number as path parameter
    severity: hint
    given: "$.paths['/claims/{claim_number}'][*].parameters[*][?(@.name=='id')]"
    then:
      function: falsy

  travelers-policy-type-enum:
    description: Policy types should be validated against known types
    severity: warn
    given: "$.components.schemas[*].properties.policy_type"
    then:
      field: enum
      function: truthy

  travelers-date-format:
    description: Date fields should use ISO 8601 date format
    severity: warn
    given: "$.components.schemas[*].properties[?(@.format=='date')]"
    then:
      field: format
      function: enumeration
      functionOptions:
        values:
          - date
          - date-time

  travelers-data-wrapper:
    description: Responses should wrap content in a data property
    severity: warn
    given: "$.components.schemas[?(@property.match(/Response$/))].properties"
    then:
      field: data
      function: truthy

  travelers-amount-format:
    description: Monetary amount fields should use number format float
    severity: hint
    given: "$.components.schemas[*].properties[?(@.property.match(/amount|premium|incurred/i))]"
    then:
      field: format
      function: enumeration
      functionOptions:
        values:
          - float
          - double

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/travelers-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.