Apache Livy · API Governance Rules

Apache Livy API Rules

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

18 Rules error 9 warn 7 info 2
View Rules File View on GitHub

Rule Categories

get info no openapi operation operationid parameter path query response schema servers

Rules

warn
info-title-prefix
Info title should start with Apache Livy
$.info
error
info-version-required
Info must have a version
$.info
error
openapi-version
Must use OpenAPI 3.x
$
error
servers-defined
Servers must be defined
$
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
error
operation-id-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have tags
$.paths[*][get,post,put,patch,delete]
error
response-description-required
Responses must have descriptions
$.paths[*][get,post,put,patch,delete].responses[*]
error
response-2xx-required
Every operation must have a 2xx response
$.paths[*][get,post,put,patch,delete].responses
error
get-no-request-body
GET operations must not have request bodies
$.paths[*].get
warn
no-empty-descriptions
Descriptions must not be empty
$..description
info
schema-description-required
Component schemas should have descriptions
$.components.schemas[*]
warn
parameter-description-required
Parameters should have descriptions
$.paths[*][get,post,put].parameters[*]
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 snake_case (the dominant convention in this API).
$.components.schemas[*].properties

Spectral Ruleset

Raw ↑
# apache-livy — 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 @ 100% (n=12)
#   - query-params-casing: snake @ 100% (n=8)
#   - operationid-casing: camel @ 100% (n=15)
#   - schema-names-casing: pascal @ 100% (n=12)
#   - schema-properties-casing: snake @ 68% (n=56)
#   - pagination params observed: ['size']
#   - merge: kept 13 existing, added 5 measured, upgraded 0
#   - added: path-params-casing, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing
extends:
  - spectral:oas
rules:
  info-title-prefix:
    description: Info title should start with Apache Livy
    severity: warn
    given: $.info
    then:
      field: title
      function: pattern
      functionOptions:
        match: ^Apache Livy
  info-version-required:
    description: Info must have a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version:
    description: Must use OpenAPI 3.x
    severity: error
    given: $
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: ^3\.
  servers-defined:
    description: Servers must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  operation-summary-required:
    description: Every operation must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-id-required:
    description: Every operation must have an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    description: Every operation must have tags
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  response-description-required:
    description: Responses must have descriptions
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  response-2xx-required:
    description: Every operation must have a 2xx response
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - '200'
          - required:
            - '201'
  get-no-request-body:
    description: GET operations must not have request bodies
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  no-empty-descriptions:
    description: Descriptions must not be empty
    severity: warn
    given: $..description
    then:
      function: pattern
      functionOptions:
        match: .+
  schema-description-required:
    description: Component schemas should have descriptions
    severity: info
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  parameter-description-required:
    description: Parameters should have descriptions
    severity: warn
    given: $.paths[*][get,post,put].parameters[*]
    then:
      field: description
      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 snake_case (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake