Skip to content
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

Propagate unknown parameter to nested fields #1575

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

mahenzon
Copy link
Contributor

Closes #1490

For backwards-compatibility propagation of the unknown happens only when it was passed explicitly

I tried to propagate parent's unknown option to the nested, but the tests began to fail.
So, for the sake of backwards compatibility and for explicit behavior it will work only when passing the unknown keyword to the schema's .load()

sirosen added a commit to sirosen/marshmallow that referenced this pull request Jul 17, 2020
The changelog entry, including credit to prior related work, covers
the closed issues and describes how `propagate_unknown` is expected to
behave.

Inline documentation attempts to strike a balance between clarify and
brevity.

closes marshmallow-code#1428, marshmallow-code#1429, marshmallow-code#1490, marshmallow-code#1575
sirosen added a commit to sirosen/marshmallow that referenced this pull request Jul 17, 2020
The changelog entry, including credit to prior related work, covers
the closed issues and describes how `propagate_unknown` is expected to
behave.

Inline documentation attempts to strike a balance between clarify and
brevity.

closes marshmallow-code#1428, marshmallow-code#1429, marshmallow-code#1490, marshmallow-code#1575
@MinuMichaelOlassayil
Copy link

When is this getting merged? Waiting to use.

@deckar01
Copy link
Member

deckar01 commented Aug 6, 2020

There are a few things blocking this PR:

  1. context is intended for user defined state, not library defined state.
  2. This changes behavior, which would require a major version release. dev would not be the correct target branch.
  3. An instance method argument is not the only way to define schema meta options in bulk. Practical solutions were linked to in "unknown" option should apply to nested fields so that "exclude" works #1490. Maximizing convenience does not seem to be a strong reason to bake this functionality into the API since the work arounds are simple and the use case is obscure.

sirosen added a commit to sirosen/marshmallow that referenced this pull request Sep 4, 2020
The changelog entry, including credit to prior related work, covers
the closed issues and describes how `propagate_unknown` is expected to
behave.

Inline documentation attempts to strike a balance between clarify and
brevity.

closes marshmallow-code#1428, marshmallow-code#1429, marshmallow-code#1490, marshmallow-code#1575
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"unknown" option should apply to nested fields so that "exclude" works
3 participants