Permalink
Browse files

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
  • Loading branch information...
wing328 committed Nov 2, 2018
1 parent ecff8b5 commit 36991a4e142e2369393c8b31107f17ea26f7ac90
Showing with 158 additions and 151 deletions.
  1. 0 bin/mysql-schema-petstore.sh
  2. 0 bin/springboot-virtualan-petstore-server.sh
  3. +37 −28 bin/utils/ensure-up-to-date
  4. +1 −1 samples/schema/petstore/mysql/.openapi-generator/VERSION
  5. +1 −1 samples/schema/petstore/mysql/mysql_schema.sql
  6. +1 −1 samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION
  7. +1 −1 ...er/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java
  8. +4 −2 ...es/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/ApiUtil.java
  9. +17 −29 ...es/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java
  10. +1 −1 ...store/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java
  11. +8 −8 ...les/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java
  12. +1 −1 ...s/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java
  13. +1 −1 ...es/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java
  14. +1 −1 ...s/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java
  15. +6 −6 .../petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java
  16. +1 −1 samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java
  17. +4 −3 ...server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java
  18. +1 −1 ...rver/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java
  19. +1 −1 ...s/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java
  20. +1 −1 samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java
  21. +1 −1 ...rver/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java
  22. +4 −4 ...server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java
  23. +13 −13 ...rver/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java
  24. +2 −2 ...petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java
  25. +13 −6 .../server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java
  26. +2 −2 ...n/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java
  27. +2 −2 ...etstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java
  28. +3 −3 ...etstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java
  29. +1 −1 ...ver/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java
  30. +4 −4 ...les/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java
  31. +1 −1 ...rver/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java
  32. +5 −5 ...es/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java
  33. +3 −3 .../petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java
  34. +3 −3 samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java
  35. +2 −2 ...r/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java
  36. +1 −1 ...etstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java
  37. +2 −2 samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java
  38. +8 −8 ...les/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java
0 bin/mysql-schema-petstore.sh 100644 → 100755
No changes.
No changes.
@@ -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
@@ -1 +1 @@
3.3.0-SNAPSHOT
3.3.3-SNAPSHOT
@@ -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;
--
@@ -1 +1 @@
3.3.0-SNAPSHOT
3.3.3-SNAPSHOT
@@ -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.
*/
@@ -8,8 +8,10 @@
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);
}
@@ -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 @@
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 @@
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 @@
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 @@
@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 @@
@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 @@
@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 @@
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"))) {
@@ -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.
*/
Oops, something went wrong.

0 comments on commit 36991a4

Please sign in to comment.