Apache Atlas · API Governance Rules

Apache Atlas API Rules

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

20 Rules error 7 warn 12 info 1
View Rules File View on GitHub

Rule Categories

error get info no operation operationid parameter path query response schema security servers

Rules

warn
info-title-prefix
API title must start with "Apache Atlas"
$.info.title
error
info-description-required
$.info
error
servers-defined
$
error
operation-summary-required
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-starts-with-apache-atlas
$.paths[*][get,post,put,patch,delete].summary
error
operation-operationId-required
$.paths[*][get,post,put,patch,delete]
warn
operation-tags-required
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
$.paths[*][get,post,put,patch,delete].parameters[*]
error
response-success-required
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
$.paths[*][get,post,put,patch,delete].responses[*]
warn
security-schemes-defined
$.components
error
get-no-request-body
$.paths[*].get
warn
path-params-casing
Path parameters should be snake_case (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
operation-security-required
Every operation should declare its security requirements.
$.paths[*][get,post,put,patch,delete]
warn
error-schema-defined
A shared error schema (AtlasErrorResponse) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# apache-atlas — 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: snake @ 100% (n=4)
#   - query-params-casing: snake @ 75% (n=16)
#   - operationid-casing: camel @ 100% (n=12)
#   - schema-names-casing: pascal @ 100% (n=11)
#   - schema-properties-casing: camel @ 60% (n=42)
#   - operation-security-required: 12/12 ops declare per-op security
#   - error-schema-defined: AtlasErrorResponse
#   - pagination params observed: ['limit', 'offset']
#   - merge: kept 12 existing, added 8 measured, upgraded 0
#   - added: path-params-casing, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, operation-security-required, error-schema-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-prefix:
    description: API title must start with "Apache Atlas"
    severity: warn
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: ^Apache Atlas
  info-description-required:
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  servers-defined:
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  operation-summary-required:
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-summary-starts-with-apache-atlas:
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: ^Apache Atlas
  operation-operationId-required:
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  parameter-description-required:
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  response-success-required:
    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:
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  security-schemes-defined:
    severity: warn
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  get-no-request-body:
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  path-params-casing:
    description: Path parameters should be snake_case (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: snake
  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
  operation-security-required:
    description: Every operation should declare its security requirements.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: security
      function: truthy
  error-schema-defined:
    description: A shared error schema (AtlasErrorResponse) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: AtlasErrorResponse
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy