marshmallow-jsonschema icon indicating copy to clipboard operation
marshmallow-jsonschema copied to clipboard

Nested field allow_none=True is not considered in definitions

Open avilaton opened this issue 5 years ago • 0 comments

    class ChildSchema(Schema):
        id = fields.Integer(required=True)

    class TestSchema(Schema):
        id = fields.Integer(required=True)
        nested_fld = fields.Nested(ChildSchema, allow_none=True)

    schema = TestSchema()

    dumped = validate_and_dump(schema)

should result on a schema that allows the nested_fld to either conform to ChildSchema or to be None.

avilaton avatar Sep 04 '20 20:09 avilaton