Workato · API Governance Rules

Workato API Rules

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

43 Rules error 12 warn 23 info 8
View Rules File View on GitHub

Rule Categories

delete error get info microcks no openapi operation operations parameter path paths query request response schema security servers tags

Rules

warn
info-title-workato-prefix
$.info.title
error
info-description-required
$.info
error
info-version-required
$.info
warn
info-contact-required
$.info
error
openapi-version-3
$.openapi
error
servers-defined
$
error
servers-https-only
$.servers[*].url
warn
servers-workato-domain
$.servers[*].url
info
paths-kebab-case
$.paths[*]~
warn
paths-no-trailing-slash
$.paths[*]~
warn
paths-api-prefix
$.paths[*]~
error
operation-summary-required
$.paths[*][get,post,put,patch,delete]
warn
operation-description-required
$.paths[*][get,post,put,patch,delete]
error
operation-id-required
$.paths[*][get,post,put,patch,delete]
warn
operation-id-camel-case
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-workato-prefix
$.paths[*][get,post,put,patch,delete].summary
info
tags-defined
$
warn
parameter-description-required
$.paths[*][get,post,put,patch,delete].parameters[*]
error
parameter-schema-required
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-snake-case
$.paths[*][get,post,put,patch,delete].parameters[*].name
warn
request-body-json-content
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
$.paths[*][get,post,put,patch,delete].responses[*]
warn
response-401-unauthorized
$.paths[*][get,post,put,patch,delete].responses
info
response-422-validation
$.paths[*][post,put].responses
warn
schema-description-required
$.components.schemas[*]
warn
schema-type-defined
$.components.schemas[*]
warn
schema-property-snake-case
$.components.schemas[*].properties[*]~
info
schema-property-description
$.components.schemas[*].properties[*]
error
security-schemes-defined
$.components
warn
security-bearer-token
$.components.securitySchemes[*]
info
security-header-api-token
$.components.securitySchemes[*][?(@.type == 'apiKey')]
error
get-no-request-body
$.paths[*].get
warn
delete-returns-success
$.paths[*].delete.responses
warn
no-empty-descriptions
$..description
info
operations-have-examples
$.paths[*][get,post,put,patch,delete].responses[*].content.application\/json
info
microcks-operation-extension
$.paths[*][get,post,put,patch,delete]
warn
path-params-casing
Path parameters should be snake_case (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
warn
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

Spectral Ruleset

Raw ↑
# workato — 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: 21/21 servers on workato.com
#   - path-params-casing: snake @ 100% (n=50)
#   - query-params-casing: snake @ 100% (n=47)
#   - operationid-casing: camel @ 100% (n=60)
#   - schema-names-casing: pascal @ 100% (n=31)
#   - schema-properties-casing: snake @ 100% (n=115)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - operation-documents-401: 100% adherence
#   - pagination params observed: ['page', 'per_page']
#   - merge: kept 38 existing, added 5 measured, upgraded 0
#   - added: path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing, error-schema-defined
extends:
  - spectral:oas
rules:
  info-title-workato-prefix:
    message: API title must begin with "Workato"
    severity: warn
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: ^Workato
  info-description-required:
    message: Info object must have a non-empty description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    message: Info object must have a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  info-contact-required:
    message: Info object should include contact information
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  openapi-version-3:
    message: Must use OpenAPI 3.0.x
    severity: error
    given: $.openapi
    then:
      function: pattern
      functionOptions:
        match: ^3\.0\.
  servers-defined:
    message: At least one server must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  servers-https-only:
    message: Server URLs must use HTTPS
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  servers-workato-domain:
    message: Server URLs should use the workato.com domain
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: workato\.com
  paths-kebab-case:
    message: Path segments must use kebab-case or snake_case (Workato uses snake_case)
    severity: info
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^(/[a-z0-9{][a-z0-9\-._{}]*)*$
  paths-no-trailing-slash:
    message: Paths must not have a trailing slash
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: /$
  paths-api-prefix:
    message: Workato API paths should begin with /api/
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^/api/
  operation-summary-required:
    message: All operations must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-description-required:
    message: All operations must have a description
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
  operation-id-required:
    message: All operations must have an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-id-camel-case:
    message: operationId must use camelCase
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
  operation-tags-required:
    message: Operations must have at least one tag
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  operation-summary-workato-prefix:
    message: Operation summaries must start with "Workato"
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: ^Workato
  tags-defined:
    message: Global tags array should be defined
    severity: info
    given: $
    then:
      field: tags
      function: truthy
  parameter-description-required:
    message: Parameters must have a description
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  parameter-schema-required:
    message: Parameters must have a schema
    severity: error
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: schema
      function: truthy
  parameter-snake-case:
    message: Parameter names should use snake_case (Workato convention)
    severity: info
    given: $.paths[*][get,post,put,patch,delete].parameters[*].name
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9_]*$
  request-body-json-content:
    message: Request bodies should use application/json content type
    severity: warn
    given: $.paths[*][post,put,patch].requestBody.content
    then:
      field: application/json
      function: truthy
  response-success-required:
    message: Operations must have a success response (200 or 201)
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
          - required:
            - '200'
          - required:
            - '201'
          - required:
            - '204'
  response-description-required:
    message: All responses must have a description
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  response-401-unauthorized:
    message: Authenticated endpoints must document 401 response
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '401'
      function: truthy
  response-422-validation:
    message: POST/PUT endpoints should document 422 validation errors
    severity: info
    given: $.paths[*][post,put].responses
    then:
      field: '422'
      function: truthy
  schema-description-required:
    message: Top-level schemas must have a description
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  schema-type-defined:
    message: Schemas must have a type defined
    severity: warn
    given: $.components.schemas[*]
    then:
      field: type
      function: truthy
  schema-property-snake-case:
    message: Schema properties should use snake_case (Workato convention)
    severity: warn
    given: $.components.schemas[*].properties[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9_]*$
  schema-property-description:
    message: Schema properties should have descriptions
    severity: info
    given: $.components.schemas[*].properties[*]
    then:
      field: description
      function: truthy
  security-schemes-defined:
    message: Security schemes must be defined in components
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  security-bearer-token:
    message: Workato APIs should use bearer token authentication
    severity: warn
    given: $.components.securitySchemes[*]
    then:
      field: scheme
      function: pattern
      functionOptions:
        match: ^bearer$
  security-header-api-token:
    message: API token should be in Authorization header as Bearer token
    severity: info
    given: $.components.securitySchemes[*][?(@.type == 'apiKey')]
    then:
      field: in
      function: enumeration
      functionOptions:
        values:
        - header
  get-no-request-body:
    message: GET operations must not have a request body
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  delete-returns-success:
    message: DELETE operations should return 200 or 204
    severity: warn
    given: $.paths[*].delete.responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
          - required:
            - '200'
          - required:
            - '204'
  no-empty-descriptions:
    message: Descriptions must not be empty strings
    severity: warn
    given: $..description
    then:
      function: pattern
      functionOptions:
        match: .+
  operations-have-examples:
    message: Operations should have response examples for documentation and mocking
    severity: info
    given: $.paths[*][get,post,put,patch,delete].responses[*].content.application\/json
    then:
      field: examples
      function: truthy
  microcks-operation-extension:
    message: Operations should have x-microcks-operation extension for mock server compatibility
    severity: info
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: x-microcks-operation
      function: truthy
  path-params-casing:
    description: Path parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: snake
  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: warn
    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