Viam · API Governance Rules

Viam API Rules

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

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

Rule Categories

operation viam

Rules

error
operation-summary-formatted
Operation summaries must use Title Case and start with "Viam ".
$.paths.*.*.summary
warn
viam-grpc-path
Viam transcoded paths must follow /viam..v1./.
$.paths.*~
warn
viam-server-url
At least one server URL must reference app.viam.com or a per-machine address.
$.servers
warn
viam-security-required
Operations on app.viam.com surfaces must declare security.
$.paths.*.*

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  # Viam OpenAPI specs are REST/JSON transcoding of gRPC. Standard REST style
  # rules don't all apply, so we relax a few and add Viam-specific guards.
  operation-tag-defined: warn
  operation-operationId: error
  operation-operationId-unique: error
  operation-description: warn
  operation-summary-formatted:
    description: Operation summaries must use Title Case and start with "Viam ".
    given: $.paths.*.*.summary
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^Viam ([A-Z][a-z0-9]*|[A-Z]+)( ([A-Z][a-z0-9]*|[A-Z]+|Api|API))*$'
  viam-grpc-path:
    description: Viam transcoded paths must follow /viam.<package>.v1.<Service>/<Method>.
    given: $.paths.*~
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^/viam\.[a-z][a-z0-9._]+\.v1\.[A-Z][A-Za-z0-9]+/[A-Z][A-Za-z0-9]+$'
  viam-server-url:
    description: At least one server URL must reference app.viam.com or a per-machine address.
    given: $.servers
    severity: warn
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            type: object
            properties:
              url:
                type: string
                pattern: '(viam\.com|viam\.cloud|machine_address|VIAM_MACHINE)'
            required: [url]
  viam-security-required:
    description: Operations on app.viam.com surfaces must declare security.
    given: $.paths.*.*
    severity: warn
    then:
      field: security
      function: truthy
  contact-properties: warn
  info-license: off
  no-$ref-siblings: warn

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