gridX · API Governance Rules
gridX API Rules
Spectral linting rules defining API design standards and conventions for gridX.
18 Rules
error 10
warn 5
Published by gridX
Served by the provider at https://github.com/grid-x/api/blob/53b0e020cbab3807cb17a77d611023900d964628/style/spectral.yaml; the copy below was fetched from there.
Rule Categories
ensure
minimum
recommend
Rules
error
minimum-openapi-version-3
Minimum openapi version must be 3.0.
$.openapi
error
ensure-info-x-api-id
Ensures that all OpenAPIs have an information object API ID extension which is unique for machine-readable API identification.
$.info
warn
ensure-do-not-use-api-for-base-path
Ensures that paths do not use /api as part of the base path.
$.paths.*~
error
ensure-normalized-paths-in-kebab-case
All paths must be normalized path without empty path segments and in kebab-case.
$.paths[*]~
warn
ensure-endpoint-summary
Endpoints must have a summary.
$.paths[*][*]
error
ensure-query-parameters-in-camel-case
All query parameters must be in camelCase.
$..*.parameters[[?(@.in=='query')]]
error
ensure-param-description
Parameters must have a description.
$..*.parameters[*]
error
ensure-param-examples
Parameters must have examples.
$.parameters[?(@.type != "object" || @.type != "array")]
warn
ensure-limit-number-of-sub-resources
Ensures that there are not too many sub-resources. Our API should follow the seperation of concerns (SoC) principle.
$.paths.*~
warn
ensure-response-description-punctuation
Response description must end with a dot.
$.components.schemas[*]
error
ensure-components-camel-case-alphanumeric
All YAML/JSON components MUST follow fields-camelCase and be ASCII alphanumeric characters or `_`.
$.components[*]~
error
ensure-properties-camel-case-alphanumeric
All JSON Schema properties MUST follow fields-camelCase and be ASCII alphanumeric characters or `_`.
$.definitions..properties[*]~
error
ensure-request-GET-and-DELETE-no-body
GET and DELETE requests MUST NOT accept parameters in 'body'
$.paths.*[get,delete].parameters..in
warn
ensure-no-request-body-on-get-and-delete
Ensures that GET and DELETE methods do not have request bodies.
$.paths.*[get,delete]
hint
ensure-created-at-format
Ensures that CreatedAt fields have format date-time and is read-only.
$..properties.[?(@property=='createdAt')]
hint
ensure-updatedAt-format
Ensures that updatedAt fields have format date-time.
$..properties.[?(@property=='updatedAt')]
error
ensure-date-time-fields-ends-with-at
Ensures that fields with format date-time should end with At.
$.components.schemas..properties[?(@.type === 'string' && @.format === 'date-time')]
hint
recommend-capitalized-enums
Recommends capitalized enum values.
$.components.schemas[*].properties[*].enum
Spectral Ruleset
Work with this as data
Every ruleset here is available over the APIs.io API and to AI agents over MCP.