Apache ZooKeeper · API Governance Rules

Apache ZooKeeper API Rules

Spectral linting rules defining API design standards and conventions for Apache ZooKeeper.

12 Rules error 7 warn 3 info 2
View Rules File View on GitHub

Rule Categories

info no operation operationid paths response servers

Rules

error
info-title-required
Info title is required
$.info
error
info-version-required
API version is required
$.info
error
servers-required
Servers array must be defined
$
error
operation-summary-required
All operations must have a summary
$.paths[*][get,post,put,patch,delete]
error
operation-operationid-required
All operations must have an operationId
$.paths[*][get,post,put,patch,delete]
info
operation-summary-prefix
Operation summaries should start with "Apache ZooKeeper"
$.paths[*][get,post,put,patch,delete].summary
error
response-success-required
Every operation should have at least one 2xx response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
All responses must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
warn
operation-tags-required
All operations should have at least one tag
$.paths[*][get,post,put,patch,delete]
info
paths-kebab-case
Path segments should use kebab-case or be simple command names
$.paths[*]~
warn
operationid-casing
Operation IDs should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].operationId
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# apache-zookeeper — 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:
#   - operationid-casing: camel @ 100% (n=21)
#   - merge: kept 10 existing, added 2 measured, upgraded 0
#   - added: operationid-casing, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-required:
    description: Info title is required
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  info-version-required:
    description: API version is required
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  servers-required:
    description: Servers array must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  operation-summary-required:
    description: All operations must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-operationid-required:
    description: All operations must have an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-summary-prefix:
    description: Operation summaries should start with "Apache ZooKeeper"
    severity: info
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: ^Apache ZooKeeper
  response-success-required:
    description: Every operation should have at least one 2xx response
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - '200'
          - required:
            - '201'
          - required:
            - '204'
  response-description-required:
    description: All responses must have a description
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  operation-tags-required:
    description: All operations should have at least one tag
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  paths-kebab-case:
    description: Path segments should use kebab-case or be simple command names
    severity: info
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^(/[a-z0-9_-]+)+$
  operationid-casing:
    description: Operation IDs should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: camel
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy