forked from loafle/openapi-generator-original
updated online version, added tag example
This commit is contained in:
parent
c82dfa3a64
commit
e5c70d5961
@ -10,7 +10,7 @@
|
|||||||
<artifactId>swagger-generator</artifactId>
|
<artifactId>swagger-generator</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<name>swagger-generator</name>
|
<name>swagger-generator</name>
|
||||||
<version>1.0.0</version>
|
<version>2.1.3-M1-SNAPSHOT</version>
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src/main/java</sourceDirectory>
|
<sourceDirectory>src/main/java</sourceDirectory>
|
||||||
<plugins>
|
<plugins>
|
||||||
@ -232,7 +232,7 @@
|
|||||||
<zip-version>1.3.2</zip-version>
|
<zip-version>1.3.2</zip-version>
|
||||||
<jetty-version>9.0.7.v20131107</jetty-version>
|
<jetty-version>9.0.7.v20131107</jetty-version>
|
||||||
<jersey2-version>2.4.1</jersey2-version>
|
<jersey2-version>2.4.1</jersey2-version>
|
||||||
<swagger-core-version>1.5.1-M1</swagger-core-version>
|
<swagger-core-version>1.5.2-M1</swagger-core-version>
|
||||||
|
|
||||||
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>
|
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>
|
||||||
<scala-version>2.10.0</scala-version>
|
<scala-version>2.10.0</scala-version>
|
||||||
|
@ -36,7 +36,8 @@ public class SwaggerResource {
|
|||||||
@Path("/download/{fileId}")
|
@Path("/download/{fileId}")
|
||||||
@Produces({"application/zip"})
|
@Produces({"application/zip"})
|
||||||
@ApiOperation(value = "Downloads a pre-generated file",
|
@ApiOperation(value = "Downloads a pre-generated file",
|
||||||
response = String.class)
|
response = String.class,
|
||||||
|
tags = {@Tag(value = "clients"), @Tag(value = "servers")})
|
||||||
public Response downloadFile(@PathParam("fileId") String fileId) throws Exception {
|
public Response downloadFile(@PathParam("fileId") String fileId) throws Exception {
|
||||||
Generated g = fileMap.get(fileId);
|
Generated g = fileMap.get(fileId);
|
||||||
System.out.println("looking for fileId " + fileId);
|
System.out.println("looking for fileId " + fileId);
|
||||||
@ -59,7 +60,9 @@ public class SwaggerResource {
|
|||||||
@Path("/clients/{language}")
|
@Path("/clients/{language}")
|
||||||
@Produces({"application/zip", "application/json"})
|
@Produces({"application/zip", "application/json"})
|
||||||
@ApiOperation(
|
@ApiOperation(
|
||||||
value = "Generates a client library based on the config")
|
value = "Generates a client library based on the config",
|
||||||
|
response = ResponseCode.class,
|
||||||
|
tags = {@Tag(value = "clients", description = "client operations")})
|
||||||
public Response generateClient(
|
public Response generateClient(
|
||||||
@ApiParam(value = "The target language for the client library", allowableValues = "android,java,php,objc,docs", required = true) @PathParam("language") String language,
|
@ApiParam(value = "The target language for the client library", allowableValues = "android,java,php,objc,docs", required = true) @PathParam("language") String language,
|
||||||
@ApiParam(value = "Configuration for building the client library", required = true) GeneratorInput opts) throws Exception {
|
@ApiParam(value = "Configuration for building the client library", required = true) GeneratorInput opts) throws Exception {
|
||||||
@ -85,7 +88,8 @@ public class SwaggerResource {
|
|||||||
@Path("/clients")
|
@Path("/clients")
|
||||||
@ApiOperation(value = "Gets languages supported by the client generator",
|
@ApiOperation(value = "Gets languages supported by the client generator",
|
||||||
response = String.class,
|
response = String.class,
|
||||||
responseContainer = "List")
|
responseContainer = "List",
|
||||||
|
tags = {@Tag(value = "clients", description = "client operations")})
|
||||||
public Response clientOptions() {
|
public Response clientOptions() {
|
||||||
String[] languages = new String[clients.size()];
|
String[] languages = new String[clients.size()];
|
||||||
languages = clients.toArray(languages);
|
languages = clients.toArray(languages);
|
||||||
@ -96,7 +100,8 @@ public class SwaggerResource {
|
|||||||
@Path("/servers")
|
@Path("/servers")
|
||||||
@ApiOperation(value = "Gets languages supported by the server generator",
|
@ApiOperation(value = "Gets languages supported by the server generator",
|
||||||
response = String.class,
|
response = String.class,
|
||||||
responseContainer = "List")
|
responseContainer = "List",
|
||||||
|
tags = {@Tag(value = "servers", description = "server operations")})
|
||||||
public Response serverOptions() {
|
public Response serverOptions() {
|
||||||
String[] languages = new String[servers.size()];
|
String[] languages = new String[servers.size()];
|
||||||
languages = servers.toArray(languages);
|
languages = servers.toArray(languages);
|
||||||
@ -106,7 +111,8 @@ public class SwaggerResource {
|
|||||||
@POST
|
@POST
|
||||||
@Path("/servers/{framework}")
|
@Path("/servers/{framework}")
|
||||||
@ApiOperation(value = "Generates a server library for the supplied server framework",
|
@ApiOperation(value = "Generates a server library for the supplied server framework",
|
||||||
notes = "The model representing this is not accurate, it needs to contain a consolidated JSON structure")
|
response = ResponseCode.class,
|
||||||
|
tags = {@Tag(value = "servers", description = "server operations")})
|
||||||
public Response generateServerForLanguage(
|
public Response generateServerForLanguage(
|
||||||
@ApiParam(value = "framework", allowableValues = "jaxrs,nodejs", required = true) @PathParam("framework") String framework,
|
@ApiParam(value = "framework", allowableValues = "jaxrs,nodejs", required = true) @PathParam("framework") String framework,
|
||||||
@ApiParam(value = "parameters", required = true) GeneratorInput opts)
|
@ApiParam(value = "parameters", required = true) GeneratorInput opts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user