Skip to content

None type object in OneOfSchema #112

Description

@froggylab

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 👍

    if obj_type is NoneType:
        return {}

Thank you,
Rom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions