Apache BookKeeper · API Governance Rules

Apache BookKeeper API Rules

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

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

Rule Categories

bookkeeper no operationid query schema

Rules

error
bookkeeper-admin-info-title
API info must have a title
$.info
warn
bookkeeper-admin-info-description
API info must have a description
$.info
error
bookkeeper-admin-info-version
API info must have a version
$.info
error
bookkeeper-admin-operation-id
All operations must have an operationId
$.paths[*][get,put,post,delete,patch]
warn
bookkeeper-admin-operation-summary
All operations must have a summary
$.paths[*][get,put,post,delete,patch]
warn
bookkeeper-admin-operation-tags
All operations must have at least one tag
$.paths[*][get,put,post,delete,patch]
warn
bookkeeper-admin-response-200
GET and PUT operations should have a 200 response
$.paths[*][get,put]
warn
bookkeeper-admin-schema-title
All component schemas must have a title
$.components.schemas[*]
warn
bookkeeper-admin-schema-description
All component schemas must have a description
$.components.schemas[*]
warn
bookkeeper-admin-summary-prefix
Operation summaries should start with Apache BookKeeper
$.paths[*][get,put,post,delete,patch].summary
warn
bookkeeper-admin-path-lowercase
API paths should use lowercase letters
$.paths
info
bookkeeper-admin-microcks-operation
All operations should have x-microcks-operation extension
$.paths[*][get,put,post,delete,patch]
warn
query-params-casing
Query parameters should be snake_case (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
operationid-casing
Operation IDs should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].operationId
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be camelCase (the dominant convention in this API).
$.components.schemas[*].properties
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# apache-bookkeeper — 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:
#   - query-params-casing: snake @ 83% (n=12)
#   - operationid-casing: camel @ 100% (n=19)
#   - schema-names-casing: pascal @ 100% (n=9)
#   - schema-properties-casing: camel @ 78% (n=23)
#   - merge: kept 12 existing, added 5 measured, upgraded 0
#   - added: query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
  - spectral:oas
rules:
  bookkeeper-admin-info-title:
    description: API info must have a title
    message: API info.title is required
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  bookkeeper-admin-info-description:
    description: API info must have a description
    message: API info.description is required
    severity: warn
    given: $.info
    then:
      field: description
      function: truthy
  bookkeeper-admin-info-version:
    description: API info must have a version
    message: API info.version is required
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  bookkeeper-admin-operation-id:
    description: All operations must have an operationId
    message: Operation must have an operationId
    severity: error
    given: $.paths[*][get,put,post,delete,patch]
    then:
      field: operationId
      function: truthy
  bookkeeper-admin-operation-summary:
    description: All operations must have a summary
    message: Operation must have a summary
    severity: warn
    given: $.paths[*][get,put,post,delete,patch]
    then:
      field: summary
      function: truthy
  bookkeeper-admin-operation-tags:
    description: All operations must have at least one tag
    message: Operation must have at least one tag
    severity: warn
    given: $.paths[*][get,put,post,delete,patch]
    then:
      field: tags
      function: truthy
  bookkeeper-admin-response-200:
    description: GET and PUT operations should have a 200 response
    message: GET/PUT operations should define a 200 response
    severity: warn
    given: $.paths[*][get,put]
    then:
      field: responses.200
      function: truthy
  bookkeeper-admin-schema-title:
    description: All component schemas must have a title
    message: Schema must have a title
    severity: warn
    given: $.components.schemas[*]
    then:
      field: title
      function: truthy
  bookkeeper-admin-schema-description:
    description: All component schemas must have a description
    message: Schema must have a description
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  bookkeeper-admin-summary-prefix:
    description: Operation summaries should start with Apache BookKeeper
    message: Operation summary should begin with "Apache BookKeeper"
    severity: warn
    given: $.paths[*][get,put,post,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: ^Apache BookKeeper
  bookkeeper-admin-path-lowercase:
    description: API paths should use lowercase letters
    message: API path should be lowercase
    severity: warn
    given: $.paths
    then:
      function: pattern
      functionOptions:
        match: ^[a-z0-9/_{}.-]+$
  bookkeeper-admin-microcks-operation:
    description: All operations should have x-microcks-operation extension
    message: Operation should include x-microcks-operation for mock support
    severity: info
    given: $.paths[*][get,put,post,delete,patch]
    then:
      field: x-microcks-operation
      function: truthy
  query-params-casing:
    description: Query parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: snake
  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
  schema-names-casing:
    description: Component schema names should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  schema-properties-casing:
    description: Schema properties should be camelCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: camel
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy