cancel
Showing results for 
Search instead for 
Did you mean: 

How to send specific annotation to swagger generated model class..?

Highlighted
New Member

How to send specific annotation to swagger generated model class..?

Hi,

I want to add annotation to the generated model class like this with swagger code generator. 

@JacksonXmlRootElement(localName ="response")

public class Response {

}

I am generating server side code using swagger 2.0 to work with application/xml request and response i.e. content-type and accept headers as application/xml but the root of response is coming as "Response" but I want it as "response".
If I add @JacksonXmlRootElement(localName ="response") manually  as above, response is generating correctly. 
But when I build the code again then this file is updated and my annotation is lost.
 
so, I want that this or whatever annotation required to produce the root element of xml as I want , should be generated by swagger code generator itself.
 

 

 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors
Top Kudoed Posts