Teller · API Governance Rules

Teller API Rules

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

12 Rules error 7 warn 5
View Rules File View on GitHub

Rule Categories

teller

Rules

warn
teller-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
error
teller-operation-must-have-operationid
All operations must have an operationId
$.paths[*][*]
warn
teller-operationid-camelcase
Operation IDs should use camelCase
$.paths[*][*].operationId
error
teller-server-must-be-api-teller
Server URL must use api.teller.io
$.servers[*].url
warn
teller-account-id-path-parameter
Account ID path parameters should be named account_id
$.paths['/accounts/{account_id}'][*].parameters[?(@.in == 'path')]
error
teller-response-must-have-401
All authenticated operations must handle 401 Unauthorized
$.paths['/accounts'][get].responses
warn
teller-response-must-have-429
GET operations should handle 429 rate limiting
$.paths[*].get.responses
error
teller-delete-returns-204
DELETE operations must return 204 No Content
$.paths[*].delete.responses
warn
teller-amount-as-string
Financial amounts should be represented as string type to preserve precision
$.components.schemas[*].properties.amount
error
teller-transaction-status-enum
Transaction status must use approved enum values
$.components.schemas.Transaction.properties.status
error
teller-account-type-enum
Account type must use approved enum values
$.components.schemas.Account.properties.type
error
teller-bearer-mtls-security-scheme
Security scheme must use bearer type for mTLS access tokens
$.components.securitySchemes.BearerMtls

Spectral Ruleset

Raw ↑
rules:
  teller-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-zA-Z0-9 ]*$"

  teller-operation-must-have-operationid:
    description: All operations must have an operationId
    severity: error
    given: "$.paths[*][*]"
    then:
      field: operationId
      function: truthy

  teller-operationid-camelcase:
    description: Operation IDs should use camelCase
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  teller-server-must-be-api-teller:
    description: Server URL must use api.teller.io
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://api\\.teller\\.io"

  teller-account-id-path-parameter:
    description: Account ID path parameters should be named account_id
    severity: warn
    given: "$.paths['/accounts/{account_id}'][*].parameters[?(@.in == 'path')]"
    then:
      field: name
      function: enumeration
      functionOptions:
        values:
          - account_id

  teller-response-must-have-401:
    description: All authenticated operations must handle 401 Unauthorized
    severity: error
    given: "$.paths['/accounts'][get].responses"
    then:
      field: '401'
      function: truthy

  teller-response-must-have-429:
    description: GET operations should handle 429 rate limiting
    severity: warn
    given: "$.paths[*].get.responses"
    then:
      field: '429'
      function: truthy

  teller-delete-returns-204:
    description: DELETE operations must return 204 No Content
    severity: error
    given: "$.paths[*].delete.responses"
    then:
      field: '204'
      function: truthy

  teller-amount-as-string:
    description: >-
      Financial amounts should be represented as string type to preserve precision
    severity: warn
    given: "$.components.schemas[*].properties.amount"
    then:
      field: type
      function: enumeration
      functionOptions:
        values:
          - string

  teller-transaction-status-enum:
    description: Transaction status must use approved enum values
    severity: error
    given: "$.components.schemas.Transaction.properties.status"
    then:
      field: enum
      function: truthy

  teller-account-type-enum:
    description: Account type must use approved enum values
    severity: error
    given: "$.components.schemas.Account.properties.type"
    then:
      field: enum
      function: truthy

  teller-bearer-mtls-security-scheme:
    description: Security scheme must use bearer type for mTLS access tokens
    severity: error
    given: "$.components.securitySchemes.BearerMtls"
    then:
      field: type
      function: enumeration
      functionOptions:
        values:
          - http