Axon Framework · API Governance Rules

Axon Framework API Rules

Spectral linting rules defining API design standards and conventions for Axon Framework.

11 Rules error 3 warn 6 info 2
View Rules File View on GitHub

Rule Categories

axon no operationid path query schema

Rules

warn
axon-operation-summary
All operations must have a summary starting with "Axon Framework"
$.paths[*][get,post,put,delete,patch]
error
axon-operation-id
All operations must have an operationId
$.paths[*][get,post,put,delete,patch]
error
axon-info-title
Info object must have a title
$.info
error
axon-response-description
All responses must have a description
$.paths[*][*].responses[*]
info
axon-microcks-annotation
Operations should have x-microcks-operation annotation
$.paths[*][get,post,put,delete,patch]
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
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 ↑
# axon-framework — 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:
#   - path-params-casing: camel @ 89% (n=9)
#   - query-params-casing: snake @ 69% (n=16)
#   - operationid-casing: camel @ 100% (n=20)
#   - schema-names-casing: pascal @ 100% (n=10)
#   - schema-properties-casing: camel @ 64% (n=47)
#   - merge: kept 5 existing, added 6 measured, upgraded 0
#   - added: path-params-casing, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
  - spectral:oas
rules:
  axon-operation-summary:
    description: All operations must have a summary starting with "Axon Framework"
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: summary
      function: pattern
      functionOptions:
        match: ^Axon Framework
  axon-operation-id:
    description: All operations must have an operationId
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy
  axon-info-title:
    description: Info object must have a title
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  axon-response-description:
    description: All responses must have a description
    severity: error
    given: $.paths[*][*].responses[*]
    then:
      field: description
      function: truthy
  axon-microcks-annotation:
    description: Operations should have x-microcks-operation annotation
    severity: info
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: x-microcks-operation
      function: truthy
  path-params-casing:
    description: Path parameters should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: camel
  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