marshmallow-code / marshmallow-code/marshmallow
Dot in key is not parsed correclty on loads()
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 738
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 7
Description
Hey, devs!
First, thanks for the great project! Really useful and helpful.
I found a weird behavior while experimenting with dictionary keys containing dots (".") in it. Here is the example:
```
>>> from marshmallow import Schema, fields
>>> TestSchema = Schema.from_dict({"something": fields.Str(), "some.thing": fields.Str()})
>>> TestSchema().loads('{"something": "data"}')
{'something': 'data'}
>>> TestSchema().loads('{"some.thing": "data"}')
{'some': {'thing': 'data'}}
```
Is it a correct behavior? How to work around it?
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 two Schema.from_dict(...).loads(...) examples first, then trace how loads() handles dotted keys. Because no target behavior, file, or test is named, confirm the intended handling with maintainers; done should be an agreed behavior with regression coverage and a documented workaround if needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100