dataclasses-json icon indicating copy to clipboard operation
dataclasses-json copied to clipboard

Easily serialize Data Classes to and from JSON

Results 160 dataclasses-json issues
Sort by recently updated
recently updated
newest added

**Note**: This issue is somewhat related to: #13, #12, but it wasn't resolved in #16. I get the same error, but for different input. **My code:** @dataclass_json() @dataclass class A:...

Related to https://github.com/lidatong/dataclasses-json/pull/279 On python 3.8, using a tuple with two fields results in an error when attempting to fetch the schema of the class. A minimal example: ```python import...

Feel free to ignore if this is too much of an edge case for your module, but I found a need to serialise dataclasses to JSON that had NumPy types...

I'm getting this error, is the package not able to work with the new generic python Typing?

Issue: https://github.com/lidatong/dataclasses-json/issues/353 ### Problem There is inconsistent behavior in how a custom decoder is used depending on whether the field of the custom decoder has `Optional` type. For optional fields...

I am trying to deserialize and validate (`schema().loads`) a dataclass with datetime fields that follow the camel case style (`LetterCase.CAMEL`). **Camel case** fields **without** custom `mm_field` config get validated/deserialized just...

Closes #341 ### Changes: * Updated `tests.entities` and `tests.test_collections` to include alternative forms of the same collection types (like `builtins.list` ("builtin") and `typing.List` (~~"generic"~~ "unbound") in addition to the existing...

It's annoying to define this for every path. It ought to be supported natively. ``` @dataclass_json @dataclass class Foo: file_path: Path = field(metadata=config(encoder=str, decoder=Path)) ```

Type arguments for a generic type alias must be provided at every use site, or the missing arguments will default to `Any`, which gives no type safety. Fixes #370.

This should give a mypy error, but doesn’t: ```python3 from dataclasses import dataclass from dataclasses_json import DataClassJsonMixin @dataclass class MyClass(DataClassJsonMixin): my_field: int x: str = MyClass.schema().load({"my_field": 0}) print(x.lower()) ``` In...