SPIRE · API Governance Rules

SPIRE API Rules

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

9 Rules error 3 warn 5 info 1
View Rules File View on GitHub

Rule Categories

spire

Rules

error
spire-operation-id-required
All operations must have an operationId.
$.paths[*][get,post,put,patch,delete,head,options]
warn
spire-operation-id-kebab-case
operationId must use camelCase starting with a verb (get, list, create, update, delete, enable, restore, kill).
$.paths[*][get,post,put,patch,delete].operationId
warn
spire-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
spire-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,patch,delete]
error
spire-response-200-required
Every operation must define a 200 or 201 success response.
$.paths[*][get,post,put,patch,delete].responses
error
spire-servers-required
The API must define at least one server.
$
warn
spire-info-contact-required
The info object must include a contact entry.
$.info
warn
spire-no-trailing-slash
Paths must not have a trailing slash.
$.paths
info
spire-health-path-naming
Health check paths should follow the /live or /ready convention.
$.paths

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, recommended]]

rules:
  spire-operation-id-required:
    description: All operations must have an operationId.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,head,options]"
    then:
      field: operationId
      function: truthy

  spire-operation-id-kebab-case:
    description: operationId must use camelCase starting with a verb (get, list, create, update, delete, enable, restore, kill).
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^(get|list|create|update|delete|enable|restore|kill|add|remove|upload|approve|deactivate|invite|track)[A-Z][a-zA-Z0-9]+$"

  spire-summary-title-case:
    description: Operation summaries must use Title Case.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9 /-]+$"

  spire-tags-required:
    description: Every operation must have at least one tag.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  spire-response-200-required:
    description: Every operation must define a 200 or 201 success response.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
            - required: ["200"]
            - required: ["201"]

  spire-servers-required:
    description: The API must define at least one server.
    severity: error
    given: "$"
    then:
      field: servers
      function: truthy

  spire-info-contact-required:
    description: The info object must include a contact entry.
    severity: warn
    given: "$.info"
    then:
      field: contact
      function: truthy

  spire-no-trailing-slash:
    description: Paths must not have a trailing slash.
    severity: warn
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        notMatch: "/$"

  spire-health-path-naming:
    description: Health check paths should follow the /live or /ready convention.
    severity: info
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        match: "^(/live|/ready|/.well-known|/keys|/admin|/client)"

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/spire-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.