actan actan -4 years ago 144
Java Question

why swagger-maven-plugin changed my output to "application/xhtml+xml"?

I am new to swagger-maven-plugin and I added it to pom.xml,
the swagger.json was generated but all my REST api is not working anymore

I found that in the response header "content type" was changed to application/xhtml+xml
and all former returned json data now became xml
like

<JSONObject xmlns=""><preferences><booking><qualityManual></qualityManual>


while before it was

{"preferences":{"booking":{"qualityManual":{},


can anyone help? Did I mis-configed something?

I am using version 3.1.4

Answer Source

The cause is I shouldn't add below to pom file:

<dependency>
<groupId>com.github.kongchen</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>3.1.4</version>
</dependency>

while they shouldn't be there and actually I just need to config the plugin in the plugin section.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download