lidatong / dataclasses-json

Easily serialize Data Classes to and from JSON
MIT License
1.34k stars 150 forks source link

fix: fix deserialization of unions if the type of a field with the same name differs between union members #511

Closed TristanSpeakEasy closed 5 months ago

TristanSpeakEasy commented 5 months ago

The type of union that failed is documented in the test I added, but basically if members of a union differed by the type of a field with a matching name, the resultant AttributeError wasn't being caught and so deserialization would stop and not all the members of the union would be tried

TristanSpeakEasy commented 5 months ago

@george-zubrienko would be great if this could be merged and a new release made. Otherwise I am staring down the barrel of having to publish our fork on pypi and updating our dependency usage to that as its a blocking issue on our side for customers that have SSE use cases in the AI space

george-zubrienko commented 5 months ago

@TristanSpeakEasy should be available in 0.6.4

TristanSpeakEasy commented 5 months ago

Great thank you