On 07/09/16 07:00, Vjacheslav V. Borisov wrote:
2016-08-29 14:00 GMT+04:00 Sergey Beryozkin <[email protected]>:
In the vast majority of cases query/header/cookie parameters are simple
properties. Doing the complex mapping from WADL grammar to individual Bean
validation properties only for the sake of enforcing some digital or string
pattern in such (query) properties and then also making sure it works the
other way around (WADL grammar is auto-enhanced based on the avail BeanVal
annotations during WADL generatiopn) is not worth it IMHO, especially that
it will also overloads WADL grammar.
To be precise, wadl grammar already overloaded in wadl2java
Becouse i can write <param style="query" name="name" type="tns:SomeType"/>
and see in generated interface param with type of SomeType - enum class
generated from xsd
I'm only aware of param/option
https://www.w3.org/Submission/wadl/#x3-280002.12.3
being optionally used to generate an enum.
I guess SourceGenerator code does not enforce that a query param should
not refer to WADL grammar as opposed to having any specific support for it.
So i think if someone finds work enabling beand validtion annotations
worth, i will gladly use this work also.
But, again, param validation is not "deal breaker" for wadl2java
As I said, doing a gigantic effort so that a query parameter can be bean
validated seems a bit overboard to me - I definitely have no time to do it.
However, if SourceGenerator does allow refer to WADL grammar types -
then it means JAX-RS ParamConverterProvider needs to be available to
create such type at runtime. This generated JAXB bean will have bean
validation properties. ParamConverter will create a bean and then use
for ex CXF BeanValidationProvider to call its validateBean
That should work ?
Sergey
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/