You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Vjacheslav V. Borisov" <sl...@gmail.com> on 2016/09/08 12:15:43 UTC
Re: Json - schema validation - JacksonProvider+JAXBElementProvider / JSONProvider
Looks like it is impossible to validate dateTime parameters using JSR303
When we have xsd validation, it contains type info (xsd:dateTime), and date
without time part issues schema validation error.
But in case bean with param of type java.util.Date, there is no such
information, this is result of string to date conversion.
Looks like only way is to do format validation in xml adapter attached to
xsd:dateTime
<xjc:javaType name="java.util.Date" xmlType="xsd:dateTime"
adapter="com.package.DateTimeXmlAdapter" />
2016-08-26 14:38 GMT+04:00 Vjacheslav V. Borisov <sl...@gmail.com>:
>
>
> 2016-08-26 13:41 GMT+04:00 J. Fiala <mo...@fwd.at>:
>
>> No, it works with and without namespace :).
>>
>> Thx so I better stay with JacksonProvider with manual BeanValidation for
>> now until wadljava+@Valid or do you actually recommend using
>> MoxyJsonProvider in favor of JacksonProvider (cxf-docs about
>> MoxyJsonProvider seems to be scarce for now...)?
>>
>
> I am using xsd validation for JSON
> but it think xsd validation for json with it's strict xsd:element order
> in xsd:sequence is not very comfortable
>
> and it also requires special settings, like includeRoot, attributePrefix,
> namespace prefixes
> it is not usable with regular json
> {
> "prop":"value"
> }
>
>
>
> So I want to try JSR-303
>