cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Fiala (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CXF-6965) CXF Swagger2Feature does not correctly support QueryParam("") and DataHandler
Date Sat, 09 Jul 2016 19:04:11 GMT

    [ https://issues.apache.org/jira/browse/CXF-6965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15369248#comment-15369248
] 

J. Fiala edited comment on CXF-6965 at 7/9/16 7:04 PM:
-------------------------------------------------------

I have also some comments regarding the WadlGenerator, maybe you can open a separate issue
for these?

h2. Issues for the WadlGenerator:

h3. 1. No bean-validation-support.
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: http://stackoverflow.com/questions/13968261/required-queryparam-in-jax-rs-and-what-to-do-in-their-absence).

For adding bean-validation-support to the complex types the JAXB processing / schema has to
be parsed/filtered.

h3. 2. Annotations in the interface are not parsed
(e.g. @Description, but also true for the bean-validation-annotation scanning for QueryParam
(see 1.))


h3. 3. Example for DataHandler not supported in WADL (pls move to separate issue for WadlGenerator):

{code}
@Consumes({ MediaType.MULTIPART_FORM_DATA })
	@Produces({ MediaType.APPLICATION_JSON })
	@POST
	@Path("/helloMultipart")
	public void helloMultipart(@Multipart(value= "payload" , type=MediaType.APPLICATION_OCTET_STREAM)
DataHandler handler) {

	}
{code}

is renderd in WADL (WRONG):
{code}
<resource path="/helloMultipart"><method name="POST"><request><representation
mediaType="application/x-www-form-urlencoded"/></request>
{code}

this would be the basic correct WADL rendering:
{code}
<resource path="/helloMultipart"><method name="POST"><request><representation
mediaType="multipart/form-data"/></request>
{code}

Which will become after wadl2java:
{code}
postHelloMultipart(MultipartBody body);
{code}

Of course it would be nice to have all the Multipart rendered correctly in WADL as well.

4.) @Description currently generates tags <doc></doc>, which are invalid for schemas.
The correct tags are <xs:annotation><xs:documentation>...</xs:documentation></xs:annotation>
This should be corrected.



was (Author: jfx):
I have also some comments regarding the WadlGenerator, maybe you can open a separate issue
for these?

h3. 1. No bean-validation-support.
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: http://stackoverflow.com/questions/13968261/required-queryparam-in-jax-rs-and-what-to-do-in-their-absence).

For adding bean-validation-support to the complex types the JAXB processing / schema has to
be parsed/filtered.

h3. 2. Annotations in the interface are not parsed
(e.g. @Description, but also true for the bean-validation-annotation scanning for QueryParam
(see 1.))


h3. 3. Example for DataHandler not supported in WADL (pls move to separate issue for WadlGenerator):

{code}
@Consumes({ MediaType.MULTIPART_FORM_DATA })
	@Produces({ MediaType.APPLICATION_JSON })
	@POST
	@Path("/helloMultipart")
	public void helloMultipart(@Multipart(value= "payload" , type=MediaType.APPLICATION_OCTET_STREAM)
DataHandler handler) {

	}
{code}

is renderd in WADL (WRONG):
{code}
<resource path="/helloMultipart"><method name="POST"><request><representation
mediaType="application/x-www-form-urlencoded"/></request>
{code}

this would be the basic correct WADL rendering:
{code}
<resource path="/helloMultipart"><method name="POST"><request><representation
mediaType="multipart/form-data"/></request>
{code}

Which will become after wadl2java:
{code}
postHelloMultipart(MultipartBody body);
{code}

Of course it would be nice to have all the Multipart rendered correctly in WADL as well.

4.) @Description currently generates tags <doc></doc>, which are invalid for schemas.
The correct tags are <xs:annotation><xs:documentation>...</xs:documentation></xs:annotation>
This should be corrected.


> CXF Swagger2Feature does not correctly support QueryParam("") and DataHandler
> -----------------------------------------------------------------------------
>
>                 Key: CXF-6965
>                 URL: https://issues.apache.org/jira/browse/CXF-6965
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>            Reporter: Sergey Beryozkin
>            Priority: Minor
>             Fix For: 3.2.0, 3.1.8
>
>
> See https://github.com/swagger-api/swagger-codegen/issues/2017#issuecomment-230426728



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message