Skip to content

Proposal: Add an option to require all defined fields of a schema #417

@pohmelie

Description

@pohmelie

There are four cases which I think should be covered with validator instance arguments:

  • Allow known missed, forbid unknown present (default behavior right now)
  • Allow known missed, allow unknown present (allow_unknown=True)
  • Forbid known missed, forbid unknown present (no way at validator creation time)
  • Forbid known missed, allow unkown present (no way at validator creation time)

Cerberus have allow_unknown option for validator, but have no allow_known_missed / forbid_known_missed or something like this. As stackoverflow question said, it is pretty annoying to set required: True for all fields, cause they can be nested and schema looks noisy and dirty.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions