Workday Advanced Compensation · API Governance Rules

Workday Advanced Compensation API Rules

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

43 Rules error 7 warn 25 info 11
View Rules File View on GitHub

Rule Categories

error no path query schema servers wdcomp

Rules

warn
wdcomp-info-contact
$.info
warn
wdcomp-info-version
$.info.version
error
wdcomp-operation-id-required
$.paths[*][get,post,put,patch,delete]
error
wdcomp-operation-summary-required
$.paths[*][get,post,put,patch,delete]
warn
wdcomp-operation-summary-workday-prefix
$.paths[*][get,post,put,patch,delete].summary
warn
wdcomp-operation-description-required
$.paths[*][get,post,put,patch,delete]
warn
wdcomp-operation-tags-required
$.paths[*][get,post,put,patch,delete]
warn
wdcomp-parameter-description-required
$.paths[*][get,post,put,patch,delete].parameters[*]
error
wdcomp-parameter-schema-required
$.paths[*][get,post,put,patch,delete].parameters[*]
error
wdcomp-response-200-required
$.paths[*].get.responses
warn
wdcomp-response-401-required
$.paths[*][get,post,put,patch,delete].responses
warn
wdcomp-response-403-required
$.paths[*][get,post,put,patch,delete].responses
warn
wdcomp-schema-title-required
$.components.schemas[*]
warn
wdcomp-schema-description-required
$.components.schemas[*]
info
wdcomp-schema-properties-description
$.components.schemas[*].properties[*]
error
wdcomp-security-schemes-defined
$.components
warn
wdcomp-operation-security-required
$.paths[*][get,post,put,patch,delete]
error
wdcomp-oauth2-flows-defined
$.components.securitySchemes.oauth2
info
wdcomp-microcks-operation-extension
$.paths[*][get,post,put,patch,delete]
info
wdcomp-microcks-example-default
$.paths[*][get,post,put,patch,delete].responses[*].content[*].examples[*]
info
wdcomp-path-kebab-case
$.paths
warn
wdcomp-schema-pascal-case
$.components.schemas
warn
wdcomp-operation-id-camel-case
$.paths[*][get,post,put,patch,delete].operationId
info
wdcomp-pagination-limit-param
$.paths[*][?(@property === 'get')].parameters[?(@.name === 'limit')]
info
wdcomp-pagination-offset-param
$.paths[*][?(@property === 'get')].parameters[?(@.name === 'offset')]
warn
wdcomp-response-schema-ref
$.paths[*][get,post,put,patch,delete].responses[200,201].content.application/json.schema
warn
wdcomp-server-tenant-variable
$.servers[*].url
info
wdcomp-error-response-schema
$.components.responses[*].content.application/json.schema
warn
wdcomp-tags-global-defined
$.tags
info
wdcomp-examples-provided
$.paths[*][get,post,put,patch,delete].responses[200,201].content.application/json
warn
wdcomp-request-body-description
$.paths[*][post,put,patch].requestBody
warn
wdcomp-request-body-required-flag
$.paths[*][post,put,patch].requestBody
info
wdcomp-compensation-effective-date
$.components.schemas[*].properties
info
wdcomp-compensation-currency-field
$.components.schemas[?(@.properties.basePay || @.properties.budgetAmount || @.properties.minimumPay)].properties
warn
wdcomp-compensation-status-enum
$.components.schemas[*].properties.status
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-expected-domain
Server URLs should be on the workday.com domain.
$.servers[*].url
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
query-params-casing
Query parameters should be snake_case (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
error-schema-defined
A shared error schema (ErrorResponse) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# workday-advanced-compensation — Spectral ruleset (strengthened)
# Plain Spectral. Existing hand-authored rules preserved; measured rules added
# from this provider's own OpenAPI conventions by strengthen_ruleset.py,
# then self-validated against the spec.
#
# Provenance:
#   - servers-https-only: 100% of servers already https (error)
#   - servers-expected-domain: 1/1 servers on workday.com
#   - path-params-casing: camel @ 100% (n=4)
#   - query-params-casing: snake @ 94% (n=17)
#   - operationid-casing: camel @ 100% (n=11)
#   - schema-names-casing: pascal @ 100% (n=21)
#   - schema-properties-casing: snake @ 60% (n=91)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - pagination params observed: ['limit', 'offset']
#   - merge: kept 35 existing, added 8 measured, upgraded 0
#   - added: servers-https-only, servers-expected-domain, path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing, error-schema-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  wdcomp-info-contact:
    message: Info object must include a contact with name and url.
    severity: warn
    given: $.info
    then:
    - field: contact.name
      function: truthy
    - field: contact.url
      function: truthy
  wdcomp-info-version:
    message: API version must follow Workday vN format.
    severity: warn
    given: $.info.version
    then:
      function: pattern
      functionOptions:
        match: ^v[0-9]+(\.[0-9]+)?$
  wdcomp-operation-id-required:
    message: Every operation must have an operationId.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  wdcomp-operation-summary-required:
    message: Every operation must have a summary.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  wdcomp-operation-summary-workday-prefix:
    message: Operation summary must start with 'Workday '.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: '^Workday '
  wdcomp-operation-description-required:
    message: Every operation must have a description.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
  wdcomp-operation-tags-required:
    message: Every operation must have at least one tag.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  wdcomp-parameter-description-required:
    message: Every parameter must have a description.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  wdcomp-parameter-schema-required:
    message: Every parameter must have a schema.
    severity: error
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: schema
      function: truthy
  wdcomp-response-200-required:
    message: GET operations must define a 200 response.
    severity: error
    given: $.paths[*].get.responses
    then:
      field: '200'
      function: truthy
  wdcomp-response-401-required:
    message: Operations must define a 401 unauthorized response.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '401'
      function: truthy
  wdcomp-response-403-required:
    message: Operations must define a 403 forbidden response.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '403'
      function: truthy
  wdcomp-schema-title-required:
    message: Every schema in components must have a title.
    severity: warn
    given: $.components.schemas[*]
    then:
      field: title
      function: truthy
  wdcomp-schema-description-required:
    message: Every schema in components must have a description.
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  wdcomp-schema-properties-description:
    message: Schema properties should have descriptions.
    severity: info
    given: $.components.schemas[*].properties[*]
    then:
      field: description
      function: truthy
  wdcomp-security-schemes-defined:
    message: API must define security schemes in components.
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  wdcomp-operation-security-required:
    message: All operations must have security defined.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: security
      function: truthy
  wdcomp-oauth2-flows-defined:
    message: OAuth2 security scheme must define flows.
    severity: error
    given: $.components.securitySchemes.oauth2
    then:
      field: flows
      function: truthy
  wdcomp-microcks-operation-extension:
    message: Operations should include x-microcks-operation extension for mock configuration.
    severity: info
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: x-microcks-operation
      function: truthy
  wdcomp-microcks-example-default:
    message: 'Response examples should include x-microcks-default: true for the primary example.'
    severity: info
    given: $.paths[*][get,post,put,patch,delete].responses[*].content[*].examples[*]
    then:
      field: x-microcks-default
      function: truthy
  wdcomp-path-kebab-case:
    message: Path segments should use camelCase per Workday conventions.
    severity: info
    given: $.paths
    then:
      function: pattern
      functionOptions:
        match: ^/[a-zA-Z0-9/{}_.]*$
  wdcomp-schema-pascal-case:
    message: Schema names in components must use PascalCase.
    severity: warn
    given: $.components.schemas
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9]*$
  wdcomp-operation-id-camel-case:
    message: Operation IDs should use camelCase.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
  wdcomp-pagination-limit-param:
    message: List operations should support a limit parameter.
    severity: info
    given: $.paths[*][?(@property === 'get')].parameters[?(@.name === 'limit')]
    then:
      field: schema.type
      function: enumeration
      functionOptions:
        values:
        - integer
  wdcomp-pagination-offset-param:
    message: List operations should support an offset parameter.
    severity: info
    given: $.paths[*][?(@property === 'get')].parameters[?(@.name === 'offset')]
    then:
      field: schema.type
      function: enumeration
      functionOptions:
        values:
        - integer
  wdcomp-response-schema-ref:
    message: Success responses should reference a defined schema component.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses[200,201].content.application/json.schema
    then:
      field: $ref
      function: truthy
  wdcomp-server-tenant-variable:
    message: Server URL should include a {tenant} variable for multi-tenant support.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: \{tenant\}
  wdcomp-error-response-schema:
    message: Error responses should reference the ErrorResponse schema.
    severity: info
    given: $.components.responses[*].content.application/json.schema
    then:
      field: $ref
      function: truthy
  wdcomp-tags-global-defined:
    message: Tags used in operations should be defined at the global level.
    severity: warn
    given: $.tags
    then:
      field: description
      function: truthy
  wdcomp-examples-provided:
    message: Responses should include examples for documentation.
    severity: info
    given: $.paths[*][get,post,put,patch,delete].responses[200,201].content.application/json
    then:
      field: examples
      function: truthy
  wdcomp-request-body-description:
    message: Request bodies should include a description.
    severity: warn
    given: $.paths[*][post,put,patch].requestBody
    then:
      field: description
      function: truthy
  wdcomp-request-body-required-flag:
    message: Request bodies should explicitly declare if they are required.
    severity: warn
    given: $.paths[*][post,put,patch].requestBody
    then:
      field: required
      function: defined
  wdcomp-compensation-effective-date:
    message: Compensation resources should include effectiveDate field.
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: effectiveDate
      function: defined
  wdcomp-compensation-currency-field:
    message: Monetary schemas should include a currency field.
    severity: info
    given: $.components.schemas[?(@.properties.basePay || @.properties.budgetAmount || @.properties.minimumPay)].properties
    then:
      field: currency
      function: defined
  wdcomp-compensation-status-enum:
    message: Status fields should use defined enum values.
    severity: warn
    given: $.components.schemas[*].properties.status
    then:
      field: enum
      function: truthy
  servers-https-only:
    description: Server URLs must use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  servers-expected-domain:
    description: Server URLs should be on the workday.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: workday\.com
  path-params-casing:
    description: Path parameters should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: camel
  query-params-casing:
    description: Query parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: snake
  schema-names-casing:
    description: Component schema names should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  schema-properties-casing:
    description: Schema properties should be snake_case (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  error-schema-defined:
    description: A shared error schema (ErrorResponse) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: ErrorResponse
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy