You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This introduces a new Parser-class variable,
`DEFAULT_UNKNOWN_BY_LOCATION`, which maps location names to
`unknown` values. It populates that and `DEFAULT_UNKNOWN` to pass
`EXCLUDE` in the general case and `RAISE` for request bodies.
The new behavior is layered and defined with lower precedence than
`Parser.unknown` or the `unknown` parameter on parse calls. In
order to implement this and allow users to opt *out* of the behavior
(i.e. in order to use schema-defined values), the way these values are
set is subtly changed. Instead of having a default value of `None`,
parse calls and parser __init__ have a default of
`unknown="_default"`. When that value is detected, the various layers
of defaults (DEFAULT_UNKNOWN and DEFAULT_UNKNOWN_BY_LOCATION) are
applied. However, if a user passes `None`, that will take effect with
the meaning "do not pass a value for `unknown`".
For parsers which define additional locations, they extend the base
DEFAULT_UNKNOWN_BY_LOCATION as appropriate.
The changelog has been updated significantly in order to handle this
and a new section of the advanced usage docs covers the behavior.
0 commit comments