Cellulant · API Governance Rules

Cellulant API Rules

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

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

Rule Categories

cellulant

Rules

warn
cellulant-operation-summary-title-case
Operation summaries must use Title Case and start with the Cellulant brand verb pattern.
$.paths.*.*.summary
warn
cellulant-operationid-camelcase
operationId must be lowerCamelCase.
$.paths.*.*.operationId
error
cellulant-https-only
All servers must use HTTPS.
$.servers[*].url
warn
cellulant-tingg-host
Production server URL must use the tingg.africa domain.
$.servers[*].url
warn
cellulant-error-schema
Every operation should reference a 4XX error response component.
$.paths.*[get,post,put,delete,patch].responses
hint
cellulant-currency-code-iso4217
currency_code fields should be 3-letter ISO 4217 codes.
$..[?(@property === 'currency_code' || @property === 'currencyCode')]^

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  cellulant-operation-summary-title-case:
    description: Operation summaries must use Title Case and start with the Cellulant brand verb pattern.
    severity: warn
    given: $.paths.*.*.summary
    then:
      function: pattern
      functionOptions:
        match: '^([A-Z][a-z0-9]*)( [A-Z][a-z0-9]*)+$|^Cellulant '
  cellulant-operationid-camelcase:
    description: operationId must be lowerCamelCase.
    severity: warn
    given: $.paths.*.*.operationId
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'
  cellulant-https-only:
    description: All servers must use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: '^https://'
  cellulant-tingg-host:
    description: Production server URL must use the tingg.africa domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: 'tingg\.africa'
  cellulant-error-schema:
    description: Every operation should reference a 4XX error response component.
    severity: warn
    given: $.paths.*[get,post,put,delete,patch].responses
    then:
      field: 4XX
      function: truthy
  cellulant-currency-code-iso4217:
    description: currency_code fields should be 3-letter ISO 4217 codes.
    severity: hint
    given: $..[?(@property === 'currency_code' || @property === 'currencyCode')]^
    then:
      function: truthy