GZW Data API · API Governance Rules
GZW Data API API Rules
Spectral linting rules defining API design standards and conventions for GZW Data API.
12 Rules
error 2
warn 6
info 4
Rule Categories
gzw
Rules
error
gzw-operation-operationid
Every operation must declare an operationId. As of 4.2.0, 0 of 362 operations do, which is why every derived artifact in this repository binds tools and skills to METHOD + PATH instead of an id, and why generated SDKs get positional names.
$.paths[*][get,post,put,patch,delete]
warn
gzw-operation-description
Every operation should carry a description as well as a summary. As of 4.2.0 all 362 operations have a one-line summary (e.g. "ammo (79 items)") and none has a description.
$.paths[*][get,post,put,patch,delete]
warn
gzw-operation-tags
Every operation should be tagged so the contract can be navigated and split by resource. As of 4.2.0 the document declares no top-level tags array and tags no operation; API Evangelist derives tags from the first path segment to produce the per-resource specs in openapi/.
$.paths[*][get,post,put,patch,delete]
info
gzw-query-parameters-declared
The docs publish a query vocabulary the contract does not — page, per_page, all, search, sort, arbitrary field equality, and on /search the dataset, fields, fuzzy and limit parameters. 176 of 362 operations declare parameters in 4.2.0 and every one is a PATH parameter; zero query parameters are declared anywhere. A code generator therefore emits a client that cannot paginate, filter or sort. This rule flags collection routes that declare no query parameter.
$.paths[?(!@property.match(/\{.*\}$/))].get
warn
gzw-info-contact
info.contact should name a reachable maintainer. The provider publishes support@gzw-data.dev and security@gzw-data.dev on its own site but neither is in the contract.
$.info
warn
gzw-info-license
info.license should be declared. The source repository is MIT-licensed; the contract says nothing.
$.info
info
gzw-info-terms
info.termsOfService should point at https://gzw-data.dev/terms-of-service/, which the provider publishes and the contract omits.
$.info
info
gzw-security-declared
An unauthenticated API should say so EXPLICITLY with a top-level `security: []`, rather than by omitting the key. As written, a reader cannot distinguish "no auth required" from "auth not documented" — the two most consequential opposite meanings in a contract.
$
error
gzw-responses-declared
REGRESSION GUARD. The 4.0.0 document declared no responses at all on any of its 352 operations. 4.2.0 declares 200/400/404/429 on all 362. Do not lose that.
$.paths[*][get,post,put,patch,delete]
warn
gzw-error-responses-declared
REGRESSION GUARD. Every operation should keep declaring its 404, which is the error a consumer of a slug-keyed read API hits most.
$.paths[*][get,post,put,patch,delete].responses
warn
gzw-rate-limit-retry-after
REGRESSION GUARD. The 429 response declares a Retry-After header in 4.2.0. That header is the only runtime backoff signal an agent gets against the 100 req/min/IP limit — keep it in the contract.
$.paths[*][get,post,put,patch,delete].responses.429
info
gzw-components-reuse
REGRESSION GUARD. Responses should keep $ref-ing the shared envelope schemas rather than inlining them.
$.paths[*][*].responses[*].content['application/json'].schema
Spectral Ruleset
Work with this as data
Every ruleset here is available over the APIs.io API and to AI agents over MCP.