Trino · API Governance Rules

Trino API Rules

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

8 Rules error 2 warn 6
View Rules File View on GitHub

Rule Categories

trino

Rules

error
trino-path-must-start-with-v1
All Trino API paths must be versioned with /v1/ prefix
$.paths[*]~
warn
trino-operation-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
warn
trino-user-header-documented
Operations should document the X-Trino-User header
$.paths[*].post.parameters[*]
warn
trino-operation-id-camel-case
OperationIds must use camelCase
$.paths[*][*].operationId
warn
trino-operation-must-have-description
All operations must have a description
$.paths[*][*]
error
trino-get-must-have-200
GET operations must have a 200 response defined
$.paths[*].get
warn
trino-path-params-must-have-descriptions
Path parameters must have descriptions
$.paths[*][*].parameters[?(@.in == 'path')].description
warn
trino-schema-names-pascal-case
Schema names must use PascalCase
$.components.schemas[*]~

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  # Trino uses versioned paths: /v1/...
  trino-path-must-start-with-v1:
    description: All Trino API paths must be versioned with /v1/ prefix
    message: "Path '{{property}}' must start with /v1/"
    given: "$.paths[*]~"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^/v1/"

  # All operation summaries must use Title Case
  trino-operation-summary-title-case:
    description: Operation summaries must use Title Case
    message: "Summary '{{value}}' should use Title Case"
    given: "$.paths[*][*].summary"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9 ]+$"

  # Trino client API requires X-Trino-User header documentation
  trino-user-header-documented:
    description: Operations should document the X-Trino-User header
    message: "Trino operations should include X-Trino-User header parameter"
    given: "$.paths[*].post.parameters[*]"
    severity: warn
    then:
      field: name
      function: enumeration
      functionOptions:
        values:
          - X-Trino-User

  # operationIds must be camelCase
  trino-operation-id-camel-case:
    description: OperationIds must use camelCase
    message: "OperationId '{{value}}' should be camelCase"
    given: "$.paths[*][*].operationId"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"

  # All operations must have descriptions
  trino-operation-must-have-description:
    description: All operations must have a description
    message: "Operation at '{{path}}' is missing a description"
    given: "$.paths[*][*]"
    severity: warn
    then:
      field: description
      function: truthy

  # Responses must include a 200 for GET operations
  trino-get-must-have-200:
    description: GET operations must have a 200 response defined
    message: "GET operation is missing a 200 response"
    given: "$.paths[*].get"
    severity: error
    then:
      field: responses.200
      function: truthy

  # Path parameters must have descriptions
  trino-path-params-must-have-descriptions:
    description: Path parameters must have descriptions
    message: "Path parameter '{{value}}' is missing a description"
    given: "$.paths[*][*].parameters[?(@.in == 'path')].description"
    severity: warn
    then:
      function: truthy

  # Components/schemas must use PascalCase
  trino-schema-names-pascal-case:
    description: Schema names must use PascalCase
    message: "Schema '{{property}}' should use PascalCase"
    given: "$.components.schemas[*]~"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9]+$"

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