Flutterwave · API Governance Rules

Flutterwave API Rules

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

12 Rules error 3 warn 7 info 2
View Rules File View on GitHub

Rule Categories

flutterwave

Rules

warn
flutterwave-info-contact
All Flutterwave OpenAPI specs must declare an info.contact block pointing to the developer portal.
$.info
warn
flutterwave-info-license
All Flutterwave OpenAPI specs must include an info.license block.
$.info
error
flutterwave-server-url-cloud
Flutterwave production server URL must be on api.flutterwave.cloud.
$.servers[?(@.description == 'Production')].url
warn
flutterwave-server-url-sandbox
Flutterwave sandbox server URL must be on api.flutterwave.cloud/f4b/sandbox.
$.servers[?(@.description == 'Sandbox')].url
warn
flutterwave-operation-summary-title-case
Operation summaries must be Title Case.
$.paths[*][get,post,put,delete,patch].summary
warn
flutterwave-operation-id-camel-case
operationId must be camelCase.
$.paths[*][get,post,put,delete,patch].operationId
info
flutterwave-mutating-ops-idempotency-key
POST and PUT operations should accept an X-Idempotency-Key header.
$.paths[*][post,put]
error
flutterwave-security-oauth2
Flutterwave APIs must declare OAuth2 client credentials security.
$.components.securitySchemes
warn
flutterwave-snake-case-properties
Schema property names must be snake_case (matches Flutterwave's JSON conventions).
$.components.schemas[*].properties[*]~
warn
flutterwave-monetary-fields-have-currency
When an `amount` property is present, a sibling `currency` property must also be defined.
$.components.schemas[?(@.properties.amount)].properties
error
flutterwave-id-fields-are-strings
All `id` properties must be strings (Flutterwave IDs are opaque strings, not integers).
$.components.schemas[*].properties.id
info
flutterwave-status-uses-enum
Lifecycle `status` properties should be enumerated.
$.components.schemas[?(@.properties.status)].properties.status

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  flutterwave-info-contact:
    description: All Flutterwave OpenAPI specs must declare an info.contact block pointing to the developer portal.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  flutterwave-info-license:
    description: All Flutterwave OpenAPI specs must include an info.license block.
    given: $.info
    severity: warn
    then:
      field: license
      function: truthy
  flutterwave-server-url-cloud:
    description: Flutterwave production server URL must be on api.flutterwave.cloud.
    given: $.servers[?(@.description == 'Production')].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^https://api\\.flutterwave\\.cloud/f4b/production'
  flutterwave-server-url-sandbox:
    description: Flutterwave sandbox server URL must be on api.flutterwave.cloud/f4b/sandbox.
    given: $.servers[?(@.description == 'Sandbox')].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^https://api\\.flutterwave\\.cloud/f4b/sandbox'
  flutterwave-operation-summary-title-case:
    description: Operation summaries must be Title Case.
    given: $.paths[*][get,post,put,delete,patch].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^([A-Z][a-zA-Z0-9]*\\s?)+$'
  flutterwave-operation-id-camel-case:
    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]*$'
  flutterwave-mutating-ops-idempotency-key:
    description: POST and PUT operations should accept an X-Idempotency-Key header.
    given: $.paths[*][post,put]
    severity: info
    then:
      field: parameters
      function: truthy
  flutterwave-security-oauth2:
    description: Flutterwave APIs must declare OAuth2 client credentials security.
    given: $.components.securitySchemes
    severity: error
    then:
      field: OAuth2
      function: truthy
  flutterwave-snake-case-properties:
    description: Schema property names must be snake_case (matches Flutterwave's JSON conventions).
    given: $.components.schemas[*].properties[*]~
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-z0-9_]*$'
  flutterwave-monetary-fields-have-currency:
    description: When an `amount` property is present, a sibling `currency` property must also be defined.
    given: $.components.schemas[?(@.properties.amount)].properties
    severity: warn
    then:
      field: currency
      function: truthy
  flutterwave-id-fields-are-strings:
    description: All `id` properties must be strings (Flutterwave IDs are opaque strings, not integers).
    given: $.components.schemas[*].properties.id
    severity: error
    then:
      field: type
      function: enumeration
      functionOptions:
        values: [string]
  flutterwave-status-uses-enum:
    description: Lifecycle `status` properties should be enumerated.
    given: $.components.schemas[?(@.properties.status)].properties.status
    severity: info
    then:
      field: enum
      function: truthy