I'm using 'jaxrs-spec' in order to generate server stubs that are deployed in a JEE server (JBoss Wildfy).
As I need my generated model pojos to be annotated with JAXB annotations (like @XmlRootElement), I have enabled the 'withXml" option. This is working very fine with "Java" language, but does not seem possible with "jaxrs-spec". Right ??
As a result, because of the missing JAXB annotations, jaxrs responses of my web services are producing incorrect xml (ie without namespace declaration) although xml namespace is defined in the yaml file.
Did someone already manage to generate jaxb annotations in combination with 'jaxrs-spec' language ? Any workaround ?
Bernard.
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.4.0</version>
...
<configuration>
...
<language>jaxrs-spec</language>
<generateModels>true</generateModels>
<withXml>true</withXml>
...
</configuration>
Example of generated model:
@ApiModel
public class ReadingRequest {..}
Expected:
@ApiModel
@XmlRootElement(namespace="...") // <= missing !
public class ReadingRequest {..}