CoreDNS · API Governance Rules

CoreDNS API Rules

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

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

Rule Categories

coredns

Rules

error
coredns-health-info-license
API info object should include Apache 2.0 license.
$.info.license
warn
coredns-health-server-localhost
Servers should reference the localhost CoreDNS health endpoint.
$.servers[*].url
error
coredns-health-paths
API must define /health and /ready paths.
$.paths
error
coredns-health-get-only
Health and readiness endpoints must only support GET.
$.paths['/health','/ready']
warn
coredns-health-text-plain-response
Health and readiness 200 responses should return text/plain.
$.paths['/health','/ready'].get.responses.200.content
error
coredns-health-503-response
Health and readiness endpoints should document 503 responses.
$.paths['/health','/ready'].get.responses
error
coredns-health-operation-id
Operations must define an operationId.
$.paths.*.get
error
coredns-health-tags
Operations must define tags.
$.paths.*.get

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://coredns.io/plugins/health/
rules:
  coredns-health-info-license:
    description: API info object should include Apache 2.0 license.
    given: "$.info.license"
    severity: error
    then:
      field: name
      function: pattern
      functionOptions:
        match: "Apache"
  coredns-health-server-localhost:
    description: Servers should reference the localhost CoreDNS health endpoint.
    given: "$.servers[*].url"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "localhost"
  coredns-health-paths:
    description: API must define /health and /ready paths.
    given: "$.paths"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
            - /health
            - /ready
  coredns-health-get-only:
    description: Health and readiness endpoints must only support GET.
    given: "$.paths['/health','/ready']"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            get:
              type: object
          additionalProperties: false
  coredns-health-text-plain-response:
    description: Health and readiness 200 responses should return text/plain.
    given: "$.paths['/health','/ready'].get.responses.200.content"
    severity: warn
    then:
      field: text/plain
      function: truthy
  coredns-health-503-response:
    description: Health and readiness endpoints should document 503 responses.
    given: "$.paths['/health','/ready'].get.responses"
    severity: error
    then:
      field: '503'
      function: truthy
  coredns-health-operation-id:
    description: Operations must define an operationId.
    given: "$.paths.*.get"
    severity: error
    then:
      field: operationId
      function: truthy
  coredns-health-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/coredns-health-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.