Spendflo · API Governance Rules

Spendflo API Rules

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

4 Rules error 2 warn 2
View Rules File View on GitHub

Rule Categories

spendflo

Rules

error
spendflo-operationid-required
All API operations should have an operationId for Spendflo integration mapping.
$.paths[*][get,post,put,patch,delete,options,head]
error
spendflo-summary-required
All API operations should have a summary describing the procurement action.
$.paths[*][get,post,put,patch,delete]
warn
spendflo-tags-required
Operations should be tagged by procurement domain (Vendors, Contracts, Spend, etc.).
$.paths[*][get,post,put,patch,delete]
warn
spendflo-error-responses-defined
Operations should document error responses for procurement workflow error handling.
$.paths[*][post,put,patch,delete].responses

Spectral Ruleset

spendflo-rules.yml Raw ↑
extends: "spectral:oas"

rules:
  spendflo-operationid-required:
    description: All API operations should have an operationId for Spendflo integration mapping.
    message: "Operation at {{path}} must have an operationId."
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,options,head]"
    then:
      field: operationId
      function: truthy

  spendflo-summary-required:
    description: All API operations should have a summary describing the procurement action.
    message: "Operation {{path}} is missing a summary."
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy

  spendflo-tags-required:
    description: Operations should be tagged by procurement domain (Vendors, Contracts, Spend, etc.).
    message: "Operation {{path}} should have at least one domain tag."
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  spendflo-error-responses-defined:
    description: Operations should document error responses for procurement workflow error handling.
    message: "Operation {{path}} should define error response codes (400, 401, 403, 404)."
    severity: warn
    given: "$.paths[*][post,put,patch,delete].responses"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          minProperties: 2