Skip to content
Discussion options

You must be logged in to vote

Try adding

    class Config:
        extra = “forbid”

inside the class definition of Item. I think that should make it raise errors if it receives unexpected fields.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
3 participants
Converted from issue

This discussion was converted from issue #903 on February 28, 2023 10:49.