Confluent Schema Registry · API Governance Rules

Confluent Schema Registry API Rules

Spectral linting rules defining API design standards and conventions for Confluent Schema Registry.

10 Rules error 4 warn 6
View Rules File View on GitHub

Rule Categories

schema

Rules

error
schema-registry-info-contact
API contact information must be present.
$.info
error
schema-registry-info-license
API license must be declared.
$.info
error
schema-registry-server-defined
At least one server URL must be defined.
$.servers
warn
schema-registry-paths-prefix
All paths must live under /subjects, /schemas, /config, /mode, /compatibility, /contexts, or /exporters.
$.paths
error
schema-registry-operation-id
Every operation must define an operationId.
$.paths[*][get,post,put,patch,delete]
warn
schema-registry-operation-tags
Every operation must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
schema-registry-tag-vocabulary
Tags must come from the Schema Registry vocabulary (Subjects, Schemas, Config, Mode, Compatibility, Contexts, Exporters).
$.paths[*][get,post,put,patch,delete].tags[*]
warn
schema-registry-error-shape
Non-2xx responses should reference the ErrorMessage schema.
$.paths[*][get,post,put,patch,delete].responses[?(@property.match(/^[45][0-9][0-9]$/))].content.application/json.schema
warn
schema-registry-content-type
2xx responses should serve application/json (or application/vnd.schemaregistry.v1+json).
$.paths[*][get,post,put,patch,delete].responses[?(@property == '200' || @property == '201')].content
warn
schema-registry-compatibility-enum
Compatibility levels should use canonical values.
$.components.schemas.Config.properties.compatibility

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas

# Spectral linting rules tuned for Confluent Schema Registry.
# Validates that the OpenAPI spec follows Schema Registry conventions:
# resource paths under /subjects, /schemas, /config, /mode, /compatibility,
# JSON content types, and consistent use of the Subjects/Schemas/Config tags.
rules:
  schema-registry-info-contact:
    description: API contact information must be present.
    severity: error
    given: "$.info"
    then:
      field: contact
      function: truthy

  schema-registry-info-license:
    description: API license must be declared.
    severity: error
    given: "$.info"
    then:
      field: license
      function: truthy

  schema-registry-server-defined:
    description: At least one server URL must be defined.
    severity: error
    given: "$.servers"
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  schema-registry-paths-prefix:
    description: All paths must live under /subjects, /schemas, /config, /mode, /compatibility, /contexts, or /exporters.
    severity: warn
    given: "$.paths"
    then:
      field: "@key"
      function: pattern
      functionOptions:
        match: "^/(subjects|schemas|config|mode|compatibility|contexts|exporters)(/.*)?$"

  schema-registry-operation-id:
    description: Every operation must define an operationId.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  schema-registry-operation-tags:
    description: Every operation must declare at least one tag.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  schema-registry-tag-vocabulary:
    description: Tags must come from the Schema Registry vocabulary (Subjects, Schemas, Config, Mode, Compatibility, Contexts, Exporters).
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].tags[*]"
    then:
      function: enumeration
      functionOptions:
        values:
          - Subjects
          - Schemas
          - Config
          - Mode
          - Compatibility
          - Contexts
          - Exporters

  schema-registry-error-shape:
    description: Non-2xx responses should reference the ErrorMessage schema.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses[?(@property.match(/^[45][0-9][0-9]$/))].content.application/json.schema"
    then:
      field: $ref
      function: pattern
      functionOptions:
        match: "ErrorMessage"

  schema-registry-content-type:
    description: 2xx responses should serve application/json (or application/vnd.schemaregistry.v1+json).
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses[?(@property == '200' || @property == '201')].content"
    then:
      field: "@key"
      function: pattern
      functionOptions:
        match: "^application/(vnd\\.schemaregistry\\.v1\\+json|json)$"

  schema-registry-compatibility-enum:
    description: Compatibility levels should use canonical values.
    severity: warn
    given: "$.components.schemas.Config.properties.compatibility"
    then:
      field: enum
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            enum:
              - NONE
              - BACKWARD
              - BACKWARD_TRANSITIVE
              - FORWARD
              - FORWARD_TRANSITIVE
              - FULL
              - FULL_TRANSITIVE

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/confluent-schema-registry-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.