ExchangeRate-API · API Governance Rules

ExchangeRate-API API Rules

Spectral linting rules defining API design standards and conventions for ExchangeRate-API.

8 Rules error 7 warn 1
View Rules File View on GitHub

Rule Categories

info iso no operation response

Rules

error
info-title-required
Info title must be present
$.info
error
info-description-required
Info description must be present
$.info
error
operation-operationid-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have tags
$.paths[*][get,post,put,patch,delete]
error
response-description-required
Every response must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
error
no-empty-descriptions
Descriptions must not be empty
$..description
warn
iso-currency-code-pattern
Currency code parameters must enforce ISO 4217 three-letter uppercase pattern
$.components.parameters[?(@.name == 'base_code' || @.name == 'target_code')].schema

Spectral Ruleset

Raw ↑
rules:
  info-title-required:
    description: Info title must be present
    severity: error
    given: $.info
    then: {field: title, function: truthy}
  info-description-required:
    description: Info description must be present
    severity: error
    given: $.info
    then: {field: description, function: truthy}
  operation-operationid-required:
    description: Every operation must have an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then: {field: operationId, function: truthy}
  operation-summary-required:
    description: Every operation must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then: {field: summary, function: truthy}
  operation-tags-required:
    description: Every operation must have tags
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then: {field: tags, function: truthy}
  response-description-required:
    description: Every response must have a description
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then: {field: description, function: truthy}
  no-empty-descriptions:
    description: Descriptions must not be empty
    severity: error
    given: $..description
    then: {function: truthy}
  iso-currency-code-pattern:
    description: Currency code parameters must enforce ISO 4217 three-letter uppercase pattern
    severity: warn
    given: $.components.parameters[?(@.name == 'base_code' || @.name == 'target_code')].schema
    then: {field: pattern, function: truthy}