Yapily · API Governance Rules

Yapily API Rules

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

7 Rules error 4 warn 3
View Rules File View on GitHub

Rule Categories

yapily

Rules

error
yapily-info-contact
Yapily OpenAPI specs must declare a contact section.
$.info
error
yapily-server-https
Yapily servers must use https://api.yapily.com.
$.servers[*].url
error
yapily-basic-auth-required
Yapily endpoints require basicAuth security.
$.components.securitySchemes
warn
yapily-summary-title-case
Operation summaries should be title cased.
$.paths.*[get,post,put,delete,patch].summary
error
yapily-tag-defined
Every operation must be tagged.
$.paths.*[get,post,put,delete,patch]
warn
yapily-operation-id-camel
operationId must be camelCase.
$.paths.*[get,post,put,delete,patch].operationId
warn
yapily-consent-header-on-data
Endpoints under /accounts and /payments should document the consent header parameter.
$.paths[?(@property.match(/^\/(accounts|payments|account-requests|payment-auth-requests|vrp)/))].*.parameters

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  yapily-info-contact:
    description: Yapily OpenAPI specs must declare a contact section.
    given: $.info
    severity: error
    then:
      field: contact
      function: truthy
  yapily-server-https:
    description: Yapily servers must use https://api.yapily.com.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^https://api\.yapily\.com'
  yapily-basic-auth-required:
    description: Yapily endpoints require basicAuth security.
    given: $.components.securitySchemes
    severity: error
    then:
      field: basicAuth
      function: truthy
  yapily-summary-title-case:
    description: Operation summaries should be title cased.
    given: $.paths.*[get,post,put,delete,patch].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z]'
  yapily-tag-defined:
    description: Every operation must be tagged.
    given: $.paths.*[get,post,put,delete,patch]
    severity: error
    then:
      field: tags
      function: length
      functionOptions:
        min: 1
  yapily-operation-id-camel:
    description: operationId must be camelCase.
    given: $.paths.*[get,post,put,delete,patch].operationId
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'
  yapily-consent-header-on-data:
    description: Endpoints under /accounts and /payments should document the consent header parameter.
    given: $.paths[?(@property.match(/^\/(accounts|payments|account-requests|payment-auth-requests|vrp)/))].*.parameters
    severity: warn
    then:
      function: schema
      functionOptions:
        schema:
          type: array