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.
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
Work with this as data
Every ruleset here is available over the APIs.io API and to AI agents over MCP.