marshmallow-code / marshmallow-code/marshmallow-oneofschema
0 does not work as schema key
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 142
- Forks
- 44
- Avg merge
- 7h 7m
- Merged PRs (30d)
- 3
Description
Suppose I want to map schemas like this:
```
class MySchema(OneOfSchema):
type_schemas = {
0: Schema1,
1: Schema2
}
```
When I try to load data with type 0, I get exception 'Missing data for required field.'.
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
Reproduce the issue with the shown type_schemas mapping and input using type 0, then inspect the schema-key handling entry point. The work is done when type 0 loads successfully like type 1 and a regression test covers the numeric-key case; the issue names no files or existing tests.
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
- Clearly specified
- Newbie friendliness
- 48/100