SAP Commerce Cloud · API Governance Rules

SAP Commerce Cloud API Rules

Spectral linting rules defining API design standards and conventions for SAP Commerce Cloud.

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

Rule Categories

sap

Rules

warn
sap-commerce-operation-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
warn
sap-commerce-operation-id-camel-case
OperationIds must use camelCase
$.paths[*][*].operationId
warn
sap-commerce-tags-title-case
All tags must use Title Case
$.tags[*].name
warn
sap-commerce-oauth2-required
Commerce Cloud APIs require OAuth 2.0 authentication
$.components.securitySchemes
warn
sap-commerce-response-200-schema
GET operations should define a response schema
$.paths[*].get.responses.200.content
info
sap-commerce-fields-parameter
Commerce Cloud APIs support a fields parameter for response shaping
$.paths[*].get.parameters
info
sap-commerce-pagination-parameters
Collection endpoints should support currentPage and pageSize
$.paths[*].get.parameters
warn
sap-commerce-servers-with-variables
Commerce Cloud server URLs must include tenant, region, and baseSiteId variables
$.servers[*].variables
info
sap-commerce-b2b-b2c-support
Commerce APIs should support both B2B and B2C scenarios
$.info.description
info
sap-commerce-occ-versioning
Commerce APIs should use OCC v2 versioning
$.servers[*].url

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  sap-commerce-operation-summary-title-case:
    description: Operation summaries must use Title Case
    message: Summary "{{value}}" should be in Title Case
    given: "$.paths[*][*].summary"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  sap-commerce-operation-id-camel-case:
    description: OperationIds must use camelCase
    message: OperationId "{{value}}" should use camelCase
    given: "$.paths[*][*].operationId"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"

  sap-commerce-tags-title-case:
    description: All tags must use Title Case
    message: Tag "{{value}}" should be in Title Case
    given: "$.tags[*].name"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  sap-commerce-oauth2-required:
    description: Commerce Cloud APIs require OAuth 2.0 authentication
    message: APIs should specify OAuth 2.0 security
    given: "$.components.securitySchemes"
    severity: warn
    then:
      function: truthy

  sap-commerce-response-200-schema:
    description: GET operations should define a response schema
    message: GET operations should return typed schemas
    given: "$.paths[*].get.responses.200.content"
    severity: warn
    then:
      function: truthy

  sap-commerce-fields-parameter:
    description: Commerce Cloud APIs support a fields parameter for response shaping
    message: List/Get operations should support the 'fields' query parameter
    given: "$.paths[*].get.parameters"
    severity: info
    then:
      function: truthy

  sap-commerce-pagination-parameters:
    description: Collection endpoints should support currentPage and pageSize
    message: Paginated list operations should define currentPage and pageSize parameters
    given: "$.paths[*].get.parameters"
    severity: info
    then:
      function: truthy

  sap-commerce-servers-with-variables:
    description: Commerce Cloud server URLs must include tenant, region, and baseSiteId variables
    message: Server URL should use variable substitution for tenant, region, and baseSiteId
    given: "$.servers[*].variables"
    severity: warn
    then:
      function: truthy

  sap-commerce-b2b-b2c-support:
    description: Commerce APIs should support both B2B and B2C scenarios
    message: API description should mention B2B and B2C commerce support
    given: "$.info.description"
    severity: info
    then:
      function: pattern
      functionOptions:
        match: "(B2B|B2C|commerce)"

  sap-commerce-occ-versioning:
    description: Commerce APIs should use OCC v2 versioning
    message: Commerce Web Services should reference OCC v2 in server URL
    given: "$.servers[*].url"
    severity: info
    then:
      function: pattern
      functionOptions:
        match: "/occ/v2"

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/sap-commerce-cloud-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.