Speedscale · API Governance Rules

Speedscale API Rules

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

4 Rules error 1 warn 2 info 1
View Rules File View on GitHub

Rule Categories

speedscale

Rules

error
speedscale-operationid-required
All operations should have an operationId for Speedscale CLI mapping.
$.paths[*][get,post,put,patch,delete,options,head]
warn
speedscale-response-schema-required
Operations should define response schemas for accurate mock generation.
$.paths[*][get,post,put,patch,delete].responses[200,201,202]
info
speedscale-security-defined
APIs with authentication should define security schemes for capture.
$.components
warn
speedscale-servers-defined
Server URLs should be defined for correct traffic routing in replay.
$

Spectral Ruleset

speedscale-rules.yml Raw ↑
extends: "spectral:oas"

rules:
  speedscale-operationid-required:
    description: All operations should have an operationId for Speedscale CLI mapping.
    message: "Operation at {{path}} must have an operationId for traffic replay mapping."
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,options,head]"
    then:
      field: operationId
      function: truthy

  speedscale-response-schema-required:
    description: Operations should define response schemas for accurate mock generation.
    message: "Operation {{path}} should define a response schema for service virtualization."
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses[200,201,202]"
    then:
      field: content
      function: truthy

  speedscale-security-defined:
    description: APIs with authentication should define security schemes for capture.
    message: "API spec should define security schemes to enable authenticated traffic capture."
    severity: info
    given: "$.components"
    then:
      field: securitySchemes
      function: truthy

  speedscale-servers-defined:
    description: Server URLs should be defined for correct traffic routing in replay.
    message: "API spec should define at least one server for replay target configuration."
    severity: warn
    given: "$"
    then:
      field: servers
      function: truthy