marshmallow-code / marshmallow-code/marshmallow-oneofschema
None type object in OneOfSchema
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 142
- Forks
- 44
- Avg merge
- 7h 7m
- Merged PRs (30d)
- 3
Description
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: "
> }
> ]
Do you think it's possible to add something like this :+1:
> if obj_type is NoneType:
> return {}
Thank you,
Rom
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the OneOfSchema object-type dispatch and reproduce the reported serialization of a nonexistent object. The issue is done when a None value is handled as the expected empty result rather than producing an unsupported NoneType error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100