MealMe · API Governance Rules
MealMe API Rules
Spectral linting rules defining API design standards and conventions for MealMe.
34 Rules
error 7
warn 18
info 9
Rule Categories
examples
get
global
info
openapi
operation
parameter
paths
request
response
schema
security
server
servers
tag
Rules
warn
info-title-mealme
API title should identify MealMe.
$.info
warn
info-description-required
Info object must have a non-empty description.
$.info
error
info-version-required
Info object must declare a version.
$.info
info
info-contact-required
A contact should be provided.
$.info
warn
openapi-version-3-1
Specs should target OpenAPI 3.1.x.
$
error
servers-defined
At least one server must be defined.
$
error
servers-https
Server URLs must use HTTPS.
$.servers[*]
info
server-is-mealme
The production server should be api.mealme.ai.
$.servers[*]
warn
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
error
paths-no-query-string
Path keys must not contain query strings.
$.paths[*]~
warn
paths-lowercase
Path segments use lowercase letters, digits, underscores, slashes, and braces.
$.paths[*]~
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
error
operation-operationId-required
Every operation must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationId-camelcase
operationId should be camelCase.
$.paths[*][get,post,put,patch,delete]
info
operation-summary-title-case
Summaries should start with a capital letter.
$.paths[*][get,post,put,patch,delete]
warn
operation-tags-required
Every operation must be tagged.
$.paths[*][get,post,put,patch,delete]
info
global-tags-defined
Specs should declare a global tags array.
$
info
tag-has-description
Each global tag should have a description.
$.tags[*]
warn
tag-title-case
Tags should use Title Case (each word capitalized).
$.tags[*]
warn
parameter-snake-case
Parameter names should be snake_case.
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-has-schema
Parameters must declare a schema.
$.paths[*][get,post,put,patch,delete].parameters[*]
error
parameter-no-api-key-in-query
API keys must travel in the Authorization header, never as a query parameter.
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
request-body-json
Request bodies should offer an application/json representation.
$.paths[*][post,put,patch].requestBody.content
warn
response-2xx-required
Every operation must define a success (2xx) response.
$.paths[*][get,post,put,patch,delete].responses
info
response-401-documented
Authenticated operations should document a 401 response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-has-description
Each response must have a description.
$.paths[*][get,post,put,patch,delete].responses[*]
warn
schema-property-snake-case
Schema property names should be snake_case (underscore-prefixed identifiers like _id allowed).
$.components.schemas[*].properties[*]~
info
schema-property-typed
Each schema property should declare a type or $ref.
$.components.schemas[*].properties[*]
warn
global-security-defined
A global security requirement should be declared.
$
warn
security-scheme-api-key-header
The API key security scheme must be an apiKey carried in the header.
$.components.securitySchemes[*]
info
security-scheme-authorization-header
The API key header should be named Authorization.
$.components.securitySchemes[?(@.in=='header')]
error
get-no-request-body
GET operations must not declare a request body.
$.paths[*].get
info
examples-encouraged
Operations are encouraged to include examples for mocking.
$.paths[*][post,put,patch].requestBody.content.application/json