BB&T Corp (Truist) · API Governance Rules

BB&T Corp (Truist) API Rules

Spectral linting rules defining API design standards and conventions for BB&T Corp (Truist).

5 Rules error 2 warn 1 info 2
View Rules File View on GitHub

Rule Categories

truist

Rules

error
truist-bearer-auth-required
All Truist API operations must use OAuth 2.0 Bearer authentication.
$.paths.*.*.security
error
truist-operation-id-required
All Truist API operations must have an operationId.
$.paths.*.*
warn
truist-response-200-required
All GET operations should define a 200 success response.
$.paths.*.get.responses
info
truist-error-responses-defined
Operations should define standard error responses.
$.paths.*.*.responses
info
truist-pagination-parameters
List operations should support pagination parameters.
$.paths[?(@property.match('accounts|transactions'))].get.parameters

Spectral Ruleset

bbandt-spectral-rules.yml Raw ↑
rules:
  truist-bearer-auth-required:
    description: All Truist API operations must use OAuth 2.0 Bearer authentication.
    message: Operation must include OAuth2 or BearerAuth security requirement.
    severity: error
    given: $.paths.*.*.security
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  truist-operation-id-required:
    description: All Truist API operations must have an operationId.
    message: Operation is missing operationId.
    severity: error
    given: $.paths.*.*
    then:
      field: operationId
      function: truthy

  truist-response-200-required:
    description: All GET operations should define a 200 success response.
    message: GET operation is missing a 200 response.
    severity: warn
    given: $.paths.*.get.responses
    then:
      field: '200'
      function: truthy

  truist-error-responses-defined:
    description: Operations should define standard error responses.
    message: Consider defining 400, 401, and 403 error responses.
    severity: info
    given: $.paths.*.*.responses
    then:
      field: '401'
      function: truthy

  truist-pagination-parameters:
    description: List operations should support pagination parameters.
    message: Consider adding page/limit or cursor pagination to list operations.
    severity: info
    given: $.paths[?(@property.match('accounts|transactions'))].get.parameters
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1