Workday Integration · API Governance Rules

Workday Integration API Rules

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

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

Rule Categories

workday

Rules

error
workday-integration-operation-id-required
All operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
error
workday-integration-summary-required
All operations must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
workday-integration-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,post,put,patch,delete].summary
error
workday-integration-tags-required
All operations must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
workday-integration-description-required
All operations must have a description.
$.paths[*][get,post,put,patch,delete]
error
workday-integration-bearer-auth
Bearer authentication must be defined.
$.components.securitySchemes
warn
workday-integration-tenant-in-url
Server URLs must include tenant variable for multi-tenancy.
$.servers[*].url
warn
workday-integration-pagination-support
Collection GET endpoints should support limit parameter.
$.paths[*].get.parameters[*][?(@.name == 'limit')]
warn
workday-integration-response-schema
Success responses must define a content schema.
$.paths[*][get,post].responses['200','201'].content.application/json.schema
hint
workday-integration-path-kebab-case
Path segments must use kebab-case or camelCase for Workday conventions.
$.paths[*]~
warn
workday-integration-info-contact
API info must include contact details.
$.info
hint
workday-integration-external-docs
API info should include external documentation link.
$
warn
workday-integration-date-format
Date fields should specify date or date-time format.
$.components.schemas[*].properties[?(@property.match(/[Dd]ate$|[Oo]n$|[Aa]t$/))]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:

  workday-integration-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-integration-summary-required:
    description: All operations must have a summary.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy

  workday-integration-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-integration-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-integration-description-required:
    description: All operations must have a description.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy

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

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

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

  workday-integration-response-schema:
    description: Success responses must define a content schema.
    severity: warn
    given: "$.paths[*][get,post].responses['200','201'].content.application/json.schema"
    then:
      function: truthy

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

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

  workday-integration-external-docs:
    description: API info should include external documentation link.
    severity: hint
    given: "$"
    then:
      field: externalDocs
      function: truthy

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