Improve ensure-up-to-date script (#1362)

* improve ensure-up-to-date script

* trigger build failure

* use exit 1 instead

* fix build failure

* update samples
This commit is contained in:
William Cheng 2018-11-02 15:38:34 +08:00 committed by GitHub
parent ecff8b5d00
commit 36991a4e14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 158 additions and 151 deletions

0
bin/mysql-schema-petstore.sh Normal file → Executable file
View File

0
bin/springboot-virtualan-petstore-server.sh Normal file → Executable file
View File

View File

@ -10,34 +10,43 @@ echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
sleep 5
# LIST OF SCRIPTS:
./bin/openapi3/ruby-client-petstore.sh > /dev/null 2>&1
./bin/java-petstore-all.sh > /dev/null 2>&1
./bin/java-jaxrs-petstore-server-all.sh > /dev/null 2>&1
./bin/openapi3/jaxrs-jersey-petstore.sh > /dev/null 2>&1
./bin/spring-all-pestore.sh > /dev/null 2>&1
./bin/kotlin-client-petstore.sh > /dev/null 2>&1
./bin/kotlin-client-string.sh > /dev/null 2>&1
./bin/kotlin-client-threetenbp.sh > /dev/null 2>&1
./bin/kotlin-server-petstore.sh > /dev/null 2>&1
./bin/mysql-schema-petstore.sh > /dev/null 2>&1
./bin/php-petstore.sh > /dev/null 2>&1
./bin/php-silex-petstore-server.sh > /dev/null 2>&1
./bin/php-symfony-petstore.sh > /dev/null 2>&1
./bin/php-lumen-petstore-server.sh > /dev/null 2>&1
./bin/php-slim-server-petstore.sh > /dev/null 2>&1
./bin/php-ze-ph-petstore-server.sh > /dev/null 2>&1
./bin/openapi3/php-petstore.sh > /dev/null 2>&1
./bin/typescript-angular-petstore-all.sh > /dev/null 2>&1
./bin/typescript-fetch-petstore-all.sh > /dev/null 2>&1
./bin/typescript-node-petstore-all.sh > /dev/null 2>&1
./bin/typescript-inversify-petstore.sh > /dev/null 2>&1
./bin/rust-server-petstore.sh > /dev/null 2>&1
./bin/haskell-http-client-petstore.sh > /dev/null 2>&1
./bin/csharp-petstore.sh > /dev/null 2>&1
./bin/meta-codegen.sh > /dev/null 2>&1
./bin/utils/export_docs_generators.sh > /dev/null 2>&1
./bin/go-petstore.sh > /dev/null 2>&1
./bin/go-gin-petstore-server.sh > /dev/null 2>&1
declare -a scripts=("./bin/openapi3/ruby-client-petstore.sh"
"./bin/java-petstore-all.sh"
"./bin/java-jaxrs-petstore-server-all.sh"
"./bin/openapi3/jaxrs-jersey-petstore.sh"
"./bin/spring-all-pestore.sh"
"./bin/kotlin-client-petstore.sh"
"./bin/kotlin-client-string.sh"
"./bin/kotlin-client-threetenbp.sh"
"./bin/kotlin-server-petstore.sh"
"./bin/mysql-schema-petstore.sh"
"./bin/php-petstore.sh"
"./bin/php-silex-petstore-server.sh"
"./bin/php-symfony-petstore.sh"
"./bin/php-lumen-petstore-server.sh"
"./bin/php-slim-server-petstore.sh"
"./bin/php-ze-ph-petstore-server.sh"
"./bin/openapi3/php-petstore.sh"
"./bin/typescript-angular-petstore-all.sh"
"./bin/typescript-fetch-petstore-all.sh"
"./bin/typescript-node-petstore-all.sh"
"./bin/typescript-inversify-petstore.sh"
"./bin/rust-server-petstore.sh"
"./bin/haskell-http-client-petstore.sh"
"./bin/csharp-petstore.sh"
"./bin/meta-codegen.sh"
"./bin/utils/export_docs_generators.sh"
"./bin/go-petstore.sh"
"./bin/go-gin-petstore-server.sh")
for script in "${scripts[@]}"; do
if eval $script > /dev/null 2>&1; then
echo "Executed $script successfully!"
else
echo "ERROR: Failed to run $script"
exit 1
fi
done
# Check:
if [ -n "$(git status --porcelain)" ]; then

View File

@ -1 +1 @@
3.3.0-SNAPSHOT
3.3.3-SNAPSHOT

View File

@ -106,7 +106,7 @@ CREATE TABLE IF NOT EXISTS `Cat` (
CREATE TABLE IF NOT EXISTS `Category` (
`id` BIGINT DEFAULT NULL,
`name` TEXT DEFAULT NULL
`name` TEXT NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--

View File

@ -1 +1 @@
3.3.0-SNAPSHOT
3.3.3-SNAPSHOT

View File

@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.3-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@ -8,8 +8,10 @@ import java.io.IOException;
public class ApiUtil {
public static void setExampleResponse(NativeWebRequest req, String contentType, String example) {
try {
req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType);
req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example);
HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class);
res.setCharacterEncoding("UTF-8");
res.addHeader("Content-Type", contentType);
res.getWriter().print(example);
} catch (IOException e) {
throw new RuntimeException(e);
}

View File

@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.3-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@ -55,14 +55,6 @@ public interface FakeApi {
produces = { "*/*" },
method = RequestMethod.POST)
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
ApiUtil.setExampleResponse(request, "*/*", "null");
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@ -97,14 +89,6 @@ public interface FakeApi {
produces = { "*/*" },
method = RequestMethod.POST)
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
ApiUtil.setExampleResponse(request, "*/*", "null");
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@ -118,14 +102,6 @@ public interface FakeApi {
produces = { "*/*" },
method = RequestMethod.POST)
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
ApiUtil.setExampleResponse(request, "*/*", "null");
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@ -189,7 +165,7 @@ public interface FakeApi {
@RequestMapping(value = "/fake",
consumes = { "application/x-www-form-urlencoded" },
method = RequestMethod.POST)
default ResponseEntity<Void> testEndpointParameters(@ApiParam(value = "None", required=true, defaultValue="null") @RequestParam(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true, defaultValue="null") @RequestParam(value="double", required=true) Double _double,@ApiParam(value = "None", required=true, defaultValue="null") @RequestParam(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true, defaultValue="null") @RequestParam(value="byte", required=true) byte[] _byte,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="integer", required=false) Integer integer,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="int32", required=false) Integer int32,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="int64", required=false) Long int64,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="float", required=false) Float _float,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="string", required=false) String string,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile binary,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="date", required=false) LocalDate date,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="password", required=false) String password,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="callback", required=false) String paramCallback) {
default ResponseEntity<Void> testEndpointParameters(@ApiParam(value = "None", required=true) @RequestParam(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestParam(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestParam(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestParam(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestParam(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestParam(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestParam(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestParam(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestParam(value="string", required=false) String string,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile binary,@ApiParam(value = "None") @RequestParam(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestParam(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestParam(value="password", required=false) String password,@ApiParam(value = "None") @RequestParam(value="callback", required=false) String paramCallback) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@ -203,7 +179,19 @@ public interface FakeApi {
@RequestMapping(value = "/fake",
consumes = { "application/x-www-form-urlencoded" },
method = RequestMethod.GET)
default ResponseEntity<Void> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @RequestParam(value="enum_form_string_array", required=false) List<String> enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestParam(value="enum_form_string", required=false) String enumFormString) {
default ResponseEntity<Void> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $", defaultValue="new ArrayList<>()") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $", defaultValue = "new ArrayList<>()") @Valid @RequestParam(value = "enum_query_string_array", required = false, defaultValue="new ArrayList<>()") List<String> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @RequestParam(value="enum_form_string_array", required=false) List<String> enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestParam(value="enum_form_string", required=false) String enumFormString) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@ApiVirtual
@ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Someting wrong") })
@RequestMapping(value = "/fake",
method = RequestMethod.DELETE)
default ResponseEntity<Void> testGroupParameters(@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@ -229,7 +217,7 @@ public interface FakeApi {
@RequestMapping(value = "/fake/jsonFormData",
consumes = { "application/x-www-form-urlencoded" },
method = RequestMethod.GET)
default ResponseEntity<Void> testJsonFormData(@ApiParam(value = "field1", required=true, defaultValue="null") @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true, defaultValue="null") @RequestParam(value="param2", required=true) String param2) {
default ResponseEntity<Void> testJsonFormData(@ApiParam(value = "field1", required=true) @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestParam(value="param2", required=true) String param2) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@ -248,7 +236,7 @@ public interface FakeApi {
produces = { "application/json" },
consumes = { "multipart/form-data" },
method = RequestMethod.POST)
default ResponseEntity<ModelApiResponse> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) {
default ResponseEntity<ModelApiResponse> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {

View File

@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.3-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.3-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@ -88,11 +88,11 @@ public interface PetApi {
@RequestMapping(value = "/pet/findByStatus",
produces = { "application/xml", "application/json" },
method = RequestMethod.GET)
default ResponseEntity<List<Pet>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List<String> status) {
default ResponseEntity<List<Pet>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold", defaultValue = "new ArrayList<>()") @Valid @RequestParam(value = "status", required = true, defaultValue="new ArrayList<>()") List<String> status) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
@ -119,11 +119,11 @@ public interface PetApi {
@RequestMapping(value = "/pet/findByTags",
produces = { "application/xml", "application/json" },
method = RequestMethod.GET)
default ResponseEntity<List<Pet>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags) {
default ResponseEntity<List<Pet>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true, defaultValue = "new ArrayList<>()") @Valid @RequestParam(value = "tags", required = true, defaultValue="new ArrayList<>()") List<String> tags) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
@ -152,7 +152,7 @@ public interface PetApi {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
@ -198,7 +198,7 @@ public interface PetApi {
@RequestMapping(value = "/pet/{petId}",
consumes = { "application/x-www-form-urlencoded" },
method = RequestMethod.POST)
default ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet", defaultValue="null") @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet", defaultValue="null") @RequestParam(value="status", required=false) String status) {
default ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) String status) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@ -217,7 +217,7 @@ public interface PetApi {
produces = { "application/json" },
consumes = { "multipart/form-data" },
method = RequestMethod.POST)
default ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) {
default ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {

View File

@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.3-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@ -1,5 +1,5 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.3-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@ -22,7 +22,7 @@ import javax.validation.constraints.*;
public class Animal {
@JsonProperty("className")
private String className = null;
private String className;
@JsonProperty("color")
private String color = "red";

View File

@ -14,22 +14,22 @@ import javax.validation.constraints.*;
public class Capitalization {
@JsonProperty("smallCamel")
private String smallCamel = null;
private String smallCamel;
@JsonProperty("CapitalCamel")
private String capitalCamel = null;
private String capitalCamel;
@JsonProperty("small_Snake")
private String smallSnake = null;
private String smallSnake;
@JsonProperty("Capital_Snake")
private String capitalSnake = null;
private String capitalSnake;
@JsonProperty("SCA_ETH_Flow_Points")
private String scAETHFlowPoints = null;
private String scAETHFlowPoints;
@JsonProperty("ATT_NAME")
private String ATT_NAME = null;
private String ATT_NAME;
public Capitalization smallCamel(String smallCamel) {
this.smallCamel = smallCamel;

View File

@ -15,7 +15,7 @@ import javax.validation.constraints.*;
public class Cat extends Animal {
@JsonProperty("declawed")
private Boolean declawed = null;
private Boolean declawed;
public Cat declawed(Boolean declawed) {
this.declawed = declawed;

View File

@ -14,10 +14,10 @@ import javax.validation.constraints.*;
public class Category {
@JsonProperty("id")
private Long id = null;
private Long id;
@JsonProperty("name")
private String name = null;
private String name = "default-name";
public Category id(Long id) {
this.id = id;
@ -48,7 +48,8 @@ public class Category {
* Get name
* @return name
**/
@ApiModelProperty(value = "")
@ApiModelProperty(required = true, value = "")
@NotNull
public String getName() {

View File

@ -15,7 +15,7 @@ import javax.validation.constraints.*;
public class ClassModel {
@JsonProperty("_class")
private String propertyClass = null;
private String propertyClass;
public ClassModel propertyClass(String propertyClass) {
this.propertyClass = propertyClass;

View File

@ -14,7 +14,7 @@ import javax.validation.constraints.*;
public class Client {
@JsonProperty("client")
private String client = null;
private String client;
public Client client(String client) {
this.client = client;

View File

@ -15,7 +15,7 @@ import javax.validation.constraints.*;
public class Dog extends Animal {
@JsonProperty("breed")
private String breed = null;
private String breed;
public Dog breed(String breed) {
this.breed = breed;

View File

@ -48,7 +48,7 @@ public class EnumArrays {
}
@JsonProperty("just_symbol")
private JustSymbolEnum justSymbol = null;
private JustSymbolEnum justSymbol;
/**
* Gets or Sets arrayEnum

View File

@ -49,7 +49,7 @@ public class EnumTest {
}
@JsonProperty("enum_string")
private EnumStringEnum enumString = null;
private EnumStringEnum enumString;
/**
* Gets or Sets enumStringRequired
@ -85,7 +85,7 @@ public class EnumTest {
}
@JsonProperty("enum_string_required")
private EnumStringRequiredEnum enumStringRequired = null;
private EnumStringRequiredEnum enumStringRequired;
/**
* Gets or Sets enumInteger
@ -119,7 +119,7 @@ public class EnumTest {
}
@JsonProperty("enum_integer")
private EnumIntegerEnum enumInteger = null;
private EnumIntegerEnum enumInteger;
/**
* Gets or Sets enumNumber
@ -153,7 +153,7 @@ public class EnumTest {
}
@JsonProperty("enum_number")
private EnumNumberEnum enumNumber = null;
private EnumNumberEnum enumNumber;
@JsonProperty("outerEnum")
private OuterEnum outerEnum = null;

View File

@ -19,43 +19,43 @@ import javax.validation.constraints.*;
public class FormatTest {
@JsonProperty("integer")
private Integer integer = null;
private Integer integer;
@JsonProperty("int32")
private Integer int32 = null;
private Integer int32;
@JsonProperty("int64")
private Long int64 = null;
private Long int64;
@JsonProperty("number")
private BigDecimal number = null;
private BigDecimal number;
@JsonProperty("float")
private Float _float = null;
private Float _float;
@JsonProperty("double")
private Double _double = null;
private Double _double;
@JsonProperty("string")
private String string = null;
private String string;
@JsonProperty("byte")
private byte[] _byte = null;
private byte[] _byte;
@JsonProperty("binary")
private Resource binary = null;
private Resource binary;
@JsonProperty("date")
private LocalDate date = null;
private LocalDate date;
@JsonProperty("dateTime")
private OffsetDateTime dateTime = null;
private OffsetDateTime dateTime;
@JsonProperty("uuid")
private UUID uuid = null;
private UUID uuid;
@JsonProperty("password")
private String password = null;
private String password;
public FormatTest integer(Integer integer) {
this.integer = integer;

View File

@ -14,10 +14,10 @@ import javax.validation.constraints.*;
public class HasOnlyReadOnly {
@JsonProperty("bar")
private String bar = null;
private String bar;
@JsonProperty("foo")
private String foo = null;
private String foo;
public HasOnlyReadOnly bar(String bar) {
this.bar = bar;

View File

@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.virtualan.model.StringBooleanMap;
import javax.validation.Valid;
import javax.validation.constraints.*;
@ -62,7 +61,8 @@ public class MapTest {
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
private StringBooleanMap indirectMap = null;
@Valid
private Map<String, Boolean> indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
@ -149,24 +149,31 @@ public class MapTest {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
public MapTest indirectMap(Map<String, Boolean> indirectMap) {
this.indirectMap = indirectMap;
return this;
}
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
if (this.indirectMap == null) {
this.indirectMap = new HashMap<>();
}
this.indirectMap.put(key, indirectMapItem);
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
@Valid
public StringBooleanMap getIndirectMap() {
public Map<String, Boolean> getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
public void setIndirectMap(Map<String, Boolean> indirectMap) {
this.indirectMap = indirectMap;
}

View File

@ -20,10 +20,10 @@ import javax.validation.constraints.*;
public class MixedPropertiesAndAdditionalPropertiesClass {
@JsonProperty("uuid")
private UUID uuid = null;
private UUID uuid;
@JsonProperty("dateTime")
private OffsetDateTime dateTime = null;
private OffsetDateTime dateTime;
@JsonProperty("map")
@Valid

View File

@ -15,10 +15,10 @@ import javax.validation.constraints.*;
public class Model200Response {
@JsonProperty("name")
private Integer name = null;
private Integer name;
@JsonProperty("class")
private String propertyClass = null;
private String propertyClass;
public Model200Response name(Integer name) {
this.name = name;

View File

@ -14,13 +14,13 @@ import javax.validation.constraints.*;
public class ModelApiResponse {
@JsonProperty("code")
private Integer code = null;
private Integer code;
@JsonProperty("type")
private String type = null;
private String type;
@JsonProperty("message")
private String message = null;
private String message;
public ModelApiResponse code(Integer code) {
this.code = code;

View File

@ -15,7 +15,7 @@ import javax.validation.constraints.*;
public class ModelReturn {
@JsonProperty("return")
private Integer _return = null;
private Integer _return;
public ModelReturn _return(Integer _return) {
this._return = _return;

View File

@ -15,16 +15,16 @@ import javax.validation.constraints.*;
public class Name {
@JsonProperty("name")
private Integer name = null;
private Integer name;
@JsonProperty("snake_case")
private Integer snakeCase = null;
private Integer snakeCase;
@JsonProperty("property")
private String property = null;
private String property;
@JsonProperty("123Number")
private Integer _123number = null;
private Integer _123number;
public Name name(Integer name) {
this.name = name;

View File

@ -15,7 +15,7 @@ import javax.validation.constraints.*;
public class NumberOnly {
@JsonProperty("JustNumber")
private BigDecimal justNumber = null;
private BigDecimal justNumber;
public NumberOnly justNumber(BigDecimal justNumber) {
this.justNumber = justNumber;

View File

@ -16,16 +16,16 @@ import javax.validation.constraints.*;
public class Order {
@JsonProperty("id")
private Long id = null;
private Long id;
@JsonProperty("petId")
private Long petId = null;
private Long petId;
@JsonProperty("quantity")
private Integer quantity = null;
private Integer quantity;
@JsonProperty("shipDate")
private OffsetDateTime shipDate = null;
private OffsetDateTime shipDate;
/**
* Order Status
@ -61,7 +61,7 @@ public class Order {
}
@JsonProperty("status")
private StatusEnum status = null;
private StatusEnum status;
@JsonProperty("complete")
private Boolean complete = false;

View File

@ -15,13 +15,13 @@ import javax.validation.constraints.*;
public class OuterComposite {
@JsonProperty("my_number")
private BigDecimal myNumber = null;
private BigDecimal myNumber;
@JsonProperty("my_string")
private String myString = null;
private String myString;
@JsonProperty("my_boolean")
private Boolean myBoolean = null;
private Boolean myBoolean;
public OuterComposite myNumber(BigDecimal myNumber) {
this.myNumber = myNumber;

View File

@ -19,13 +19,13 @@ import javax.validation.constraints.*;
public class Pet {
@JsonProperty("id")
private Long id = null;
private Long id;
@JsonProperty("category")
private Category category = null;
@JsonProperty("name")
private String name = null;
private String name;
@JsonProperty("photoUrls")
@Valid
@ -69,7 +69,7 @@ public class Pet {
}
@JsonProperty("status")
private StatusEnum status = null;
private StatusEnum status;
public Pet id(Long id) {
this.id = id;

View File

@ -14,10 +14,10 @@ import javax.validation.constraints.*;
public class ReadOnlyFirst {
@JsonProperty("bar")
private String bar = null;
private String bar;
@JsonProperty("baz")
private String baz = null;
private String baz;
public ReadOnlyFirst bar(String bar) {
this.bar = bar;

View File

@ -14,7 +14,7 @@ import javax.validation.constraints.*;
public class SpecialModelName {
@JsonProperty("$special[property.name]")
private Long $specialPropertyName = null;
private Long $specialPropertyName;
public SpecialModelName $specialPropertyName(Long $specialPropertyName) {
this.$specialPropertyName = $specialPropertyName;

View File

@ -14,10 +14,10 @@ import javax.validation.constraints.*;
public class Tag {
@JsonProperty("id")
private Long id = null;
private Long id;
@JsonProperty("name")
private String name = null;
private String name;
public Tag id(Long id) {
this.id = id;

View File

@ -14,28 +14,28 @@ import javax.validation.constraints.*;
public class User {
@JsonProperty("id")
private Long id = null;
private Long id;
@JsonProperty("username")
private String username = null;
private String username;
@JsonProperty("firstName")
private String firstName = null;
private String firstName;
@JsonProperty("lastName")
private String lastName = null;
private String lastName;
@JsonProperty("email")
private String email = null;
private String email;
@JsonProperty("password")
private String password = null;
private String password;
@JsonProperty("phone")
private String phone = null;
private String phone;
@JsonProperty("userStatus")
private Integer userStatus = null;
private Integer userStatus;
public User id(Long id) {
this.id = id;