forked from loafle/openapi-generator-original
added resource, method stub for generator options
This commit is contained in:
parent
b4146d3f9c
commit
dadc85b6fd
@ -20,10 +20,15 @@ import org.slf4j.LoggerFactory;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class Generator {
|
public class Generator {
|
||||||
static Logger LOGGER = LoggerFactory.getLogger(Generator.class);
|
static Logger LOGGER = LoggerFactory.getLogger(Generator.class);
|
||||||
|
|
||||||
|
public static Map<String, String> getOptions(String language) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
CLIENT("client"),
|
CLIENT("client"),
|
||||||
SERVER("server");
|
SERVER("server");
|
||||||
|
@ -89,6 +89,26 @@ public class SwaggerResource {
|
|||||||
return Response.status(500).build();
|
return Response.status(500).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/clients/{language}")
|
||||||
|
@ApiOperation(
|
||||||
|
value = "Returns options for a client library",
|
||||||
|
response = String.class,
|
||||||
|
responseContainer = "map",
|
||||||
|
tags = "clients")
|
||||||
|
public Response getClientOptions(
|
||||||
|
@Context HttpServletRequest request,
|
||||||
|
@ApiParam(value = "The target language for the client library", required = true) @PathParam("language") String language) throws Exception {
|
||||||
|
|
||||||
|
Map<String, String> opts = Generator.getOptions(language);
|
||||||
|
|
||||||
|
if (opts != null) {
|
||||||
|
return Response.ok().entity(opts).build();
|
||||||
|
} else {
|
||||||
|
return Response.status(404).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/clients")
|
@Path("/clients")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user