Stacker · API Governance Rules

Stacker API Rules

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

7 Rules error 3 warn 4
View Rules File View on GitHub

Rule Categories

stacker

Rules

error
stacker-operation-ids
All operations must have an operationId in camelCase
$.paths[*][*]
error
stacker-tags-required
All operations must have at least one tag
$.paths[*][*]
warn
stacker-trailing-slash
All Stacker API paths end with a trailing slash
$.paths[*]~
warn
stacker-header-auth
Operations must use IntegrationKey security scheme
$.paths[*][*]
error
stacker-response-200-or-201
All operations must have a 200 or 201 success response
$.paths[*][*].responses
warn
stacker-object-sid-path-param
Paths using object SID must name the parameter object_sid
$.paths[*][*].parameters[?(@.in=='path')]
warn
stacker-content-type-json
Request bodies must use application/json
$.paths[*][*].requestBody.content

Spectral Ruleset

Raw ↑
rules:
  stacker-operation-ids:
    description: All operations must have an operationId in camelCase
    message: 'Operation must have a camelCase operationId: {{path}}'
    severity: error
    given: '$.paths[*][*]'
    then:
      field: operationId
      function: truthy

  stacker-tags-required:
    description: All operations must have at least one tag
    message: 'Operation at {{path}} must have at least one tag'
    severity: error
    given: '$.paths[*][*]'
    then:
      field: tags
      function: truthy

  stacker-trailing-slash:
    description: All Stacker API paths end with a trailing slash
    message: 'Stacker API path {{path}} must end with a trailing slash'
    severity: warn
    given: '$.paths[*]~'
    then:
      function: pattern
      functionOptions:
        match: '/$'

  stacker-header-auth:
    description: Operations must use IntegrationKey security scheme
    message: 'Operation at {{path}} must declare security with IntegrationKey'
    severity: warn
    given: '$.paths[*][*]'
    then:
      field: security
      function: truthy

  stacker-response-200-or-201:
    description: All operations must have a 200 or 201 success response
    message: 'Operation at {{path}} must define a 200 or 201 response'
    severity: error
    given: '$.paths[*][*].responses'
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
            - required: ['200']
            - required: ['201']
            - required: ['204']

  stacker-object-sid-path-param:
    description: Paths using object SID must name the parameter object_sid
    message: 'Object SID path parameter should be named object_sid'
    severity: warn
    given: "$.paths[*][*].parameters[?(@.in=='path')]"
    then:
      function: schema
      functionOptions:
        schema:
          if:
            properties:
              description:
                pattern: object
          then:
            properties:
              name:
                pattern: '^object_sid$'

  stacker-content-type-json:
    description: Request bodies must use application/json
    message: 'Request body at {{path}} should use application/json content type'
    severity: warn
    given: '$.paths[*][*].requestBody.content'
    then:
      function: schema
      functionOptions:
        schema:
          required: ['application/json']

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/stacker-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 email required.

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