Repository navigation
Pin API contract 1.0.0 and check every call against it - #7
Merged
Merged
Conversation
The SDK now states the API contract version it was validated against: a CONTRACT_VERSION file, a public constant and a README line, with the contract itself committed under contract/openapi-1.0.0.json (the backend repository is private, so CI cannot download it). A contract test calls every public method with a stubbed transport and checks that each request's method and path exist in the pinned contract and that every field the contract marks required is sent. A guard fails when a public method is added without being covered by the check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
LiveXFace/backend#8: each SDK release must say which API contract it was validated against and prove its calls exist in it.
What changed
CONTRACT_VERSION(1.0.0), the contract committed ascontract/openapi-1.0.0.json(byte-identical to the backend'sdocs/openapi.json), a public version constant and a README line on how to move to a new contract.images[N]/frame_Ncount forimages[0]/frame_0). A guard fails on a public method the check does not call, and a test ties the constant to the file and the contract'sinfo.version.Verification