Frostbyte · API Governance Rules

Frostbyte API Rules

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

7 Rules warn 6 info 1
View Rules File View on GitHub

Rule Categories

frostbyte

Rules

warn
frostbyte-info-contact
All Frostbyte APIs must declare a contact block pointing at the catalog.
$.info
warn
frostbyte-info-license
Info must declare a license.
$.info
warn
frostbyte-server-production
Specs should declare the production gateway URL.
$.servers[*]
warn
frostbyte-operation-summary-required
Every operation must define a summary.
$.paths[*][get,post,put,patch,delete]
warn
frostbyte-operation-summary-title-case
Operation summaries should use Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
frostbyte-path-versioned
All non-admin paths must be versioned under /v1/ or /api/.
$.paths
info
frostbyte-credit-aware-402
Operations should document the 402 Payment Required response (x402 / USDC on Base).
$.paths[*][get,post,put,patch,delete].responses

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  frostbyte-info-contact:
    description: All Frostbyte APIs must declare a contact block pointing at the catalog.
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy

  frostbyte-info-license:
    description: Info must declare a license.
    severity: warn
    given: $.info
    then:
      field: license
      function: truthy

  frostbyte-server-production:
    description: Specs should declare the production gateway URL.
    severity: warn
    given: $.servers[*]
    then:
      field: url
      function: pattern
      functionOptions:
        match: 'agent-gateway-kappa\\.vercel\\.app'

  frostbyte-operation-summary-required:
    description: Every operation must define a summary.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy

  frostbyte-operation-summary-title-case:
    description: Operation summaries should use Title Case.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z]'

  frostbyte-path-versioned:
    description: All non-admin paths must be versioned under /v1/ or /api/.
    severity: warn
    given: $.paths
    then:
      function: pattern
      functionOptions:
        match: '^/(v1|api|health)'

  frostbyte-credit-aware-402:
    description: Operations should document the 402 Payment Required response (x402 / USDC on Base).
    severity: info
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '402'
      function: truthy