Altruistiq · API Governance Rules

Altruistiq API Rules

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

6 Rules warn 6
View Rules File View on GitHub

Rule Categories

altruistiq

Rules

warn
altruistiq-info-contact
Info object must include a contact.
$.info
warn
altruistiq-operation-summary-title-case
Operation summaries should use Title Case (Altruistiq style).
$.paths[*][get,post,put,patch,delete].summary
warn
altruistiq-paths-snake-or-kebab
Path segments must use lowercase with kebab-case (no snake_case, no camelCase).
$.paths
warn
altruistiq-uses-public-v1-prefix
All operations must live under the /api/public/v1 prefix.
$.paths
warn
altruistiq-oauth2-security
API should advertise OAuth 2.0 Client Credentials security.
$.components.securitySchemes
warn
altruistiq-tag-defined
Every operation must declare at least one tag.
$.paths[*][get,post,put,patch,delete]

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  altruistiq-info-contact:
    description: Info object must include a contact.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  altruistiq-operation-summary-title-case:
    description: Operation summaries should use Title Case (Altruistiq style).
    given: $.paths[*][get,post,put,patch,delete].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z0-9][A-Za-z0-9 \\-/()&,.']*$"
  altruistiq-paths-snake-or-kebab:
    description: Path segments must use lowercase with kebab-case (no snake_case, no camelCase).
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[/{}a-z0-9\\-]+$"
  altruistiq-uses-public-v1-prefix:
    description: All operations must live under the /api/public/v1 prefix.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^/api/public/v1/"
  altruistiq-oauth2-security:
    description: API should advertise OAuth 2.0 Client Credentials security.
    given: $.components.securitySchemes
    severity: warn
    then:
      function: truthy
  altruistiq-tag-defined:
    description: Every operation must declare at least one tag.
    given: $.paths[*][get,post,put,patch,delete]
    severity: warn
    then:
      field: tags
      function: truthy