Rancher · API Governance Rules

Rancher API Rules

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

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

Rule Categories

rancher

Rules

warn
rancher-operation-ids-camel-case
All operationIds must use camelCase to match the Rancher Management API convention.
$.paths[*][*].operationId
warn
rancher-tags-title-case
All tags must use Title Case.
$.paths[*][*].tags[*]
warn
rancher-bearer-auth-required
All operations should use BearerAuth security scheme.
$.paths[*][*]
hint
rancher-collection-responses
Collection GET endpoints should return a typed collection with 'data' array.
$.paths[*].get.responses.200.content.application/json.schema
hint
rancher-resource-ids-path-params
Resource identifier path parameters should be named 'id'.
$.paths[*][*].parameters[?(@.in == 'path')]
warn
rancher-delete-returns-204
DELETE operations should return 204 No Content.
$.paths[*].delete.responses
error
rancher-no-trailing-slashes
API paths must not end with a trailing slash.
$.paths

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  rancher-operation-ids-camel-case:
    description: All operationIds must use camelCase to match the Rancher Management API convention.
    message: "OperationId '{{value}}' must be camelCase (e.g., listClusters, createCluster)."
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  rancher-tags-title-case:
    description: All tags must use Title Case.
    message: "Tag '{{value}}' must use Title Case."
    severity: warn
    given: "$.paths[*][*].tags[*]"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z ]*$"

  rancher-bearer-auth-required:
    description: All operations should use BearerAuth security scheme.
    message: "Operation at '{{path}}' should specify BearerAuth security."
    severity: warn
    given: "$.paths[*][*]"
    then:
      field: security
      function: truthy

  rancher-collection-responses:
    description: Collection GET endpoints should return a typed collection with 'data' array.
    message: "Collection endpoint should return an object with 'data' array following Rancher's collection pattern."
    severity: hint
    given: "$.paths[*].get.responses.200.content.application/json.schema"
    then:
      function: truthy

  rancher-resource-ids-path-params:
    description: Resource identifier path parameters should be named 'id'.
    message: "Path parameter for resource identifier should be named 'id'."
    severity: hint
    given: "$.paths[*][*].parameters[?(@.in == 'path')]"
    then:
      field: name
      function: truthy

  rancher-delete-returns-204:
    description: DELETE operations should return 204 No Content.
    message: "DELETE operation at '{{path}}' should define a 204 response."
    severity: warn
    given: "$.paths[*].delete.responses"
    then:
      field: 204
      function: truthy

  rancher-no-trailing-slashes:
    description: API paths must not end with a trailing slash.
    message: "Path '{{path}}' must not end with a trailing slash."
    severity: error
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        notMatch: "/$"

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