johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <strub...@yahoo.de>
Subject JSON-with-types
Date Tue, 10 Nov 2015 04:53:23 GMT
Hi!

Please excuse if I’m blank on this side. 
Is there something like a JSON with information about the types?

E.g. consider a class hierarchy
Customer extends Person extends Partner
Employee extends Person extends Partner
Organisation extends Partner

Now if you have a class ‚Contract‘ which has a Partner you don’t really know whether
it is of type Person, Customer, Employee or Organisation. Got me?

Same is if you have Lists, Sets or Maps…

My childish idea was to store this additional type information as comment in JSON. This can
be read back by Johnzon. 

How useful would that be?
Is there anything in this regard in other JSON libs?

LieGrue,
strub
Mime
View raw message