users@jersey.java.net

[Jersey] Re: Exposing JSON schema/resource in REST

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Thu, 3 Nov 2011 08:09:48 -0700

On Thu, Nov 3, 2011 at 6:21 AM, Gerard Davison
<Gerard.Davison_at_oracle.com> wrote:
>
> Tatu,
> I looks like the Jackson API has the ability to generate a schema for a
> particular class, although it would be more useful if it could be passed a
> group of classes I guess:
> http://jackson.codehaus.org/1.9.0/javadoc/org/codehaus/jackson/schema/class-use/JsonSchema.html

Yes. Code has not been update a lot, I assume due to limited usage.
But there is much more that could be done, esp. with respect to
allowing additional schema-generation specific annotations.

> I could look at having Jersey generate  a schema of this form if I can
> figure out a way to pass it a bunch of classes and then be able to resolve
> those back to classes later. It doesn't look like it would take that much
> work. If you raise a bug against Jersey I might be able to look at it in the
> future as this seem related to some stuff I am working on.
> Out of interest do you know of any code that could take this JSON scheme
> definition and generate out binding classes based on this? This would mean I
> could update the wadl.java.net project at the same time.

I wish I had link at hand -- after a long time with no tools to take
that obvious step, one tool was recently introduced. I'll see if I can
locate it, it looked pretty promising.

Also, not sure if it'd work here, but Swagger
(http://swagger.wordnik.com/) seems interesting and related to here.
People working on it are knowledgeable as well and I think would be
interested in co-operating.

-+ Tatu +-