Algebraic data types are a way to accurately describe the data.
When it comes to JSON there is no problem with product types, that is each structure is listing props one-by-one that belong to them.
However it's not clear what to do with a sum-types that imply one set of props or the other, but not both or their mix (unless they share some similarities).
So
- how can you represent a sum type in JSON?
- how can you differentiate between the equally possible cases?