Skip to content

Forbid extra fields #3

Description

@symroe

If we pass JSON to a model, the default is that it will ignore extra fields not defined on it.

This isn't useful if we want to validate JSON, so it would be better to do:

class Config:
    extra = Extra.forbid

This does mean that we'll be less tolerant and produce more errors if we don't add fields properly, but that's sort of the point of this library.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions