Workday Extend · API Governance Rules

Workday Extend API Rules

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

15 Rules error 6 warn 8
View Rules File View on GitHub

Rule Categories

workday

Rules

error
workday-extend-operation-id-required
All operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
error
workday-extend-operation-summary-required
All operations must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
workday-extend-operation-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,post,put,patch,delete].summary
error
workday-extend-operation-tags-required
All operations must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
workday-extend-operation-description-required
All operations must have a description.
$.paths[*][get,post,put,patch,delete]
warn
workday-extend-path-kebab-case
Path segments must use kebab-case.
$.paths[*]~
warn
workday-extend-response-200-schema
GET operations must define a schema for 200 responses.
$.paths[*].get.responses.200.content.application/json.schema
error
workday-extend-security-defined
All operations must define security requirements.
$.paths[*][get,post,put,patch,delete]
error
workday-extend-oauth2-scopes
OAuth2 flows must define scopes.
$.components.securitySchemes[*].flows[*].scopes
warn
workday-extend-parameters-description
All parameters must have a description.
$.components.parameters[*]
warn
workday-extend-info-contact
API info must include contact details.
$.info
error
workday-extend-servers-defined
At least one server must be defined.
$
hint
workday-extend-schema-properties-description
Schema properties should include descriptions for documentation.
$.components.schemas[*].properties[*]
warn
workday-extend-pagination-limit-param
Collection endpoints should support limit query parameter for pagination.
$.paths[*].get.parameters[*][?(@.name == 'limit')]
warn
workday-extend-tenant-variable-required
Server URLs must include tenant variable for multi-tenancy.
$.servers[*].url

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:

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

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

  workday-extend-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-extend-security-defined:
    description: All operations must define security requirements.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: security
      function: truthy

  workday-extend-oauth2-scopes:
    description: OAuth2 flows must define scopes.
    severity: error
    given: "$.components.securitySchemes[*].flows[*].scopes"
    then:
      function: truthy

  workday-extend-parameters-description:
    description: All parameters must have a description.
    severity: warn
    given: "$.components.parameters[*]"
    then:
      field: description
      function: truthy

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

  workday-extend-servers-defined:
    description: At least one server must be defined.
    severity: error
    given: "$"
    then:
      field: servers
      function: truthy

  workday-extend-schema-properties-description:
    description: Schema properties should include descriptions for documentation.
    severity: hint
    given: "$.components.schemas[*].properties[*]"
    then:
      field: description
      function: truthy

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

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