Enable Banking · API Governance Rules

Enable Banking API Rules

Spectral linting rules defining API design standards and conventions for Enable Banking.

10 Rules error 3 warn 6
View Rules File View on GitHub

Rule Categories

enable

Rules

error
enable-banking-info-title-required
Info object must have a title.
$.info
error
enable-banking-info-version-required
Info object must have a version.
$.info
warn
enable-banking-servers-must-include-production
Enable Banking specs should advertise https://api.enablebanking.com as the primary server.
$.servers
error
enable-banking-bearer-security-required
Enable Banking uses bearer JWT security; all operations should inherit bearerAuth.
$
warn
enable-banking-operation-id-snake-case
Operation IDs in Enable Banking specs follow snake_case_with_path suffix.
$.paths[*][get,post,put,patch,delete].operationId
warn
enable-banking-operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
hint
enable-banking-operation-summary-title-case
Operation summaries should be in Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
enable-banking-tag-allowed
Operations should be tagged with one of the four canonical Enable Banking tags.
$.paths[*][get,post,put,patch,delete].tags[*]
warn
enable-banking-no-trailing-slash
Enable Banking paths do not use trailing slashes.
$.paths
warn
enable-banking-no-internal-fields
Component schemas must not expose internal fields prefixed with underscore.
$.components.schemas[*].properties.*~

Spectral Ruleset

Raw ↑
extends: spectral:oas
documentationUrl: https://github.com/api-evangelist/enable-banking
rules:
  enable-banking-info-title-required:
    description: Info object must have a title.
    given: $.info
    severity: error
    then:
      field: title
      function: truthy

  enable-banking-info-version-required:
    description: Info object must have a version.
    given: $.info
    severity: error
    then:
      field: version
      function: truthy

  enable-banking-servers-must-include-production:
    description: Enable Banking specs should advertise https://api.enablebanking.com as the primary server.
    given: $.servers
    severity: warn
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            type: object
            properties:
              url:
                const: https://api.enablebanking.com

  enable-banking-bearer-security-required:
    description: Enable Banking uses bearer JWT security; all operations should inherit bearerAuth.
    given: $
    severity: error
    then:
      field: security
      function: truthy

  enable-banking-operation-id-snake-case:
    description: Operation IDs in Enable Banking specs follow snake_case_with_path suffix.
    given: $.paths[*][get,post,put,patch,delete].operationId
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9_]*$

  enable-banking-operation-summary-required:
    description: Every operation must have a summary.
    given: $.paths[*][get,post,put,patch,delete]
    severity: warn
    then:
      field: summary
      function: truthy

  enable-banking-operation-summary-title-case:
    description: Operation summaries should be in Title Case.
    given: $.paths[*][get,post,put,patch,delete].summary
    severity: hint
    then:
      function: pattern
      functionOptions:
        match: ^([A-Z][a-z0-9]*)(\s+([A-Z][a-z0-9]*|of|for|in|to|by|the|a|an|with|and|or))*$

  enable-banking-tag-allowed:
    description: Operations should be tagged with one of the four canonical Enable Banking tags.
    given: $.paths[*][get,post,put,patch,delete].tags[*]
    severity: warn
    then:
      function: enumeration
      functionOptions:
        values:
          - User sessions
          - Accounts data
          - Payments
          - Misc

  enable-banking-no-trailing-slash:
    description: Enable Banking paths do not use trailing slashes.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        notMatch: /$

  enable-banking-no-internal-fields:
    description: Component schemas must not expose internal fields prefixed with underscore.
    given: $.components.schemas[*].properties.*~
    severity: warn
    then:
      function: pattern
      functionOptions:
        notMatch: ^_