MongoDB · API Governance Rules
MongoDB — openapi rules
Spectral linting rules defining API design standards and conventions for MongoDB.
10 Rules
error 10
Published by MongoDB
Served by the provider at https://github.com/mongodb/openapi/blob/e579b1476f09280be945ffc1872c92f5a7e84c61/tools/spectral/.spectral.yaml; the copy below was fetched from there.
Rule Categories
accept
soa
x
xgen
Rules
error
accept-header-upcoming-version-limit
Ensure that each operation has at most one upcoming API Accept header.
$.paths[*][*]
error
xgen-schema-name-pascal-case
OpenAPI Schema names should use PascalCase. PascalCase ensures consistency with OpenAPI generated code.
$.components.schemas[*]~
error
xgen-docs-tags-alphabetical
Many documentation tools show tags in the order they are defined, so defining them not in alphabetical order can look funny to API consumers.
$
error
xgen-docs-tags
Tags help group logic into conceptual groups instead of making end-users dig through URLs or lists of operation names.
$
error
xgen-docs-operation-tags
Once tags are defined they should be references in the operation, otherwise they will not be doing anything.
#OperationObject
error
xgen-docs-operationId-valid-in-url
Most documentation tools use the operationId to produce URLs, so the characters used must be safe and legal when used in the URL.
#OperationObject
error
xgen-docs-operationId-camel-case
operationId should be camelCased.
$.paths[*]..operationId
error
x-xgen-hidden-env-format
Ensure x-xgen-hidden-env extension has the correct format. https://go/openapi-hidden-extension
$..x-xgen-hidden-env
error
soa-migration-extension
Ensure the x-xgen-soa-migration extension is valid.
$.paths[*][*].x-xgen-soa-migration
error
xgen-security-override
Security must not be set at resource or method level because it is set globally. Use @Unauthenticated annotation to set no security. https://go/openapi-unauthenticated-annotation
#OperationObject.security
Spectral Ruleset
Work with this as data
Every ruleset here is available over the APIs.io API and to AI agents over MCP.