
Check recorded responses against the OpenAPI response schema
Source:R/test_proposals.R
review_recordings.RdValidate each declared scenario's recorded response bodies against the response schema its operation declares, and report the result for review. No file is changed.
Value
A list keyed by service ID, then scenario ID. Each entry holds the route, the cassette path and a status: agrees, disagrees with errors (instance paths and messages, never recorded values, although a path can name a key from the recorded body), or unchecked with a reason. placeholders lists any testing filter placeholders found in the recording.
Details
Only interactions whose method and path match the scenario's operation are checked. The schema for the recorded status is used, then its 2XX-style range, then default; OpenAPI 3 uses the JSON media type and Swagger 2 the response schema; shared responses ($ref into the document's responses) are followed. Bodies vcr kept as base64 (raw or gzip) are decoded first. Internal references resolve against the schema document's component schemas or definitions; examples, defaults and x- extensions are ignored. OpenAPI 3.0 and Swagger 2 validate as JSON Schema draft 4, with nullable honored, and OpenAPI 3.1 as draft 2020-12. A disagreement means review the recording or the schema; it never marks either as correct, and it never re-records. Values replaced by testing filters read as placeholders and can disagree.