Discogs · API Governance Rules
Discogs API Rules
Spectral linting rules defining API design standards and conventions for Discogs.
35 Rules
error 11
warn 19
info 5
Rule Categories
http
info
openapi
operation
parameter
paths
request
response
schema
security
server
tags
Rules
warn
info-discogs-title
Info title should match Discogs naming pattern.
$.info.title
error
info-description-required
Info description is required.
$.info
error
info-version-required
Info version is required.
$.info
warn
info-contact-required
Info should declare contact.
$.info
warn
info-license-required
Info should declare license.
$.info
error
openapi-version-3
OpenAPI version must be 3.x.
$
error
server-https-required
Servers must use HTTPS.
$.servers[*].url
error
server-discogs-host
Server URL must be on api.discogs.com.
$.servers[*].url
warn
paths-snake-case
Path segments use snake_case (Discogs convention).
$.paths[*]~
warn
paths-no-trailing-slash
No trailing slashes on paths.
$.paths[*]~
error
operation-operationid-required
Operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camelcase
operationId must be camelCase.
$.paths[*][get,post,put,patch,delete].operationId
error
operation-summary-required
Operations must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-discogs-prefix
Operation summary should start with "Discogs".
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Operations must have a description.
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Operations must declare tags.
$.paths[*][get,post,put,patch,delete]
warn
tags-global-defined
Global tags array must be defined.
$
warn
tags-title-case
Tag names should be Title Case.
$.tags[*].name
warn
parameter-description-required
Parameters must have a description.
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-snake-case
Parameter names should be snake_case.
$.paths[*][get,post,put,patch,delete].parameters[?(@.in!="path")].name
info
parameter-pagination-page-perpage
Use page + per_page for pagination (Discogs convention).
$.paths[*][get].parameters[?(@.in=="query")].name
warn
request-body-json
Request bodies must use application/json.
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Operations must define a 2xx response.
$.paths[*][get,post,put,patch,delete].responses
info
response-401-on-secured
Secured operations should declare a 401 response.
$.paths[*][post,put,patch,delete].responses
warn
response-json-content
Responses should be application/json.
$.paths[*][get,post,put,patch,delete].responses[2,3]??.content
warn
schema-property-snake-case
Schema property names should be snake_case (Discogs convention).
$.components.schemas[*].properties[*]~
warn
schema-type-required
Schemas must declare a type.
info
schema-description-encouraged
Top-level schemas should have a description.
$.components.schemas[*]
error
security-schemes-defined
Security schemes must be declared in components.
$.components
warn
security-global-required
Global security should be declared.
$
error
http-get-no-body
GET operations must not have a request body.
$.paths[*].get
warn
http-delete-no-body
DELETE operations should not have a request body.
$.paths[*].delete
info
operation-x-microcks-required
Operations should declare x-microcks-operation for mock-server compatibility.
$.paths[*][get,post,put,patch,delete]
info
operation-rate-limit-documented
Document the 60 req/min (auth) / 25 req/min (unauth) Discogs rate limits in info.description.
$.info.description
warn
operation-user-agent-required
Document the mandatory unique User-Agent requirement in info.description.
$.info.description