TIER · API Governance Rules

TIER API Rules

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

5 Rules warn 5
View Rules File View on GitHub

Rule Categories

tier

Rules

warn
tier-info-contact
TIER/Dott OpenAPI must declare an info.contact block.
$.info
warn
tier-operation-id-camel
All operationIds use camelCase.
$.paths.*[get,post,put,delete,patch]
warn
tier-tag-title-case
Tags use Title Case.
$.tags[*].name
warn
tier-summary-title-case
Operation summaries are written in Title Case.
$.paths.*[get,post,put,delete,patch].summary
warn
tier-gbfs-system-id-param
City-scoped feeds must accept the {system_id} path parameter.
$.paths['/{system_id}/gbfs.json'].get.parameters

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, all]]
rules:
  tier-info-contact:
    description: TIER/Dott OpenAPI must declare an info.contact block.
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  tier-operation-id-camel:
    description: All operationIds use camelCase.
    severity: warn
    given: $.paths.*[get,post,put,delete,patch]
    then:
      field: operationId
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'
  tier-tag-title-case:
    description: Tags use Title Case.
    severity: warn
    given: $.tags[*].name
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][A-Za-z0-9 ]+$'
  tier-summary-title-case:
    description: Operation summaries are written in Title Case.
    severity: warn
    given: $.paths.*[get,post,put,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: '^(?:[A-Z][a-zA-Z0-9]*)(?:\s+[A-Za-z0-9]+)*$'
  tier-gbfs-system-id-param:
    description: City-scoped feeds must accept the {system_id} path parameter.
    severity: warn
    given: $.paths['/{system_id}/gbfs.json'].get.parameters
    then:
      function: truthy