Science Museum Group · API Governance Rules
Science Museum Group API Rules
Spectral linting rules defining API design standards and conventions for Science Museum Group.
10 Rules
error 3
warn 7
Rule Categories
smg
Rules
warn
smg-jsonapi-content-type
Science Museum Group API responses must use the JSONAPI content type application/vnd.api+json
$.paths.*.*.responses.*.content
warn
smg-search-requires-pagination
All search endpoints must support page[number] and page[size] parameters
$.paths[?(@property.startsWith('/search'))].get.parameters[*].name
warn
smg-operation-id-camel-case
Operation IDs must use camelCase naming
$.paths.*.*.operationId
warn
smg-path-kebab-case
API paths must use kebab-case
$.paths[*]~
warn
smg-operation-description-required
All API operations must have a description
$.paths.*.*
warn
smg-operation-tags-required
All API operations must be tagged
$.paths.*.*
error
smg-path-params-used
Path parameters declared in parameters must appear in the path
$.paths.*.*.parameters[?(@.in == 'path')].name
warn
smg-single-resource-has-404
Endpoints that retrieve a single resource by ID must define a 404 response
$.paths.*[?(@property == 'get')].responses
error
smg-openapi-version
APIs must use OpenAPI 3.x specification
$.openapi
error
smg-servers-required
API specification must define at least one server URL
$