CRI-O · API Governance Rules

CRI-O API Rules

Spectral linting rules defining API design standards and conventions for CRI-O.

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

Rule Categories

cri

Rules

error
cri-o-metrics-info-license
API info object should declare the Apache 2.0 license.
$.info.license
warn
cri-o-metrics-server-port
Server URL should reference the default metrics port 9090.
$.servers[*].url
error
cri-o-metrics-paths
API must define the /metrics path.
$.paths
error
cri-o-metrics-get-only
Metrics endpoint must only support GET.
$.paths['/metrics']
error
cri-o-metrics-text-plain-response
Metrics 200 response must be text/plain (Prometheus exposition format).
$.paths['/metrics'].get.responses.200.content
error
cri-o-metrics-operation-id
Operations must define an operationId.
$.paths.*.get
error
cri-o-metrics-tags
Operations must define tags.
$.paths.*.get

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://github.com/cri-o/cri-o/blob/main/docs/metrics.md
rules:
  cri-o-metrics-info-license:
    description: API info object should declare the Apache 2.0 license.
    given: "$.info.license"
    severity: error
    then:
      field: name
      function: pattern
      functionOptions:
        match: "Apache"
  cri-o-metrics-server-port:
    description: Server URL should reference the default metrics port 9090.
    given: "$.servers[*].url"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "9090"
  cri-o-metrics-paths:
    description: API must define the /metrics path.
    given: "$.paths"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
            - /metrics
  cri-o-metrics-get-only:
    description: Metrics endpoint must only support GET.
    given: "$.paths['/metrics']"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            get:
              type: object
          additionalProperties: false
  cri-o-metrics-text-plain-response:
    description: Metrics 200 response must be text/plain (Prometheus exposition format).
    given: "$.paths['/metrics'].get.responses.200.content"
    severity: error
    then:
      field: text/plain
      function: truthy
  cri-o-metrics-operation-id:
    description: Operations must define an operationId.
    given: "$.paths.*.get"
    severity: error
    then:
      field: operationId
      function: truthy
  cri-o-metrics-tags:
    description: Operations must define tags.
    given: "$.paths.*.get"
    severity: error
    then:
      field: tags
      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/cri-o-metrics-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.