Skip to content

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

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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