StackRox · API Governance Rules

StackRox API Rules

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

6 Rules error 4 warn 1 info 1
View Rules File View on GitHub

Rule Categories

stackrox

Rules

error
stackrox-operation-ids
All operations must have an operationId
$.paths[*][*]
error
stackrox-tags-required
All operations must have at least one tag
$.paths[*][*]
warn
stackrox-v1-api-path
All StackRox API paths should begin with /v1/
$.paths[*]~
error
stackrox-api-token-auth
StackRox API should use ApiToken security scheme
$.components.securitySchemes
error
stackrox-successful-response
All operations must define at least one success response
$.paths[*][*].responses
info
stackrox-count-endpoint-naming
Count endpoints should follow the {resource}count naming convention
$.paths[?(/count/)][*]~

Spectral Ruleset

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

  stackrox-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

  stackrox-v1-api-path:
    description: All StackRox API paths should begin with /v1/
    message: 'Path {{path}} must begin with /v1/'
    severity: warn
    given: '$.paths[*]~'
    then:
      function: pattern
      functionOptions:
        match: '^/v1/'

  stackrox-api-token-auth:
    description: StackRox API should use ApiToken security scheme
    message: 'Security scheme must include ApiToken'
    severity: error
    given: '$.components.securitySchemes'
    then:
      function: schema
      functionOptions:
        schema:
          required: ['ApiToken']

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

  stackrox-count-endpoint-naming:
    description: Count endpoints should follow the {resource}count naming convention
    message: 'Count endpoint {{path}} should follow /v1/{resource}count pattern'
    severity: info
    given: '$.paths[?(/count/)][*]~'
    then:
      function: pattern
      functionOptions:
        match: 'count$'

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