forked from loafle/openapi-generator-original
Replace ^M with new line (\r) in mustache template (#3865)
* fix jaxrs line break * fix java gradle bat line break * fix scala gradle line break * fix undertow crt line break * fix spring line break * fix undertow line break in pom * rollback undertwo petstore to use petstore.yaml
This commit is contained in:
@@ -1,36 +1,36 @@
|
||||
package io.swagger;
|
||||
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.ExitCodeGenerator;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableSwagger2
|
||||
@ComponentScan(basePackages = "io.swagger")
|
||||
public class Swagger2SpringBoot implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... arg0) throws Exception {
|
||||
if (arg0.length > 0 && arg0[0].equals("exitcode")) {
|
||||
throw new ExitException();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new SpringApplication(Swagger2SpringBoot.class).run(args);
|
||||
}
|
||||
|
||||
class ExitException extends RuntimeException implements ExitCodeGenerator {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public int getExitCode() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
package io.swagger;
|
||||
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.ExitCodeGenerator;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableSwagger2
|
||||
@ComponentScan(basePackages = "io.swagger")
|
||||
public class Swagger2SpringBoot implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... arg0) throws Exception {
|
||||
if (arg0.length > 0 && arg0[0].equals("exitcode")) {
|
||||
throw new ExitException();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new SpringApplication(Swagger2SpringBoot.class).run(args);
|
||||
}
|
||||
|
||||
class ExitException extends RuntimeException implements ExitCodeGenerator {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public int getExitCode() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public interface FakeApi {
|
||||
,
|
||||
|
||||
|
||||
@ApiParam(value = "None", required=true ) @RequestPart(value="string", required=true) String string
|
||||
@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter
|
||||
,
|
||||
|
||||
|
||||
@@ -81,6 +81,10 @@ public interface FakeApi {
|
||||
,
|
||||
|
||||
|
||||
@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string
|
||||
,
|
||||
|
||||
|
||||
@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary
|
||||
,
|
||||
|
||||
@@ -108,13 +112,13 @@ public interface FakeApi {
|
||||
ResponseEntity<Void> testEnumParameters(
|
||||
|
||||
|
||||
@ApiParam(value = "Form parameter enum test (string array)" ) @RequestPart(value="enumFormStringArray", required=false) List<String> enumFormStringArray
|
||||
@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List<String> enumFormStringArray
|
||||
,
|
||||
|
||||
|
||||
@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString
|
||||
,
|
||||
@ApiParam(value = "Header parameter enum test (string array)" ) @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray
|
||||
@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray
|
||||
|
||||
|
||||
,
|
||||
|
||||
@@ -46,7 +46,7 @@ public class FakeApiController implements FakeApi {
|
||||
|
||||
|
||||
|
||||
@ApiParam(value = "None", required=true ) @RequestPart(value="string", required=true) String string
|
||||
@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter
|
||||
,
|
||||
|
||||
|
||||
@@ -76,6 +76,11 @@ public class FakeApiController implements FakeApi {
|
||||
|
||||
|
||||
|
||||
@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string
|
||||
,
|
||||
|
||||
|
||||
|
||||
@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary
|
||||
,
|
||||
|
||||
@@ -100,7 +105,7 @@ public class FakeApiController implements FakeApi {
|
||||
public ResponseEntity<Void> testEnumParameters(
|
||||
|
||||
|
||||
@ApiParam(value = "Form parameter enum test (string array)" ) @RequestPart(value="enumFormStringArray", required=false) List<String> enumFormStringArray
|
||||
@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List<String> enumFormStringArray
|
||||
,
|
||||
|
||||
|
||||
@@ -108,7 +113,7 @@ public class FakeApiController implements FakeApi {
|
||||
@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString
|
||||
,
|
||||
|
||||
@ApiParam(value = "Header parameter enum test (string array)" ) @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray
|
||||
@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray
|
||||
|
||||
|
||||
,
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package io.swagger.configuration;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* Home redirection to swagger api documentation
|
||||
*/
|
||||
@Controller
|
||||
public class HomeController {
|
||||
@RequestMapping(value = "/")
|
||||
public String index() {
|
||||
System.out.println("swagger-ui.html");
|
||||
return "redirect:swagger-ui.html";
|
||||
}
|
||||
}
|
||||
package io.swagger.configuration;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* Home redirection to swagger api documentation
|
||||
*/
|
||||
@Controller
|
||||
public class HomeController {
|
||||
@RequestMapping(value = "/")
|
||||
public String index() {
|
||||
System.out.println("swagger-ui.html");
|
||||
return "redirect:swagger-ui.html";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Model200Response {
|
||||
private Integer name = null;
|
||||
|
||||
@JsonProperty("class")
|
||||
private String PropertyClass = null;
|
||||
private String propertyClass = null;
|
||||
|
||||
public Model200Response name(Integer name) {
|
||||
this.name = name;
|
||||
@@ -42,22 +42,22 @@ public class Model200Response {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Model200Response PropertyClass(String PropertyClass) {
|
||||
this.PropertyClass = PropertyClass;
|
||||
public Model200Response propertyClass(String propertyClass) {
|
||||
this.propertyClass = propertyClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get PropertyClass
|
||||
* @return PropertyClass
|
||||
* Get propertyClass
|
||||
* @return propertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getPropertyClass() {
|
||||
return PropertyClass;
|
||||
return propertyClass;
|
||||
}
|
||||
|
||||
public void setPropertyClass(String PropertyClass) {
|
||||
this.PropertyClass = PropertyClass;
|
||||
public void setPropertyClass(String propertyClass) {
|
||||
this.propertyClass = propertyClass;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,12 +71,12 @@ public class Model200Response {
|
||||
}
|
||||
Model200Response _200Response = (Model200Response) o;
|
||||
return Objects.equals(this.name, _200Response.name) &&
|
||||
Objects.equals(this.PropertyClass, _200Response.PropertyClass);
|
||||
Objects.equals(this.propertyClass, _200Response.propertyClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, PropertyClass);
|
||||
return Objects.hash(name, propertyClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,7 +85,7 @@ public class Model200Response {
|
||||
sb.append("class Model200Response {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n");
|
||||
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user