ramonhagenaars / jsons

🐍 A Python lib for (de)serializing Python objects to/from JSON
https://jsons.readthedocs.io
MIT License
289 stars 41 forks source link

Bug: a string is deserialised as datetime #167

Closed tbarkai closed 2 years ago

tbarkai commented 2 years ago

This code:

@dataclass
class Sample:
    prop: str

json = {'prop': '1025'}
print(jsons.load(json, Sample, strict=True))

Outputs:

Sample(prop=datetime.datetime(1025, 1, 1, 0, 0))

It seems that the default_string_deserializer despite the str type annotation.

tbarkai commented 2 years ago

Sorry, GitHub incident (https://www.githubstatus.com/incidents/zhtplv7zd052) caused multiple issues to be opened.