WooCommerce · API Governance Rules
WooCommerce API Rules
Spectral linting rules defining API design standards and conventions for WooCommerce.
45 Rules
error 12
warn 28
info 5
Generated by API Evangelist
Written by API Evangelist tooling for WooCommerce's APIs. It is a starting point, not a ruleset WooCommerce publishes or enforces.
Rule Categories
delete
error
external
get
info
microcks
no
openapi
operation
parameter
path
paths
post
put
query
request
response
schema
security
servers
tag
tags
Rules
error
info-title-required
API title must be present and start with "WooCommerce".
$.info
error
info-description-required
API description must be present and at least 100 characters.
$.info
error
info-version-required
API version must be specified.
$.info
warn
info-contact-required
Contact information must be present.
$.info
warn
info-terms-of-service
Terms of service URL must be present.
$.info
warn
openapi-version-31
OpenAPI version must be 3.1.0.
$
error
servers-required
At least one server must be defined.
$
warn
servers-description-required
Each server should have a description.
$.servers[*]
warn
paths-use-kebab-case
Path segments must use kebab-case (lowercase letters, digits, hyphens).
$.paths[*]~
warn
paths-no-trailing-slash
Paths must not have trailing slashes.
$.paths[*]~
info
paths-plural-resource-nouns
Collection 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-camelcase
operationId must 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-woocommerce-prefix
Operation summaries must start with "WooCommerce ".
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
warn
operation-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
All parameters must have descriptions.
$.paths[*][get,post,put,patch,delete][*].parameters[*]
warn
parameter-naming-snake-case
Parameter names must use snake_case.
$.paths[*][get,post,put,patch,delete].parameters[*].name
info
parameter-pagination-standard
Pagination parameters should be named page and per_page.
$.paths[*][get].parameters[*]
warn
request-body-json-content-type
Request bodies should use application/json content type.
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Operations must define at least a 200 or 201 success response.
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
All responses must have descriptions.
$.paths[*][get,post,put,patch,delete].responses[*]
warn
response-json-content-type
Successful responses should return application/json.
$.paths[*][get,post,put,patch].responses['200'].content
info
response-error-401-defined
Protected endpoints should define a 401 unauthorized response.
$.paths[*][get,post,put,patch,delete].responses
warn
schema-property-snake-case
Schema property names must use snake_case.
$.components.schemas[*].properties[*]~
warn
schema-description-required
Top-level component schemas should have descriptions.
$.components.schemas[*]
warn
schema-type-defined
Schemas should define an explicit type.
$.components.schemas[*]
error
security-schemes-defined
Security schemes must be defined in components.
$.components.securitySchemes
error
get-no-request-body
GET operations must not have request bodies.
$.paths[*].get
warn
delete-returns-200-or-204
DELETE operations should return 200 or 204.
$.paths[*].delete.responses
warn
post-has-request-body
POST operations that create resources should have request bodies.
$.paths[*].post
error
put-has-request-body
PUT operations must have request bodies.
$.paths[*].put
warn
tags-global-defined
Global tags array should be defined with all tags used in operations.
$
warn
tag-descriptions-required
Global tag definitions must include descriptions.
$.tags[*]
info
microcks-operation-extension
Operations should include x-microcks-operation for mock server compatibility.
$.paths[*][get,post,put,patch,delete]
info
external-docs-encouraged
APIs should reference external documentation.
$
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-expected-domain
Server URLs should be on the example.com domain.
$.servers[*].url
warn
path-params-casing
Path parameters should be snake_case (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
query-params-casing
Query parameters should be snake_case (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
warn
schema-properties-casing
Schema properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
error-schema-defined
A shared error schema (Error) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description
Spectral Ruleset
Work with this as data
Every ruleset here is available over the APIs.io API and to AI agents over MCP.