Skip to main content

Module json

Module json 

Source
Expand description

Generic “parse a JSON body, or fall back to a default when the client sent none” helper — the shape every REST handler in this workspace that accepts an optional body already needs.

Enums§

JsonBodyOutcome
Outcome of extracting an optional JSON body: either the parsed (or defaulted) value, or a response to return immediately because extraction failed for a reason other than “no body was sent”.

Functions§

json_body_or_else
Parse body, or call default when the client omitted the JSON content type and allow_missing is set. Any other rejection short-circuits with a rendered error response.