At-Bay · API Governance Rules

At-Bay API Rules

Spectral linting rules defining API design standards and conventions for At-Bay.

5 Rules error 3 warn 2
View Rules File View on GitHub

Rule Categories

bearer insurance operation v2

Rules

warn
operation-summary-title-case
Operation summaries should use Title Case.
$.paths[*][*].summary
error
operation-tag-set
Every operation must have at least one tag.
$.paths[*][*]
error
bearer-jwt-auth
At-Bay uses HTTP bearer JWT auth on all operations.
$.components.securitySchemes
warn
v2-base-url
Base URLs must point to the v2 API.
$.servers[*].url
error
insurance-product-enum
The insurance_product field must be CYB, TEO, or MPL.
$..properties.insurance_product

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  operation-summary-title-case:
    description: Operation summaries should use Title Case.
    given: $.paths[*][*].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^([A-Z][A-Za-z0-9&]*\s?)+$'
  operation-tag-set:
    description: Every operation must have at least one tag.
    given: $.paths[*][*]
    severity: error
    then:
      field: tags
      function: truthy
  bearer-jwt-auth:
    description: At-Bay uses HTTP bearer JWT auth on all operations.
    given: $.components.securitySchemes
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required: [bearerAuth]
  v2-base-url:
    description: Base URLs must point to the v2 API.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '.*at-bay\\.com\\/v2$'
  insurance-product-enum:
    description: The insurance_product field must be CYB, TEO, or MPL.
    given: $..properties.insurance_product
    severity: error
    then:
      field: enum
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            enum: [CYB, TEO, MPL]