Workday Finance · API Governance Rules

Workday Finance API Rules

Spectral linting rules defining API design standards and conventions for Workday Finance.

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

Rule Categories

workday

Rules

error
workday-finance-operation-id-required
All operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
error
workday-finance-operation-summary-required
All operations must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
workday-finance-operation-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,post,put,patch,delete].summary
error
workday-finance-tags-required
All operations must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
workday-finance-path-kebab-case
Path segments must use kebab-case.
$.paths[*]~
warn
workday-finance-response-200-schema
GET operations must define a schema for 200 responses.
$.paths[*].get.responses.200.content.application/json.schema
error
workday-finance-bearer-auth-defined
Bearer authentication must be defined in security schemes.
$.components.securitySchemes
warn
workday-finance-pagination-params
Collection GET endpoints should support limit and offset parameters.
$.paths[*].get.parameters[*][?(@.name == 'limit')]
warn
workday-finance-tenant-in-server-url
Server URLs must include tenant variable for multi-tenancy.
$.servers[*].url
hint
workday-finance-financial-amounts-as-number
Financial amount fields should use number type for precision.
$.components.schemas[*].properties[?(@property.match(/[Aa]mount|[Bb]alance|[Cc]ost|[Pp]rice/))]
warn
workday-finance-date-fields-format
Date fields must specify date or date-time format.
$.components.schemas[*].properties[?(@property.match(/[Dd]ate$|[Oo]n$/))]
warn
workday-finance-info-contact
API info must include contact details.
$.info

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:

  workday-finance-operation-id-required:
    description: All operations must have an operationId.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  workday-finance-operation-summary-required:
    description: All operations must have a summary.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy

  workday-finance-operation-summary-title-case:
    description: Operation summaries must use Title Case.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  workday-finance-tags-required:
    description: All operations must have at least one tag.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  workday-finance-path-kebab-case:
    description: Path segments must use kebab-case.
    severity: warn
    given: "$.paths[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^(/[a-zA-Z0-9{}-]+)+$"

  workday-finance-response-200-schema:
    description: GET operations must define a schema for 200 responses.
    severity: warn
    given: "$.paths[*].get.responses.200.content.application/json.schema"
    then:
      function: truthy

  workday-finance-bearer-auth-defined:
    description: Bearer authentication must be defined in security schemes.
    severity: error
    given: "$.components.securitySchemes"
    then:
      function: truthy

  workday-finance-pagination-params:
    description: Collection GET endpoints should support limit and offset parameters.
    severity: warn
    given: "$.paths[*].get.parameters[*][?(@.name == 'limit')]"
    then:
      field: schema.type
      function: pattern
      functionOptions:
        match: "integer"

  workday-finance-tenant-in-server-url:
    description: Server URLs must include tenant variable for multi-tenancy.
    severity: warn
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "\\{tenant\\}"

  workday-finance-financial-amounts-as-number:
    description: Financial amount fields should use number type for precision.
    severity: hint
    given: "$.components.schemas[*].properties[?(@property.match(/[Aa]mount|[Bb]alance|[Cc]ost|[Pp]rice/))]"
    then:
      field: type
      function: pattern
      functionOptions:
        match: "number"

  workday-finance-date-fields-format:
    description: Date fields must specify date or date-time format.
    severity: warn
    given: "$.components.schemas[*].properties[?(@property.match(/[Dd]ate$|[Oo]n$/))]"
    then:
      field: format
      function: truthy

  workday-finance-info-contact:
    description: API info must include contact details.
    severity: warn
    given: "$.info"
    then:
      field: contact
      function: truthy