AT&T · API Governance Rules

AT&T API Rules

Spectral linting rules defining API design standards and conventions for AT&T.

33 Rules error 13 warn 19 info 1
View Rules File View on GitHub

Rule Categories

atandt error no operationid path schema

Rules

error
atandt-info-title-required
AT&T APIs must have a title in the info object
$.info
error
atandt-info-description-required
AT&T APIs must include a description
$.info
error
atandt-info-version-required
AT&T APIs must specify a version
$.info
warn
atandt-info-contact-required
AT&T APIs must include contact information
$.info
warn
atandt-info-terms-required
AT&T APIs must include terms of service
$.info
error
atandt-openapi-version
AT&T APIs must use OpenAPI 3.0.x
$
error
atandt-servers-required
AT&T APIs must define at least one server
$
error
atandt-server-url-https
AT&T API servers must use HTTPS
$.servers[*]
warn
atandt-server-att-domain
AT&T API servers should use att.com domains
$.servers[*]
error
atandt-operation-id-required
All AT&T API operations must have an operationId
$.paths[*][get,post,put,patch,delete,options,head]
error
atandt-operation-summary-required
All AT&T API operations must have a summary
$.paths[*][get,post,put,patch,delete,options,head]
warn
atandt-operation-description-required
All AT&T API operations must have a description
$.paths[*][get,post,put,patch,delete,options,head]
warn
atandt-operation-tags-required
All AT&T API operations must have tags
$.paths[*][get,post,put,patch,delete,options,head]
warn
atandt-parameter-description-required
All AT&T API parameters must have a description
$.paths[*][*].parameters[*]
error
atandt-path-parameter-required
Path parameters must be marked as required
$.paths[*][*].parameters[?(@.in == 'path')]
error
atandt-request-body-content-required
AT&T API request bodies must define content
$.paths[*][*].requestBody
warn
atandt-request-body-json
AT&T API request bodies should support application/json
$.paths[*][*].requestBody.content
error
atandt-response-description-required
All AT&T API responses must have a description
$.paths[*][*].responses[*]
error
atandt-success-response-required
AT&T API operations must define at least one success response
$.paths[*][get,post,put,patch,delete]
warn
atandt-error-400-defined
AT&T POST/PUT/PATCH operations should define 400 response
$.paths[*][post,put,patch].responses
warn
atandt-error-401-defined
AT&T API operations should define 401 response
$.paths[*][get,post,put,patch,delete].responses
warn
atandt-schema-type-required
AT&T API component schemas must have a type
$.components.schemas[*]
warn
atandt-schema-description-required
AT&T API component schemas must have a description
$.components.schemas[*]
error
atandt-security-schemes-required
AT&T APIs must define security schemes
$.components
warn
atandt-security-oauth2
AT&T APIs should use OAuth 2.0
$.components.securitySchemes[*]
warn
atandt-phone-number-e164
AT&T CAMARA APIs must use E.164 format for phone numbers
$.components.schemas[*].properties.phoneNumber
warn
atandt-tags-defined
AT&T APIs must define top-level tags
$
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
operationid-casing
Operation IDs should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].operationId
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be camelCase (the dominant convention in this API).
$.components.schemas[*].properties
warn
error-schema-defined
A shared error schema (ErrorResponse) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# atandt — Spectral ruleset (strengthened)
# Plain Spectral. Existing hand-authored rules preserved; measured rules added
# from this provider's own OpenAPI conventions by strengthen_ruleset.py,
# then self-validated against the spec.
#
# Provenance:
#   - servers-https-only: 100% of servers already https (error)
#   - servers-expected-domain: 2/2 servers on att.com
#   - path-params-casing: camel @ 100% (n=3)
#   - operationid-casing: camel @ 100% (n=15)
#   - schema-names-casing: pascal @ 100% (n=22)
#   - schema-properties-casing: camel @ 63% (n=60)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - merge: kept 27 existing, added 6 measured, upgraded 0
#   - added: path-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, error-schema-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  atandt-info-title-required:
    description: AT&T APIs must have a title in the info object
    message: info.title is required for AT&T APIs
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  atandt-info-description-required:
    description: AT&T APIs must include a description
    message: info.description is required for AT&T APIs
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  atandt-info-version-required:
    description: AT&T APIs must specify a version
    message: info.version is required for AT&T APIs
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  atandt-info-contact-required:
    description: AT&T APIs must include contact information
    message: info.contact is required for AT&T APIs
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  atandt-info-terms-required:
    description: AT&T APIs must include terms of service
    message: info.termsOfService is required for AT&T APIs
    severity: warn
    given: $.info
    then:
      field: termsOfService
      function: truthy
  atandt-openapi-version:
    description: AT&T APIs must use OpenAPI 3.0.x
    message: openapi must be 3.0.x
    severity: error
    given: $
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: ^3\.0\.\d+$
  atandt-servers-required:
    description: AT&T APIs must define at least one server
    message: servers array is required
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  atandt-server-url-https:
    description: AT&T API servers must use HTTPS
    message: Server URL must use HTTPS
    severity: error
    given: $.servers[*]
    then:
      field: url
      function: pattern
      functionOptions:
        match: ^https://
  atandt-server-att-domain:
    description: AT&T API servers should use att.com domains
    message: Server URL should use att.com domain
    severity: warn
    given: $.servers[*]
    then:
      field: url
      function: pattern
      functionOptions:
        match: \.att\.com
  atandt-operation-id-required:
    description: All AT&T API operations must have an operationId
    message: operationId is required for all operations
    severity: error
    given: $.paths[*][get,post,put,patch,delete,options,head]
    then:
      field: operationId
      function: truthy
  atandt-operation-summary-required:
    description: All AT&T API operations must have a summary
    message: summary is required for all operations
    severity: error
    given: $.paths[*][get,post,put,patch,delete,options,head]
    then:
      field: summary
      function: truthy
  atandt-operation-description-required:
    description: All AT&T API operations must have a description
    message: description is required for all operations
    severity: warn
    given: $.paths[*][get,post,put,patch,delete,options,head]
    then:
      field: description
      function: truthy
  atandt-operation-tags-required:
    description: All AT&T API operations must have tags
    message: tags array is required for all operations
    severity: warn
    given: $.paths[*][get,post,put,patch,delete,options,head]
    then:
      field: tags
      function: truthy
  atandt-parameter-description-required:
    description: All AT&T API parameters must have a description
    message: description is required for all parameters
    severity: warn
    given: $.paths[*][*].parameters[*]
    then:
      field: description
      function: truthy
  atandt-path-parameter-required:
    description: Path parameters must be marked as required
    message: Path parameters must have required=true
    severity: error
    given: $.paths[*][*].parameters[?(@.in == 'path')]
    then:
      field: required
      function: truthy
  atandt-request-body-content-required:
    description: AT&T API request bodies must define content
    message: requestBody.content is required
    severity: error
    given: $.paths[*][*].requestBody
    then:
      field: content
      function: truthy
  atandt-request-body-json:
    description: AT&T API request bodies should support application/json
    message: requestBody should include application/json content type
    severity: warn
    given: $.paths[*][*].requestBody.content
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
          - application/json
  atandt-response-description-required:
    description: All AT&T API responses must have a description
    message: Response description is required
    severity: error
    given: $.paths[*][*].responses[*]
    then:
      field: description
      function: truthy
  atandt-success-response-required:
    description: AT&T API operations must define at least one success response
    message: At least one 2xx response is required
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            responses:
              type: object
          required:
          - responses
  atandt-error-400-defined:
    description: AT&T POST/PUT/PATCH operations should define 400 response
    message: 400 Bad Request response should be defined for mutating operations
    severity: warn
    given: $.paths[*][post,put,patch].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
          - '400'
  atandt-error-401-defined:
    description: AT&T API operations should define 401 response
    message: 401 Unauthorized response should be defined for secured operations
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
          - '401'
  atandt-schema-type-required:
    description: AT&T API component schemas must have a type
    message: Schema type is required
    severity: warn
    given: $.components.schemas[*]
    then:
      field: type
      function: truthy
  atandt-schema-description-required:
    description: AT&T API component schemas must have a description
    message: Schema description is required
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  atandt-security-schemes-required:
    description: AT&T APIs must define security schemes
    message: components.securitySchemes is required
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  atandt-security-oauth2:
    description: AT&T APIs should use OAuth 2.0
    message: OAuth 2.0 security scheme should be defined
    severity: warn
    given: $.components.securitySchemes[*]
    then:
      field: type
      function: enumeration
      functionOptions:
        values:
        - oauth2
  atandt-phone-number-e164:
    description: AT&T CAMARA APIs must use E.164 format for phone numbers
    message: Phone number properties should use E.164 pattern
    severity: warn
    given: $.components.schemas[*].properties.phoneNumber
    then:
      field: pattern
      function: truthy
  atandt-tags-defined:
    description: AT&T APIs must define top-level tags
    message: Top-level tags array is required
    severity: warn
    given: $
    then:
      field: tags
      function: truthy
  path-params-casing:
    description: Path parameters should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: camel
  operationid-casing:
    description: Operation IDs should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: camel
  schema-names-casing:
    description: Component schema names should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  schema-properties-casing:
    description: Schema properties should be camelCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: camel
  error-schema-defined:
    description: A shared error schema (ErrorResponse) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: ErrorResponse
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy