Trivy · API Governance Rules

Trivy API Rules

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

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

Rule Categories

trivy

Rules

warn
trivy-operation-id-camel-case
Operation IDs must use camelCase
$.paths[*][*].operationId
warn
trivy-require-tags
All operations must have at least one tag
$.paths[*][*]
warn
trivy-require-description
All operations must have a description
$.paths[*][*]
warn
trivy-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
info
trivy-token-auth-optional
Trivy server supports optional token authentication via Trivy-Token header
$.components.securitySchemes
warn
trivy-health-endpoint-present
Trivy server must expose a /healthz endpoint
$.paths

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  # Trivy Server API Convention Rules

  trivy-operation-id-camel-case:
    description: Operation IDs must use camelCase
    message: "Operation ID '{{value}}' must use camelCase"
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"

  trivy-require-tags:
    description: All operations must have at least one tag
    message: Operations must be tagged for organization
    severity: warn
    given: "$.paths[*][*]"
    then:
      field: tags
      function: truthy

  trivy-require-description:
    description: All operations must have a description
    message: Operations must have a description
    severity: warn
    given: "$.paths[*][*]"
    then:
      field: description
      function: truthy

  trivy-summary-title-case:
    description: Operation summaries must use Title Case
    message: "Summary '{{value}}' must start with a capital letter (Title Case)"
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  trivy-token-auth-optional:
    description: Trivy server supports optional token authentication via Trivy-Token header
    message: Trivy-Token authentication scheme should be defined when auth is documented
    severity: info
    given: "$.components.securitySchemes"
    then:
      field: TrivyToken
      function: truthy

  trivy-health-endpoint-present:
    description: Trivy server must expose a /healthz endpoint
    message: The /healthz health check endpoint should be documented
    severity: warn
    given: "$.paths"
    then:
      field: /healthz
      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/trivy-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.