From 11771a8ccf07b0ee690b234fb67d27eb56ab105c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 4 Oct 2023 15:11:06 +0800 Subject: [PATCH] update samples --- .../lib/src/model/dog.dart | 12 ------------ .../java/org/openapitools/api/AnotherFakeApi.java | 1 + .../gen/java/org/openapitools/api/FakeApi.java | 15 +++++++++++++++ .../openapitools/api/FakeClassnameTestApi.java | 1 + .../src/gen/java/org/openapitools/api/PetApi.java | 8 ++++++++ .../gen/java/org/openapitools/api/StoreApi.java | 4 ++++ .../gen/java/org/openapitools/api/UserApi.java | 8 ++++++++ 7 files changed, 37 insertions(+), 12 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart index 484567e74d7..8d3d3e27a17 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart @@ -51,11 +51,6 @@ class _$DogSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); } - yield r'className'; - yield serializers.serialize( - object.className, - specifiedType: const FullType(String), - ); if (object.breed != null) { yield r'breed'; yield serializers.serialize( @@ -98,13 +93,6 @@ class _$DogSerializer implements PrimitiveSerializer { ) as String; result.color = valueDes; break; - case r'className': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.className = valueDes; - break; case r'breed': final valueDes = serializers.deserialize( value, diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 0907d35bbda..09fb429f39e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -26,4 +26,5 @@ public interface AnotherFakeApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) Client call123testSpecialTags(@HeaderParam("uuid_test") @NotNull @ApiParam("to test uuid example value") UUID uuidTest,@Valid @NotNull Client body); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java index 77b99b940ca..a49f6153579 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java @@ -36,6 +36,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void createXmlItem(@Valid @NotNull XmlItem xmlItem); + @POST @Path("/outer/boolean") @Produces({ "*/*" }) @@ -44,6 +45,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) Boolean fakeOuterBooleanSerialize(@Valid Boolean body); + @POST @Path("/outer/composite") @Produces({ "*/*" }) @@ -52,6 +54,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite body); + @POST @Path("/outer/number") @Produces({ "*/*" }) @@ -60,6 +63,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body); + @POST @Path("/outer/string") @Produces({ "*/*" }) @@ -68,6 +72,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "Output string", response = String.class) }) String fakeOuterStringSerialize(@Valid String body); + @PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) @@ -76,6 +81,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "Success", response = Void.class) }) void testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass body); + @PUT @Path("/body-with-query-params") @Consumes({ "application/json" }) @@ -84,6 +90,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "Success", response = Void.class) }) void testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User body); + @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) @@ -92,6 +99,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) Client testClientModel(@Valid @NotNull Client body); + @POST @Consumes({ "application/x-www-form-urlencoded" }) @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @@ -103,6 +111,7 @@ public interface FakeApi { @ApiResponse(code = 404, message = "User not found", response = Void.class) }) void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback); + @GET @Consumes({ "application/x-www-form-urlencoded" }) @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", tags={ "fake" }) @@ -114,12 +123,14 @@ public interface FakeApi { @ApiResponse(code = 404, message = "Not found", response = Void.class) }) void testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); + @DELETE @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Something wrong", response = Void.class) }) void testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group); + @POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) @@ -128,6 +139,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void testInlineAdditionalProperties(@Valid @NotNull Map param); + @GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) @@ -136,6 +148,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); + @PUT @Path("/test-query-parameters") @ApiOperation(value = "", notes = "To test the collection format in query parameters", tags={ "fake" }) @@ -143,6 +156,7 @@ public interface FakeApi { @ApiResponse(code = 200, message = "Success", response = Void.class) }) void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context); + @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @@ -155,4 +169,5 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 5623f06f66e..f918940c2cb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -28,4 +28,5 @@ public interface FakeClassnameTestApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) Client testClassname(@Valid @NotNull Client body); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java index aac1bacb129..944a8b54889 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java @@ -33,6 +33,7 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) void addPet(@Valid @NotNull Pet body); + @DELETE @Path("/{petId}") @ApiOperation(value = "Deletes a pet", notes = "", authorizations = { @@ -48,6 +49,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId); + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -61,6 +63,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) List findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) @@ -74,6 +77,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "Set") }) Set findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") Set tags); + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) @@ -87,6 +91,7 @@ public interface PetApi { @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) Pet getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId); + @PUT @Consumes({ "application/json", "application/xml" }) @ApiOperation(value = "Update an existing pet", notes = "", authorizations = { @@ -101,6 +106,7 @@ public interface PetApi { @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) void updatePet(@Valid @NotNull Pet body); + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -113,6 +119,7 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) void updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status); + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @@ -125,4 +132,5 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/StoreApi.java index aac53375188..d4f7f13e6d1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/StoreApi.java @@ -27,6 +27,7 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) void deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId); + @GET @Path("/inventory") @Produces({ "application/json" }) @@ -38,6 +39,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) Map getInventory(); + @GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) @@ -48,6 +50,7 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) Order getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) @ApiParam("ID of pet that needs to be fetched") Long orderId); + @POST @Path("/order") @Produces({ "application/xml", "application/json" }) @@ -56,4 +59,5 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) Order placeOrder(@Valid @NotNull Order body); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java index 0638dfd3835..ad65de6d744 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java @@ -25,6 +25,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void createUser(@Valid @NotNull User body); + @POST @Path("/createWithArray") @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user" }) @@ -32,6 +33,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void createUsersWithArrayInput(@Valid @NotNull List body); + @POST @Path("/createWithList") @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user" }) @@ -39,6 +41,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void createUsersWithListInput(@Valid @NotNull List body); + @DELETE @Path("/{username}") @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", tags={ "user" }) @@ -47,6 +50,7 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found", response = Void.class) }) void deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username); + @GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) @@ -57,6 +61,7 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found", response = Void.class) }) User getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing.") String username); + @GET @Path("/login") @Produces({ "application/xml", "application/json" }) @@ -66,6 +71,7 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) String loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password); + @GET @Path("/logout") @ApiOperation(value = "Logs out current logged in user session", notes = "", tags={ "user" }) @@ -73,6 +79,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void logoutUser(); + @PUT @Path("/{username}") @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", tags={ "user" }) @@ -80,4 +87,5 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) void updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid @NotNull User body); + }