When I say "JSON value" below, I mean any of None, str, bool, int, float, lists of JSON values, or dicts of str -> JSON values.
When decoding values that can be any valid JSON object, instead of emitting a useless warning about "Unable to decode a value" just return the value: basically assume it's a valid JSON value. The encoder already does this for all unknown values, and the schema generator adds no information (Dict[str, Any] becomes {"type": "object"}).
There's reasonable precedent: hologram already uses Any in its JsonDict type definition to implicitly mean "Any JSON value".
When I say "JSON value" below, I mean any of
None
,str
,bool
,int
,float
,list
s of JSON values, ordict
s ofstr
-> JSON values.When decoding values that can be any valid JSON object, instead of emitting a useless warning about "Unable to decode a value" just return the value: basically assume it's a valid JSON value. The encoder already does this for all unknown values, and the schema generator adds no information (
Dict[str, Any]
becomes{"type": "object"}
).There's reasonable precedent: hologram already uses
Any
in itsJsonDict
type definition to implicitly mean "Any JSON value".