0

I have noticed that most often when I see an example of JSON encoding and decoding a custom class:

  • In the encoding direction, a subclass is used with the cls parameter
  • In the decoding direction, a function is used with the object-hook parameter

...even in the same example.

Is there a reason that this seems to be preferred? Why not just be consistent in both directions?

0 Answers0