Skip to content

Dot in key is not parsed correclty on loads() #2194

Open
@dchirikov

Description

@dchirikov

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions