publiq · API Governance Rules

publiq API Rules

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

25 Rules error 14 warn 11
Published by publiq Served by the provider at https://github.com/cultuurnet/apidocs/blob/253bb51def286cc4c19066c0724525ab997aee60/.spectral.json; the copy below was fetched from there.
View Rules File View on GitHub

Rule Categories

publiq

Rules

error
publiq-alphabetical-tags
Tags must be sorted alphabetically
$
error
publiq-operation-summary
Operations must have a summary
$paths[*][*][get,post,put,patch,delete,options,head]
error
publiq-operation-description
Operations must have a description
$[paths][*][get,post,put,patch,delete,options,head]
error
publiq-properties-description
$..[properties][?(@.type)]
error
publiq-requestBody-description
Request bodies must have a description.
$[paths][*][*][requestBody]
error
publiq-response-description
Responses must have a description for each status code.
$[paths][*][*][responses][*]
error
publiq-get-delete-no-request-body
Operations with GET or DELETE method must not have a 'requestBody' property.
$[paths][*][get,delete]
error
publiq-request-body-allowed-content-types
Request bodies must only use content-types 'application/json', 'application/ld+json', or 'multipart/form-data' (discouraged)
$[paths][*][*][requestBody][content]
error
publiq-request-body-400-response
Requests with a body must have a response with status code 400.
$[paths][*][?(@.requestBody)]
error
publiq-bad-request-content
Responses with a 4xx status code must have a 'content' property.
$[paths][*][*][responses]['400','401','403','404','405','406']
error
publiq-bad-request-content-type
Responses with a 4xx status code must (only) have an 'application/problem+json' content-type.
$[paths][*][*][responses]['400','401','403','404','405','406'][content]
error
publiq-bad-request-content-type-schema
Responses with a 4xx status code must have a 'schema' property.
$[paths][*][*][responses]['400','401','403','404','405','406'][content]['application/problem+json']
error
publiq-bad-request-400-body-errors
$[paths][*][?(@.requestBody)]
error
publiq-paths-kebab-case
Paths must be kebab-case (e.g. `path-parameter`).
$[paths][*]~
warn
publiq-properties-camel-case
Property names must be camelCase.
$..[properties][*]~
warn
publiq-request-headers-casing
Request header names must only contain lowercase characters and hyphens (-).
$[paths]..[parameters][?(@.in == 'header')]
warn
publiq-response-headers-casing
Response header names must only contain lowercase characters and hyphens (-).
$[paths][*][*][responses][*][headers][*]~
warn
publiq-response-headers-description-required
Response headers must have a description.
$[paths][*][*][responses][*][headers][*]
warn
publiq-response-headers-type-required
Response headers must have a 'type' property in their 'schema'.
$[paths][*][*][responses][*][headers][*][schema]
warn
publiq-response-headers-example-required
Response headers must have an 'example' property in their 'schema'.
$[paths][*][*][responses][*][headers][*][schema]
warn
publiq-format-uri-not-url
$..[parameter,properties,items]..[format]
warn
publiq-strings-with-format-do-not-need-minLength
Strings with a 'format' property should not have a 'minLength' property.
$..[?(@.type == 'string' && @.format)]
warn
publiq-strings-with-enum-do-not-need-minLength
Strings with an 'enum' property should not have a 'minLength' property.
$..[?(@.type == 'string' && @.enum)]
warn
publiq-strings-with-enum-do-not-need-maxLength
Strings with an 'enum' property should not have a 'maxLength' property.
$..[?(@.type == 'string' && @.enum)]
warn
publiq-examples-strings-real-value
Examples must not use 'string' as a value.
$..[examples]..[*]

Spectral Ruleset

Raw ↑
# harvested from https://github.com/cultuurnet/apidocs/blob/253bb51def286cc4c19066c0724525ab997aee60/.spectral.json on 2026-10-09 — a Spectral ruleset published in the provider's own GitHub repository (cultuurnet/apidocs); found by GitHub code search, fetched verbatim and converted from JSON to YAML
x-method: harvested
x-stamped: 2026-10-09
x-source-url: https://github.com/cultuurnet/apidocs/blob/253bb51def286cc4c19066c0724525ab997aee60/.spectral.json
functionsDir: ./spectral/functions
functions:
- doesNotEqual
- formatUriNotUrl
- response400Required
- response400MustMentionBodyErrors
- truthyCustomErrorMessage
extends:
- - spectral:oas
  - all
formats:
- oas3
rules:
  info-license: 'off'
  license-url: 'off'
  tag-description: 'off'
  publiq-alphabetical-tags:
    description: Tags must be sorted alphabetically
    given: $
    then:
      field: tags
      function: alphabetical
      functionOptions:
        keyedBy: name
    severity: error
  publiq-operation-summary:
    description: Operations must have a summary
    given: $paths[*][*][get,post,put,patch,delete,options,head]
    then:
      field: summary
      function: truthy
    severity: error
  publiq-operation-description:
    description: Operations must have a description
    given: $[paths][*][get,post,put,patch,delete,options,head]
    then:
      field: description
      function: truthy
    severity: error
  publiq-properties-description:
    given: $..[properties][?(@.type)]
    then:
      field: description
      function: truthyCustomErrorMessage
    severity: error
  publiq-requestBody-description:
    description: Request bodies must have a description.
    given: $[paths][*][*][requestBody]
    then:
      field: description
      function: truthy
    severity: error
  publiq-response-description:
    description: Responses must have a description for each status code.
    given: $[paths][*][*][responses][*]
    then:
      field: description
      function: truthy
    severity: error
  publiq-get-delete-no-request-body:
    description: Operations with GET or DELETE method must not have a 'requestBody'
      property.
    given: $[paths][*][get,delete]
    then:
      field: requestBody
      function: falsy
    severity: error
  publiq-request-body-allowed-content-types:
    description: Request bodies must only use content-types 'application/json', 'application/ld+json',
      or 'multipart/form-data' (discouraged)
    given: $[paths][*][*][requestBody][content]
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          minProperties: 1
          additionalProperties: false
          properties:
            application/json: {}
            application/ld+json: {}
            multipart/form-data: {}
            text/plain: {}
    severity: error
  publiq-request-body-400-response:
    description: Requests with a body must have a response with status code 400.
    given: $[paths][*][?(@.requestBody)]
    then:
      function: response400Required
    severity: error
  publiq-bad-request-content:
    description: Responses with a 4xx status code must have a 'content' property.
    given: $[paths][*][*][responses]['400','401','403','404','405','406']
    then:
      field: content
      function: truthy
    severity: error
  publiq-bad-request-content-type:
    description: Responses with a 4xx status code must (only) have an 'application/problem+json'
      content-type.
    given: $[paths][*][*][responses]['400','401','403','404','405','406'][content]
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          additionalProperties: false
          properties:
            application/problem+json: {}
          required:
          - application/problem+json
    severity: error
  publiq-bad-request-content-type-schema:
    description: Responses with a 4xx status code must have a 'schema' property.
    given: $[paths][*][*][responses]['400','401','403','404','405','406'][content]['application/problem+json']
    then:
      field: schema
      function: truthy
    severity: error
  publiq-bad-request-400-body-errors:
    given: $[paths][*][?(@.requestBody)]
    then:
      function: response400MustMentionBodyErrors
    severity: error
  publiq-paths-kebab-case:
    description: Paths must be kebab-case (e.g. `path-parameter`).
    given: $[paths][*]~
    then:
      function: pattern
      functionOptions:
        match: ^(\/[a-z0-9-.]+|\/{[a-zA-Z0-9_]+})+|(.zip)+$
    severity: error
  publiq-properties-camel-case:
    description: Property names must be camelCase.
    given: $..[properties][*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z@][a-zA-Z0-9:]*$
  publiq-request-headers-casing:
    description: Request header names must only contain lowercase characters and hyphens
      (-).
    given: $[paths]..[parameters][?(@.in == 'header')]
    then:
      field: name
      function: pattern
      functionOptions:
        match: ^[a-z][a-z\-]*$
  publiq-response-headers-casing:
    description: Response header names must only contain lowercase characters and
      hyphens (-).
    given: $[paths][*][*][responses][*][headers][*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z\-]*$
  publiq-response-headers-description-required:
    description: Response headers must have a description.
    given: $[paths][*][*][responses][*][headers][*]
    then:
      field: description
      function: truthy
  publiq-response-headers-type-required:
    description: Response headers must have a 'type' property in their 'schema'.
    given: $[paths][*][*][responses][*][headers][*][schema]
    then:
      field: type
      function: truthy
  publiq-response-headers-example-required:
    description: Response headers must have an 'example' property in their 'schema'.
    given: $[paths][*][*][responses][*][headers][*][schema]
    then:
      field: example
      function: truthy
  publiq-format-uri-not-url:
    given: $..[parameter,properties,items]..[format]
    then:
      function: formatUriNotUrl
    severity: warn
  publiq-strings-with-format-do-not-need-minLength:
    description: Strings with a 'format' property should not have a 'minLength' property.
    given: $..[?(@.type == 'string' && @.format)]
    then:
      field: minLength
      function: falsy
    severity: warn
  publiq-strings-with-enum-do-not-need-minLength:
    description: Strings with an 'enum' property should not have a 'minLength' property.
    given: $..[?(@.type == 'string' && @.enum)]
    then:
      field: minLength
      function: falsy
    severity: warn
  publiq-strings-with-enum-do-not-need-maxLength:
    description: Strings with an 'enum' property should not have a 'maxLength' property.
    given: $..[?(@.type == 'string' && @.enum)]
    then:
      field: maxLength
      function: falsy
    severity: warn
  publiq-examples-strings-real-value:
    description: Examples must not use 'string' as a value.
    given: $..[examples]..[*]
    then:
      function: doesNotEqual
      functionOptions:
        value: string
    severity: warn

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/publiq-apidocs-spectral-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.