You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update cg check spec for the API version negotiation ADR (#1159, #1372). Today it skips headers completely, so it can't tell whether an API supports versioning. From 0.6.0 on, it should flag any route that's missing the version headers. This depends on the core v0.6.0 release, because the CLI needs the 0.6.0 spec to check against.
Acceptance criteria
The CLI bundles the 0.6.0 spec, and cg check spec --protocol-version 0.6.0 works
When checking against 0.6.0 or later, cg check reports any route missing the CG-Version request header or the CG-Version-Served response header. Checks against 0.1.0 to 0.5.0 work the same as today
Protocol versions sort as version numbers, so 0.10.0 comes after 0.9.0
An API that puts the version in its paths (like /v0.6/common-grants/...) gets a message saying versions go in the header, instead of a long list of missing routes
Additional information
Test for the second criterion: a 0.6.0 OpenAPI document where an operation is missing the CG-Version request parameter or the CG-Version-Served response header gets a cg check finding for that operation. cg check ignores headers today, so this is the test that proves the change.
cg check can't enforce the rule that servers serving more than one version must publish the discovery route. Route tags can't express that condition, so it's out of scope here.
Activity
[#1390] Regenerate the bundled 0.6.0 spec with version errors and dis…
feat(cli): check the version negotiation headers in cg check spec (#1418