CoreDNS · API Governance Rules

CoreDNS API Rules

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

8 Rules error 5 warn 2 info 1
View Rules File View on GitHub

Rule Categories

coredns

Rules

error
coredns-metrics-info-license
API info object should declare Apache 2.0.
$.info.license
warn
coredns-metrics-port-9153
Servers should reference port 9153 (default Prometheus metrics port).
$.servers[*].url
error
coredns-metrics-path
API must define the /metrics path.
$.paths
error
coredns-metrics-get-only
The /metrics endpoint must only support GET.
$.paths['/metrics']
warn
coredns-metrics-prometheus-response
200 response should return text/plain Prometheus exposition format.
$.paths['/metrics'].get.responses.200.content
error
coredns-metrics-operation-id
Operations must define an operationId.
$.paths.*.get
error
coredns-metrics-tags
Operations must define tags.
$.paths.*.get
info
coredns-metrics-no-auth
Metrics endpoint typically does not require authentication; consider documenting this.
$.paths['/metrics'].get

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://coredns.io/plugins/metrics/
rules:
  coredns-metrics-info-license:
    description: API info object should declare Apache 2.0.
    given: "$.info.license"
    severity: error
    then:
      field: name
      function: pattern
      functionOptions:
        match: "Apache"
  coredns-metrics-port-9153:
    description: Servers should reference port 9153 (default Prometheus metrics port).
    given: "$.servers[*].url"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: ":9153"
  coredns-metrics-path:
    description: API must define the /metrics path.
    given: "$.paths"
    severity: error
    then:
      field: /metrics
      function: truthy
  coredns-metrics-get-only:
    description: The /metrics endpoint must only support GET.
    given: "$.paths['/metrics']"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            get:
              type: object
          additionalProperties: false
  coredns-metrics-prometheus-response:
    description: 200 response should return text/plain Prometheus exposition format.
    given: "$.paths['/metrics'].get.responses.200.content"
    severity: warn
    then:
      field: text/plain
      function: truthy
  coredns-metrics-operation-id:
    description: Operations must define an operationId.
    given: "$.paths.*.get"
    severity: error
    then:
      field: operationId
      function: truthy
  coredns-metrics-tags:
    description: Operations must define tags.
    given: "$.paths.*.get"
    severity: error
    then:
      field: tags
      function: truthy
  coredns-metrics-no-auth:
    description: Metrics endpoint typically does not require authentication; consider documenting this.
    given: "$.paths['/metrics'].get"
    severity: info
    then:
      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/coredns-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.