Stack Overflow · API Governance Rules

Stack Overflow API Rules

Spectral linting rules defining API design standards and conventions for Stack Overflow.

9 Rules error 3 warn 6
View Rules File View on GitHub

Rule Categories

stack

Rules

warn
stack-overflow-operation-summaries-title-case
All Stack Overflow API operation summaries must use Title Case
$.paths[*][get,post,put,patch,delete].summary
warn
stack-overflow-operationid-camel-case
Stack Overflow API operationIds must use camelCase
$.paths[*][get,post,put,patch,delete].operationId
error
stack-overflow-operations-must-have-operationid
All Stack Overflow API operations must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
stack-overflow-pagination-supported
List operations should support page and pagesize parameters
$.paths[*].get.parameters[*]
warn
stack-overflow-wrapper-response-schema
Stack Overflow list responses must use the wrapper format with items
$.components.schemas[*]
error
stack-overflow-teams-bearer-auth
Stack Overflow for Teams API must use bearer token authentication
$.components.securitySchemes
warn
stack-overflow-teams-path-includes-team
Stack Overflow for Teams paths must include team parameter
$.paths[*]~
warn
stack-overflow-response-error-schemas
Error responses must reference ErrorResponse schema
$.paths[*][get,post,put,patch,delete].responses[4*].content.application/json.schema
error
stack-overflow-post-requires-body
POST and PUT operations must have request bodies
$.paths[*][post,put]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  stack-overflow-operation-summaries-title-case:
    description: All Stack Overflow API operation summaries must use Title Case
    message: "Operation summary '{{value}}' 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]*([ ][A-Z][a-zA-Z0-9]*)*$"

  stack-overflow-operationid-camel-case:
    description: Stack Overflow API operationIds must use camelCase
    message: "operationId '{{value}}' must use camelCase"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  stack-overflow-operations-must-have-operationid:
    description: All Stack Overflow API operations must have an operationId
    message: "Operation is missing operationId"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  stack-overflow-pagination-supported:
    description: List operations should support page and pagesize parameters
    message: "List operations should support pagination via page and pagesize"
    severity: warn
    given: "$.paths[*].get.parameters[*]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  stack-overflow-wrapper-response-schema:
    description: Stack Overflow list responses must use the wrapper format with items
    message: "Response schema should include items array for list responses"
    severity: warn
    given: "$.components.schemas[*]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  stack-overflow-teams-bearer-auth:
    description: Stack Overflow for Teams API must use bearer token authentication
    message: "Teams API must define bearerAuth security scheme"
    severity: error
    given: "$.components.securitySchemes"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  stack-overflow-teams-path-includes-team:
    description: Stack Overflow for Teams paths must include team parameter
    message: "Teams API paths should include the {team} path parameter"
    severity: warn
    given: "$.paths[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^/teams/\\{team\\}"

  stack-overflow-response-error-schemas:
    description: Error responses must reference ErrorResponse schema
    message: "4xx responses should use ErrorResponse schema"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses[4*].content.application/json.schema"
    then:
      function: truthy

  stack-overflow-post-requires-body:
    description: POST and PUT operations must have request bodies
    message: "POST/PUT operations must define a requestBody"
    severity: error
    given: "$.paths[*][post,put]"
    then:
      field: requestBody
      function: truthy

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/stack-overflow-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.