forked from loafle/openapi-generator-original
improved definitions, messages, fixed init params
This commit is contained in:
@@ -29,6 +29,7 @@ public class GeneratorInput {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
@ApiModelProperty(example = "http://petstore.swagger.io/v2/swagger.json")
|
||||
public String getSwaggerUrl() {
|
||||
return swaggerUrl;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package io.swagger.generator.model;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class ResponseCode {
|
||||
private String code;
|
||||
private String link;
|
||||
@@ -12,6 +14,7 @@ public class ResponseCode {
|
||||
setLink(link);
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "File download code", example = "d40029be-eda6-4d62-b1ef-d05e2e91a72a")
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
@@ -20,6 +23,7 @@ public class ResponseCode {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "URL for fetching the generated client", example = "http://generator.swagger.io:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a")
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,10 @@ public class Generator {
|
||||
throw new BadRequestException(400, "No options were supplied");
|
||||
}
|
||||
JsonNode node = opts.getSpec();
|
||||
if(node != null && "{}".equals(node.toString())) {
|
||||
LOGGER.debug("ignoring empty spec");
|
||||
node = null;
|
||||
}
|
||||
Swagger swagger;
|
||||
if (node == null) {
|
||||
if (opts.getSwaggerUrl() != null) {
|
||||
|
||||
@@ -26,14 +26,6 @@
|
||||
<param-name>jersey.config.server.wadl.disableWadl</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>generator.host</param-name>
|
||||
<param-value>localhost:8001</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>generator.protocol</param-name>
|
||||
<param-value>http</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
@@ -50,6 +42,14 @@
|
||||
<servlet-name>Bootstrap</servlet-name>
|
||||
<servlet-class>io.swagger.generator.Bootstrap</servlet-class>
|
||||
<load-on-startup>2</load-on-startup>
|
||||
<init-param>
|
||||
<param-name>generator.host</param-name>
|
||||
<param-value>localhost:8001</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>generator.protocol</param-name>
|
||||
<param-value>http</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
<filter-mapping>
|
||||
<filter-name>ApiOriginFilter</filter-name>
|
||||
|
||||
Reference in New Issue
Block a user