Skip to main content

Module shape

Module shape 

Source
Expand description

Structural validation of a live response against the spec’s own response schema.

null is accepted everywhere: the generated schemas don’t model nullability, and the server answers null for any absent optional — judging nulls is the population baseline’s job. Shape only asks whether the data that is there has the declared structure, which is what catches a number turning into a string or an array of objects flattening into scalars.

Structs§

Violation
One structural disagreement between response and schema.

Functions§

response_schema
Find the JSON response schema the spec declares for method on the concrete path (path template segments {like_this} match anything), for the given status code.
template_matches
Whether a path template matches concrete path segments, treating any {seg} as a wildcard. Segment counts must agree.
validate
Validate value against schema, resolving $refs through the spec’s components/schemas. Returns every violation found.