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

Ignore unknown fields for marshmallow2 #70

Merged
merged 2 commits into from Dec 1, 2022

Conversation

Pliner
Copy link
Contributor

@Pliner Pliner commented Dec 1, 2022

It works correctly for marshmallow3, but doesn't for marshmallow2

@Pliner Pliner requested a review from a team as a code owner December 1, 2022 13:05
@Pliner Pliner merged commit 958ff1f into main Dec 1, 2022
@Pliner Pliner deleted the ignore-unknown-fields-for-marshmallow-v2 branch December 1, 2022 13:13
@@ -163,6 +163,13 @@ def post_load(self, data: dict[str, Any]) -> Any:

@m.pre_load # type: ignore
def pre_load(self, data: dict[str, Any]) -> Any:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be it could be optional (maybe with turn on by default), with an exception for overlap names? This way it might be more useful for general porpoise

@@ -163,6 +163,13 @@ def post_load(self, data: dict[str, Any]) -> Any:

@m.pre_load # type: ignore
def pre_load(self, data: dict[str, Any]) -> Any:
# Exclude unknown fields

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Exclude unknown fields
# Exclude unknown fields to prevent possible value overriding in marshmallow 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants