diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache index 48249db662eb..f7bcdc7b12bb 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache @@ -47,6 +47,7 @@ import {{javaxPackage}}.annotation.Generated; public interface {{classname}} { {{#operation}} + String PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}} = "{{{path}}}"; /** * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} {{#notes}} @@ -74,7 +75,7 @@ public interface {{classname}} { {{/useResponseEntity}} @HttpExchange( method = "{{{httpMethod}}}", - value = "{{{path}}}", + value = {{classname}}.PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}, accept = { {{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}} }{{#vendorExtensions.x-content-type}}, contentType = "{{{vendorExtensions.x-content-type}}}"{{/vendorExtensions.x-content-type}} ) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 0bd582e30076..c20b93ff8d47 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -6865,6 +6865,24 @@ public void testClientRegistrationIdAnnotation() throws IOException { .containsWithNameAndAttributes("ClientRegistrationId", ImmutableMap.of("value", "\"my-oauth-client\"")); } + @Test + public void testPathConstantGeneratedForSpringHttpInterfaceLibrary() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary("spring-http-interface"); + + final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml"); + + // Check that the path constant field is generated + JavaFileAssert.assertThat(files.get("PetApi.java")) + .fileContains("String PATH_GET_PET_BY_ID = \"/pet/{petId}\";"); + + // Check that @HttpExchange's value attribute reuses the constant instead of a hardcoded path + JavaFileAssert.assertThat(files.get("PetApi.java")) + .assertMethod("getPetById") + .assertMethodAnnotations() + .containsWithNameAndAttributes("HttpExchange", ImmutableMap.of("value", "PetApi.PATH_GET_PET_BY_ID")); + } + @Test public void testClientRegistrationIdAnnotationNotPresentWhenNotConfigured() throws IOException { final SpringCodegen codegen = new SpringCodegen(); diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1a3bf4eb8572..ac5f73cb5aaf 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface AnotherFakeApi { + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -33,7 +34,7 @@ public interface AnotherFakeApi { */ @HttpExchange( method = "PATCH", - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java index a089293ed3f8..9775faf460a0 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -35,6 +35,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeApi { + String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -44,7 +45,7 @@ public interface FakeApi { */ @HttpExchange( method = "POST", - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, accept = { "application/json" }, contentType = "application/xml" ) @@ -53,6 +54,7 @@ ResponseEntity createXmlItem( ); + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -62,7 +64,7 @@ ResponseEntity createXmlItem( */ @HttpExchange( method = "POST", - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -71,6 +73,7 @@ ResponseEntity fakeOuterBooleanSerialize( ); + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -80,7 +83,7 @@ ResponseEntity fakeOuterBooleanSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -89,6 +92,7 @@ ResponseEntity fakeOuterCompositeSerialize( ); + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -98,7 +102,7 @@ ResponseEntity fakeOuterCompositeSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -107,6 +111,7 @@ ResponseEntity fakeOuterNumberSerialize( ); + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -116,7 +121,7 @@ ResponseEntity fakeOuterNumberSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -125,6 +130,7 @@ ResponseEntity fakeOuterStringSerialize( ); + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. @@ -134,7 +140,7 @@ ResponseEntity fakeOuterStringSerialize( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, accept = { "application/json" }, contentType = "application/json" ) @@ -143,6 +149,7 @@ ResponseEntity testBodyWithFileSchema( ); + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -152,7 +159,7 @@ ResponseEntity testBodyWithFileSchema( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, accept = { "application/json" }, contentType = "application/json" ) @@ -162,6 +169,7 @@ ResponseEntity testBodyWithQueryParams( ); + String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -171,7 +179,7 @@ ResponseEntity testBodyWithQueryParams( */ @HttpExchange( method = "PATCH", - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, accept = { "application/json" }, contentType = "application/json" ) @@ -180,6 +188,7 @@ ResponseEntity testClientModel( ); + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -203,7 +212,7 @@ ResponseEntity testClientModel( */ @HttpExchange( method = "POST", - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -225,6 +234,7 @@ ResponseEntity testEndpointParameters( ); + String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -242,7 +252,7 @@ ResponseEntity testEndpointParameters( */ @HttpExchange( method = "GET", - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -258,6 +268,7 @@ ResponseEntity testEnumParameters( ); + String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -272,7 +283,7 @@ ResponseEntity testEnumParameters( */ @HttpExchange( method = "DELETE", - value = "/fake", + value = FakeApi.PATH_TEST_GROUP_PARAMETERS, accept = { "application/json" } ) ResponseEntity testGroupParameters( @@ -285,6 +296,7 @@ ResponseEntity testGroupParameters( ); + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -294,7 +306,7 @@ ResponseEntity testGroupParameters( */ @HttpExchange( method = "POST", - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, accept = { "application/json" }, contentType = "application/json" ) @@ -303,6 +315,7 @@ ResponseEntity testInlineAdditionalProperties( ); + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -313,7 +326,7 @@ ResponseEntity testInlineAdditionalProperties( */ @HttpExchange( method = "GET", - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -323,6 +336,7 @@ ResponseEntity testJsonFormData( ); + String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -332,7 +346,7 @@ ResponseEntity testJsonFormData( */ @HttpExchange( method = "POST", - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, accept = { "application/json" }, contentType = "application/json" ) @@ -341,6 +355,7 @@ ResponseEntity testNullable( ); + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -353,7 +368,7 @@ ResponseEntity testNullable( */ @HttpExchange( method = "PUT", - value = "/fake/test-query-parameters", + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT, accept = { "application/json" } ) ResponseEntity testQueryParameterCollectionFormat( @@ -364,6 +379,7 @@ ResponseEntity testQueryParameterCollectionFormat( ); + String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example"; /** * GET /fake/response-with-example * This endpoint defines an example value for its response schema. @@ -372,7 +388,7 @@ ResponseEntity testQueryParameterCollectionFormat( */ @HttpExchange( method = "GET", - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) ResponseEntity testWithResultExample( diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 1482e1393c35..271b850493e8 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeClassnameTags123Api { + String PATH_TEST_CLASSNAME = "/fake_classname_test"; /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -33,7 +34,7 @@ public interface FakeClassnameTags123Api { */ @HttpExchange( method = "PATCH", - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java index c2720d5ccd9f..70ae71d2a822 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java @@ -28,6 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -38,7 +39,7 @@ public interface PetApi { */ @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -47,6 +48,7 @@ ResponseEntity addPet( ); + String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -58,7 +60,7 @@ ResponseEntity addPet( */ @HttpExchange( method = "DELETE", - value = "/pet/{petId}", + value = PetApi.PATH_DELETE_PET, accept = { "application/json" } ) ResponseEntity deletePet( @@ -67,6 +69,7 @@ ResponseEntity deletePet( ); + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; /** * GET /pet/findByStatus : Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -77,7 +80,7 @@ ResponseEntity deletePet( */ @HttpExchange( method = "GET", - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) ResponseEntity> findPetsByStatus( @@ -85,6 +88,7 @@ ResponseEntity> findPetsByStatus( ); + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; /** * GET /pet/findByTags : Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -97,7 +101,7 @@ ResponseEntity> findPetsByStatus( @Deprecated @HttpExchange( method = "GET", - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) ResponseEntity> findPetsByTags( @@ -105,6 +109,7 @@ ResponseEntity> findPetsByTags( ); + String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -116,7 +121,7 @@ ResponseEntity> findPetsByTags( */ @HttpExchange( method = "GET", - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) ResponseEntity getPetById( @@ -124,6 +129,7 @@ ResponseEntity getPetById( ); + String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -132,7 +138,7 @@ ResponseEntity getPetById( */ @HttpExchange( method = "GET", - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) ResponseEntity responseObjectDifferentNames( @@ -140,6 +146,7 @@ ResponseEntity responseObjectDifferent ); + String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -152,7 +159,7 @@ ResponseEntity responseObjectDifferent */ @HttpExchange( method = "PUT", - value = "/pet", + value = PetApi.PATH_UPDATE_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -161,6 +168,7 @@ ResponseEntity updatePet( ); + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -172,7 +180,7 @@ ResponseEntity updatePet( */ @HttpExchange( method = "POST", - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -183,6 +191,7 @@ ResponseEntity updatePetWithForm( ); + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -194,7 +203,7 @@ ResponseEntity updatePetWithForm( */ @HttpExchange( method = "POST", - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) @@ -205,6 +214,7 @@ ResponseEntity uploadFile( ); + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -216,7 +226,7 @@ ResponseEntity uploadFile( */ @HttpExchange( method = "POST", - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java index 3cc149bde388..faa0cc3ec4bd 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface StoreApi { + String PATH_DELETE_ORDER = "/store/order/{order_id}"; /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -35,7 +36,7 @@ public interface StoreApi { */ @HttpExchange( method = "DELETE", - value = "/store/order/{order_id}", + value = StoreApi.PATH_DELETE_ORDER, accept = { "application/json" } ) ResponseEntity deleteOrder( @@ -43,6 +44,7 @@ ResponseEntity deleteOrder( ); + String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -51,7 +53,7 @@ ResponseEntity deleteOrder( */ @HttpExchange( method = "GET", - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) ResponseEntity> getInventory( @@ -59,6 +61,7 @@ ResponseEntity> getInventory( ); + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; /** * GET /store/order/{order_id} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -70,7 +73,7 @@ ResponseEntity> getInventory( */ @HttpExchange( method = "GET", - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) ResponseEntity getOrderById( @@ -78,6 +81,7 @@ ResponseEntity getOrderById( ); + String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -88,7 +92,7 @@ ResponseEntity getOrderById( */ @HttpExchange( method = "POST", - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java index 6a740f996f02..da9ba7fc56e8 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface UserApi { + String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -34,7 +35,7 @@ public interface UserApi { */ @HttpExchange( method = "POST", - value = "/user", + value = UserApi.PATH_CREATE_USER, accept = { "application/json" }, contentType = "application/json" ) @@ -43,6 +44,7 @@ ResponseEntity createUser( ); + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -52,7 +54,7 @@ ResponseEntity createUser( */ @HttpExchange( method = "POST", - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -61,6 +63,7 @@ ResponseEntity createUsersWithArrayInput( ); + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -70,7 +73,7 @@ ResponseEntity createUsersWithArrayInput( */ @HttpExchange( method = "POST", - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -79,6 +82,7 @@ ResponseEntity createUsersWithListInput( ); + String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -89,7 +93,7 @@ ResponseEntity createUsersWithListInput( */ @HttpExchange( method = "DELETE", - value = "/user/{username}", + value = UserApi.PATH_DELETE_USER, accept = { "application/json" } ) ResponseEntity deleteUser( @@ -97,6 +101,7 @@ ResponseEntity deleteUser( ); + String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -108,7 +113,7 @@ ResponseEntity deleteUser( */ @HttpExchange( method = "GET", - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) ResponseEntity getUserByName( @@ -116,6 +121,7 @@ ResponseEntity getUserByName( ); + String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -127,7 +133,7 @@ ResponseEntity getUserByName( */ @HttpExchange( method = "GET", - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) ResponseEntity loginUser( @@ -136,6 +142,7 @@ ResponseEntity loginUser( ); + String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -144,7 +151,7 @@ ResponseEntity loginUser( */ @HttpExchange( method = "GET", - value = "/user/logout", + value = UserApi.PATH_LOGOUT_USER, accept = { "application/json" } ) ResponseEntity logoutUser( @@ -152,6 +159,7 @@ ResponseEntity logoutUser( ); + String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -163,7 +171,7 @@ ResponseEntity logoutUser( */ @HttpExchange( method = "PUT", - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java index 73fa87163830..fe7f96a60c8a 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -21,6 +21,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface AnotherFakeApi { + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -31,7 +32,7 @@ public interface AnotherFakeApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PATCH", - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index debb7ecc8f66..d0673f0c6ece 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -32,6 +32,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeApi { + String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -42,7 +43,7 @@ public interface FakeApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, accept = { "application/json" }, contentType = "application/xml" ) @@ -51,6 +52,7 @@ void createXmlItem( ); + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -61,7 +63,7 @@ void createXmlItem( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -70,6 +72,7 @@ Boolean fakeOuterBooleanSerialize( ); + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -80,7 +83,7 @@ Boolean fakeOuterBooleanSerialize( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -89,6 +92,7 @@ OuterCompositeDto fakeOuterCompositeSerialize( ); + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -99,7 +103,7 @@ OuterCompositeDto fakeOuterCompositeSerialize( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -108,6 +112,7 @@ BigDecimal fakeOuterNumberSerialize( ); + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -118,7 +123,7 @@ BigDecimal fakeOuterNumberSerialize( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -127,6 +132,7 @@ String fakeOuterStringSerialize( ); + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. @@ -137,7 +143,7 @@ String fakeOuterStringSerialize( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PUT", - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, accept = { "application/json" }, contentType = "application/json" ) @@ -146,6 +152,7 @@ void testBodyWithFileSchema( ); + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -156,7 +163,7 @@ void testBodyWithFileSchema( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PUT", - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, accept = { "application/json" }, contentType = "application/json" ) @@ -166,6 +173,7 @@ void testBodyWithQueryParams( ); + String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -176,7 +184,7 @@ void testBodyWithQueryParams( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PATCH", - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, accept = { "application/json" }, contentType = "application/json" ) @@ -185,6 +193,7 @@ ClientDto testClientModel( ); + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -209,7 +218,7 @@ ClientDto testClientModel( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "POST", - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -231,6 +240,7 @@ void testEndpointParameters( ); + String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -249,7 +259,7 @@ void testEndpointParameters( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "GET", - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -265,6 +275,7 @@ void testEnumParameters( ); + String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -280,7 +291,7 @@ void testEnumParameters( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "DELETE", - value = "/fake", + value = FakeApi.PATH_TEST_GROUP_PARAMETERS, accept = { "application/json" } ) void testGroupParameters( @@ -293,6 +304,7 @@ void testGroupParameters( ); + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -303,7 +315,7 @@ void testGroupParameters( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, accept = { "application/json" }, contentType = "application/json" ) @@ -312,6 +324,7 @@ void testInlineAdditionalProperties( ); + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -323,7 +336,7 @@ void testInlineAdditionalProperties( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -333,6 +346,7 @@ void testJsonFormData( ); + String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -343,7 +357,7 @@ void testJsonFormData( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, accept = { "application/json" }, contentType = "application/json" ) @@ -352,6 +366,7 @@ void testNullable( ); + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -365,7 +380,7 @@ void testNullable( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PUT", - value = "/fake/test-query-parameters", + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT, accept = { "application/json" } ) void testQueryParameterCollectionFormat( @@ -376,6 +391,7 @@ void testQueryParameterCollectionFormat( ); + String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example"; /** * GET /fake/response-with-example * This endpoint defines an example value for its response schema. @@ -385,7 +401,7 @@ void testQueryParameterCollectionFormat( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) Integer testWithResultExample( diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 007b9456d7a5..83594ab0d581 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -21,6 +21,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeClassnameTags123Api { + String PATH_TEST_CLASSNAME = "/fake_classname_test"; /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -31,7 +32,7 @@ public interface FakeClassnameTags123Api { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PATCH", - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java index 72d69f6db07c..b3e89fe73a3e 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -36,7 +37,7 @@ public interface PetApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -45,6 +46,7 @@ void addPet( ); + String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -57,7 +59,7 @@ void addPet( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "DELETE", - value = "/pet/{petId}", + value = PetApi.PATH_DELETE_PET, accept = { "application/json" } ) void deletePet( @@ -66,6 +68,7 @@ void deletePet( ); + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; /** * GET /pet/findByStatus : Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -77,7 +80,7 @@ void deletePet( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) List findPetsByStatus( @@ -85,6 +88,7 @@ List findPetsByStatus( ); + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; /** * GET /pet/findByTags : Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -98,7 +102,7 @@ List findPetsByStatus( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) Set findPetsByTags( @@ -106,6 +110,7 @@ Set findPetsByTags( ); + String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -118,7 +123,7 @@ Set findPetsByTags( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) PetDto getPetById( @@ -126,6 +131,7 @@ PetDto getPetById( ); + String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -135,7 +141,7 @@ PetDto getPetById( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) ResponseObjectWithDifferentFieldNamesDto responseObjectDifferentNames( @@ -143,6 +149,7 @@ ResponseObjectWithDifferentFieldNamesDto responseObjectDifferentNames( ); + String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -156,7 +163,7 @@ ResponseObjectWithDifferentFieldNamesDto responseObjectDifferentNames( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PUT", - value = "/pet", + value = PetApi.PATH_UPDATE_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -165,6 +172,7 @@ void updatePet( ); + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -177,7 +185,7 @@ void updatePet( @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @HttpExchange( method = "POST", - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -188,6 +196,7 @@ void updatePetWithForm( ); + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -200,7 +209,7 @@ void updatePetWithForm( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) @@ -211,6 +220,7 @@ ApiResponseDto uploadFile( ); + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -223,7 +233,7 @@ ApiResponseDto uploadFile( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java index 3aa621eff85d..16e394476f63 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java @@ -22,6 +22,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface StoreApi { + String PATH_DELETE_ORDER = "/store/order/{order_id}"; /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -33,7 +34,7 @@ public interface StoreApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "DELETE", - value = "/store/order/{order_id}", + value = StoreApi.PATH_DELETE_ORDER, accept = { "application/json" } ) void deleteOrder( @@ -41,6 +42,7 @@ void deleteOrder( ); + String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -50,7 +52,7 @@ void deleteOrder( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) Map getInventory( @@ -58,6 +60,7 @@ Map getInventory( ); + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; /** * GET /store/order/{order_id} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -70,7 +73,7 @@ Map getInventory( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) OrderDto getOrderById( @@ -78,6 +81,7 @@ OrderDto getOrderById( ); + String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -89,7 +93,7 @@ OrderDto getOrderById( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java index 5b3fadca8cb7..e14c3fa8669c 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java @@ -22,6 +22,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface UserApi { + String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -32,7 +33,7 @@ public interface UserApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/user", + value = UserApi.PATH_CREATE_USER, accept = { "application/json" }, contentType = "application/json" ) @@ -41,6 +42,7 @@ void createUser( ); + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -51,7 +53,7 @@ void createUser( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -60,6 +62,7 @@ void createUsersWithArrayInput( ); + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -70,7 +73,7 @@ void createUsersWithArrayInput( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -79,6 +82,7 @@ void createUsersWithListInput( ); + String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -90,7 +94,7 @@ void createUsersWithListInput( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "DELETE", - value = "/user/{username}", + value = UserApi.PATH_DELETE_USER, accept = { "application/json" } ) void deleteUser( @@ -98,6 +102,7 @@ void deleteUser( ); + String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -110,7 +115,7 @@ void deleteUser( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) UserDto getUserByName( @@ -118,6 +123,7 @@ UserDto getUserByName( ); + String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -130,7 +136,7 @@ UserDto getUserByName( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) String loginUser( @@ -139,6 +145,7 @@ String loginUser( ); + String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -148,7 +155,7 @@ String loginUser( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/user/logout", + value = UserApi.PATH_LOGOUT_USER, accept = { "application/json" } ) void logoutUser( @@ -156,6 +163,7 @@ void logoutUser( ); + String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -168,7 +176,7 @@ void logoutUser( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "PUT", - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java index 3aaa4f5fdcc0..5e9906c0ce5c 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java @@ -23,6 +23,7 @@ @ClientRegistrationId("petstore-oauth") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -33,7 +34,7 @@ public interface PetApi { */ @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 5d836725bf7c..d4ac9bbc222a 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -28,6 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface AnotherFakeApi { + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -37,7 +38,7 @@ public interface AnotherFakeApi { */ @HttpExchange( method = "PATCH", - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java index 066620ff21e3..b48f14db9c4e 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -39,6 +39,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeApi { + String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -48,7 +49,7 @@ public interface FakeApi { */ @HttpExchange( method = "POST", - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, accept = { "application/json" }, contentType = "application/xml" ) @@ -57,6 +58,7 @@ Mono> createXmlItem( ); + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -66,7 +68,7 @@ Mono> createXmlItem( */ @HttpExchange( method = "POST", - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -75,6 +77,7 @@ Mono> fakeOuterBooleanSerialize( ); + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -84,7 +87,7 @@ Mono> fakeOuterBooleanSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -93,6 +96,7 @@ Mono> fakeOuterCompositeSerialize( ); + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -102,7 +106,7 @@ Mono> fakeOuterCompositeSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -111,6 +115,7 @@ Mono> fakeOuterNumberSerialize( ); + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -120,7 +125,7 @@ Mono> fakeOuterNumberSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -129,6 +134,7 @@ Mono> fakeOuterStringSerialize( ); + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. @@ -138,7 +144,7 @@ Mono> fakeOuterStringSerialize( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, accept = { "application/json" }, contentType = "application/json" ) @@ -147,6 +153,7 @@ Mono> testBodyWithFileSchema( ); + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -156,7 +163,7 @@ Mono> testBodyWithFileSchema( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, accept = { "application/json" }, contentType = "application/json" ) @@ -166,6 +173,7 @@ Mono> testBodyWithQueryParams( ); + String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -175,7 +183,7 @@ Mono> testBodyWithQueryParams( */ @HttpExchange( method = "PATCH", - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, accept = { "application/json" }, contentType = "application/json" ) @@ -184,6 +192,7 @@ Mono> testClientModel( ); + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -207,7 +216,7 @@ Mono> testClientModel( */ @HttpExchange( method = "POST", - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -229,6 +238,7 @@ Mono> testEndpointParameters( ); + String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -246,7 +256,7 @@ Mono> testEndpointParameters( */ @HttpExchange( method = "GET", - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -262,6 +272,7 @@ Mono> testEnumParameters( ); + String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -276,7 +287,7 @@ Mono> testEnumParameters( */ @HttpExchange( method = "DELETE", - value = "/fake", + value = FakeApi.PATH_TEST_GROUP_PARAMETERS, accept = { "application/json" } ) Mono> testGroupParameters( @@ -289,6 +300,7 @@ Mono> testGroupParameters( ); + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -298,7 +310,7 @@ Mono> testGroupParameters( */ @HttpExchange( method = "POST", - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, accept = { "application/json" }, contentType = "application/json" ) @@ -307,6 +319,7 @@ Mono> testInlineAdditionalProperties( ); + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -317,7 +330,7 @@ Mono> testInlineAdditionalProperties( */ @HttpExchange( method = "GET", - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -327,6 +340,7 @@ Mono> testJsonFormData( ); + String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -336,7 +350,7 @@ Mono> testJsonFormData( */ @HttpExchange( method = "POST", - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, accept = { "application/json" }, contentType = "application/json" ) @@ -345,6 +359,7 @@ Mono> testNullable( ); + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -357,7 +372,7 @@ Mono> testNullable( */ @HttpExchange( method = "PUT", - value = "/fake/test-query-parameters", + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT, accept = { "application/json" } ) Mono> testQueryParameterCollectionFormat( @@ -368,6 +383,7 @@ Mono> testQueryParameterCollectionFormat( ); + String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example"; /** * GET /fake/response-with-example * This endpoint defines an example value for its response schema. @@ -376,7 +392,7 @@ Mono> testQueryParameterCollectionFormat( */ @HttpExchange( method = "GET", - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) Mono> testWithResultExample( diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index dd423b00dbf1..02233921d10a 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -28,6 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeClassnameTags123Api { + String PATH_TEST_CLASSNAME = "/fake_classname_test"; /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -37,7 +38,7 @@ public interface FakeClassnameTags123Api { */ @HttpExchange( method = "PATCH", - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java index b8977d72836e..ba53471dfa36 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java @@ -32,6 +32,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -42,7 +43,7 @@ public interface PetApi { */ @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -51,6 +52,7 @@ Mono> addPet( ); + String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -62,7 +64,7 @@ Mono> addPet( */ @HttpExchange( method = "DELETE", - value = "/pet/{petId}", + value = PetApi.PATH_DELETE_PET, accept = { "application/json" } ) Mono> deletePet( @@ -71,6 +73,7 @@ Mono> deletePet( ); + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; /** * GET /pet/findByStatus : Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -81,7 +84,7 @@ Mono> deletePet( */ @HttpExchange( method = "GET", - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) Mono>> findPetsByStatus( @@ -89,6 +92,7 @@ Mono>> findPetsByStatus( ); + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; /** * GET /pet/findByTags : Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -101,7 +105,7 @@ Mono>> findPetsByStatus( @Deprecated @HttpExchange( method = "GET", - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) Mono>> findPetsByTags( @@ -109,6 +113,7 @@ Mono>> findPetsByTags( ); + String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -120,7 +125,7 @@ Mono>> findPetsByTags( */ @HttpExchange( method = "GET", - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) Mono> getPetById( @@ -128,6 +133,7 @@ Mono> getPetById( ); + String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -136,7 +142,7 @@ Mono> getPetById( */ @HttpExchange( method = "GET", - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) Mono> responseObjectDifferentNames( @@ -144,6 +150,7 @@ Mono> responseObjectDiffer ); + String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -156,7 +163,7 @@ Mono> responseObjectDiffer */ @HttpExchange( method = "PUT", - value = "/pet", + value = PetApi.PATH_UPDATE_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -165,6 +172,7 @@ Mono> updatePet( ); + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -176,7 +184,7 @@ Mono> updatePet( */ @HttpExchange( method = "POST", - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -187,6 +195,7 @@ Mono> updatePetWithForm( ); + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -198,7 +207,7 @@ Mono> updatePetWithForm( */ @HttpExchange( method = "POST", - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) @@ -209,6 +218,7 @@ Mono> uploadFile( ); + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -220,7 +230,7 @@ Mono> uploadFile( */ @HttpExchange( method = "POST", - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/StoreApi.java index 4d8d5cee2118..81632328b596 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/StoreApi.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface StoreApi { + String PATH_DELETE_ORDER = "/store/order/{order_id}"; /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -39,7 +40,7 @@ public interface StoreApi { */ @HttpExchange( method = "DELETE", - value = "/store/order/{order_id}", + value = StoreApi.PATH_DELETE_ORDER, accept = { "application/json" } ) Mono> deleteOrder( @@ -47,6 +48,7 @@ Mono> deleteOrder( ); + String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -55,7 +57,7 @@ Mono> deleteOrder( */ @HttpExchange( method = "GET", - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) Mono>> getInventory( @@ -63,6 +65,7 @@ Mono>> getInventory( ); + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; /** * GET /store/order/{order_id} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -74,7 +77,7 @@ Mono>> getInventory( */ @HttpExchange( method = "GET", - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) Mono> getOrderById( @@ -82,6 +85,7 @@ Mono> getOrderById( ); + String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -92,7 +96,7 @@ Mono> getOrderById( */ @HttpExchange( method = "POST", - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/UserApi.java index 9e30c628a320..bc509682647c 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/UserApi.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface UserApi { + String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -38,7 +39,7 @@ public interface UserApi { */ @HttpExchange( method = "POST", - value = "/user", + value = UserApi.PATH_CREATE_USER, accept = { "application/json" }, contentType = "application/json" ) @@ -47,6 +48,7 @@ Mono> createUser( ); + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -56,7 +58,7 @@ Mono> createUser( */ @HttpExchange( method = "POST", - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -65,6 +67,7 @@ Mono> createUsersWithArrayInput( ); + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -74,7 +77,7 @@ Mono> createUsersWithArrayInput( */ @HttpExchange( method = "POST", - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -83,6 +86,7 @@ Mono> createUsersWithListInput( ); + String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -93,7 +97,7 @@ Mono> createUsersWithListInput( */ @HttpExchange( method = "DELETE", - value = "/user/{username}", + value = UserApi.PATH_DELETE_USER, accept = { "application/json" } ) Mono> deleteUser( @@ -101,6 +105,7 @@ Mono> deleteUser( ); + String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -112,7 +117,7 @@ Mono> deleteUser( */ @HttpExchange( method = "GET", - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) Mono> getUserByName( @@ -120,6 +125,7 @@ Mono> getUserByName( ); + String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -131,7 +137,7 @@ Mono> getUserByName( */ @HttpExchange( method = "GET", - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) Mono> loginUser( @@ -140,6 +146,7 @@ Mono> loginUser( ); + String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -148,7 +155,7 @@ Mono> loginUser( */ @HttpExchange( method = "GET", - value = "/user/logout", + value = UserApi.PATH_LOGOUT_USER, accept = { "application/json" } ) Mono> logoutUser( @@ -156,6 +163,7 @@ Mono> logoutUser( ); + String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -167,7 +175,7 @@ Mono> logoutUser( */ @HttpExchange( method = "PUT", - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java index d6913da388d3..cbd1ca00e71a 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface AnotherFakeApi { + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -35,7 +36,7 @@ public interface AnotherFakeApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PATCH", - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index d0056903871a..b467f726e9d9 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeApi { + String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -46,7 +47,7 @@ public interface FakeApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, accept = { "application/json" }, contentType = "application/xml" ) @@ -55,6 +56,7 @@ Mono createXmlItem( ); + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -65,7 +67,7 @@ Mono createXmlItem( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -74,6 +76,7 @@ Mono fakeOuterBooleanSerialize( ); + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -84,7 +87,7 @@ Mono fakeOuterBooleanSerialize( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -93,6 +96,7 @@ Mono fakeOuterCompositeSerialize( ); + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -103,7 +107,7 @@ Mono fakeOuterCompositeSerialize( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -112,6 +116,7 @@ Mono fakeOuterNumberSerialize( ); + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -122,7 +127,7 @@ Mono fakeOuterNumberSerialize( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -131,6 +136,7 @@ Mono fakeOuterStringSerialize( ); + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. @@ -141,7 +147,7 @@ Mono fakeOuterStringSerialize( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PUT", - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, accept = { "application/json" }, contentType = "application/json" ) @@ -150,6 +156,7 @@ Mono testBodyWithFileSchema( ); + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -160,7 +167,7 @@ Mono testBodyWithFileSchema( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PUT", - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, accept = { "application/json" }, contentType = "application/json" ) @@ -170,6 +177,7 @@ Mono testBodyWithQueryParams( ); + String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -180,7 +188,7 @@ Mono testBodyWithQueryParams( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PATCH", - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, accept = { "application/json" }, contentType = "application/json" ) @@ -189,6 +197,7 @@ Mono testClientModel( ); + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -213,7 +222,7 @@ Mono testClientModel( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "POST", - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -235,6 +244,7 @@ Mono testEndpointParameters( ); + String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -253,7 +263,7 @@ Mono testEndpointParameters( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "GET", - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -269,6 +279,7 @@ Mono testEnumParameters( ); + String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -284,7 +295,7 @@ Mono testEnumParameters( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "DELETE", - value = "/fake", + value = FakeApi.PATH_TEST_GROUP_PARAMETERS, accept = { "application/json" } ) Mono testGroupParameters( @@ -297,6 +308,7 @@ Mono testGroupParameters( ); + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -307,7 +319,7 @@ Mono testGroupParameters( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, accept = { "application/json" }, contentType = "application/json" ) @@ -316,6 +328,7 @@ Mono testInlineAdditionalProperties( ); + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -327,7 +340,7 @@ Mono testInlineAdditionalProperties( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -337,6 +350,7 @@ Mono testJsonFormData( ); + String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -347,7 +361,7 @@ Mono testJsonFormData( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, accept = { "application/json" }, contentType = "application/json" ) @@ -356,6 +370,7 @@ Mono testNullable( ); + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -369,7 +384,7 @@ Mono testNullable( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PUT", - value = "/fake/test-query-parameters", + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT, accept = { "application/json" } ) Mono testQueryParameterCollectionFormat( @@ -380,6 +395,7 @@ Mono testQueryParameterCollectionFormat( ); + String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example"; /** * GET /fake/response-with-example * This endpoint defines an example value for its response schema. @@ -389,7 +405,7 @@ Mono testQueryParameterCollectionFormat( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) Mono testWithResultExample( diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 1d20b6040b0f..2e44d9c9fbd7 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeClassnameTags123Api { + String PATH_TEST_CLASSNAME = "/fake_classname_test"; /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -35,7 +36,7 @@ public interface FakeClassnameTags123Api { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PATCH", - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java index 1d3ca1b6ade9..75fec8644b46 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -40,7 +41,7 @@ public interface PetApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -49,6 +50,7 @@ Mono addPet( ); + String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -61,7 +63,7 @@ Mono addPet( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "DELETE", - value = "/pet/{petId}", + value = PetApi.PATH_DELETE_PET, accept = { "application/json" } ) Mono deletePet( @@ -70,6 +72,7 @@ Mono deletePet( ); + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; /** * GET /pet/findByStatus : Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -81,7 +84,7 @@ Mono deletePet( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) Flux findPetsByStatus( @@ -89,6 +92,7 @@ Flux findPetsByStatus( ); + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; /** * GET /pet/findByTags : Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -102,7 +106,7 @@ Flux findPetsByStatus( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) Flux findPetsByTags( @@ -110,6 +114,7 @@ Flux findPetsByTags( ); + String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -122,7 +127,7 @@ Flux findPetsByTags( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) Mono getPetById( @@ -130,6 +135,7 @@ Mono getPetById( ); + String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -139,7 +145,7 @@ Mono getPetById( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) Mono responseObjectDifferentNames( @@ -147,6 +153,7 @@ Mono responseObjectDifferentNames( ); + String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -160,7 +167,7 @@ Mono responseObjectDifferentNames( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "PUT", - value = "/pet", + value = PetApi.PATH_UPDATE_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -169,6 +176,7 @@ Mono updatePet( ); + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -181,7 +189,7 @@ Mono updatePet( @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @HttpExchange( method = "POST", - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -192,6 +200,7 @@ Mono updatePetWithForm( ); + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -204,7 +213,7 @@ Mono updatePetWithForm( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) @@ -215,6 +224,7 @@ Mono uploadFile( ); + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -227,7 +237,7 @@ Mono uploadFile( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java index 397e809ee6b3..895947109cd9 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface StoreApi { + String PATH_DELETE_ORDER = "/store/order/{order_id}"; /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -37,7 +38,7 @@ public interface StoreApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "DELETE", - value = "/store/order/{order_id}", + value = StoreApi.PATH_DELETE_ORDER, accept = { "application/json" } ) Mono deleteOrder( @@ -45,6 +46,7 @@ Mono deleteOrder( ); + String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -54,7 +56,7 @@ Mono deleteOrder( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) Mono> getInventory( @@ -62,6 +64,7 @@ Mono> getInventory( ); + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; /** * GET /store/order/{order_id} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -74,7 +77,7 @@ Mono> getInventory( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) Mono getOrderById( @@ -82,6 +85,7 @@ Mono getOrderById( ); + String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -93,7 +97,7 @@ Mono getOrderById( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java index 46a77f0f665c..cae5e26735c3 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface UserApi { + String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -36,7 +37,7 @@ public interface UserApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/user", + value = UserApi.PATH_CREATE_USER, accept = { "application/json" }, contentType = "application/json" ) @@ -45,6 +46,7 @@ Mono createUser( ); + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -55,7 +57,7 @@ Mono createUser( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -64,6 +66,7 @@ Mono createUsersWithArrayInput( ); + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -74,7 +77,7 @@ Mono createUsersWithArrayInput( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "POST", - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -83,6 +86,7 @@ Mono createUsersWithListInput( ); + String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -94,7 +98,7 @@ Mono createUsersWithListInput( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "DELETE", - value = "/user/{username}", + value = UserApi.PATH_DELETE_USER, accept = { "application/json" } ) Mono deleteUser( @@ -102,6 +106,7 @@ Mono deleteUser( ); + String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -114,7 +119,7 @@ Mono deleteUser( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) Mono getUserByName( @@ -122,6 +127,7 @@ Mono getUserByName( ); + String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -134,7 +140,7 @@ Mono getUserByName( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) Mono loginUser( @@ -143,6 +149,7 @@ Mono loginUser( ); + String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -152,7 +159,7 @@ Mono loginUser( @ResponseStatus(HttpStatus.OK) @HttpExchange( method = "GET", - value = "/user/logout", + value = UserApi.PATH_LOGOUT_USER, accept = { "application/json" } ) Mono logoutUser( @@ -160,6 +167,7 @@ Mono logoutUser( ); + String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -172,7 +180,7 @@ Mono logoutUser( @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( method = "PUT", - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index f602bff597db..9aae113bd0d4 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface AnotherFakeApi { + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -34,7 +35,7 @@ public interface AnotherFakeApi { */ @HttpExchange( method = "PATCH", - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java index af75ee77bd9c..3c7c45ec49cc 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeApi { + String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -45,7 +46,7 @@ public interface FakeApi { */ @HttpExchange( method = "POST", - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, accept = { "application/json" }, contentType = "application/xml" ) @@ -54,6 +55,7 @@ Mono> createXmlItem( ); + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -63,7 +65,7 @@ Mono> createXmlItem( */ @HttpExchange( method = "POST", - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -72,6 +74,7 @@ Mono> fakeOuterBooleanSerialize( ); + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -81,7 +84,7 @@ Mono> fakeOuterBooleanSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -90,6 +93,7 @@ Mono> fakeOuterCompositeSerialize( ); + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -99,7 +103,7 @@ Mono> fakeOuterCompositeSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -108,6 +112,7 @@ Mono> fakeOuterNumberSerialize( ); + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -117,7 +122,7 @@ Mono> fakeOuterNumberSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -126,6 +131,7 @@ Mono> fakeOuterStringSerialize( ); + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. @@ -135,7 +141,7 @@ Mono> fakeOuterStringSerialize( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, accept = { "application/json" }, contentType = "application/json" ) @@ -144,6 +150,7 @@ Mono> testBodyWithFileSchema( ); + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -153,7 +160,7 @@ Mono> testBodyWithFileSchema( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, accept = { "application/json" }, contentType = "application/json" ) @@ -163,6 +170,7 @@ Mono> testBodyWithQueryParams( ); + String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -172,7 +180,7 @@ Mono> testBodyWithQueryParams( */ @HttpExchange( method = "PATCH", - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, accept = { "application/json" }, contentType = "application/json" ) @@ -181,6 +189,7 @@ Mono> testClientModel( ); + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -204,7 +213,7 @@ Mono> testClientModel( */ @HttpExchange( method = "POST", - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -226,6 +235,7 @@ Mono> testEndpointParameters( ); + String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -243,7 +253,7 @@ Mono> testEndpointParameters( */ @HttpExchange( method = "GET", - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -259,6 +269,7 @@ Mono> testEnumParameters( ); + String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -273,7 +284,7 @@ Mono> testEnumParameters( */ @HttpExchange( method = "DELETE", - value = "/fake", + value = FakeApi.PATH_TEST_GROUP_PARAMETERS, accept = { "application/json" } ) Mono> testGroupParameters( @@ -286,6 +297,7 @@ Mono> testGroupParameters( ); + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -295,7 +307,7 @@ Mono> testGroupParameters( */ @HttpExchange( method = "POST", - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, accept = { "application/json" }, contentType = "application/json" ) @@ -304,6 +316,7 @@ Mono> testInlineAdditionalProperties( ); + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -314,7 +327,7 @@ Mono> testInlineAdditionalProperties( */ @HttpExchange( method = "GET", - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -324,6 +337,7 @@ Mono> testJsonFormData( ); + String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -333,7 +347,7 @@ Mono> testJsonFormData( */ @HttpExchange( method = "POST", - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, accept = { "application/json" }, contentType = "application/json" ) @@ -342,6 +356,7 @@ Mono> testNullable( ); + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -354,7 +369,7 @@ Mono> testNullable( */ @HttpExchange( method = "PUT", - value = "/fake/test-query-parameters", + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT, accept = { "application/json" } ) Mono> testQueryParameterCollectionFormat( @@ -365,6 +380,7 @@ Mono> testQueryParameterCollectionFormat( ); + String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example"; /** * GET /fake/response-with-example * This endpoint defines an example value for its response schema. @@ -373,7 +389,7 @@ Mono> testQueryParameterCollectionFormat( */ @HttpExchange( method = "GET", - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) Mono> testWithResultExample( diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index ef543be01c78..e6eb7ea67235 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeClassnameTags123Api { + String PATH_TEST_CLASSNAME = "/fake_classname_test"; /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -34,7 +35,7 @@ public interface FakeClassnameTags123Api { */ @HttpExchange( method = "PATCH", - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java index fea355653977..103fd5621774 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -39,7 +40,7 @@ public interface PetApi { */ @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -48,6 +49,7 @@ Mono> addPet( ); + String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -59,7 +61,7 @@ Mono> addPet( */ @HttpExchange( method = "DELETE", - value = "/pet/{petId}", + value = PetApi.PATH_DELETE_PET, accept = { "application/json" } ) Mono> deletePet( @@ -68,6 +70,7 @@ Mono> deletePet( ); + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; /** * GET /pet/findByStatus : Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -78,7 +81,7 @@ Mono> deletePet( */ @HttpExchange( method = "GET", - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) Mono>> findPetsByStatus( @@ -86,6 +89,7 @@ Mono>> findPetsByStatus( ); + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; /** * GET /pet/findByTags : Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -98,7 +102,7 @@ Mono>> findPetsByStatus( @Deprecated @HttpExchange( method = "GET", - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) Mono>> findPetsByTags( @@ -106,6 +110,7 @@ Mono>> findPetsByTags( ); + String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -117,7 +122,7 @@ Mono>> findPetsByTags( */ @HttpExchange( method = "GET", - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) Mono> getPetById( @@ -125,6 +130,7 @@ Mono> getPetById( ); + String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -133,7 +139,7 @@ Mono> getPetById( */ @HttpExchange( method = "GET", - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) Mono> responseObjectDifferentNames( @@ -141,6 +147,7 @@ Mono> responseObjectDiffer ); + String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -153,7 +160,7 @@ Mono> responseObjectDiffer */ @HttpExchange( method = "PUT", - value = "/pet", + value = PetApi.PATH_UPDATE_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -162,6 +169,7 @@ Mono> updatePet( ); + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -173,7 +181,7 @@ Mono> updatePet( */ @HttpExchange( method = "POST", - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -184,6 +192,7 @@ Mono> updatePetWithForm( ); + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -195,7 +204,7 @@ Mono> updatePetWithForm( */ @HttpExchange( method = "POST", - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) @@ -206,6 +215,7 @@ Mono> uploadFile( ); + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -217,7 +227,7 @@ Mono> uploadFile( */ @HttpExchange( method = "POST", - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java index 764c066b6a51..6589e8bcd8e9 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface StoreApi { + String PATH_DELETE_ORDER = "/store/order/{order_id}"; /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -36,7 +37,7 @@ public interface StoreApi { */ @HttpExchange( method = "DELETE", - value = "/store/order/{order_id}", + value = StoreApi.PATH_DELETE_ORDER, accept = { "application/json" } ) Mono> deleteOrder( @@ -44,6 +45,7 @@ Mono> deleteOrder( ); + String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -52,7 +54,7 @@ Mono> deleteOrder( */ @HttpExchange( method = "GET", - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) Mono>> getInventory( @@ -60,6 +62,7 @@ Mono>> getInventory( ); + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; /** * GET /store/order/{order_id} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -71,7 +74,7 @@ Mono>> getInventory( */ @HttpExchange( method = "GET", - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) Mono> getOrderById( @@ -79,6 +82,7 @@ Mono> getOrderById( ); + String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -89,7 +93,7 @@ Mono> getOrderById( */ @HttpExchange( method = "POST", - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java index 2643d9a3a461..b36bdcc377d0 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface UserApi { + String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -35,7 +36,7 @@ public interface UserApi { */ @HttpExchange( method = "POST", - value = "/user", + value = UserApi.PATH_CREATE_USER, accept = { "application/json" }, contentType = "application/json" ) @@ -44,6 +45,7 @@ Mono> createUser( ); + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -53,7 +55,7 @@ Mono> createUser( */ @HttpExchange( method = "POST", - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -62,6 +64,7 @@ Mono> createUsersWithArrayInput( ); + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -71,7 +74,7 @@ Mono> createUsersWithArrayInput( */ @HttpExchange( method = "POST", - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -80,6 +83,7 @@ Mono> createUsersWithListInput( ); + String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -90,7 +94,7 @@ Mono> createUsersWithListInput( */ @HttpExchange( method = "DELETE", - value = "/user/{username}", + value = UserApi.PATH_DELETE_USER, accept = { "application/json" } ) Mono> deleteUser( @@ -98,6 +102,7 @@ Mono> deleteUser( ); + String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -109,7 +114,7 @@ Mono> deleteUser( */ @HttpExchange( method = "GET", - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) Mono> getUserByName( @@ -117,6 +122,7 @@ Mono> getUserByName( ); + String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -128,7 +134,7 @@ Mono> getUserByName( */ @HttpExchange( method = "GET", - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) Mono> loginUser( @@ -137,6 +143,7 @@ Mono> loginUser( ); + String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -145,7 +152,7 @@ Mono> loginUser( */ @HttpExchange( method = "GET", - value = "/user/logout", + value = UserApi.PATH_LOGOUT_USER, accept = { "application/json" } ) Mono> logoutUser( @@ -153,6 +160,7 @@ Mono> logoutUser( ); + String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -164,7 +172,7 @@ Mono> logoutUser( */ @HttpExchange( method = "PUT", - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1a3bf4eb8572..ac5f73cb5aaf 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface AnotherFakeApi { + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -33,7 +34,7 @@ public interface AnotherFakeApi { */ @HttpExchange( method = "PATCH", - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java index a089293ed3f8..9775faf460a0 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java @@ -35,6 +35,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeApi { + String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -44,7 +45,7 @@ public interface FakeApi { */ @HttpExchange( method = "POST", - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, accept = { "application/json" }, contentType = "application/xml" ) @@ -53,6 +54,7 @@ ResponseEntity createXmlItem( ); + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -62,7 +64,7 @@ ResponseEntity createXmlItem( */ @HttpExchange( method = "POST", - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -71,6 +73,7 @@ ResponseEntity fakeOuterBooleanSerialize( ); + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -80,7 +83,7 @@ ResponseEntity fakeOuterBooleanSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -89,6 +92,7 @@ ResponseEntity fakeOuterCompositeSerialize( ); + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -98,7 +102,7 @@ ResponseEntity fakeOuterCompositeSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -107,6 +111,7 @@ ResponseEntity fakeOuterNumberSerialize( ); + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -116,7 +121,7 @@ ResponseEntity fakeOuterNumberSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -125,6 +130,7 @@ ResponseEntity fakeOuterStringSerialize( ); + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. @@ -134,7 +140,7 @@ ResponseEntity fakeOuterStringSerialize( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, accept = { "application/json" }, contentType = "application/json" ) @@ -143,6 +149,7 @@ ResponseEntity testBodyWithFileSchema( ); + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -152,7 +159,7 @@ ResponseEntity testBodyWithFileSchema( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, accept = { "application/json" }, contentType = "application/json" ) @@ -162,6 +169,7 @@ ResponseEntity testBodyWithQueryParams( ); + String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -171,7 +179,7 @@ ResponseEntity testBodyWithQueryParams( */ @HttpExchange( method = "PATCH", - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, accept = { "application/json" }, contentType = "application/json" ) @@ -180,6 +188,7 @@ ResponseEntity testClientModel( ); + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -203,7 +212,7 @@ ResponseEntity testClientModel( */ @HttpExchange( method = "POST", - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -225,6 +234,7 @@ ResponseEntity testEndpointParameters( ); + String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -242,7 +252,7 @@ ResponseEntity testEndpointParameters( */ @HttpExchange( method = "GET", - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -258,6 +268,7 @@ ResponseEntity testEnumParameters( ); + String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -272,7 +283,7 @@ ResponseEntity testEnumParameters( */ @HttpExchange( method = "DELETE", - value = "/fake", + value = FakeApi.PATH_TEST_GROUP_PARAMETERS, accept = { "application/json" } ) ResponseEntity testGroupParameters( @@ -285,6 +296,7 @@ ResponseEntity testGroupParameters( ); + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -294,7 +306,7 @@ ResponseEntity testGroupParameters( */ @HttpExchange( method = "POST", - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, accept = { "application/json" }, contentType = "application/json" ) @@ -303,6 +315,7 @@ ResponseEntity testInlineAdditionalProperties( ); + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -313,7 +326,7 @@ ResponseEntity testInlineAdditionalProperties( */ @HttpExchange( method = "GET", - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -323,6 +336,7 @@ ResponseEntity testJsonFormData( ); + String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -332,7 +346,7 @@ ResponseEntity testJsonFormData( */ @HttpExchange( method = "POST", - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, accept = { "application/json" }, contentType = "application/json" ) @@ -341,6 +355,7 @@ ResponseEntity testNullable( ); + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -353,7 +368,7 @@ ResponseEntity testNullable( */ @HttpExchange( method = "PUT", - value = "/fake/test-query-parameters", + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT, accept = { "application/json" } ) ResponseEntity testQueryParameterCollectionFormat( @@ -364,6 +379,7 @@ ResponseEntity testQueryParameterCollectionFormat( ); + String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example"; /** * GET /fake/response-with-example * This endpoint defines an example value for its response schema. @@ -372,7 +388,7 @@ ResponseEntity testQueryParameterCollectionFormat( */ @HttpExchange( method = "GET", - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) ResponseEntity testWithResultExample( diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 1482e1393c35..271b850493e8 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeClassnameTags123Api { + String PATH_TEST_CLASSNAME = "/fake_classname_test"; /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -33,7 +34,7 @@ public interface FakeClassnameTags123Api { */ @HttpExchange( method = "PATCH", - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/PetApi.java index c2720d5ccd9f..70ae71d2a822 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/PetApi.java @@ -28,6 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -38,7 +39,7 @@ public interface PetApi { */ @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -47,6 +48,7 @@ ResponseEntity addPet( ); + String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -58,7 +60,7 @@ ResponseEntity addPet( */ @HttpExchange( method = "DELETE", - value = "/pet/{petId}", + value = PetApi.PATH_DELETE_PET, accept = { "application/json" } ) ResponseEntity deletePet( @@ -67,6 +69,7 @@ ResponseEntity deletePet( ); + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; /** * GET /pet/findByStatus : Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -77,7 +80,7 @@ ResponseEntity deletePet( */ @HttpExchange( method = "GET", - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) ResponseEntity> findPetsByStatus( @@ -85,6 +88,7 @@ ResponseEntity> findPetsByStatus( ); + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; /** * GET /pet/findByTags : Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -97,7 +101,7 @@ ResponseEntity> findPetsByStatus( @Deprecated @HttpExchange( method = "GET", - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) ResponseEntity> findPetsByTags( @@ -105,6 +109,7 @@ ResponseEntity> findPetsByTags( ); + String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -116,7 +121,7 @@ ResponseEntity> findPetsByTags( */ @HttpExchange( method = "GET", - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) ResponseEntity getPetById( @@ -124,6 +129,7 @@ ResponseEntity getPetById( ); + String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -132,7 +138,7 @@ ResponseEntity getPetById( */ @HttpExchange( method = "GET", - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) ResponseEntity responseObjectDifferentNames( @@ -140,6 +146,7 @@ ResponseEntity responseObjectDifferent ); + String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -152,7 +159,7 @@ ResponseEntity responseObjectDifferent */ @HttpExchange( method = "PUT", - value = "/pet", + value = PetApi.PATH_UPDATE_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -161,6 +168,7 @@ ResponseEntity updatePet( ); + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -172,7 +180,7 @@ ResponseEntity updatePet( */ @HttpExchange( method = "POST", - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -183,6 +191,7 @@ ResponseEntity updatePetWithForm( ); + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -194,7 +203,7 @@ ResponseEntity updatePetWithForm( */ @HttpExchange( method = "POST", - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) @@ -205,6 +214,7 @@ ResponseEntity uploadFile( ); + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -216,7 +226,7 @@ ResponseEntity uploadFile( */ @HttpExchange( method = "POST", - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/StoreApi.java index 3cc149bde388..faa0cc3ec4bd 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/StoreApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface StoreApi { + String PATH_DELETE_ORDER = "/store/order/{order_id}"; /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -35,7 +36,7 @@ public interface StoreApi { */ @HttpExchange( method = "DELETE", - value = "/store/order/{order_id}", + value = StoreApi.PATH_DELETE_ORDER, accept = { "application/json" } ) ResponseEntity deleteOrder( @@ -43,6 +44,7 @@ ResponseEntity deleteOrder( ); + String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -51,7 +53,7 @@ ResponseEntity deleteOrder( */ @HttpExchange( method = "GET", - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) ResponseEntity> getInventory( @@ -59,6 +61,7 @@ ResponseEntity> getInventory( ); + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; /** * GET /store/order/{order_id} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -70,7 +73,7 @@ ResponseEntity> getInventory( */ @HttpExchange( method = "GET", - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) ResponseEntity getOrderById( @@ -78,6 +81,7 @@ ResponseEntity getOrderById( ); + String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -88,7 +92,7 @@ ResponseEntity getOrderById( */ @HttpExchange( method = "POST", - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/UserApi.java index 6a740f996f02..da9ba7fc56e8 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/UserApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface UserApi { + String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -34,7 +35,7 @@ public interface UserApi { */ @HttpExchange( method = "POST", - value = "/user", + value = UserApi.PATH_CREATE_USER, accept = { "application/json" }, contentType = "application/json" ) @@ -43,6 +44,7 @@ ResponseEntity createUser( ); + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -52,7 +54,7 @@ ResponseEntity createUser( */ @HttpExchange( method = "POST", - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -61,6 +63,7 @@ ResponseEntity createUsersWithArrayInput( ); + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -70,7 +73,7 @@ ResponseEntity createUsersWithArrayInput( */ @HttpExchange( method = "POST", - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -79,6 +82,7 @@ ResponseEntity createUsersWithListInput( ); + String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -89,7 +93,7 @@ ResponseEntity createUsersWithListInput( */ @HttpExchange( method = "DELETE", - value = "/user/{username}", + value = UserApi.PATH_DELETE_USER, accept = { "application/json" } ) ResponseEntity deleteUser( @@ -97,6 +101,7 @@ ResponseEntity deleteUser( ); + String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -108,7 +113,7 @@ ResponseEntity deleteUser( */ @HttpExchange( method = "GET", - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) ResponseEntity getUserByName( @@ -116,6 +121,7 @@ ResponseEntity getUserByName( ); + String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -127,7 +133,7 @@ ResponseEntity getUserByName( */ @HttpExchange( method = "GET", - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) ResponseEntity loginUser( @@ -136,6 +142,7 @@ ResponseEntity loginUser( ); + String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -144,7 +151,7 @@ ResponseEntity loginUser( */ @HttpExchange( method = "GET", - value = "/user/logout", + value = UserApi.PATH_LOGOUT_USER, accept = { "application/json" } ) ResponseEntity logoutUser( @@ -152,6 +159,7 @@ ResponseEntity logoutUser( ); + String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -163,7 +171,7 @@ ResponseEntity logoutUser( */ @HttpExchange( method = "PUT", - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/AnotherFakeApi.java index 2aef95aa88b5..c48e2562c6b6 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface AnotherFakeApi { + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -33,7 +34,7 @@ public interface AnotherFakeApi { */ @HttpExchange( method = "PATCH", - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java index d8898d654c99..74c37de2b2ca 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java @@ -35,6 +35,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeApi { + String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -44,7 +45,7 @@ public interface FakeApi { */ @HttpExchange( method = "POST", - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, accept = { "application/json" }, contentType = "application/xml" ) @@ -53,6 +54,7 @@ ResponseEntity createXmlItem( ); + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -62,7 +64,7 @@ ResponseEntity createXmlItem( */ @HttpExchange( method = "POST", - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -71,6 +73,7 @@ ResponseEntity fakeOuterBooleanSerialize( ); + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -80,7 +83,7 @@ ResponseEntity fakeOuterBooleanSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -89,6 +92,7 @@ ResponseEntity fakeOuterCompositeSerialize( ); + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -98,7 +102,7 @@ ResponseEntity fakeOuterCompositeSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -107,6 +111,7 @@ ResponseEntity fakeOuterNumberSerialize( ); + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -116,7 +121,7 @@ ResponseEntity fakeOuterNumberSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -125,6 +130,7 @@ ResponseEntity fakeOuterStringSerialize( ); + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. @@ -134,7 +140,7 @@ ResponseEntity fakeOuterStringSerialize( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, accept = { "application/json" }, contentType = "application/json" ) @@ -143,6 +149,7 @@ ResponseEntity testBodyWithFileSchema( ); + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -152,7 +159,7 @@ ResponseEntity testBodyWithFileSchema( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, accept = { "application/json" }, contentType = "application/json" ) @@ -162,6 +169,7 @@ ResponseEntity testBodyWithQueryParams( ); + String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -171,7 +179,7 @@ ResponseEntity testBodyWithQueryParams( */ @HttpExchange( method = "PATCH", - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, accept = { "application/json" }, contentType = "application/json" ) @@ -180,6 +188,7 @@ ResponseEntity testClientModel( ); + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -203,7 +212,7 @@ ResponseEntity testClientModel( */ @HttpExchange( method = "POST", - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -225,6 +234,7 @@ ResponseEntity testEndpointParameters( ); + String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -242,7 +252,7 @@ ResponseEntity testEndpointParameters( */ @HttpExchange( method = "GET", - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -258,6 +268,7 @@ ResponseEntity testEnumParameters( ); + String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -272,7 +283,7 @@ ResponseEntity testEnumParameters( */ @HttpExchange( method = "DELETE", - value = "/fake", + value = FakeApi.PATH_TEST_GROUP_PARAMETERS, accept = { "application/json" } ) ResponseEntity testGroupParameters( @@ -285,6 +296,7 @@ ResponseEntity testGroupParameters( ); + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -294,7 +306,7 @@ ResponseEntity testGroupParameters( */ @HttpExchange( method = "POST", - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, accept = { "application/json" }, contentType = "application/json" ) @@ -303,6 +315,7 @@ ResponseEntity testInlineAdditionalProperties( ); + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -313,7 +326,7 @@ ResponseEntity testInlineAdditionalProperties( */ @HttpExchange( method = "GET", - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -323,6 +336,7 @@ ResponseEntity testJsonFormData( ); + String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -332,7 +346,7 @@ ResponseEntity testJsonFormData( */ @HttpExchange( method = "POST", - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, accept = { "application/json" }, contentType = "application/json" ) @@ -341,6 +355,7 @@ ResponseEntity testNullable( ); + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -353,7 +368,7 @@ ResponseEntity testNullable( */ @HttpExchange( method = "PUT", - value = "/fake/test-query-parameters", + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT, accept = { "application/json" } ) ResponseEntity testQueryParameterCollectionFormat( @@ -364,6 +379,7 @@ ResponseEntity testQueryParameterCollectionFormat( ); + String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example"; /** * GET /fake/response-with-example * This endpoint defines an example value for its response schema. @@ -372,7 +388,7 @@ ResponseEntity testQueryParameterCollectionFormat( */ @HttpExchange( method = "GET", - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) ResponseEntity testWithResultExample( diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index f1405212ced4..02f1b9b1b8c6 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeClassnameTags123Api { + String PATH_TEST_CLASSNAME = "/fake_classname_test"; /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -33,7 +34,7 @@ public interface FakeClassnameTags123Api { */ @HttpExchange( method = "PATCH", - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/PetApi.java index 56616133b94e..d752a439795e 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/PetApi.java @@ -28,6 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -38,7 +39,7 @@ public interface PetApi { */ @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -47,6 +48,7 @@ ResponseEntity addPet( ); + String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -58,7 +60,7 @@ ResponseEntity addPet( */ @HttpExchange( method = "DELETE", - value = "/pet/{petId}", + value = PetApi.PATH_DELETE_PET, accept = { "application/json" } ) ResponseEntity deletePet( @@ -67,6 +69,7 @@ ResponseEntity deletePet( ); + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; /** * GET /pet/findByStatus : Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -77,7 +80,7 @@ ResponseEntity deletePet( */ @HttpExchange( method = "GET", - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) ResponseEntity> findPetsByStatus( @@ -85,6 +88,7 @@ ResponseEntity> findPetsByStatus( ); + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; /** * GET /pet/findByTags : Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -97,7 +101,7 @@ ResponseEntity> findPetsByStatus( @Deprecated @HttpExchange( method = "GET", - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) ResponseEntity> findPetsByTags( @@ -105,6 +109,7 @@ ResponseEntity> findPetsByTags( ); + String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -116,7 +121,7 @@ ResponseEntity> findPetsByTags( */ @HttpExchange( method = "GET", - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) ResponseEntity getPetById( @@ -124,6 +129,7 @@ ResponseEntity getPetById( ); + String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -132,7 +138,7 @@ ResponseEntity getPetById( */ @HttpExchange( method = "GET", - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) ResponseEntity responseObjectDifferentNames( @@ -140,6 +146,7 @@ ResponseEntity responseObjectDifferentNam ); + String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -152,7 +159,7 @@ ResponseEntity responseObjectDifferentNam */ @HttpExchange( method = "PUT", - value = "/pet", + value = PetApi.PATH_UPDATE_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -161,6 +168,7 @@ ResponseEntity updatePet( ); + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -172,7 +180,7 @@ ResponseEntity updatePet( */ @HttpExchange( method = "POST", - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -183,6 +191,7 @@ ResponseEntity updatePetWithForm( ); + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -194,7 +203,7 @@ ResponseEntity updatePetWithForm( */ @HttpExchange( method = "POST", - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) @@ -205,6 +214,7 @@ ResponseEntity uploadFile( ); + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -216,7 +226,7 @@ ResponseEntity uploadFile( */ @HttpExchange( method = "POST", - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/StoreApi.java index a9f9812fcc4b..be4342743427 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/StoreApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface StoreApi { + String PATH_DELETE_ORDER = "/store/order/{order_id}"; /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -35,7 +36,7 @@ public interface StoreApi { */ @HttpExchange( method = "DELETE", - value = "/store/order/{order_id}", + value = StoreApi.PATH_DELETE_ORDER, accept = { "application/json" } ) ResponseEntity deleteOrder( @@ -43,6 +44,7 @@ ResponseEntity deleteOrder( ); + String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -51,7 +53,7 @@ ResponseEntity deleteOrder( */ @HttpExchange( method = "GET", - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) ResponseEntity> getInventory( @@ -59,6 +61,7 @@ ResponseEntity> getInventory( ); + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; /** * GET /store/order/{order_id} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -70,7 +73,7 @@ ResponseEntity> getInventory( */ @HttpExchange( method = "GET", - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) ResponseEntity getOrderById( @@ -78,6 +81,7 @@ ResponseEntity getOrderById( ); + String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -88,7 +92,7 @@ ResponseEntity getOrderById( */ @HttpExchange( method = "POST", - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/UserApi.java index 0caf178a8771..658d8096c9ac 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/UserApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface UserApi { + String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -34,7 +35,7 @@ public interface UserApi { */ @HttpExchange( method = "POST", - value = "/user", + value = UserApi.PATH_CREATE_USER, accept = { "application/json" }, contentType = "application/json" ) @@ -43,6 +44,7 @@ ResponseEntity createUser( ); + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -52,7 +54,7 @@ ResponseEntity createUser( */ @HttpExchange( method = "POST", - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -61,6 +63,7 @@ ResponseEntity createUsersWithArrayInput( ); + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -70,7 +73,7 @@ ResponseEntity createUsersWithArrayInput( */ @HttpExchange( method = "POST", - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -79,6 +82,7 @@ ResponseEntity createUsersWithListInput( ); + String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -89,7 +93,7 @@ ResponseEntity createUsersWithListInput( */ @HttpExchange( method = "DELETE", - value = "/user/{username}", + value = UserApi.PATH_DELETE_USER, accept = { "application/json" } ) ResponseEntity deleteUser( @@ -97,6 +101,7 @@ ResponseEntity deleteUser( ); + String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -108,7 +113,7 @@ ResponseEntity deleteUser( */ @HttpExchange( method = "GET", - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) ResponseEntity getUserByName( @@ -116,6 +121,7 @@ ResponseEntity getUserByName( ); + String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -127,7 +133,7 @@ ResponseEntity getUserByName( */ @HttpExchange( method = "GET", - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) ResponseEntity loginUser( @@ -136,6 +142,7 @@ ResponseEntity loginUser( ); + String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -144,7 +151,7 @@ ResponseEntity loginUser( */ @HttpExchange( method = "GET", - value = "/user/logout", + value = UserApi.PATH_LOGOUT_USER, accept = { "application/json" } ) ResponseEntity logoutUser( @@ -152,6 +159,7 @@ ResponseEntity logoutUser( ); + String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -163,7 +171,7 @@ ResponseEntity logoutUser( */ @HttpExchange( method = "PUT", - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java index 6cb36b67e47b..7685fa6c2d49 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -21,6 +21,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface AnotherFakeApi { + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; /** * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number @@ -30,7 +31,7 @@ public interface AnotherFakeApi { */ @HttpExchange( method = "PATCH", - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java index a617a642bae4..836a70922310 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java @@ -32,6 +32,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeApi { + String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -41,7 +42,7 @@ public interface FakeApi { */ @HttpExchange( method = "POST", - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, accept = { "application/json" }, contentType = "application/xml" ) @@ -50,6 +51,7 @@ ResponseEntity createXmlItem( ); + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -59,7 +61,7 @@ ResponseEntity createXmlItem( */ @HttpExchange( method = "POST", - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -68,6 +70,7 @@ ResponseEntity fakeOuterBooleanSerialize( ); + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -77,7 +80,7 @@ ResponseEntity fakeOuterBooleanSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -86,6 +89,7 @@ ResponseEntity fakeOuterCompositeSerialize( ); + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -95,7 +99,7 @@ ResponseEntity fakeOuterCompositeSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -104,6 +108,7 @@ ResponseEntity fakeOuterNumberSerialize( ); + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -113,7 +118,7 @@ ResponseEntity fakeOuterNumberSerialize( */ @HttpExchange( method = "POST", - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, accept = { "*/*" }, contentType = "application/json" ) @@ -122,6 +127,7 @@ ResponseEntity fakeOuterStringSerialize( ); + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. @@ -131,7 +137,7 @@ ResponseEntity fakeOuterStringSerialize( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, accept = { "application/json" }, contentType = "application/json" ) @@ -140,6 +146,7 @@ ResponseEntity testBodyWithFileSchema( ); + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -149,7 +156,7 @@ ResponseEntity testBodyWithFileSchema( */ @HttpExchange( method = "PUT", - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, accept = { "application/json" }, contentType = "application/json" ) @@ -159,6 +166,7 @@ ResponseEntity testBodyWithQueryParams( ); + String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -168,7 +176,7 @@ ResponseEntity testBodyWithQueryParams( */ @HttpExchange( method = "PATCH", - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, accept = { "application/json" }, contentType = "application/json" ) @@ -177,6 +185,7 @@ ResponseEntity testClientModel( ); + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -200,7 +209,7 @@ ResponseEntity testClientModel( */ @HttpExchange( method = "POST", - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -222,6 +231,7 @@ ResponseEntity testEndpointParameters( ); + String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -239,7 +249,7 @@ ResponseEntity testEndpointParameters( */ @HttpExchange( method = "GET", - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -255,6 +265,7 @@ ResponseEntity testEnumParameters( ); + String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -269,7 +280,7 @@ ResponseEntity testEnumParameters( */ @HttpExchange( method = "DELETE", - value = "/fake", + value = FakeApi.PATH_TEST_GROUP_PARAMETERS, accept = { "application/json" } ) ResponseEntity testGroupParameters( @@ -282,6 +293,7 @@ ResponseEntity testGroupParameters( ); + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -291,7 +303,7 @@ ResponseEntity testGroupParameters( */ @HttpExchange( method = "POST", - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, accept = { "application/json" }, contentType = "application/json" ) @@ -300,6 +312,7 @@ ResponseEntity testInlineAdditionalProperties( ); + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -310,7 +323,7 @@ ResponseEntity testInlineAdditionalProperties( */ @HttpExchange( method = "GET", - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -320,6 +333,7 @@ ResponseEntity testJsonFormData( ); + String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -329,7 +343,7 @@ ResponseEntity testJsonFormData( */ @HttpExchange( method = "POST", - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, accept = { "application/json" }, contentType = "application/json" ) @@ -338,6 +352,7 @@ ResponseEntity testNullable( ); + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -350,7 +365,7 @@ ResponseEntity testNullable( */ @HttpExchange( method = "PUT", - value = "/fake/test-query-parameters", + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT, accept = { "application/json" } ) ResponseEntity testQueryParameterCollectionFormat( @@ -361,6 +376,7 @@ ResponseEntity testQueryParameterCollectionFormat( ); + String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example"; /** * GET /fake/response-with-example * This endpoint defines an example value for its response schema. @@ -369,7 +385,7 @@ ResponseEntity testQueryParameterCollectionFormat( */ @HttpExchange( method = "GET", - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) ResponseEntity testWithResultExample( diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 29775df7c20b..740f252d867c 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -21,6 +21,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface FakeClassnameTags123Api { + String PATH_TEST_CLASSNAME = "/fake_classname_test"; /** * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case @@ -30,7 +31,7 @@ public interface FakeClassnameTags123Api { */ @HttpExchange( method = "PATCH", - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, accept = { "application/json" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java index 4a4716006a21..6161dc1c61af 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java @@ -25,6 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface PetApi { + String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -35,7 +36,7 @@ public interface PetApi { */ @HttpExchange( method = "POST", - value = "/pet", + value = PetApi.PATH_ADD_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -44,6 +45,7 @@ ResponseEntity addPet( ); + String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -55,7 +57,7 @@ ResponseEntity addPet( */ @HttpExchange( method = "DELETE", - value = "/pet/{petId}", + value = PetApi.PATH_DELETE_PET, accept = { "application/json" } ) ResponseEntity deletePet( @@ -64,6 +66,7 @@ ResponseEntity deletePet( ); + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; /** * GET /pet/findByStatus : Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -74,7 +77,7 @@ ResponseEntity deletePet( */ @HttpExchange( method = "GET", - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) ResponseEntity> findPetsByStatus( @@ -82,6 +85,7 @@ ResponseEntity> findPetsByStatus( ); + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; /** * GET /pet/findByTags : Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -94,7 +98,7 @@ ResponseEntity> findPetsByStatus( @Deprecated @HttpExchange( method = "GET", - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) ResponseEntity> findPetsByTags( @@ -102,6 +106,7 @@ ResponseEntity> findPetsByTags( ); + String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -113,7 +118,7 @@ ResponseEntity> findPetsByTags( */ @HttpExchange( method = "GET", - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) ResponseEntity getPetById( @@ -121,6 +126,7 @@ ResponseEntity getPetById( ); + String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -129,7 +135,7 @@ ResponseEntity getPetById( */ @HttpExchange( method = "GET", - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) ResponseEntity responseObjectDifferentNames( @@ -137,6 +143,7 @@ ResponseEntity responseObjectDifferent ); + String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -149,7 +156,7 @@ ResponseEntity responseObjectDifferent */ @HttpExchange( method = "PUT", - value = "/pet", + value = PetApi.PATH_UPDATE_PET, accept = { "application/json" }, contentType = "application/json" ) @@ -158,6 +165,7 @@ ResponseEntity updatePet( ); + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -169,7 +177,7 @@ ResponseEntity updatePet( */ @HttpExchange( method = "POST", - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, accept = { "application/json" }, contentType = "application/x-www-form-urlencoded" ) @@ -180,6 +188,7 @@ ResponseEntity updatePetWithForm( ); + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -191,7 +200,7 @@ ResponseEntity updatePetWithForm( */ @HttpExchange( method = "POST", - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) @@ -202,6 +211,7 @@ ResponseEntity uploadFile( ); + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -213,7 +223,7 @@ ResponseEntity uploadFile( */ @HttpExchange( method = "POST", - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, accept = { "application/json" }, contentType = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java index e246b9a10964..7f036396ba67 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java @@ -22,6 +22,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface StoreApi { + String PATH_DELETE_ORDER = "/store/order/{order_id}"; /** * DELETE /store/order/{order_id} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -32,7 +33,7 @@ public interface StoreApi { */ @HttpExchange( method = "DELETE", - value = "/store/order/{order_id}", + value = StoreApi.PATH_DELETE_ORDER, accept = { "application/json" } ) ResponseEntity deleteOrder( @@ -40,6 +41,7 @@ ResponseEntity deleteOrder( ); + String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -48,7 +50,7 @@ ResponseEntity deleteOrder( */ @HttpExchange( method = "GET", - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) ResponseEntity> getInventory( @@ -56,6 +58,7 @@ ResponseEntity> getInventory( ); + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; /** * GET /store/order/{order_id} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -67,7 +70,7 @@ ResponseEntity> getInventory( */ @HttpExchange( method = "GET", - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) ResponseEntity getOrderById( @@ -75,6 +78,7 @@ ResponseEntity getOrderById( ); + String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -85,7 +89,7 @@ ResponseEntity getOrderById( */ @HttpExchange( method = "POST", - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, accept = { "application/json", "application/xml" }, contentType = "application/json" ) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java index c131548a266e..2eb819ee0206 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java @@ -22,6 +22,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT") public interface UserApi { + String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -31,7 +32,7 @@ public interface UserApi { */ @HttpExchange( method = "POST", - value = "/user", + value = UserApi.PATH_CREATE_USER, accept = { "application/json" }, contentType = "application/json" ) @@ -40,6 +41,7 @@ ResponseEntity createUser( ); + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -49,7 +51,7 @@ ResponseEntity createUser( */ @HttpExchange( method = "POST", - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -58,6 +60,7 @@ ResponseEntity createUsersWithArrayInput( ); + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -67,7 +70,7 @@ ResponseEntity createUsersWithArrayInput( */ @HttpExchange( method = "POST", - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, accept = { "application/json" }, contentType = "application/json" ) @@ -76,6 +79,7 @@ ResponseEntity createUsersWithListInput( ); + String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -86,7 +90,7 @@ ResponseEntity createUsersWithListInput( */ @HttpExchange( method = "DELETE", - value = "/user/{username}", + value = UserApi.PATH_DELETE_USER, accept = { "application/json" } ) ResponseEntity deleteUser( @@ -94,6 +98,7 @@ ResponseEntity deleteUser( ); + String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -105,7 +110,7 @@ ResponseEntity deleteUser( */ @HttpExchange( method = "GET", - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) ResponseEntity getUserByName( @@ -113,6 +118,7 @@ ResponseEntity getUserByName( ); + String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -124,7 +130,7 @@ ResponseEntity getUserByName( */ @HttpExchange( method = "GET", - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) ResponseEntity loginUser( @@ -133,6 +139,7 @@ ResponseEntity loginUser( ); + String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -141,7 +148,7 @@ ResponseEntity loginUser( */ @HttpExchange( method = "GET", - value = "/user/logout", + value = UserApi.PATH_LOGOUT_USER, accept = { "application/json" } ) ResponseEntity logoutUser( @@ -149,6 +156,7 @@ ResponseEntity logoutUser( ); + String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -160,7 +168,7 @@ ResponseEntity logoutUser( */ @HttpExchange( method = "PUT", - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, accept = { "application/json" }, contentType = "application/json" )