s-knibbs / dataclasses-jsonschema

JSON schema generation from dataclasses
MIT License
166 stars 38 forks source link

Make type hint of from_json() compatible with json.loads() #165

Closed robinoburka closed 2 years ago

robinoburka commented 3 years ago

The change makes type hint for data parameter of from_json() compatible with the corresponding one in json.loads().

It makes me trouble during interactions with different libraries, but I hope it can be useful for others.

Of course, it can be solved as Cls.from_dict(json.loads(x)), but I appreciate the from_json interface.