WildApricot · API Governance Rules

WildApricot API Rules

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

35 Rules error 11 warn 18 info 6
View Rules File View on GitHub

Rule Categories

error get info no openapi operation operationid parameter path paths post query request response schema security servers tags

Rules

error
info-title-required
API info must have a title
$.info
warn
info-description-required
API info must have a description
$.info
error
info-version-required
API info must have a version
$.info
warn
info-contact-required
API info should have contact information
$.info
error
openapi-version-3
All WildApricot specs must use OpenAPI 3.x
$
error
servers-defined
Servers array must be defined
$
error
servers-https
Server URLs must use HTTPS
$.servers[*].url
info
paths-account-prefix
WildApricot paths should use /accounts/{accountId}/ prefix
$.paths[*]~
warn
paths-no-trailing-slash
Paths must not end with a trailing slash
$.paths[*]~
error
operation-summary-required
All operations must have a summary
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-description-required
All operations should have a description
$.paths[*][get,post,put,patch,delete,head,options]
error
operation-operation-id-required
All operations must have an operationId
$.paths[*][get,post,put,patch,delete,head,options]
info
operation-summary-wildapricot-prefix
Operation summaries should start with "WildApricot"
$.paths[*][get,post,put,patch,delete,head,options].summary
warn
operation-tags-required
All operations must have at least one tag
$.paths[*][get,post,put,patch,delete,head,options]
warn
tags-global-defined
Global tags array must be defined
$
info
parameter-account-id-path
Path parameters named accountId should use path-level definition
$.paths[*][get,post,put,patch,delete].parameters[?(@.name == 'accountId')]
warn
parameter-description-required
All parameters must have a description
$.paths[*][get,post,put,patch,delete].parameters[*]
error
request-body-content-required
Request bodies must define content
$.paths[*][post,put,patch].requestBody
error
response-success-required
Every operation must define at least one 2xx response
$.paths[*][get,post,put,patch,delete]
error
response-description-required
All responses must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
info
schema-description-required
Top-level schemas should have descriptions
$.components.schemas[*]
warn
security-schemes-defined
Security schemes must be defined for OAuth2
$.components
warn
operation-security-defined
Operations should define security requirements
$.paths[*][get,post,put,patch,delete]
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
post-returns-2xx
POST operations should return 200 or 201
$.paths[*].post
warn
no-empty-descriptions
Descriptions must not be empty strings
$..description
warn
servers-expected-domain
Server URLs should be on the wildapricot.org domain.
$.servers[*].url
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
info
query-params-casing
Query parameters should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
operationid-casing
Operation IDs should be PascalCase (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 PascalCase (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
operation-documents-401
Operations should document a 401 response (documented on 87% of this API's operations).
$.paths[*][get,post,put,patch,delete].responses
warn
operation-documents-429
Operations should document a 429 response (documented on 87% of this API's operations).
$.paths[*][get,post,put,patch,delete].responses

Spectral Ruleset

Raw ↑
# wildapricot — 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 wildapricot.org
#   - path-params-casing: camel @ 97% (n=152)
#   - query-params-casing: camel @ 55% (n=87)
#   - operationid-casing: pascal @ 94% (n=101)
#   - schema-names-casing: pascal @ 99% (n=175)
#   - schema-properties-casing: pascal @ 85% (n=640)
#   - operation-security-required: 105/105 ops declare per-op security
#   - error-schema-defined: Error
#   - operation-documents-401: 87% adherence
#   - operation-documents-429: 87% adherence
#   - merge: kept 26 existing, added 9 measured, upgraded 0
#   - added: servers-expected-domain, path-params-casing, query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing, error-schema-defined, operation-documents-401, operation-documents-429
extends:
  - spectral:oas
rules:
  info-title-required:
    description: API info must have a title
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  info-description-required:
    description: API info must have a description
    severity: warn
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: API info must have a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  info-contact-required:
    description: API info should have contact information
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  openapi-version-3:
    description: All WildApricot specs must use OpenAPI 3.x
    severity: error
    given: $
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: ^3\.
  servers-defined:
    description: Servers array must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  servers-https:
    description: Server URLs must use HTTPS
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://
  paths-account-prefix:
    description: WildApricot paths should use /accounts/{accountId}/ prefix
    severity: info
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^/(accounts|rpc)/
  paths-no-trailing-slash:
    description: Paths must not end with a trailing slash
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: /$
  operation-summary-required:
    description: All operations must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete,head,options]
    then:
      field: summary
      function: truthy
  operation-description-required:
    description: All operations should have a description
    severity: warn
    given: $.paths[*][get,post,put,patch,delete,head,options]
    then:
      field: description
      function: truthy
  operation-operation-id-required:
    description: All operations must have an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete,head,options]
    then:
      field: operationId
      function: truthy
  operation-summary-wildapricot-prefix:
    description: Operation summaries should start with "WildApricot"
    severity: info
    given: $.paths[*][get,post,put,patch,delete,head,options].summary
    then:
      function: pattern
      functionOptions:
        match: '^WildApricot '
  operation-tags-required:
    description: All operations must have at least one tag
    severity: warn
    given: $.paths[*][get,post,put,patch,delete,head,options]
    then:
      field: tags
      function: truthy
  tags-global-defined:
    description: Global tags array must be defined
    severity: warn
    given: $
    then:
      field: tags
      function: truthy
  parameter-account-id-path:
    description: Path parameters named accountId should use path-level definition
    severity: info
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.name == 'accountId')]
    then:
      field: in
      function: pattern
      functionOptions:
        match: ^path$
  parameter-description-required:
    description: All parameters must have a description
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[*]
    then:
      field: description
      function: truthy
  request-body-content-required:
    description: Request bodies must define content
    severity: error
    given: $.paths[*][post,put,patch].requestBody
    then:
      field: content
      function: truthy
  response-success-required:
    description: Every operation must define at least one 2xx response
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: responses
      function: truthy
  response-description-required:
    description: All responses must have a description
    severity: error
    given: $.paths[*][get,post,put,patch,delete].responses[*]
    then:
      field: description
      function: truthy
  schema-description-required:
    description: Top-level schemas should have descriptions
    severity: info
    given: $.components.schemas[*]
    then:
      field: description
      function: truthy
  security-schemes-defined:
    description: Security schemes must be defined for OAuth2
    severity: warn
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  operation-security-defined:
    description: Operations should define security requirements
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: security
      function: truthy
  get-no-request-body:
    description: GET operations must not have a request body
    severity: error
    given: $.paths[*].get
    then:
      field: requestBody
      function: falsy
  post-returns-2xx:
    description: POST operations should return 200 or 201
    severity: warn
    given: $.paths[*].post
    then:
      field: responses
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings
    severity: warn
    given: $..description
    then:
      function: pattern
      functionOptions:
        match: .+
  servers-expected-domain:
    description: Server URLs should be on the wildapricot.org domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: wildapricot\.org
  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 camelCase (the dominant convention in this API).
    severity: info
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: camel
  operationid-casing:
    description: Operation IDs should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: pascal
  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 PascalCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  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
  operation-documents-401:
    description: Operations should document a 401 response (documented on 87% of this API's operations).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '401'
      function: truthy
  operation-documents-429:
    description: Operations should document a 429 response (documented on 87% of this API's operations).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '429'
      function: truthy