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

Easily serialize Data Classes to and from JSON

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

## What's in this change? * Adding improved instantiation logic for `str`, `int`, `float` in dataclass decoder. * Fixing bugs in test code ### Why do we need improved instantiation...

Last month, a **mypy** change was released that made all arguments for the `mypy.main` method **keyword** only. They also removed an unused argument. https://github.com/python/mypy/pull/13399 The alternative to this change is...

The following example demonstrates my problem: class MIT is not loaded properly from json - the dict keys are strings, where they should have been integers. ``` import dataclasses import...

triage

I have decision tree where the nodes are subclasses to support different types of decisions. Not surprisingly, if I dump using the base Node schema I only get the fields...

triage

I have a dataclass that has a list of an enumeration in it. I have custom field properties to handle this when it is a single instance of the enumeration,...

### Description The current behavior of decoding Union types with `from_dict` is if none of the types in the Union matches, then the field becomes a dict. To me, I...

enhancement

The two contributions of the pr are as follows: 1. add class info to restore subclasses from json, can be enabled by set global_config.include_class_info = True 2. save time by...

### Description The @validates_schema decorator does not work when the Schema is loaded. ### Code snippet that reproduces the issue ``` @dataclass_json @dataclass class Person: name: str = field( metadata=config(...

bug

Resolves https://github.com/lidatong/dataclasses-json/issues/518 Change to the snake_case letter converter to give more consistent behavior for strings containing multiple numeric characters in sequence. For instance: ``` >>print(old_snakecase('Alice'), new_snakecase('Alice')) alice alice >>print(old_snakecase('Alice123'), new_snakecase('Alice123'))...

### Description When declaring a dataclass with `@dataclass_json(letter_case=SNAKE)`, it appears that name conversion is creating extraneous underscores for the output name like so: `test_123` maps to `test__1_2_3` Specifically, it seems...

bug