[Java][Spring][Server] Issue #4680 (#6890)

* Issue #4680 correct values for enum with escaped double quotes

* Issue #4680 regenerate samples

* Issue #4680 remove new lines

* Issue #4680 fixed scripts

* Issue #4680 update samples under CentOS
This commit is contained in:
Maxim Zinchenko 2017-11-27 13:30:39 +03:00 committed by William Cheng
parent 088eef5927
commit a8642dbdfc
32 changed files with 66 additions and 60 deletions

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l java -o samples\client\petstore\java --library=okhttp-gson -DdateLibrary=joda,hideGenerationTimestamp=true
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l java -o samples\client\petstore\java --library=okhttp-gson -DdateLibrary=joda -DhideGenerationTimestamp=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l java -o samples\client\petstore\java -DdateLibrary=joda,hideGenerationTimestamp=true
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l java -o samples\client\petstore\java -DdateLibrary=joda -DhideGenerationTimestamp=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l java-play-framework -o samples\server\petstore\java-play-framework
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l java-play-framework -o samples\server\petstore\java-play-framework -DhideGenerationTimestamp=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l java-vertx -o samples\server\petstore\java-vertx\async -DvertxSwaggerRouterVersion=1.2.0
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l java-vertx -o samples\server\petstore\java-vertx\async -DvertxSwaggerRouterVersion=1.2.0 -DhideGenerationTimestamp=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l java-vertx -o samples\server\petstore\java-vertx\rx -DvertxSwaggerRouterVersion=1.2.0,rxInterface=true
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l java-vertx -o samples\server\petstore\java-vertx\rx -DvertxSwaggerRouterVersion=1.2.0 -DrxInterface=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l spring --library=spring-mvc -o samples\server\petstore\spring-mvc-j8-async -c bin\spring-mvc-petstore-j8-async.json
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l spring --library=spring-mvc -o samples\server\petstore\spring-mvc-j8-async -c bin\spring-mvc-petstore-j8-async.json -DhideGenerationTimestamp=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l spring --library=spring-mvc -o samples\server\petstore\spring-mvc
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -c bin\spring-mvc-petstore-server.json -l spring --library=spring-mvc -o samples\server\petstore\spring-mvc -DhideGenerationTimestamp=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l spring -o samples\server\petstore\springboot
set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l spring -o samples\server\petstore\springboot -DhideGenerationTimestamp=true
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -1 +1 @@
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}}
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],

View File

@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],
@ -722,8 +722,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "$",
"enum" : [ ">", "$" ]
"enum" : [ ">", "$" ],
"default" : "$"
}
}, {
"name" : "enum_form_string",
@ -741,8 +741,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "$",
"enum" : [ ">", "$" ]
"enum" : [ ">", "$" ],
"default" : "$"
}
}, {
"name" : "enum_header_string",
@ -760,8 +760,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "$",
"enum" : [ ">", "$" ]
"enum" : [ ">", "$" ],
"default" : "$"
}
}, {
"name" : "enum_query_string",

View File

@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],

View File

@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],

View File

@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],

View File

@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],

View File

@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -99,7 +99,7 @@ public class Order {
@JsonProperty("complete")
public Boolean getComplete() {
public Boolean isComplete() {
return complete;
}
public void setComplete(Boolean complete) {

View File

@ -18,8 +18,8 @@ public class Pet {
private Long id = null;
private Category category = null;
private String name = null;
private List<String> photoUrls = new ArrayList<String>();
private List<Tag> tags = new ArrayList<Tag>();
private List<String> photoUrls = new ArrayList<>();
private List<Tag> tags = new ArrayList<>();
public enum StatusEnum {

View File

@ -9,7 +9,7 @@
"email" : "apiteam@swagger.io"
},
"license" : {
"name" : "Apache 2.0",
"name" : "Apache-2.0",
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],
@ -173,6 +173,7 @@
"security" : [ {
"petstore_auth" : [ "write:pets", "read:pets" ]
} ],
"deprecated" : true,
"x-contentType" : "application/json",
"x-accepts" : "application/json"
}

View File

@ -1 +1 @@
2.2.3-SNAPSHOT
2.3.0-SNAPSHOT

View File

@ -99,7 +99,7 @@ public class Order {
@JsonProperty("complete")
public Boolean getComplete() {
public Boolean isComplete() {
return complete;
}
public void setComplete(Boolean complete) {

View File

@ -18,8 +18,8 @@ public class Pet {
private Long id = null;
private Category category = null;
private String name = null;
private List<String> photoUrls = new ArrayList<String>();
private List<Tag> tags = new ArrayList<Tag>();
private List<String> photoUrls = new ArrayList<>();
private List<Tag> tags = new ArrayList<>();
public enum StatusEnum {

View File

@ -9,7 +9,7 @@
"email" : "apiteam@swagger.io"
},
"license" : {
"name" : "Apache 2.0",
"name" : "Apache-2.0",
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],
@ -173,6 +173,7 @@
"security" : [ {
"petstore_auth" : [ "write:pets", "read:pets" ]
} ],
"deprecated" : true,
"x-contentType" : "application/json",
"x-accepts" : "application/json"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -141,7 +141,7 @@ public class Order {
@ApiModelProperty(value = "")
@JsonProperty("complete")
public Boolean getComplete() {
public Boolean isComplete() {
return complete;
}
public void setComplete(Boolean complete) {

View File

@ -9,7 +9,7 @@
"email" : "apiteam@swagger.io"
},
"license" : {
"name" : "Apache 2.0",
"name" : "Apache-2.0",
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
},
"collectionFormat" : "csv"
} ],
@ -173,6 +173,7 @@
"security" : [ {
"petstore_auth" : [ "write:pets", "read:pets" ]
} ],
"deprecated" : true,
"x-contentType" : "application/json",
"x-accepts" : "application/json"
}
@ -749,7 +750,7 @@
"title" : "Pet catehgry",
"description" : "A category for a pet",
"example" : {
"name" : "aeiou",
"name" : "name",
"id" : 6
},
"xml" : {
@ -790,14 +791,14 @@
"title" : "a User",
"description" : "A User who is purchasing from the pet store",
"example" : {
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"firstName" : "firstName",
"lastName" : "lastName",
"password" : "password",
"userStatus" : 6,
"phone" : "aeiou",
"phone" : "phone",
"id" : 0,
"email" : "aeiou",
"username" : "aeiou"
"email" : "email",
"username" : "username"
},
"xml" : {
"name" : "User"
@ -817,7 +818,7 @@
"title" : "Pet Tag",
"description" : "A tag for a pet",
"example" : {
"name" : "aeiou",
"name" : "name",
"id" : 1
},
"xml" : {
@ -868,15 +869,18 @@
"title" : "a Pet",
"description" : "A pet for sale in the pet store",
"example" : {
"photoUrls" : [ "aeiou" ],
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "aeiou",
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "aeiou",
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
@ -903,8 +907,8 @@
"description" : "Describes the result of uploading an image resource",
"example" : {
"code" : 0,
"type" : "aeiou",
"message" : "aeiou"
"type" : "type",
"message" : "message"
}
}
},