apryor6 / flask_accepts

Easy, opinionated Flask input/output handling mixing Marshmallow with flask-restx
BSD 3-Clause "New" or "Revised" License
169 stars 40 forks source link

Partial param for Schema loading #80

Closed vladarefiev closed 4 years ago

vladarefiev commented 4 years ago

Hey there. I would like to add partial: bool param to @accepts decorator for passing it to schema.load() I created local branch with those changes, how can I create a PR?

volfpeter commented 4 years ago

Hi @apryor6, @vladarefiev

Would it be possible to undo #81 ?

Here is the problem: the default value of partial in accepts() is False (the only correct default would be None, meaning let the schema do its job), and this argument is directly passed to schema.load(), overriding the schema instance's partial property and effectively breaking the passed in schema instance.

Keeping this argument with a default value of None is acceptable, but I would avoid it because it would still violate several best practices.

Br, Peter

volfpeter commented 4 years ago

Also, see the suggested solution to this exact problem in #62

apryor6 commented 4 years ago

Peter,

That makes perfect sense. Happy to accept a PR that reconciles. I can get to it sooner or later, but it will be more challenging to find time than one might like for personal reasons.

On Aug 26, 2020, at 3:14 AM, Peter Volf notifications@github.com wrote:

 Hi @apryor6, @vladarefiev

Would it be possible to undo #81 ?

Here is the problem: the default value of partial in accepts() is False (the only correct default would be None, meaning let the schema do its job), and this argument is directly passed to schema.load(), overriding the schema instance's partial property and effectively breaking the passed in schema instance.

Keeping this argument with a default value of None is acceptable, but I would avoid it because it would still violate several best practices.

Br, Peter

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

volfpeter commented 4 years ago

Hi,

I can submit a PR that removes the partial argument and restores the original state if that's okay for you.