I added this PR for bean-validation-support for query parameters:
https://github.com/apache/cxf/pull/146
This also adds the required-flag for params by supporting @NotNull (see
related question here:
Example for DataHandler not supported in WADL:
@Consumes({ MediaType.MULTIPART_FORM_DATA })
@Produces({ MediaType.APPLICATION_JSON })
@POST
@Path("/helloMultipart")
public void helloMultipart(@Multipart(value= "payload" ,
type=MediaType.APPLICATION_OCTET_STREAM) DataHandler
Currently annotations in the interface are not parsed by CXF (e.g.
@Path, @GET, @Produces, @Consumes etc.), it will only read from the
implementing API class.
This is especially annoying if wadl2java is used to generate the API
interfaces automatically.
To make it work, one has to manually
The WadlGenerator currently generates @Description comments as .
These are invalid for schemas.
The correct tags for comments in schemas are
...
IMHO this should be corrected.
Best regards,
Johannes
CXF3 wadl2java SourceGenerator does not support BeanValidation for
request/response structures
BeanValidation support for request/response structures has been added in
this extension to the cxf-wadl2java-plugin:
https://github.com/jfiala/krasa-jaxb-tools
It would be nice if this can somehow
Currently the wadl2java SourceGenerator (cxf-tools-wadlto-jaxrs) does
not support BeanValidation for query parameters
I added the support of @NotNull to SourceGenerator.java to start with
(see https://github.com/apache/cxf/pull/146, SourceGenerator.java).
However, to add
use CXF 2, there everything is working
out of the box.
Is there another way to get the CXF 3 client working with wadl2java
without removing ObjectFactory.java from the buildpath?
Best regards,
J. Fiala
an also be auto-scanned - but I found in my experiments that
muiltiple Jackson providers can be picked up, so I'd rather return an
instance from the code
Sergey
On 17/08/16 17:40, J. Fiala wrote:
I try to run a CXF JAX-RS endpoint using Spring XML configuration and
Spring Boot.
The services are
I try to run a CXF JAX-RS endpoint using Spring XML configuration and
Spring Boot.
The services are listed correctly when I access the server and the
WADL/Swagger endpoint is generated correctly:
http://localhost:8080/services/
The API methods are annoted with:
not have JAX-RS annotations spread over the interface
and impl, just keep them all on the interface
Cheers, Sergey
On 18/08/16 14:18, J. Fiala wrote:
Sure:
Interface (generated using wadl2java):
@Path("/helloWorld")
public interface HelloWorldResource {
@GET
@Produces("a
interface on the config file...
Vassilis
On 08/18/2016 05:01 PM, J. Fiala wrote:
That's exactly what I would like to do - if I remove the annotations
from the implementing class methods, they vanish from the WADL.
Best regards,
Johannes
Am 18.08.2016 um 15:54 schrieb Sergey Beryozkin:
It's i
Hello,
I defined a Multipart in the WADL (I'd like to use a multipart with both
json data + binary data):
type="xs:string" required="true"/>
element="mytypes:CreateMultipartRequestType"/>
p.s. a basic multipart like
works, but then I only get the generic MultipartBody generated without
any hint to the client how to assemble it correctly.
Best regards,
Johannes
Am 18.08.2016 um 16:13 schrieb J. Fiala:
Hello,
I defined a Multipart in the WADL (I'd like to use a multipart
at Apache,
Can you please submit ICLA and also create a Confluence account ?
Thanks, Sergey
On 03/02/17 14:41, J. Fiala wrote:
Hi there,
I found two minor issues regarding the docs:
http://cxf.apache.org/docs/wsdl-to-java.html
1.) Q: How to map xsd:dateTime to java.util.Date?:
The package names
Dear Dan,
Thanks, now it is up to date.
Best regards,
Johannes
Am 03.02.2017 um 22:13 schrieb Daniel Kulp:
On Feb 3, 2017, at 1:40 PM, J. Fiala <mod...@fwd.at> wrote:
Dear Sergey,
I updated the wiki page
(https://cwiki.apache.org/confluence/display/CXF20DOC/WSDL+to+Java), but I
don
can edit the Wiki already, then I'll add this
myself.
Best regards,
J. Fiala
is the interface and the serviceBean is the
implementing class. The name of both are the same but they live in
different packages impl vs iface.
Hope that may help somehow...
Vassilis
On 2016-08-18 17:18, J. Fiala wrote:
Hi,
I defined the implementing class in the spring configuration
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,
Hi Sergey,
I posted directly to the camel mailing list .
=== snippet from response to camel mailing list
I added a few features to the CXF code generator in Swagger-Codegen
(bean-validation-api support, CXF3 Swagger2Feature for complimentary
code first support, generate test classes,
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 :).
ed 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 <mod...@fwd.at>:
Sergey,
OK, so there is n
processing)...
Best regards,
Johannes
Am 04.09.2016 um 18:49 schrieb 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
class with Bean
validations can be projected back into the grammar
Cheers, Sergey
On 08/09/16 08:41, J. Fiala wrote:
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
really
doesn't like it, but I think this will be rarely the case.
Best regards,
Johannes
Am 18.08.2016 um 13:19 schrieb 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
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
be enhanced to optionally add non-body JAX-RS parameter types to a
JAXB context passed to JAXB schema compiler.
2. Introduce a cxf:beanVal extension which may be added to wadl:doc ?
Sergey
On 08/09/16 10:22, J. Fiala wrote:
Hi Sergey,
No problem, the solution you suggested is of course th
access to the simpletypes is possible
during the parameter processing.
Best regards,
Johannes
Am 10.09.2016 um 21:41 schrieb 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
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
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
beanVal API dep
Many thanks, Sergey
On 11/09/16 10:00, J. Fiala wrote:
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
Sergey,
Correct, removed the jettison from the classpath and everything works
without excluding...!
Best regards,
Johannes
Am 18.08.2016 um 00:27 schrieb Sergey Beryozkin:
Looks like you have CXF JSONProvider loaded...
Sergey
On 17/08/16 17:53, J. Fiala wrote:
I'm using wadl2java
which is more specific than
Jackson (FYI it has wildcard Consumes/Produces which makes it less
specific compared to other provider candidates)
Cheers, Sergey
On 17/08/16 18:02, J. Fiala wrote:
Sergey,
Thank you for the quick response!
I'm using cxf-spring-boot-starter-jaxrs 3.1.7 with Spring
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:
I added this PR
in the end - we have
another pending issue with Swagger not handling multi-bundle case
well, but that is another story
Sergey
On 17/08/16 18:23, J. Fiala wrote:
Currently annotations in the interface are not parsed by CXF (e.g.
@Path, @GET, @Produces, @Consumes etc.), it will only read from
Hi,
Thank you for the hint, looked it up & yes that's fine (still schema
editors mark it as an error).
Best regards,
Johannes
Am 18.08.2016 um 00:34 schrieb Sergey Beryozkin:
On 17/08/16 18:28, J. Fiala wrote:
The WadlGenerator currently generates @Description comm
small example project if you need it.
Best regards,
Johannes
Am 18.08.2016 um 13:21 schrieb Sergey Beryozkin:
Can you prototype here an interface and an impl class please
thanks, Sergey
On 18/08/16 12:11, J. Fiala wrote:
Hi,
No, that has nothing to do with Swagger, I'm only working with the
gener
Hi,
I have a WADL resource which should accept both xml + json:
required="true"/>
element="mytypes:MyRequest"/>
element="mytypes:MyRequest"/>
Hi,
I just came across the Exception handling behaviour of CXF 3 and was
wondering if this is intended:
1.) Passing simply a string as message results in message is not
included in the response.
throw new InternalServerErrorException("message");
==> will return only Status: 500
Status :
Hi,
A minor detail:
If the service URL doesn't exist inside the CXF application, CXF will
return 404 + HTML, although Json was sent + accepted:
WebClient.client(api)
.type(MediaType.APPLICATION_JSON_TYPE)
.accept(MediaType.APPLICATION_JSON_TYPE);
Result:
No service
me ask you in return,
do you think 'JacksonJsonProvider' can handle XML ?
Cheers, Sergey
On 18/08/16 14:54, J. Fiala wrote:
Hi,
I have a WADL resource which should accept both
MultipartBody is generated. In some simple
cases @Multipart parameters can be generated to repesent simple
multiparts, or have InputStream as a parameter
Sergey
On 18/08/16 15:21, J. Fiala wrote:
p.s. a basic multipart like
works, but then I only get the generic MultipartBody generated without
any
Hi,
I tried to use an exceptionMapper in the cxf:bus
(http://cxf.apache.org/docs/jaxrs-services-configuration.html):
CXF-version 3.1.6
|<||cxf:bus||>|
|||<||cxf:properties||>|
|||<||entry| |key||=||"javax.ws.rs.ext.ExceptionMapper"|
|ref||=||"exceptionMapper"||/>|
|||Caused by:
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
Hi,
I tried to use JacksonXMLProvider in combination with wadl2java (this is
a bit related to the schemavalidation question before, but I think it's
worth a separate thread).
version: CXF 3.1.6
I get this exception:
com.sun.istack.internal.SAXException2: unable to marshal type
ingle item"
arrays serialized without []
I think better way, if you require xsd validation, use moxy json provider,
or wait for JSR303 validation switch for wadl2java.
2016-08-26 12:32 GMT+04:00 J. Fiala <mod...@fwd.at>:
Hi,
I'd like to add schema validation for Json reques
Hi,
I'd like to add schema validation for Json requests (as described in
https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Data+Bindings#JAX-RSDataBindings-Schemavalidation).
1.) Schemavalidation using Json JacksonProvider / JAXBElementProvider:
Configuration used:
|
|
|
Am 25.08.2016 um 23:14 schrieb Sergey Beryozkin:
Hi
See
https://github.com/apache/cxf/blob/master/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/filters/filters-serverJwt.xml#L36
Sergey
On 25/08/16 18:23, J. Fiala wrote:
Hi,
I tried to use an exc
asics.html#JAX-RSBasics-MappingexceptionsthrownfromCXFinterceptors,
Customizing default WebApplicationException mapper), so it is available
for copy & paste...
Best regards,
Johannes
Am 18.08.2016 um 16:49 schrieb Sergey Beryozkin:
Hi
On 18/08/16 14:32, J. Fiala wrote:
Hi,
I just came ac
to
generate the JAXB beans and then use the same schema to enforce the
JAXB-level schema validation which will work on the client and on the
server sides.
FYI, you can configure CXF JAXBElementProvider with XML schema
references.
Cheers, Sergey
On 23/08/16 18:03, J. Fiala wrote:
Hi,
CXF supports
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 ?
Cheers, Sergey
On 24/08/16 17:45, Sergey Beryozkin wrote:
Hi
On 24/08/16 17:36, J. Fiala wrote
e a namespace which would extend the core
WADL namespace. Ex,
http://wadl.dev.java.net/extensions/bval
Might be worth investigating if it is allowed or not.
Cheers, Sergey
On 07/11/16 18:01, J. Fiala wrote:
Hi Sergey,
Thx for the analysis.
Regarding the WadlGenerator I'd also prefer option 1 oppos
it is
done
Thanks, Sergey
On 06/11/16 21:58, J. Fiala wrote:
Hi Sergey,
Should we add a link to the docs to make people aware what they can do
with the Swagger contract/SwaggerFeature at the client side?
If you like, I can also start editing the Wiki (but I haven't heard
anything about my
r types in the
signature and register ParamConverterProvider. This is still a perfectly
valid JAX-RS 2.0.
Cheers, Sergey
On 08/11/16 10:25, Sergey Beryozkin wrote:
Hi
On 07/11/16 22:52, J. Fiala wrote:
Hi Sergey,
I think we should split the whole thing into two topics (issues/PRs):
Well. I'd rath
ork
was needed to keep both approaches in sync. Right now I see WADLGen has
some explicit BeanVal dependencies. I def remember objecting to this
particular approach.
So how this can be generalized, be WADL friendly, and work both ways ?
Sergey
On 06/11/16 21:59, J. Fiala wrote:
Hi Sergey,
OK, I agree
ki account with a 'jfiala' id ?
Cheers, Sergey
On 08/11/16 17:10, J. Fiala wrote:
Hi Sergey,
I'd prefer jfx or jfiala.
Best regards,
Johannes
Am 08.11.2016 um 18:01 schrieb Sergey Beryozkin:
Hi Johannes, what is your preferred login id ?
Cheers, Sergey
On 07/11/16 15:48, Sergey Beryozkin wrote:
H
Hi there,
The CXF server generator is merged into the master and is scheduled for
the next release of Swagger-Codegen 2.2.2.
Best regards,
Johannes
Am 16.10.2016 um 18:55 schrieb J. Fiala:
Hi there,
I added configuration options for the various CXF features for the
CXF-server/client
know how I can contribut there) or provide you with a draft.
Best regards,
Johannes
Am 06.11.2016 um 22:53 schrieb J. Fiala:
Hi Philippe,
p.s. if you want to see this all in action you can also come to
ApacheCon Seville in two weeks and see my talk there
(http://events.linuxfoundation.org
Hi Philippe,
CXF REST services actually support clients of any programming language
capable of doing REST API calls.
If you want to generate client code, pls check out Swagger-Codegen
(http://github.com/swagger-api/swagger-codegen), it currently supports
around 40 programming languages
Hi Philippe,
p.s. if you want to see this all in action you can also come to
ApacheCon Seville in two weeks and see my talk there
(http://events.linuxfoundation.org/events/apachecon-europe/program/schedule).
Best regards,
Johannes
Am 06.11.2016 um 22:44 schrieb J. Fiala:
Hi Philippe,
CXF
Hi Sergey,
I can ask him or simply do a fork of the complete project and then cover
it under the Apache license provided the author agrees with this.
Do you think further BeanValidation extensions for CXF should also go
there and I should subclass the WadlGenerator/SourceGenerator? Or shall
/11/16 21:46, J. Fiala wrote:
Hi Sergey,
I can ask him or simply do a fork of the complete project and then cover
it under the Apache license provided the author agrees with this.
Do you think further BeanValidation extensions for CXF should also go
there and I should subclass the WadlGenerator
Hi Sergey,
Asked him: https://github.com/krasa/krasa-jaxb-tools/issues/57
Best regards,
Johannes
Am 06.11.2016 um 22:46 schrieb J. Fiala:
Hi Sergey,
I can ask him or simply do a fork of the complete project and then
cover it under the Apache license provided the author agrees
eanvalidation
annotations.
Additionally, we could use the autogenerated simpletype names maybe for
the Swagger2Feature as well to make it easier to extract field types
(definitions).
Best regards,
Johannes
Am 07.11.2016 um 23:52 schrieb J. Fiala:
Hi Sergey,
I think we should split the whole thi
Hi,
Thank you, moving the validationFeature to the endpoint did the job
perfectly!
Best regards,
Johannes
Am 24.10.2016 um 14:11 schrieb Sergey Beryozkin:
Or register the validation feature directly on the server endpoint
Sergey
On 24/10/16 13:10, Sergey Beryozkin wrote:
Hi
This is
Hi there,
Is automatic client-side beanvalidation supported somehow (currently
this is not mentioned in the docs)?
Maybe it would make sense to add this to the configuration, so this has
not to be done manually before calling the server?
Best regards,
Johannes
side bean
validation for the proxy clients as they have all the bean validation
annotations available...
Cheers, Sergey
On 24/10/16 14:47, J. Fiala wrote:
Hi there,
Is automatic client-side beanvalidation supported somehow (currently
this is not mentioned in the docs)?
Maybe it would make se
stify my position as much as I can.
Sometimes it is good to have a break in discussions which go too long,
think about the whole issue a bit more and then may be revisit it later
Thanks, Sergey
On 18/11/16 21:27, J. Fiala wrote:
Hi Sergey,
So far you can reference any simpletype at the WAD
Dear Sergey,
Here is a list of the configuration options (CLI-options) I added to
Swagger-Codegen language jaxrs-cxf to allow easy setup of a new server stub:
useJaxbAnnotations
Use JAXB annotations for XML (Default: false)
useBeanValidation
Use BeanValidation API
in 3.1.7 an issue was reported that
On 18/11/16 19:40, J. Fiala wrote:
Dear Sergey,
The Swagger-UI feature works perfectly at Spring Boot, but if I deploy
the application to e.g. Jboss EAP the link points to the Swagger-API
not to the Swagger-UI anymore (swagger-ui is bundled in the WAR
the new PR to move to a separate branch to get a clean master to get the
lastest updates :).
best regards,
Johannes
Am 08.11.2016 um 18:11 schrieb J. Fiala:
Hi Sergey,
Thx for all the feedback. I think this is a good idea - check what
other projects are doing / generating WADLs to see how we can
for validating
the entity only, .validateBean().
Sergey
On 14/11/16 21:52, Sergey Beryozkin wrote:
This Object is a proxy.
Please focus on validating the request parameters only. And simply
create a local final var with the same property
Sergey
On 14/11/16 21:35, J. Fiala wrote:
Dear Sergey,
Can you
interceptor.
However lets keep the whole wadl-to-java, Swagger, BeanValidation for
a separate conversation. We've already had 2 iterations so far :-) but
I'm ready for another one if you'd like.
Many thanks
Sergey
On 18/11/16 18:57, J. Fiala wrote:
Hi Sergey,
It was nice to meet you
11.11.2016 um 17:09 schrieb Sergey Beryozkin:
Hi Johannes.
You are doing something quite big there with Swagger CodeGen, thanks,
- unfortunately I'll miss next Friday presentations - but please show
you demo to me on Wed/Thursday, we'll find some time for sure
Thanks, Sergey
On 11/11/16 16:05, J
Dear Sergey,
Great, I added this for the next Swagger-Codegen release so Swagger-UI
can be activated with CLI options:
PR https://github.com/swagger-api/swagger-codegen/pull/4164
Best regards,
Johannes
Am 11.11.2016 um 16:33 schrieb Sergey Beryozkin:
Hi Johannes
On 11/11/16 14:58,
lients as they have all the bean validation
annotations available...
Cheers, Sergey
On 24/10/16 14:47, J. Fiala wrote:
Hi there,
Is automatic client-side beanvalidation supported somehow (currently
this is not mentioned in the docs)?
Maybe it would make sense to add this to the configurati
in an interceptor?
Or do I have to subclass ClientProxyImpl.java?
Best regards,
Johannes
Am 13.11.2016 um 20:45 schrieb J. Fiala:
Dear Sergey,
I tried to implement the BeanValidation for the client for outgoing
operations in an OutInterceptor.
I need to be able to validate the parameters for the method
Dear Sergey,
p.s. can you make the constants public for easy referencing?
Best regards,
Johannes
Am 14.11.2016 um 22:35 schrieb J. Fiala:
Dear Sergey,
Can you please also add the Object o (from public Object invoke(Object
o, Method m, Object[] params) throws Throwable) as "method.o
gards,
Johannes
Am 14.11.2016 um 13:08 schrieb Sergey Beryozkin:
Hi
I've updated ClientProxyImpl to pass them as a "method.parameters" CXF
Message property
Thanks, Sergey.
On 13/11/16 19:49, J. Fiala wrote:
Dear Sergey,
To be more specific, at ClientProxyImpl.java the Object[] params
Hi there,
I added configuration options for the various CXF features for the
CXF-server/client generator for Swagger-Codegen:
*) LoggingInterceptors
*) GzipInterceptors
*) BeanValidationFeature/Interceptors
*) SwaggerFeature (server)
*) WadlGenerator (server)
*) Spring-configuration (XML
79 matches
Mail list logo