Swagger Version 2.0.X annotations are not supported
See original GitHub issueI am using the following versions of swagger and swagger-maven-plugin. You can see below my configuration and the swagger.json file. It is clearly missing many of the fields defined in the annotation.
Is it possible that the current version of the maven plugin does not support Version 2? Is there any plans to support them in the future?
swagger-maven-plugin 3.1.7 swagger-core 2.0.2
pom.xml
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-core</artifactId>
<scope>compile</scope>
<version>2.0.2</version>
</dependency>
<profile>
<id>apidoc</id>
<build>
<plugins>
<plugin>
<groupId>com.github.kongchen</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>3.1.7</version>
<configuration>
<apiSources>
<apiSource>
<info>
<title>x API</title>
<version>${project.version}</version>
<description>
Here you will find all the endpoints provided by the platform and
how to interact with them.
</description>
<contact>
<name>Choesang</name>
<email>choesang@x.com</email>
<url>http://www.x.com</url>
</contact>
</info>
<schemes>
<scheme>http</scheme>
<scheme>https</scheme>
</schemes>
<locations>com.x.platform.api</locations>
<host>localhost:8080</host>
<basePath>/platform-web/api</basePath>
<templatePath>${basedir}/src/main/resources/swagger/strapdown.html.hbs
</templatePath>
<outputPath>${project.build.directory}/apidocs/strapdown.html</outputPath>
<swaggerDirectory>${project.build.directory}/apidocs</swaggerDirectory>
</apiSource>
</apiSources>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<activation>
<property>
<name>!no-swagger</name>
</property>
</activation>
</profile>
Resource class
@POST
@Path("/{id}/stop")
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Stop job with given id", responses = {
@ApiResponse(responseCode = "202", description = "Successfully stopped the job"),
@ApiResponse(responseCode = "500", description = "Internal messaging error"),
@ApiResponse(responseCode = "404", description = "Job could not be found,Job-Id")
})
public Response stopJob(@Context final UriInfo uriInfo,
@Parameter(description = "jobId", required = true) @PathParam("id") final String jobId) {
return Response.accepted().location(uriInfo.getRequestUri()).build();
}
swagger.json
"/jobs/{id}/stop" : {
"post" : {
"operationId" : "stopJob",
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"responses" : {
"default" : {
"description" : "successful operation"
}
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
OpenAPI Specification - Version 2.0 - Swagger
Version 2.0 specification defines a set of files required to describe an API. These files can then be used by the Swagger-UI project...
Read more >java - Swagger 2 Issue - Spring Boot - Stack Overflow
The springfox plugin is not compatible with PathPattern-based matching in Spring MVC which has replaced the previous Ant-based matching in ...
Read more >Guide - 7.10.12.2 Migrating to OpenApi 3.0 and Swagger 2.X ...
Product To Version ... document shows major differences between swagger-annotations 1.5.x and 2.x. ... Only if the decorated getter is not an array...
Read more >Solved: Question about Swagger 2.X Annotations
May I use the @RequestBody annotation to. ... Is swagger definition available? ... 2.JPG. I use this code ,but not working.
Read more >Using OpenAPI and Swagger UI - Quarkus
There are some MicroProfile OpenAPI annotations which describe global API ... The value / is not allowed as it blocks the application from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, this would be great to have for us as well! 😃
I just saw that the current swagger-maven-plugin is built on swagger 1.5.18. Are there any plans to support the latest swagger 2.0.x ?