ThemeParks.wiki · API Governance Rules

ThemeParks.wiki API Rules

Spectral linting rules defining API design standards and conventions for ThemeParks.wiki.

27 Rules error 8 warn 15 info 4
View Rules File View on GitHub

Rule Categories

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

Rules

error
info-title-required
Info object must have a title
$.info
warn
info-description-required
Info object must have a description
$.info
error
info-version-required
API version must be defined
$.info
warn
openapi-version-3
OpenAPI version should be 3.x
$
error
servers-defined
Servers array must be defined
$
error
servers-https
Server URLs must use HTTPS
$.servers[*].url
warn
paths-kebab-case
Path segments must use kebab-case
$.paths[*]~
warn
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths[*]~
error
operation-summary-required
Operations must have a summary
$.paths[*][get,post,put,delete,patch]
warn
operation-description-required
Operations must have a description
$.paths[*][get,post,put,delete,patch]
error
operation-operationId-required
Operations must have an operationId
$.paths[*][get,post,put,delete,patch]
warn
operation-tags-required
Operations must have at least one tag
$.paths[*][get,post,put,delete,patch]
info
operation-summary-provider-prefix
Operation summaries should start with 'ThemeParks.wiki'
$.paths[*][get,post,put,delete,patch].summary
info
parameter-entity-id-uuid
Entity ID path parameters should use UUID format
$.paths[*][get,post,put,delete,patch].parameters[?(@.name=='entityID')]
warn
parameter-description-required
Parameters must have descriptions
$.paths[*][get,post,put,delete,patch].parameters[*]
error
response-success-required
Operations must have at least one success response
$.paths[*][get,post,put,delete,patch].responses
warn
response-404-for-entity-paths
Entity endpoints should document 404 not found response
$.paths[/entity/*][get].responses
warn
response-description-required
Response objects must have a description
$.paths[*][get,post,put,delete,patch].responses[*]
warn
schema-type-defined
Schema objects should have a type
$.components.schemas[*]
info
no-auth-required
ThemeParks.wiki API requires no authentication
$
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
no-empty-descriptions
Descriptions must not be empty
$..description
warn
servers-expected-domain
Server URLs should be on the themeparks.wiki domain.
$.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 snake_case (the dominant convention in this API).
$.components.schemas[*].properties

Spectral Ruleset

Raw ↑
# themeparks-wiki — 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 themeparks.wiki
#   - path-params-casing: camel @ 71% (n=7)
#   - operationid-casing: camel @ 100% (n=6)
#   - schema-names-casing: pascal @ 100% (n=11)
#   - schema-properties-casing: snake @ 64% (n=42)
#   - operation-documents-404: 83% adherence
#   - merge: kept 22 existing, added 5 measured, upgraded 0
#   - added: servers-expected-domain, path-params-casing, operationid-casing, schema-names-casing, schema-properties-casing
extends:
  - spectral:oas
rules:
  info-title-required:
    description: Info object must have a title
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  info-description-required:
    description: Info object must have a description
    severity: warn
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: API version must be defined
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version-3:
    description: OpenAPI version should be 3.x
    severity: warn
    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-kebab-case:
    description: Path segments must use kebab-case
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^(/[a-z0-9]+(-[a-z0-9]+)*(/{[a-zA-Z]+})?)*$
  paths-no-trailing-slash:
    description: Paths must not have trailing slashes
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: /$
  operation-summary-required:
    description: Operations must have a summary
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: summary
      function: truthy
  operation-description-required:
    description: Operations must have a description
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: description
      function: truthy
  operation-operationId-required:
    description: Operations must have an operationId
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    description: Operations must have at least one tag
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy
  operation-summary-provider-prefix:
    description: Operation summaries should start with 'ThemeParks.wiki'
    severity: info
    given: $.paths[*][get,post,put,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: '^ThemeParks.wiki '
  parameter-entity-id-uuid:
    description: Entity ID path parameters should use UUID format
    severity: info
    given: $.paths[*][get,post,put,delete,patch].parameters[?(@.name=='entityID')]
    then:
      field: schema.format
      function: enumeration
      functionOptions:
        values:
        - uuid
  parameter-description-required:
    description: Parameters must have descriptions
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].parameters[*]
    then:
      field: description
      function: truthy
  response-success-required:
    description: Operations must have at least one success response
    severity: error
    given: $.paths[*][get,post,put,delete,patch].responses
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          minProperties: 1
  response-404-for-entity-paths:
    description: Entity endpoints should document 404 not found response
    severity: warn
    given: $.paths[/entity/*][get].responses
    then:
      field: '404'
      function: defined
  response-description-required:
    description: Response objects must have a description
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].responses[*]
    then:
      field: description
      function: truthy
  schema-type-defined:
    description: Schema objects should have a type
    severity: warn
    given: $.components.schemas[*]
    then:
      field: type
      function: truthy
  no-auth-required:
    description: ThemeParks.wiki API requires no authentication
    severity: info
    given: $
    then:
      field: security
      function: falsy
  get-no-request-body:
    description: GET operations must not have a request body
    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: .+
  servers-expected-domain:
    description: Server URLs should be on the themeparks.wiki domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: themeparks\.wiki
  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: pattern
      functionOptions:
        match: ^[a-z][A-Za-z0-9]*$
  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