MarginEdge · API Governance Rules
MarginEdge API Rules
Spectral linting rules defining API design standards and conventions for MarginEdge.
36 Rules
error 10
warn 16
info 10
Rule Categories
get
global
info
oas3
operation
pagination
parameter
paths
response
schema
security
server
servers
tag
Rules
warn
info-title-marginedge
Info title should identify the MarginEdge API.
$.info
warn
info-description-required
Info description is required and should be meaningful.
$.info
error
info-version-required
Info version is required.
$.info
info
info-contact-required
Provide a contact for the API.
$.info
warn
oas3-version-pinned
This catalog standardizes on OpenAPI 3.0.x.
$.openapi
error
servers-defined
At least one server must be defined.
$
error
servers-https-only
Servers must use HTTPS.
$.servers[*].url
info
server-is-marginedge-public
The public API is served under api.marginedge.com/public.
$.servers[*].url
warn
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
warn
paths-camelcase-segments
Path segments use camelCase (e.g. restaurantUnits, vendorItems); avoid snake_case or kebab-case.
$.paths[*]~
error
paths-no-query-string
Path keys must not contain query strings.
$.paths[*]~
error
operation-read-only-get
The MarginEdge Public API is read-only; only GET operations are permitted.
$.paths[*]
warn
operation-summary-required
Every operation needs a summary.
$.paths[*][get]
warn
operation-summary-marginedge-prefixed
Operation summaries are prefixed with "MarginEdge".
$.paths[*][get].summary
info
operation-description-required
Every operation needs a description.
$.paths[*][get]
error
operation-id-required
Every operation needs an operationId.
$.paths[*][get]
warn
operation-id-camelcase
operationId should be camelCase (e.g. getOrders, getVendorItems).
$.paths[*][get].operationId
info
operation-id-verb-prefix
Read operations should start with a get/list verb.
$.paths[*][get].operationId
warn
operation-tags-required
Every operation must be tagged.
$.paths[*][get]
info
global-tags-defined
Top-level tags array should be defined with descriptions.
$
info
tag-has-description
Each global tag should have a description.
$.tags[*]
warn
tag-title-case
Tags use Title Case (e.g. "Restaurant Units", "Vendors").
$.tags[*].name
info
parameter-description-required
Parameters should be described.
$.paths[*][get].parameters[*]
warn
parameter-camelcase
Query and path parameters use camelCase (restaurantUnitId, vendorId, nextPage).
$.paths[*][get].parameters[?(@.in=='query' || @.in=='path')].name
error
parameter-no-apikey-in-query
API keys must travel in the x-api-key header, never in the query string.
$.paths[*][get].parameters[?(@.in=='query')].name
info
pagination-cursor-name
Cursor pagination standardizes on the "nextPage" parameter name.
$.paths[*][get].parameters[?(@.in=='query')].name
error
get-no-request-body
GET operations must not declare a request body.
$.paths[*][get]
error
response-200-defined
Each operation must define a 200 success response.
$.paths[*][get].responses
warn
response-403-defined
Operations should document a 403 (unauthorized / unauthorized restaurant) response.
$.paths[*][get].responses
warn
response-json-content
Success responses should return application/json.
$.paths[*][get].responses.200.content
warn
schema-property-camelcase
Schema properties use camelCase (centralProductId, vendorItemCode, accountingCode).
$.components.schemas[*]..properties[*]~
warn
schema-property-typed
Schema properties must declare a type.
$.components.schemas[*]..properties[*]
info
pagination-nextpage-field
List response schemas should expose a "nextPage" cursor field.
$.components.schemas[?(@property.match(/ResponseModel$/))].properties
error
global-security-defined
A global security requirement must be declared.
$
warn
security-scheme-apikey-header
The API key scheme must be apiKey-in-header named x-api-key.
$.components.securitySchemes[*]
info
security-scheme-described
Security schemes should be described.
$.components.securitySchemes[*]