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
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.
Cheers,
Gerard
On 1 Nov 2011, at 17:07, Tatu Saloranta wrote:
> On Tue, Nov 1, 2011 at 2:57 AM, Pavel Bucek <pavel.bucek_at_oracle.com> wrote:
>> Hello Raji,
>>
>> yes, Jersey supports WADL - its generated for each app by default and it is
>> accessible at <context-root>/application.wadl or its returned in response to
>> OPTIONS request.
>>
>> Problem in JSON here is obvious - JSON does not have anything like JSON
>> schema yet, so we can't really specify much about exposed/accepted entity.
>
> FWIW, there actually is JSON Schema:
>
> http://json-schema.org/
>
> and there is active development around specifying it.
>
> However, I would agree in that it is not nearly as useful (at this
> point) for defining data types as XML Schema is for XML (others may
> disagree -- I am disappointed at its lack of support for common OO
> concepts).
>
> -+ Tatu +-
--
Gerard Davison | Senior Principal Software Engineer | +44 118 924 5095
Oracle JDeveloper Web Service Tooling Development
Oracle Corporation UK Ltd is a company incorporated in England & Wales.
Company Reg. No. 1782505.
Reg. office: Oracle Parkway, Thames Valley Park, Reading RG6 1RA.
Blog http://kingsfleet.blogspot.com