marshmallow-oneofschema
marshmallow-oneofschema copied to clipboard
None type object in OneOfSchema
Hello,
I use Marshmallow-oneofschema with flask_restx, sqlalchemy and flask_accepts. When I query a nonexistent object with the normal schemas, the result is {}. With OneOfSchema, unfortunately, it's not working because the NoneType value doens't match any schema :
[ null, { "_schema": "Unsupported object type: <class 'NoneType'>" } ]
Do you think it's possible to add something like this :+1:
if obj_type is NoneType: return {}
Thank you, Rom