EBANX · API Governance Rules

EBANX API Rules

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

9 Rules error 5 warn 4
View Rules File View on GitHub

Rule Categories

ebanx

Rules

error
ebanx-info-contact
EBANX specs must include a contact block.
$.info
error
ebanx-info-version
EBANX specs must declare an info.version.
$.info
error
ebanx-server-defined
Every EBANX OpenAPI spec must declare both sandbox and production servers.
$.servers
warn
ebanx-only-post
EBANX REST operations are exposed as POST endpoints under /ws/* — flag non-POST methods.
$.paths[*][?(@property != 'post')]
warn
ebanx-operation-summary-title-case
Operation summaries must use Title Case.
$.paths[*][*].summary
error
ebanx-operation-id-camel-case
operationId must be camelCase.
$.paths[*][*].operationId
warn
ebanx-operation-description
Every operation must include a description.
$.paths[*][*]
error
ebanx-security-integration-key
Every spec must declare the integrationKey security scheme.
$.components.securitySchemes.integrationKey
warn
ebanx-no-trailing-slash
Paths must not end with a trailing slash.
$.paths

Spectral Ruleset

Raw ↑
extends:
  - [spectral:oas, all]
rules:
  ebanx-info-contact:
    description: EBANX specs must include a contact block.
    given: $.info
    severity: error
    then:
      field: contact
      function: truthy

  ebanx-info-version:
    description: EBANX specs must declare an info.version.
    given: $.info
    severity: error
    then:
      field: version
      function: truthy

  ebanx-server-defined:
    description: Every EBANX OpenAPI spec must declare both sandbox and production servers.
    given: $.servers
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 2

  ebanx-only-post:
    description: EBANX REST operations are exposed as POST endpoints under /ws/* — flag non-POST methods.
    given: $.paths[*][?(@property != 'post')]
    severity: warn
    then:
      function: falsy

  ebanx-operation-summary-title-case:
    description: Operation summaries must use Title Case.
    given: $.paths[*][*].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][A-Za-z0-9]*( [A-Z][A-Za-z0-9]*)*$'

  ebanx-operation-id-camel-case:
    description: operationId must be camelCase.
    given: $.paths[*][*].operationId
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]*$'

  ebanx-operation-description:
    description: Every operation must include a description.
    given: $.paths[*][*]
    severity: warn
    then:
      field: description
      function: truthy

  ebanx-security-integration-key:
    description: Every spec must declare the integrationKey security scheme.
    given: $.components.securitySchemes.integrationKey
    severity: error
    then:
      function: truthy

  ebanx-no-trailing-slash:
    description: Paths must not end with a trailing slash.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[^/].*[^/]$|^/.*[^/]$|^/$'