Zipkin · API Governance Rules

Zipkin API Rules

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

6 Rules error 2 warn 4
View Rules File View on GitHub

Rule Categories

zipkin

Rules

warn
zipkin-summary-prefix
All operation summaries must start with "Zipkin"
$.paths.*[get,post,put,delete,patch].summary
error
zipkin-operation-id
Every operation must have an operationId
$.paths.*[get,post,put,delete,patch]
warn
zipkin-operation-tags
Every operation must have at least one tag
$.paths.*[get,post,put,delete,patch]
warn
zipkin-operation-description
Every operation must have a description
$.paths.*[get,post,put,delete,patch]
warn
zipkin-trace-id-pattern
traceId fields must use the hex pattern
$.components.schemas.Span.properties.traceId.pattern
error
zipkin-server-url
Servers must be defined
$.servers

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  zipkin-summary-prefix:
    description: All operation summaries must start with "Zipkin"
    message: "Operation summary should start with 'Zipkin' provider prefix"
    severity: warn
    given: "$.paths.*[get,post,put,delete,patch].summary"
    then:
      function: pattern
      functionOptions:
        match: "^Zipkin "
  zipkin-operation-id:
    description: Every operation must have an operationId
    message: "Operation must define an operationId"
    severity: error
    given: "$.paths.*[get,post,put,delete,patch]"
    then:
      field: operationId
      function: truthy
  zipkin-operation-tags:
    description: Every operation must have at least one tag
    message: "Operation must have a tag"
    severity: warn
    given: "$.paths.*[get,post,put,delete,patch]"
    then:
      field: tags
      function: truthy
  zipkin-operation-description:
    description: Every operation must have a description
    severity: warn
    given: "$.paths.*[get,post,put,delete,patch]"
    then:
      field: description
      function: truthy
  zipkin-trace-id-pattern:
    description: traceId fields must use the hex pattern
    severity: warn
    given: "$.components.schemas.Span.properties.traceId.pattern"
    then:
      function: truthy
  zipkin-server-url:
    description: Servers must be defined
    severity: error
    given: "$.servers"
    then:
      function: truthy