Yawplet · API Governance Rules
Yawplet API Rules
Spectral linting rules defining API design standards and conventions for Yawplet.
25 Rules
error 19
warn 4
info 2
Published by Yawplet
Served by the provider at https://yawplet.com/governance/spectral.yml; the copy below was fetched from there.
Rule Categories
agentic
create
error
headers
info
money
needs
no
operation
parameters
paths
post
problem
read
request
security
servers
success
tags
webhooks
Rules
error
operation-operationid-camel-case
Every operation has an operationId in camelCase. MCP tools, the Postman collection and the API reference are all keyed on it.
$.paths[*][get,put,post,delete,patch,options,head,trace]$.webhooks[*][get,put,post,delete,patch,options,head,trace]
error
operation-summary-and-description
Every operation has both a summary (one line, used as the tool title) and a description (what it does, what it costs, what comes back).
$.paths[*][get,put,post,delete,patch,options,head,trace]$.webhooks[*][get,put,post,delete,patch,options,head,trace]
error
operation-single-declared-tag
Every operation has exactly one tag, and it is one of the tags declared at the root (operation-tag-defined from spectral:oas checks the declaration). One tag means one folder in the Postman collection and one section in the reference.
$.paths[*][get,put,post,delete,patch,options,head,trace]$.webhooks[*][get,put,post,delete,patch,options,head,trace]
info
tags-described
Every root tag has a description, so a reader knows what the group is for.
$.tags[*]
error
info-contact-complete
info.contact names the operator with a name, an email and a url.
$.info
warn
info-terms-of-service
info.termsOfService is an https URL. Each site serves the same terms at /terms/.
$.info
error
servers-https-only
Every server URL is https. The sites are served only over TLS.
$.servers[*]
error
paths-versioned-lowercase
Every path starts with /v1 and is made of lowercase segments (a-z, 0-9, hyphen) or {snake_case} parameters, with no trailing slash and no query string.
$.paths
error
error-responses-problem-json
Every 4xx and 5xx response offers application/problem+json (RFC 9457). Agents can rely on type, title, status, detail and a stable code.
$.paths[*][*].responses[?(@property.match(/^[45]/))]
error
problem-schema-is-error
Every application/problem+json body is the shared Error schema, by reference, so there is one problem shape across the API.
$.components.responses[*].content['application/problem+json'].schema$.paths[*][*].responses[?(@property.match(/^[45]/))].content['application/problem+json'].schema
error
success-response-example
Every 2xx response returns application/json with an example (or named examples). Agents learn the shape from the example before they spend anything.
$.paths[*][*].responses[?(@property.match(/^2/))]
error
request-body-example
Every JSON request body has an example (or named examples), and the Postman collection sends it as the default body.
$.paths[*][*].requestBody.content['application/json']
error
create-post-safe-to-retry-and-try
createPost declares the Idempotency-Key header (a retry is never charged twice) and the dry_run query parameter (every check, nothing charged). Posting costs money, so both are part of the contract.
$.paths['/v1/posts'].post
error
no-credentials-in-query
No query parameter carries a credential. Keys travel in the Authorization header, never in a URL that ends up in logs.
$.paths[*][*].parameters[?(@.in == 'query')]$.paths[*].parameters[?(@.in == 'query')]$.components.parameters[?(@.in == 'query')]
error
security-scheme-bearer-header
Every security scheme is HTTP bearer, so the API key is sent as Authorization Bearer and nowhere else.
$.components.securitySchemes[*]
error
webhooks-signed-delivery
The contract has a webhooks section, and every outbound delivery declares the Standard Webhooks headers: webhook-id, webhook-timestamp and webhook-signature, all required.
$
error
agentic-access-declared
Every operation carries x-agentic-access: action-class (read, acting, connected), consequence (read, write, financial, irreversible), human-in-the-loop (none, recommended, required), reversible, and notes. Defined in x-agentic-access-schema.
$.paths[*][get,put,post,delete,patch,options,head,trace]$.webhooks[*][get,put,post,delete,patch,options,head,trace]
error
agentic-access-irreversible-not-reversible
An operation whose consequence is irreversible cannot also say reversible true.
$.paths[*][?(@ && @['x-agentic-access'] && @['x-agentic-access'].consequence == 'irreversible')]
error
agentic-access-402-is-financial
An operation that can answer 402 (the owner must pay) moves money, so its x-agentic-access consequence is financial.
$.paths[*][?(@ && @.responses && @.responses['402'])]
error
read-is-read
An operation whose action-class is read has no write consequence. It either changes nothing (read) or, like search past its free allowance, costs money (financial).
$.paths[*][?(@ && @['x-agentic-access'] && @['x-agentic-access']['action-class'] == 'read')]
warn
needs-human-carries-account-url
The NeedsHuman problem shows account_url and for_human: true, the hand-off every agent must recognise.
$.components.responses.NeedsHuman.content['application/problem+json'].example
error
post-content-untrusted
A published Post declares content_trust: untrusted-user-content as a constant, so every reader is told not to follow what a post says.
$.components.schemas.Post.properties.content_trust
warn
money-integer-micro-dollars
An integer money field (price, balance, amount, charged, refunded, penalty_if_abuse, threshold, price_each) says in its description that it is micro-dollars (1 USD = 1,000,000).
$..properties[?(@property.match(/^(price|balance|amount|charged|refunded|penalty_if_abuse|threshold|price_each)$/) && @.type == 'integer')]
warn
parameters-described
Every parameter has a description.
$.paths[*][*].parameters[*]$.paths[*].parameters[*]$.webhooks[*][*].parameters[*]$.components.parameters[*]
info
headers-no-x-prefix
Header names do not use the X- prefix (RFC 6648); we use registered or draft names such as RateLimit and Idempotency-Key.
$.paths[*][*].responses[*].headers$.components.headers
Spectral Ruleset
Work with this as data
Every ruleset here is available over the APIs.io API and to AI agents over MCP.