Skip to content

Releases: yukinarit/pyserde

v0.13.0

07 Jan 12:36
10e660a
Compare
Choose a tag to compare

What's Changed

New features

New custom class (de)serializer allows to extend pyserde to support third party types in a neat and robust way. Also custom global (de)serializer is a game changer to allow sharing and reusing custom serializers across different python projects. See custom class serializer and custom global serializer for more information.

e.g. Implementing serializer for datetime and int

class Serializer:
    # Custom serializer for "datetime"
    @overload
    def serialize(self, value: datetime) -> str:
        return value.strftime("%d/%m/%y")

   # Custom serializer for "int"
   @overload
   def serialize(self, value: int) -> Any:
       return str(value)

   ....

Build

Documentation

Full Changelog: v0.12.7...v0.13.0

v0.12.7

17 Dec 03:16
b39d881
Compare
Choose a tag to compare

What's Changed

Refactoring

  • Fix skip_if causing serialization of a recursive type to be O(2**n) instead of O(n) by @gschaffner in #452

Other changes

New Contributors

Full Changelog: v0.12.6...v0.12.7

v0.12.6

28 Nov 05:19
7119be7
Compare
Choose a tag to compare

What's Changed

Bug fixes

Other changes

New Contributors

Full Changelog: v0.12.5...v0.12.6

v0.12.5

11 Nov 07:42
1cba1da
Compare
Choose a tag to compare

What's Changed

Bug fixes

Full Changelog: v0.12.4...v0.12.5

v0.12.4

25 Oct 02:08
76e919c
Compare
Choose a tag to compare

What's Changed

Bug fixes

Other changes

New Contributors

Full Changelog: v0.12.3...v0.12.4

v0.12.3

09 Oct 02:58
fead102
Compare
Choose a tag to compare

What's Changed

Bug fixes

Refactoring

Test

Full Changelog: v0.12.2...v0.12.3

v0.12.2

25 Jul 15:32
031f4c4
Compare
Choose a tag to compare

What's Changed

New features

  • Add support for dataclasses with kw_only by @m472 in #413

Bug fixes

CI

Build

Documentation

Other changes

New Contributors

  • @m472 made their first contribution in #413

Full Changelog: v0.12.1...v0.12.2

v0.12.1

18 Jul 00:00
c09842b
Compare
Choose a tag to compare

What's Changed

Bug fixes

Refactoring

Documentation

Full Changelog: v0.12.0...v0.12.1

v0.12.0

15 Jul 08:21
7bb6c0f
Compare
Choose a tag to compare

What's Changed

New features

This example works correctly now

@serde
@dataclass
class Foo:
    a: int

@serde
@dataclass
class Bar:
    a: int

bar = Bar(10)
s = to_json(bar)
print(s)
print(from_json(Union[Foo, Bar], s))

However, This will introduce a breaking change!! The default behaviour when you pass Union directly was "Untagged" until v0.11.1, but since v0.12.0 it is "ExternalTagging".

The following code prints {"a": 10} until v0.11.1, but prints {"Bar": {"a": 10}} since v0.12.0

print(to_json(bar))

For more information about Union, please see the docs

Refactoring

Other changes

Full Changelog: v0.11.1...v0.12.0

v0.11.1

25 Jun 05:41
04cc5bf
Compare
Choose a tag to compare

What's Changed

New features

  • Support (de)serialize a subclass of primitive type by @yukinarit in #388

Bug fixes

  • Fix deserializing from incompatible value e.g. None by @yukinarit in #389

Refactoring

Other changes

New Contributors

Full Changelog: v0.11.0...v0.11.1