Avaloq · API Governance Rules

Avaloq API Rules

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

33 Rules error 9 warn 22 info 2
View Rules File View on GitHub

Rule Categories

avaloq error no operationid path query schema servers

Rules

error
avaloq-info-title-required
Avaloq APIs must have a title in the info object.
$.info
error
avaloq-info-version-required
Avaloq APIs must define a version.
$.info
warn
avaloq-info-description-required
Avaloq APIs must have a description.
$.info
warn
avaloq-info-contact-required
Avaloq APIs must include contact information.
$.info
error
avaloq-servers-required
Avaloq APIs must define at least one server.
$
error
avaloq-server-url-https
Avaloq server URLs must use HTTPS.
$.servers[*]
warn
avaloq-paths-kebab-case
Avaloq path segments must use kebab-case.
$.paths
error
avaloq-operation-summary-required
All Avaloq operations must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
avaloq-operation-description-required
All Avaloq operations must have a description.
$.paths[*][get,post,put,patch,delete]
error
avaloq-operation-id-required
All Avaloq operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
avaloq-operation-tags-required
All Avaloq operations must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
avaloq-parameters-description-required
All Avaloq parameters must have a description.
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
avaloq-request-body-description
Avaloq request bodies must have a description.
$.paths[*][post,put,patch].requestBody
error
avaloq-response-200-required
Avaloq GET operations must have a 200 response.
$.paths[*].get.responses
warn
avaloq-response-400-required
Avaloq operations must document 400 errors.
$.paths[*][get,post,put,patch,delete].responses
warn
avaloq-response-401-required
Avaloq operations must document 401 unauthorized.
$.paths[*][get,post,put,patch,delete].responses
warn
avaloq-schema-properties-described
Avaloq schema properties must have descriptions.
$.components.schemas[*].properties[*]
warn
avaloq-schema-type-required
Avaloq schema properties must have a type.
$.components.schemas[*].properties[*]
error
avaloq-security-defined
Avaloq APIs must define security schemes.
$.components
warn
avaloq-bearer-auth-required
Avaloq APIs must use Bearer/JWT authentication.
$.components.securitySchemes[*]
error
avaloq-get-no-request-body
Avaloq GET operations must not have a request body.
$.paths[*].get
warn
avaloq-delete-no-request-body
Avaloq DELETE operations must not have a request body.
$.paths[*].delete
warn
avaloq-post-returns-201
Avaloq POST creation operations should return 201.
$.paths[*].post.responses
info
avaloq-schema-example-provided
Avaloq schemas should have examples.
$.components.schemas[*]
warn
avaloq-response-content-type
Avaloq API responses must specify content type.
$.paths[*][get,post,put,patch].responses[*]
warn
servers-expected-domain
Server URLs should be on the avaloq.com domain.
$.servers[*].url
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
warn
error-schema-defined
A shared error schema (Error) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# avaloq — 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: 4/4 servers on avaloq.com
#   - path-params-casing: camel @ 100% (n=4)
#   - query-params-casing: snake @ 64% (n=11)
#   - operationid-casing: camel @ 100% (n=9)
#   - schema-names-casing: pascal @ 100% (n=12)
#   - schema-properties-casing: snake @ 56% (n=69)
#   - security: global (root) — NOT emitting operation-security-required
#   - error-schema-defined: Error
#   - pagination params observed: ['limit', 'offset']
#   - merge: kept 25 existing, added 8 measured, upgraded 0
#   - added: servers-expected-domain, path-params-casing, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, error-schema-defined, no-empty-descriptions
extends:
  - spectral:oas
rules:
  avaloq-info-title-required:
    description: Avaloq APIs must have a title in the info object.
    message: Info object must have a title.
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  avaloq-info-version-required:
    description: Avaloq APIs must define a version.
    message: Info object must have a version.
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  avaloq-info-description-required:
    description: Avaloq APIs must have a description.
    message: Info object must have a description.
    severity: warn
    given: $.info
    then:
      field: description
      function: truthy
  avaloq-info-contact-required:
    description: Avaloq APIs must include contact information.
    message: Info object must have a contact.
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  avaloq-servers-required:
    description: Avaloq APIs must define at least one server.
    message: Servers array must be defined and non-empty.
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  avaloq-server-url-https:
    description: Avaloq server URLs must use HTTPS.
    message: Server URL must use HTTPS protocol.
    severity: error
    given: $.servers[*]
    then:
      field: url
      function: pattern
      functionOptions:
        match: ^https://
  avaloq-paths-kebab-case:
    description: Avaloq path segments must use kebab-case.
    message: Path segments must use lowercase kebab-case.
    severity: warn
    given: $.paths
    then:
      function: pattern
      functionOptions:
        match: ^(\/[a-z0-9-{}]+)+$
  avaloq-operation-summary-required:
    description: All Avaloq operations must have a summary.
    message: Operation must have a summary.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  avaloq-operation-description-required:
    description: All Avaloq operations must have a description.
    message: Operation must have a description.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
  avaloq-operation-id-required:
    description: All Avaloq operations must have an operationId.
    message: Operation must have an operationId.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  avaloq-operation-tags-required:
    description: All Avaloq operations must have at least one tag.
    message: Operation must have at least one tag.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  avaloq-parameters-description-required:
    description: All Avaloq parameters must have a description.
    message: Parameter must have a description.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  avaloq-request-body-description:
    description: Avaloq request bodies must have a description.
    message: Request body must have a description.
    severity: warn
    given: $.paths[*][post,put,patch].requestBody
    then:
      field: description
      function: truthy
  avaloq-response-200-required:
    description: Avaloq GET operations must have a 200 response.
    message: GET operation must define a 200 response.
    severity: error
    given: $.paths[*].get.responses
    then:
      field: '200'
      function: truthy
  avaloq-response-400-required:
    description: Avaloq operations must document 400 errors.
    message: Operation must define a 400 error response.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '400'
      function: truthy
  avaloq-response-401-required:
    description: Avaloq operations must document 401 unauthorized.
    message: Operation must define a 401 response.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '401'
      function: truthy
  avaloq-schema-properties-described:
    description: Avaloq schema properties must have descriptions.
    message: Schema property must have a description.
    severity: warn
    given: $.components.schemas[*].properties[*]
    then:
      field: description
      function: truthy
  avaloq-schema-type-required:
    description: Avaloq schema properties must have a type.
    message: Schema property must have a type.
    severity: warn
    given: $.components.schemas[*].properties[*]
    then:
      field: type
      function: truthy
  avaloq-security-defined:
    description: Avaloq APIs must define security schemes.
    message: Components must include securitySchemes.
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  avaloq-bearer-auth-required:
    description: Avaloq APIs must use Bearer/JWT authentication.
    message: Security scheme must be OAuth2 or bearer type.
    severity: warn
    given: $.components.securitySchemes[*]
    then:
      field: type
      function: enumeration
      functionOptions:
        values:
        - oauth2
        - http
        - apiKey
  avaloq-get-no-request-body:
    description: Avaloq GET operations must not have a request body.
    message: GET operations must not include a requestBody.
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  avaloq-delete-no-request-body:
    description: Avaloq DELETE operations must not have a request body.
    message: DELETE operations must not include a requestBody.
    severity: warn
    given: $.paths[*].delete
    then:
      field: requestBody
      function: falsy
  avaloq-post-returns-201:
    description: Avaloq POST creation operations should return 201.
    message: POST operations creating resources should return 201.
    severity: warn
    given: $.paths[*].post.responses
    then:
      field: '201'
      function: truthy
  avaloq-schema-example-provided:
    description: Avaloq schemas should have examples.
    message: Schema should include an example.
    severity: info
    given: $.components.schemas[*]
    then:
      field: example
      function: truthy
  avaloq-response-content-type:
    description: Avaloq API responses must specify content type.
    message: Response must define a content type.
    severity: warn
    given: $.paths[*][get,post,put,patch].responses[*]
    then:
      field: content
      function: truthy
  servers-expected-domain:
    description: Server URLs should be on the avaloq.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: avaloq\.com
  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
  error-schema-defined:
    description: A shared error schema (Error) should be defined for error payloads.
    severity: warn
    given: $.components.schemas
    then:
      field: Error
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy