Sitecore · API Governance Rules

Sitecore API Rules

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

14 Rules error 4 warn 6 info 4
View Rules File View on GitHub

Rule Categories

sitecore

Rules

warn
sitecore-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
error
sitecore-operation-id-camel-case
Operation IDs must use camelCase
$.paths[*][*].operationId
warn
sitecore-path-kebab-case
Path segments must use kebab-case or camelCase (no underscores)
$.paths
error
sitecore-bearer-or-basic-auth
Security schemes must be Bearer token or Basic Auth (Sitecore standard)
$.components.securitySchemes[*]
warn
sitecore-response-200-has-schema
All 200 responses must define a schema
$.paths[*][*].responses['200'].content['application/json']
info
sitecore-400-uses-problem-details
400 error responses should reference a ProblemDetails or error schema
$.paths[*][*].responses['400']
warn
sitecore-tags-must-match-defined
Operation tags must correspond to tags defined in the root tags array
$.paths[*][*].tags[*]
info
sitecore-versioned-path
API paths should include a version prefix (/v1/, /v2.1/, /authoring/)
$.paths
error
sitecore-no-trailing-slash
Paths must not end with a trailing slash
$.paths
warn
sitecore-post-has-request-body
POST operations that create or update resources must have a request body
$.paths[*].post
info
sitecore-delete-returns-204
DELETE operations should return 204 No Content on success
$.paths[*].delete.responses
info
sitecore-list-operations-paginated
List operations should support pagination parameters
$.paths[*].get
warn
sitecore-info-contact-defined
The info section must include a contact object
$.info
error
sitecore-servers-defined
At least one server must be defined
$

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  sitecore-operation-summary-title-case:
    description: All operation summaries must use Title Case
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-z]*(\\s[A-Za-z][a-z]*)*)(\\s[A-Za-z][a-z]*)*$"

  sitecore-operation-id-camel-case:
    description: Operation IDs must use camelCase
    severity: error
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  sitecore-path-kebab-case:
    description: Path segments must use kebab-case or camelCase (no underscores)
    severity: warn
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        match: "^(\\/[a-zA-Z0-9{}\\-\\.]+)*$"

  sitecore-bearer-or-basic-auth:
    description: Security schemes must be Bearer token or Basic Auth (Sitecore standard)
    severity: error
    given: "$.components.securitySchemes[*]"
    then:
      function: schema
      functionOptions:
        schema:
          oneOf:
            - properties:
                type:
                  const: http
                scheme:
                  enum: [bearer, basic]
            - properties:
                type:
                  const: apiKey

  sitecore-response-200-has-schema:
    description: All 200 responses must define a schema
    severity: warn
    given: "$.paths[*][*].responses['200'].content['application/json']"
    then:
      field: schema
      function: truthy

  sitecore-400-uses-problem-details:
    description: 400 error responses should reference a ProblemDetails or error schema
    severity: info
    given: "$.paths[*][*].responses['400']"
    then:
      function: truthy

  sitecore-tags-must-match-defined:
    description: Operation tags must correspond to tags defined in the root tags array
    severity: warn
    given: "$.paths[*][*].tags[*]"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z\\s]*$"

  sitecore-versioned-path:
    description: API paths should include a version prefix (/v1/, /v2.1/, /authoring/)
    severity: info
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        match: "^\\/(?:v[0-9]+(\\.[0-9]+)?|api\\/v[0-9]+|authoring)\\/.*$"

  sitecore-no-trailing-slash:
    description: Paths must not end with a trailing slash
    severity: error
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        notMatch: "\\/$"

  sitecore-post-has-request-body:
    description: POST operations that create or update resources must have a request body
    severity: warn
    given: "$.paths[*].post"
    then:
      field: requestBody
      function: truthy

  sitecore-delete-returns-204:
    description: DELETE operations should return 204 No Content on success
    severity: info
    given: "$.paths[*].delete.responses"
    then:
      field: "204"
      function: truthy

  sitecore-list-operations-paginated:
    description: List operations should support pagination parameters
    severity: info
    given: "$.paths[*].get"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  sitecore-info-contact-defined:
    description: The info section must include a contact object
    severity: warn
    given: "$.info"
    then:
      field: contact
      function: truthy

  sitecore-servers-defined:
    description: At least one server must be defined
    severity: error
    given: "$"
    then:
      field: servers
      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/sitecore-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.