marshmallow-jsonschema
marshmallow-jsonschema copied to clipboard
Nested field allow_none=True is not considered in definitions
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.