Hi Aishwarya,

Got it. I think you may try out to write your own extensions, similar to 
http://cxf.apache.org/cxf-xjc-wsdlextension.html, we don't have an example for 
it but you may just look how other extensions are implemented 
(https://github.com/apache/cxf-xjc-utils/blob/master/wsdlextension/src/main/java/org/apache/cxf/xjc/wsdlextension/WSDLExtension.java).


For the WADL and Swagger Codegen:

https://github.com/swagger-api/swagger-codegen
https://github.com/LucyBot-Inc/api-spec-converter (haven't tried it but seems 
to work)

For the Swagger endpoints, please remove usePathBasedConfig (or set it to 
false).
Thanks.

Best Regards,
    Andriy Redko

AS> Hi Andriy,


AS> Thanks for the reply.


AS> 1) Generated Java classes from XSD


AS> XSD is a purely custom one. We generate Java classes from the XSD using the 
cxf xjc plugin.Is there anybway to
AS> customize the xjc plugin ( by extending or implementing a Java class 
specific to xjc or something) so that I can
AS> code to add the annotation on the generated classes. I wanna add @ApiModel 
on each model class and @ApiModelProperty
AS> on each property of  a model class. As u said, Swagger will be able to use 
the POJOs without the need for
AS> annotations. But in order to describe each property( a one-liner about each 
property) in the swagger UI, adding
AS> @ApiModelProperty is necessary I believe. Please correct me if I am 
wrong.Or could you tell me any approach where we
AS> can read java docs using the documentation tags of the XSD and show it in 
Swagger UI?Any other ideas you have will also be of much help to me. 


AS> 2) Generated REST API classes from WADL.


AS> Actually I am trying to use Cxf based "Swagger2Feature" class which is 
generating the Swagger UI. But the problem
AS> is we have defined 2 cxf server endpoints in our code and the Swagger UI is 
displaying APIs corresponding to only
AS> one server endpoint at any point of time. Could you please provide inputs 
on how to resolve this issue?


AS> Please provide me any reference links or examples for converting WADL to 
OpenAPI and about the Swagger Codegen
AS> library. So that I can try this option too if it will work in the case of 
multiple cxf server endpoints as well.


AS> Thanks,
AS> Aishwarya S

AS> On Fri, 7 Sep 2018, 8:30 am Aishwarya S, <[email protected]> wrote:



AS> On Fri, 7 Sep 2018, 8:29 am Aishwarya S, <[email protected]> wrote:




AS> On Fri, 7 Sep 2018, 7:01 am Andriy Redko, <[email protected]> wrote:

AS> Hi,

AS>  I am not aware of such plugins but here are some thoughts regarding your 
use cases.

 asgc>> 1. Generated Java classes from XSD

AS>  Not sure if it is possible. In general, Swagger is able to use POJOs 
without
AS>  the need to add annotations explicitly. Is it some kind of well-known / 
standardized
AS>  XSD schema? Or purely custom one?

 asgc>> 2. Generated REST API classes from WADL.

AS>  In general, Swagger-based integrations do not need annotations and could 
discover the
AS>  APIs just from the JAX-RS annotations (though the amount of details would 
be limited). 
AS>  Another option could be to convert WADL to OpenAPI 2.x / 3.x (there are 
tools to do that)
AS>  and use Swagger Codegen to generate classes (they will be annotated).

AS>  Best Regards,
AS>      Andriy Redko

 asgc>> Hi,

 asgc>> I am trying to find a way to add Swagger annotations like 
@ApiOperation, @ApiModel and @ApiModelProperty to

 asgc>> 1. Generated Java classes from XSD
 asgc>> 2. Generated REST API classes from WADL.

 asgc>> Is there any way to do it in CXF using the XJC or codegen plugin? 
Please help





Reply via email to