Re: WadlGenerator - Bean validation support for complex types?

2016-09-30 Thread J. Fiala
Hi, No problem, all I need is a quick confirmation if you like the solution, then I can extend it to support more nested restrictions and polish everything up (I'd suggest moving all the beanvalidation methods into a separate utiltiy class). After SourceGenerator is fine, I can take a look at

Re: WadlGenerator - Bean validation support for complex types?

2016-09-30 Thread Sergey Beryozkin
Hi I'm sorry have not had much time to look into recently, being a bit overwhelmed with the various tasks. I'll try to look deeper into it in a week's time, I'll be on and off next week. I saw your presentation being scheduled for Apache Con EU 2016, great, may we we can also discuss few

Re: WadlGenerator - Bean validation support for complex types?

2016-09-30 Thread J. Fiala
Sergey, Pls let me know what you think of my addition to the SourceGenerator.java (https://github.com/apache/cxf/pull/146/files), then I can add support for the other BeanValidation annotations and polish things up (maybe extract the whole BeanValidation into a separate utility class?). Best

Re: WadlGenerator - Bean validation support for complex types?

2016-09-17 Thread J. Fiala
Sergey, Thanks for the hint - now I added the schema type reference detection for minLength/maxLength/pattern as example in SourceGenerator.java. I had to add a separate method to get all prefixes used in the WADL (createWadlPrefixMap(app)), as schemaCollections doesn't hold them

Re: WadlGenerator - Bean validation support for complex types?

2016-09-12 Thread Sergey Beryozkin
Johannes, FYI, SourceGenerator keeps a SchemaCollection field - so knowing a parameter type reference (SourceGenerator has a utility method for giving you a full QName of this reference) you can load an appropriate XML Schema type. I'm still thinking going a ParamConverter path is

Re: WadlGenerator - Bean validation support for complex types?

2016-09-11 Thread Sergey Beryozkin
Swagger JAX-RS is capable of generating Swagger JSON based on JAX-RS annotations alone. Having partial schema fragment inside WADL param is not good IMHO. If you'd like to explore it further - do assume that parameters will refer to XML Schema in WADL:grammar. WADL has XMLSchema loaded - so

Re: WadlGenerator - Bean validation support for complex types?

2016-09-11 Thread J. Fiala
Sergey, I think we can use the simpletype restrictions as already implemented in WadlGenerator and even use them in the SourceGenerator (wadl2java). I implemented a draft for Size(min,max) and Pattern, can you take a look in the PR (see SourceGenerator.java)?

Re: WadlGenerator - Bean validation support for complex types?

2016-09-10 Thread J. Fiala
Sergey, 1.) So we would have to map the complex types to the parameter list here. I don't think this is a really good idea, I think the parameters should always map to simpletypes. 2.) I think the cxf:beanVal extension is a good starting point for now (as long as we don't get access to the

Re: WadlGenerator - Bean validation support for complex types?

2016-09-08 Thread Sergey Beryozkin
Hi Johannes I suppose an idea which you have tried to do with enriching wadl:doc is useful - lets keep it in mind. So these ideas are proposed: 1. in WADL-first one simply has the query/header/path parameters referring to WADL grammar complex types - this will produce Java types with

Re: WadlGenerator - Bean validation support for complex types?

2016-09-08 Thread Sergey Beryozkin
On 08/09/16 10:11, Sergey Beryozkin wrote: Hi Johannes I'm sorry but I'm not seeing how this can be applied - you generate some schema types inside wadl:doc - it will never have a chance of any interoperability (non CXF wadl-to-java processing it) and looks like a 'perfect' hack :-) - I do

Re: WadlGenerator - Bean validation support for complex types?

2016-09-08 Thread J. Fiala
Hi Sergey, No problem, the solution you suggested is of course the better way regarding interoperability! (and great if it will work both ways eventually...!!) Best regards, Johannes Am 08.09.2016 um 11:11 schrieb Sergey Beryozkin: Hi Johannes I'm sorry but I'm not seeing how this can

Re: WadlGenerator - Bean validation support for complex types?

2016-09-08 Thread Sergey Beryozkin
Hi Johannes I'm sorry but I'm not seeing how this can be applied - you generate some schema types inside wadl:doc - it will never have a chance of any interoperability (non CXF wadl-to-java processing it) and looks like a 'perfect' hack :-) - I do appreciate your effort, thanks for that, but

Re: WadlGenerator - Bean validation support for complex types?

2016-09-08 Thread J. Fiala
Hi Sergey, The point of the extension I did for the WadlGenerator (to add simpletype restrictions to query parameters based on their beanvalidation annotations - seee https://github.com/apache/cxf/pull/146/files, WadlGenerator.java) is to support developers who have an existing codebase with

Re: WadlGenerator - Bean validation support for complex types?

2016-08-18 Thread Sergey Beryozkin
Hi thanks for the explanation. On 18/08/16 11:57, J. Fiala wrote: Hi, If I'm using BeanValidation-annotations in my model classes, they are not picked up by the WADLGenerator and so are lost if I do code first and I have to look them up and model them in the WADL manually. At least @NotNull

Re: WadlGenerator - Bean validation support for complex types?

2016-08-18 Thread J. Fiala
Hi, If I'm using BeanValidation-annotations in my model classes, they are not picked up by the WADLGenerator and so are lost if I do code first and I have to look them up and model them in the WADL manually. At least @NotNull support would be nice, because this is really easy to do (see the

Re: WadlGenerator - Bean validation support for complex types?

2016-08-17 Thread Sergey Beryozkin
Hi Can you explain please what exactly the purpose of it can be ? WADL generator simply reports the model info by using a JAXB compiler to generate XML schema, I'm trying to figure out how does the bean validation can help here or what it can change Sergey On 17/08/16 18:18, J. Fiala wrote: