users@jersey.java.net

Re: [Jersey] passing in JSON to create a resource

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Wed, 29 Jul 2009 23:45:55 -0700

On Wed, Jul 29, 2009 at 10:34 PM, Paul Sandoz<Paul.Sandoz_at_sun.com> wrote:
> Hi,
>
> The current documentation is here:
>
> https://jersey.dev.java.net/documentation/1.1.1-ea/user-guide.html#json
>
> Unfortunately there is currently no document formally describing the mapping
> of the JAXB conventions (mapping from XSD say).
>
> So currently you need to work from looking at the serializations produced by
> Jersey from the GET request. Often showing examples of JSON is a common way
> to document the representation. As i understand there is progression towards
> a JSON-based schema, so if this becomes popular i might expect that would be
> a better way to document (with examples).

There is the emerging JSON schema standard:

http://www.json.com/json-schema-proposal/

which has enough semantic power, but there aren't very many tools that
can use it
(Jackson can produce simple json schema output from Java classes
currently, but otherwise I don't know of many Java tools, most
validators seem to be written in javascript....)
But hopefully this changes over time, and hopefully faster than it has so far.

Also: I hope there will in future be a more readable notation for that
schema, same ways as RelaxNG has its "compact notation" (aka readable,
simple DSL, instead of xml serialization).

-+ Tatu +-