Acadia · API Governance Rules

Acadia API Rules

Spectral linting rules defining API design standards and conventions for Acadia.

32 Rules error 13 warn 14 info 5
View Rules File View on GitHub

Rule Categories

delete error get info no openapi operation operationid parameter paths query response schema security servers

Rules

error
info-title-acadia-prefix
Info title must start with "Acadia"
$.info
error
info-description-required
Info description must be present
$.info
error
info-version-required
Info version must be present
$.info
error
openapi-version-3
Must use OpenAPI 3.0.x
$
error
servers-https-required
Server URLs must use HTTPS
$.servers[*]
warn
paths-kebab-case
Path segments must use kebab-case
$.paths
warn
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths
warn
operation-summary-prefix
Operation summaries must start with "Acadia"
$.paths[*][get,post,put,patch,delete]
error
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete]
error
operation-id-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-id-camel-case
operationId must use camelCase
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have tags
$.paths[*][get,post,put,patch,delete]
error
parameter-description-required
Parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-pagination-page
List endpoints should support page parameter
$.paths[*].get.parameters[?(@.name == "page")]
info
parameter-pagination-limit
List endpoints should support limit parameter
$.paths[*].get.parameters[?(@.name == "limit")]
error
response-success-required
Every operation must have a 2xx success response
$.paths[*][get,post,put,patch,delete].responses
warn
response-401-required
Protected operations should document 401 response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
All responses must have descriptions
$.paths[*][get,post,put,patch,delete].responses[*]
warn
schema-description-required
Component schemas must have descriptions
$.components.schemas[*]
info
schema-property-description
Schema properties should have descriptions
$.components.schemas[*].properties[*]
info
schema-property-example
Schema properties should have example values
$.components.schemas[*].properties[*]
error
security-schemes-required
Security schemes must be defined
$
warn
security-bearer-jwt
Acadia uses Bearer JWT authentication
$.components.securitySchemes[*][?(@.type == "http")]
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
delete-returns-200-or-204
DELETE operations should return 200 or 204
$.paths[*].delete.responses
warn
servers-expected-domain
Server URLs should be on the acadia-software.com domain.
$.servers[*].url
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
warn
error-schema-defined
A shared error schema (ErrorResponse) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# acadia — 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)
#   - servers-expected-domain: 1/1 servers on acadia-software.com
#   - query-params-casing: snake @ 100% (n=9)
#   - operationid-casing: camel @ 100% (n=7)
#   - schema-names-casing: pascal @ 100% (n=13)
#   - schema-properties-casing: snake @ 79% (n=62)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: ErrorResponse
#   - pagination params observed: ['limit', 'page']
#   - merge: kept 25 existing, added 7 measured, upgraded 0
#   - added: servers-expected-domain, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, error-schema-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  info-title-acadia-prefix:
    description: Info title must start with "Acadia"
    severity: error
    given: $.info
    then:
      field: title
      function: pattern
      functionOptions:
        match: ^Acadia
  info-description-required:
    description: Info description must be present
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: Info version must be present
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version-3:
    description: Must use OpenAPI 3.0.x
    severity: error
    given: $
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: ^3\.0\.
  servers-https-required:
    description: Server URLs must use HTTPS
    severity: error
    given: $.servers[*]
    then:
      field: url
      function: pattern
      functionOptions:
        match: ^https://
  paths-kebab-case:
    description: Path segments must use kebab-case
    severity: warn
    given: $.paths
    then:
      field: '@key'
      function: pattern
      functionOptions:
        match: ^(\/[a-z0-9_\-\{\}]*)*$
  paths-no-trailing-slash:
    description: Paths must not have trailing slashes
    severity: warn
    given: $.paths
    then:
      field: '@key'
      function: pattern
      functionOptions:
        notMatch: .+\/$
  operation-summary-prefix:
    description: Operation summaries must start with "Acadia"
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: pattern
      functionOptions:
        match: ^Acadia
  operation-description-required:
    description: Every operation must have a description
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      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-id-camel-case:
    description: operationId must use camelCase
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]+$
  operation-tags-required:
    description: Every operation must have tags
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  parameter-description-required:
    description: Parameters must have descriptions
    severity: error
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  parameter-pagination-page:
    description: List endpoints should support page parameter
    severity: info
    given: $.paths[*].get.parameters[?(@.name == "page")]
    then:
      field: schema.type
      function: enumeration
      functionOptions:
        values:
        - integer
  parameter-pagination-limit:
    description: List endpoints should support limit parameter
    severity: info
    given: $.paths[*].get.parameters[?(@.name == "limit")]
    then:
      field: schema.type
      function: enumeration
      functionOptions:
        values:
        - integer
  response-success-required:
    description: Every operation must have a 2xx success response
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - '200'
          - required:
            - '201'
          - required:
            - '204'
  response-401-required:
    description: Protected operations should document 401 response
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '401'
      function: truthy
  response-description-required:
    description: All responses must have descriptions
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  schema-description-required:
    description: Component schemas must have descriptions
    severity: warn
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  schema-property-description:
    description: Schema properties should have descriptions
    severity: info
    given: $.components.schemas[*].properties[*]
    then:
      field: description
      function: truthy
  schema-property-example:
    description: Schema properties should have example values
    severity: info
    given: $.components.schemas[*].properties[*]
    then:
      field: example
      function: truthy
  security-schemes-required:
    description: Security schemes must be defined
    severity: error
    given: $
    then:
      field: components.securitySchemes
      function: truthy
  security-bearer-jwt:
    description: Acadia uses Bearer JWT authentication
    severity: warn
    given: $.components.securitySchemes[*][?(@.type == "http")]
    then:
      field: scheme
      function: enumeration
      functionOptions:
        values:
        - bearer
  get-no-request-body:
    description: GET operations must not have a request body
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  delete-returns-200-or-204:
    description: DELETE operations should return 200 or 204
    severity: warn
    given: $.paths[*].delete.responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - '200'
          - required:
            - '204'
  servers-expected-domain:
    description: Server URLs should be on the acadia-software.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: acadia\-software\.com
  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
  error-schema-defined:
    description: A shared error schema (ErrorResponse) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: ErrorResponse
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy