Volcano · API Governance Rules

Volcano API Rules

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

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

Rule Categories

volcano

Rules

warn
volcano-operation-summary-title-case
All operation summaries must use Title Case.
$.paths[*][*].summary
warn
volcano-operation-ids-camel-case
OperationIds must use camelCase.
$.paths[*][*].operationId
error
volcano-tags-required
Each operation must have at least one tag.
$.paths[*][*]
warn
volcano-kubernetes-api-group-in-path
Paths must include a Kubernetes API group (e.g. batch.volcano.sh or scheduling.volcano.sh).
$.paths
info
volcano-server-variable-required
Server URL must use a variable for the kubernetes-api-server address.
$.servers[*].url
warn
volcano-namespace-path-param
Namespaced resource paths must include a namespace parameter.
$.paths[*namespaces*][get,post,put,patch,delete].parameters[*]
info
volcano-list-pagination-support
List operations should support limit and continue query parameters.
$.paths[*][get][operationId][?(@.match(/^list/))]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  volcano-operation-summary-title-case:
    description: All operation summaries must use Title Case.
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-zA-Z]*(\\s[A-Z][a-zA-Z]*)*)"

  volcano-operation-ids-camel-case:
    description: OperationIds must use camelCase.
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  volcano-tags-required:
    description: Each operation must have at least one tag.
    severity: error
    given: "$.paths[*][*]"
    then:
      field: tags
      function: truthy

  volcano-kubernetes-api-group-in-path:
    description: Paths must include a Kubernetes API group (e.g. batch.volcano.sh or scheduling.volcano.sh).
    severity: warn
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        match: ".*volcano\\.sh.*"

  volcano-server-variable-required:
    description: Server URL must use a variable for the kubernetes-api-server address.
    severity: info
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: ".*\\{.*\\}.*"

  volcano-namespace-path-param:
    description: Namespaced resource paths must include a namespace parameter.
    severity: warn
    given: "$.paths[*namespaces*][get,post,put,patch,delete].parameters[*]"
    then:
      field: name
      function: enumeration
      functionOptions:
        values:
          - namespace
          - name
          - labelSelector
          - fieldSelector
          - limit
          - continue

  volcano-list-pagination-support:
    description: List operations should support limit and continue query parameters.
    severity: info
    given: "$.paths[*][get][operationId][?(@.match(/^list/))]"
    then:
      function: truthy