Apache ORC · API Governance Rules

Apache ORC API Rules

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

14 Rules error 5 warn 7 info 2
View Rules File View on GitHub

Rule Categories

info no operation operationid path paths response schema servers

Rules

error
info-title-required
API must have a title
$.info
error
operation-summary-required
Operations must have summaries
$.paths[*][*]
error
operation-operationId-required
$.paths[*][*]
warn
operation-tags-required
$.paths[*][*]
info
operation-summary-apache-prefix
Summaries should start with Apache ORC
$.paths[*][get,post,put,delete,patch].summary
warn
paths-kebab-case
$.paths[*]~
error
response-success-required
$.paths[*][*].responses
warn
schema-type-defined
$.components.schemas[*].properties[*]
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
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-orc — 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:
#   - servers-https-only: 100% of servers already https (error)
#   - path-params-casing: camel @ 100% (n=3)
#   - operationid-casing: camel @ 100% (n=6)
#   - schema-names-casing: pascal @ 100% (n=12)
#   - schema-properties-casing: camel @ 57% (n=47)
#   - merge: kept 8 existing, added 6 measured, upgraded 0
#   - added: servers-https-only, path-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-required:
    description: API must have a title
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  operation-summary-required:
    description: Operations must have summaries
    severity: error
    given: $.paths[*][*]
    then:
      field: summary
      function: truthy
  operation-operationId-required:
    severity: error
    given: $.paths[*][*]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    severity: warn
    given: $.paths[*][*]
    then:
      field: tags
      function: truthy
  operation-summary-apache-prefix:
    description: Summaries should start with Apache ORC
    severity: info
    given: $.paths[*][get,post,put,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: ^Apache ORC
  paths-kebab-case:
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^(/[a-z0-9{}-]+)+$
  response-success-required:
    severity: error
    given: $.paths[*][*].responses
    then:
      function: schema
      functionOptions:
        schema:
          required:
          - '200'
  schema-type-defined:
    severity: warn
    given: $.components.schemas[*].properties[*]
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - type
          - required:
            - $ref
  servers-https-only:
    description: Server URLs must use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  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
  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