Expand description
Mountebank wire-shape tolerance, shared across crates (issue #936).
Mountebank accepts several spellings of the same value — a status code as a number or a
numeric string, a header as one value or an array, a header value as any JSON scalar. Those
rules are a property of the wire format, not of any one subsystem, so they live here rather
than inside the imposter types: the imposter stub path and the intercept rule schema both
parse the same JSON and must agree about what it means. They previously lived in
rift-mock-core as pub(crate), which is exactly why the intercept path drifted (issue #933
for body, this issue for statusCode/headers).
Modules§
- multi_
value_ headers - Serde for multi-value headers (issue #238). Accepts the Mountebank-style
"k": "v"and"k": ["v1", "v2"]on the wire; serializes a single value back as a plain string and multiple values as an array, so existing single-value consumers are unaffected. - single_
value_ headers - Serde for header objects that hold one value per name (issue #1050) —
proxy.injectHeadersand_rift.fault.error.headers.
Functions§
- deserialize_
optional_ status_ code - Deserialize an optional top-level
statusCode(flat response form, issue #304), reusing the number-or-string parsing. Only invoked when the field is present; anullis treated as absent (None) so a stray null on a non-flat response stays accepted as before. - deserialize_
status_ code - Deserialize statusCode from either a number or a string