Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-08 Thread Sergey Beryozkin
This can be revisited if a ParamConverter approach works - because ParamConverter will be needed for the service to work with such parameters (if you have them refer to complex types). Sergey On 08/09/16 12:20, J. Fiala wrote: Vjacheslav, Exactly, methods + complex parameters always get

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-08 Thread J. Fiala
Vjacheslav, Exactly, methods + complex parameters always get annotated with @Valid with beanValidation active. Query parameters never get @Valid. Best regards, Johannes Am 08.09.2016 um 12:51 schrieb Vjacheslav V. Borisov: 2016-09-08 12:43 GMT+04:00 Sergey Beryozkin

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-08 Thread Vjacheslav V. Borisov
2016-09-08 12:43 GMT+04:00 Sergey Beryozkin : > >>> As I know, only xsd:enumeration types are projected to custom class by >> default, all other simpleTypes projected to java.lang.String, >> hower, if we map some xsd type to java class, then i think this should >> work, but

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-08 Thread Sergey Beryozkin
On 08/09/16 07:02, Vjacheslav V. Borisov wrote: To be precise, wadl grammar already overloaded in wadl2java Becouse i can write and see in generated interface param with type of SomeType - enum class generated from xsd I'm only aware of param/option

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-08 Thread Vjacheslav V. Borisov
> >>> To be precise, wadl grammar already overloaded in wadl2java >> Becouse i can write >> 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

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-07 Thread Sergey Beryozkin
On 07/09/16 07:00, Vjacheslav V. Borisov wrote: 2016-08-29 14:00 GMT+04:00 Sergey Beryozkin : 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

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-07 Thread Vjacheslav V. Borisov
2016-08-29 14:00 GMT+04:00 Sergey Beryozkin : > > 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

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-05 Thread Sergey Beryozkin
Hi On 05/09/16 17:26, J. Fiala wrote: Sergey, Thanks, I'll check whether the ValidationExceptionMapper is invoked. The ValidationExceptionMapper currently does not return the beanvalidation errors - do you think we can add this using a new flag addMessageToResponse to indicate what has gone

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-05 Thread J. Fiala
Sergey, Thanks, I'll check whether the ValidationExceptionMapper is invoked. The ValidationExceptionMapper currently does not return the beanvalidation errors - do you think we can add this using a new flag addMessageToResponse to indicate what has gone wrong to the client? Regarding

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-04 Thread Sergey Beryozkin
Hi, see comments inline please On 03/09/16 19:00, J. Fiala wrote: Sergey, p.s. If you like I can provide a PR for ValidationExceptionMapper Best regards, Johannes Am 03.09.2016 um 19:59 schrieb J. Fiala: Sergey, The wadl2java extraarg "-beanValidation" works like a charm, thanks a lot -

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-03 Thread J. Fiala
Sergey, p.s. If you like I can provide a PR for ValidationExceptionMapper Best regards, Johannes Am 03.09.2016 um 19:59 schrieb J. Fiala: Sergey, The wadl2java extraarg "-beanValidation" works like a charm, thanks a lot - now everything I need is a JEE 7 container :). However, there are

Re: CXF3 BeanValidation - wadl2java @Valid

2016-09-03 Thread J. Fiala
Sergey, The wadl2java extraarg "-beanValidation" works like a charm, thanks a lot - now everything I need is a JEE 7 container :). However, there are some things I have to note: 1.) ValidationExceptionMapper: Regarding how the ConstraintViolationException is returned with

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-29 Thread Sergey Beryozkin
I've added a 'beanValidation' option: https://issues.apache.org/jira/browse/CXF-7032 I'll resolve it once I complete the test Sergey On 29/08/16 11:00, Sergey Beryozkin wrote: On 29/08/16 10:46, Vjacheslav V. Borisov wrote: 2016-08-27 18:58 GMT+04:00 J. Fiala : Sergey, OK,

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-29 Thread Sergey Beryozkin
On 29/08/16 10:46, Vjacheslav V. Borisov wrote: 2016-08-27 18:58 GMT+04:00 J. Fiala : Sergey, OK, so there is no option to get query parameter validation for wadl2java generated java sources in the near future? So if query parameter validation is desired, one has to switch to

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-29 Thread Vjacheslav V. Borisov
2016-08-27 18:58 GMT+04:00 J. Fiala : > Sergey, > > OK, so there is no option to get query parameter validation for wadl2java > generated java sources in the near future? > > So if query parameter validation is desired, one has to switch to Swagger > as contract and generate the

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-27 Thread J. Fiala
Sergey, OK, so there is no option to get query parameter validation for wadl2java generated java sources in the near future? So if query parameter validation is desired, one has to switch to Swagger as contract and generate the BeanValidation-annotations using Swagger-Codegen or use code

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-25 Thread Vjacheslav V. Borisov
2016-08-25 16:58 GMT+04:00 Sergey Beryozkin : > https://www.w3.org/Submission/wadl/#x3-90002.4 > > states the WADL grammar "acts as a container for definitions of the format > of data exchanged during execution..." - this implies the > 'wadl:representation'. > > These other

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-25 Thread Sergey Beryozkin
https://www.w3.org/Submission/wadl/#x3-90002.4 states the WADL grammar "acts as a container for definitions of the format of data exchanged during execution..." - this implies the 'wadl:representation'. These other parameters should really refer to some existing primitive types defined in

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-25 Thread Vjacheslav V. Borisov
2016-08-25 15:55 GMT+04:00 Sergey Beryozkin : > Linking schema elements to non representation parameters is not going to > work for sure. > It overloads the idea that the schema elements represent the in/out > payloads. > WADL Parameter Definition contains also "type"

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-25 Thread Sergey Beryozkin
Linking schema elements to non representation parameters is not going to work for sure. It overloads the idea that the schema elements represent the in/out payloads. Adding @Valid to method returning the payload beans or to a method parameter representing the in payload may be reasonable if a

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-25 Thread Vjacheslav V. Borisov
2016-08-24 21:56 GMT+04:00 J. Fiala : > Sergey, > > Exactly, this plugin provides the beanvalidation annotations for > complextypes at the client + server side, making BeanValidation possible on > both sides. > > What is missing so far: > > 1.) Necessary: Add a switch to wadl2java

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-24 Thread J. Fiala
Sergey, Exactly, this plugin provides the beanvalidation annotations for complextypes at the client + server side, making BeanValidation possible on both sides. What is missing so far: 1.) Necessary: Add a switch to wadl2java to allow adding @Valid to the method + parameters for generated

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-24 Thread Sergey Beryozkin
Let me clarify - https://github.com/krasa/krasa-jaxb-tools what can it do ? Can you configure JAXB compiler with that plugin for it to generate Beans with the bean validation annotations ? I.e, is the only thing you are missing is having @Valid annotations added to the generated methods ?

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-24 Thread Sergey Beryozkin
Hi On 24/08/16 17:36, J. Fiala wrote: Hi, I see the following cases when BeanValidation is preferable to schema validation: 1.) if the error should be clearly associated to the property which caused the error. This is possible with beanvalidation using the propertypath, with xml schema

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-24 Thread J. Fiala
Hi, I see the following cases when BeanValidation is preferable to schema validation: 1.) if the error should be clearly associated to the property which caused the error. This is possible with beanvalidation using the propertypath, with xml schema validation error messages you usually get

Re: CXF3 BeanValidation - wadl2java @Valid

2016-08-23 Thread Sergey Beryozkin
Hi I'm not sure I'm understanding why is it needed. If we have a WADL-first approach which is where wadl-to-java becomes useful, one can properly design XML schema (have all the restrictions specified as needed). Then import this schema as a WADL grammar to generate the JAXB beans and then

CXF3 BeanValidation - wadl2java @Valid

2016-08-23 Thread J. Fiala
Hi, CXF supports bean validation, however wadl2java doesn't support any bean validation annotations yet (see https://github.com/krasa/krasa-jaxb-tools for the implementation for complex parameters). As it is not allowed to add @Valid to the method signatures of the implementation classes,