On Wed, Mar 24, 2010 at 2:04 AM, Jakub Podlesak <Jakub.Podlesak_at_sun.com> wrote:
>
...
> When implementing the JSON API, we have not thought about validating JSON using the XML schema validation
> of the intermediary XML data, but i think it is generally not a bad idea for the JAXB/JSON scenario.
>
> Regarding the current behavior, even if we put aside the JSON validation, i think you should be able to validate
> XML wthout breaking the JSON functionality.
Another way to consider would be to forget about data format level (it
is often too low-level anyway) and instead use bean validation API. It
is used by annotating POJOs to define constraints.
For output side you would probably want to serialize, deserialize
back, validate. This would actually work better than plain old
writer-side validation because it would test whether data can be read
back, not just whether it comes out as defined by schema (by using
jerser/jax-rs).
Just an idea,
-+ Tatu +-