New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"load_only" fields #87

Closed
sloria opened this Issue Dec 8, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@sloria
Member

sloria commented Dec 8, 2014

Possible feature: add a Field parameter that would make the field active for validation/deserialization but not appear in serialization output.

This came up in a discussion here: marshmallow-code/flask-marshmallow#5 (comment) (though we used the term "write-only", which is a misnomer).

Related to #61 .

EDIT: Fix URL to comment.

@sloria sloria added the enhancement label Dec 8, 2014

@sloria sloria added this to the 2.0-a milestone Jan 17, 2015

@sloria

This comment has been minimized.

Member

sloria commented Jan 25, 2015

Added in #131

@sloria sloria closed this Jan 25, 2015

@Lacrymology

This comment has been minimized.

Lacrymology commented Sep 30, 2016

is there a way to have dump_only fields throw an error if they're passed on to load?

@lafrech

This comment has been minimized.

Member

lafrech commented Sep 30, 2016

@Lacrymology, this could be a sub-use case of the check_unknown_fields example: http://marshmallow.readthedocs.io/en/latest/extending.html#validating-original-input-data

It seems the authors don't see this as a feature that should be in the core, available through a parameter, but leave this to user code (#524).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment