Windstream Holdings · API Governance Rules

Windstream Holdings API Rules

Spectral linting rules defining API design standards and conventions for Windstream Holdings.

9 Rules error 5 warn 2 info 2
View Rules File View on GitHub

Rule Categories

windstream

Rules

warn
windstream-uuid-path-params
Tenant and extension path parameters should use UUID format
$.paths[*][*].parameters[?(@.in=='path')]
error
windstream-operation-id-required
All operations must have an operationId
$.paths[*][get,post,put,delete,patch]
warn
windstream-operation-id-camel-case
OperationIds should use camelCase
$.paths[*][*].operationId
error
windstream-operation-tags-required
All operations must have at least one tag
$.paths[*][get,post,put,delete,patch]
error
windstream-summary-required
All operations must have a summary
$.paths[*][get,post,put,delete,patch]
error
windstream-no-get-request-body
GET operations should not have request bodies
$.paths[*].get
error
windstream-success-response-required
Operations must define at least one response
$.paths[*][get,post,put,delete,patch].responses
info
windstream-schema-property-descriptions
Schema properties should have descriptions
$.components.schemas[*].properties[*]
info
windstream-hal-content-type
HAL responses should use application/hal+json content type
$.paths[*][*].responses[*].content

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, recommended]]

rules:
  # Windstream APIs use UUID path parameters for tenant/extension operations
  windstream-uuid-path-params:
    description: Tenant and extension path parameters should use UUID format
    message: "Path parameter '{{value}}' for tenant/extension should be a UUID"
    severity: warn
    given: "$.paths[*][*].parameters[?(@.in=='path')]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  # All operations must have operationIds
  windstream-operation-id-required:
    description: All operations must have an operationId
    message: "Operation is missing an operationId"
    severity: error
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: operationId
      function: truthy

  # OperationIds use camelCase
  windstream-operation-id-camel-case:
    description: OperationIds should use camelCase
    message: "OperationId '{{value}}' should use camelCase"
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"

  # Operations must have tags
  windstream-operation-tags-required:
    description: All operations must have at least one tag
    message: "Operation is missing tags"
    severity: error
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: tags
      function: truthy

  # Summaries must be present and use Title Case
  windstream-summary-required:
    description: All operations must have a summary
    message: "Operation is missing a summary"
    severity: error
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: summary
      function: truthy

  # GET operations should not have request bodies
  windstream-no-get-request-body:
    description: GET operations should not have request bodies
    message: "GET operation should not have a requestBody"
    severity: error
    given: "$.paths[*].get"
    then:
      field: requestBody
      function: falsy

  # Responses must include success codes
  windstream-success-response-required:
    description: Operations must define at least one response
    message: "Operation has no responses defined"
    severity: error
    given: "$.paths[*][get,post,put,delete,patch].responses"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          minProperties: 1

  # Schema properties should have descriptions
  windstream-schema-property-descriptions:
    description: Schema properties should have descriptions
    message: "Schema property is missing a description"
    severity: info
    given: "$.components.schemas[*].properties[*]"
    then:
      field: description
      function: truthy

  # HAL responses should use application/hal+json content type
  windstream-hal-content-type:
    description: HAL responses should use application/hal+json content type
    message: "HAL response should declare application/hal+json content type"
    severity: info
    given: "$.paths[*][*].responses[*].content"
    then:
      function: schema
      functionOptions:
        schema:
          type: object