Merge · API Governance Rules

Merge API Rules

Spectral linting rules defining API design standards and conventions for Merge.

37 Rules error 15 warn 15 info 7
View Rules File View on GitHub

Rule Categories

delete examples get info no openapi operation pagination parameter paths remote request response schema security servers

Rules

error
info-title-required
Info object must have a title.
$.info
warn
info-title-merge-prefix
Info title should start with "Merge".
$.info.title
error
info-description-required
Info object must have a description.
$.info
warn
info-description-min-length
Info description should be at least 50 characters.
$.info.description
error
info-version-required
Info object must have a version.
$.info
warn
info-contact-required
Info object should have contact information.
$.info
warn
openapi-version-3
OpenAPI version should be 3.x.
$
error
servers-defined
At least one server must be defined.
$
error
servers-https
Server URLs should use HTTPS.
$.servers[*].url
info
servers-merge-api-domain
Server URL should be on api.merge.dev.
$.servers[*].url
warn
paths-kebab-case
Path segments should use kebab-case.
$.paths
error
paths-no-trailing-slash
Paths must not have trailing slashes.
$.paths
info
paths-plural-resources
Resource paths should use plural nouns.
$.paths
error
operation-operationid-required
Every operation must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camel-case
operationId should use camelCase.
$.paths[*][get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-merge-prefix
Operation summaries should start with "Merge".
$.paths[*][get,post,put,patch,delete].summary
error
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
Every parameter must have a description.
$.paths[*][*].parameters[*]
warn
parameter-snake-case
Parameter names should use snake_case.
$.paths[*][*].parameters[*].name
info
parameter-pagination-cursor
Merge APIs use cursor-based pagination with cursor parameter.
$.paths[*].get.parameters
warn
request-body-json
Request bodies should use application/json.
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Every operation must have a success response.
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Every response must have a description.
$.paths[*][*].responses[*]
warn
schema-property-snake-case
Schema properties should use snake_case naming.
$.components.schemas[*].properties
warn
schema-type-defined
Schemas must define a type.
$.components.schemas[*]
info
schema-description
Top-level schemas should have descriptions.
$.components.schemas[*]
error
security-defined
Global security must be defined.
$
warn
security-bearer-auth
Merge APIs should use Bearer token authentication.
$.components.securitySchemes
warn
security-account-token-header
Merge APIs require X-Account-Token header.
$.components.securitySchemes
error
get-no-request-body
GET operations must not have a request body.
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not have a request body.
$.paths[*].delete
info
pagination-response-format
List endpoints should return paginated responses with next/previous/results.
$.paths[*].get.responses.200.content.application/json.schema
info
remote-was-deleted-field
Merge schemas should include remote_was_deleted field for soft delete tracking.
$.components.schemas[?(@.type=='object' && [email protected](/Paginated|Request|Error/))]
error
no-empty-descriptions
Descriptions must not be empty strings.
$..description
info
examples-encouraged
Schema properties should include example values.
$.components.schemas[*].properties[*]