-
-
Notifications
You must be signed in to change notification settings - Fork 161
Should parse allow arguments to be passed through to schema.load and/or dict2schema? #480
Copy link
Copy link
Closed
Labels
Description
I'm looking at the features of marshmallow and Parser.parse (and, by extension, use_args too) and thinking about whether or not this will expose more marshmallow features while not adding too much code (or even, my real goal, simplifying things?).
I have two basic ideas I'm toying with:
- the
validateargument toparseis basically the same as a schema withvalidates_schemamethods- but the
validateerrors have slightly differentmessages-- they don't show the schema name (is that good for generated schemas? can avalidates_schemamethod do that?) - can these be unified, maybe deprecate
validate=..., and remove in 7.0 or later?
- but the
- there's no way to tell
parseto passunknowntoschema.load-- it would be nice to be able to sayparse(..., unknown=ma.EXCLUDE)- should this just be a container for
schema.loadarguments, likeparse(..., load_params=dict(unknown=ma.INCLUDE, partial=True))? It's a less nice interface to use but more flexible - you can handle this today by making different schema objects with your desired behaviors
- maybe this is doable along with (1) for the dict2schema case by setting attributes of
Meta?
- should this just be a container for
This is really low priority. You can do everything today in 6 by using full schema definitions. Supporting unknown=... or load_params=... is really just a convenience feature.
Reactions are currently unavailable