question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deserialization of extended types inside a container type fails

See original GitHub issue

The following fails to deserialize. It seems that in the “more types” deserializer (for Path) the Optional[Path] field is passed. The deserializer in more_types.py then complains that Optional is an unsupported type. Same thing happens with other container types (e.g. List).

@deserialize
@dataclass
class Foo:
    bar: Optional[Path]

from_json(Foo, '{"bar": "/asdf"}')

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jfuechslcommented, Nov 30, 2020

@yukinarit Thank you very much! It is fixed for me 😃

1reaction
yukinaritcommented, Nov 29, 2020

Hi @jfuechsl, pyserde 0.2.1 was released! Please check! ツ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can Jackson polymorphic deserialization be used to serialize ...
It basically allows omitting of actual Type Id field or value, as long as the subtype can be deduced ( @JsonTypeInfo(use=DEDUCTION) ) from ......
Read more >
Java JSON deserialization problems with the Jackson ... - Snyk
Learn how Jackson ObjectMapper deserialization vulnerabilities work and how to make sure you are not affected by them.
Read more >
[JDK-8199664] Deserialization fails when subclass contains ...
The class has a subclass with a field of any hash container type (e.g. HashMap, HashSet, etc.). * The hash container in the...
Read more >
Deserializing subclass of map fails when field is defined as an ...
You say that the type property should be set to the type of the values in the map, however that is not what...
Read more >
Deserialization - OWASP Cheat Sheet Series
Serialization is the process of turning some object into a data format that can be restored later. People often serialize objects in order...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found