users@jersey.java.net

Re: [Jersey] JsonGenerationException: Can not write text value, expecting field name

From: Martin Probst <mail_at_martin-probst.com>
Date: Thu, 11 Jun 2009 09:26:01 +0200

> On further analysis it appears that the use of schema extensibility in
> highlighted section below from rim.xsd may be the problem. Perhaps the
> JSONMarshaller does not handle such schema extensibility correctly?

I believe the XML to JSON process doesn't have any type information
associated, but works on the level of SAX events. So basically
element/attribute content gets to the JSON serializer just as a bunch
of characters. This is also why you have to explicitly tell the
serializer if some field is a number, even though it's already an int
in Java.

This is somewhat unrelated, but does anyone know a good way to start
with JSON and generate XML from that? This way, less type information
would be lost in the process.

Martin