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

RFC: Respect schema prefix on load #991

Closed
lafrech opened this Issue Oct 11, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@lafrech
Member

lafrech commented Oct 11, 2018

I just realized schema prefix is only used when dumping.

Shouldn't it be used also when loading for consistency?

@deckar01

This comment has been minimized.

Member

deckar01 commented Oct 11, 2018

Optional prefix that will be prepended to all the serialized field names.

https://marshmallow.readthedocs.io/en/3.0/api_reference.html#marshmallow.Schema

It makes sense to me to apply it during load, but I'm not familiar with the use case for this feature.

@lafrech

This comment has been minimized.

Member

lafrech commented Oct 13, 2018

On second thought, the existence of the feature is questionable. It would be easy to achieve in a post_dump method, as it is not even recursive. The symmetric operation can be achieved in a pre_load method.

In fact, it is typically the kind of feature you (@deckar01) object to precisely because it adds to the maintenance burden while it would be easy to do on user side.

Here's the commit adding it: 78a237f.

@sloria

This comment has been minimized.

Member

sloria commented Oct 13, 2018

Yes, it's a very old feature, and I don't even recall the use case for which it was added. I wouldn't be opposed to removing it.

@lafrech

This comment has been minimized.

Member

lafrech commented Oct 14, 2018

Alright. I just sent a PR to remove the feature.

The maintenance burden is relatively low, but the added value is low as well, considering the @post_dump method is trivial.

@sloria sloria closed this in #999 Oct 14, 2018

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