diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index e34cbee7799e..3940aea826f4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import com.samskivert.mustache.Mustache; import io.swagger.v3.oas.models.OpenAPI; @@ -45,6 +46,7 @@ import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.templating.mustache.ReplaceAllLambda; import org.openapitools.codegen.utils.CamelizeOption; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index ca566b626bd5..5b10b5d5f3f5 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -127,6 +127,7 @@ public interface {{classname}} { {{/jdk8-default-interface}} {{#operation}} + public static final String PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}} = "{{{path}}}"; /** * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} {{#notes}} @@ -232,7 +233,7 @@ public interface {{classname}} { {{/implicitHeadersParams.0}} @RequestMapping( method = RequestMethod.{{httpMethod}}, - value = "{{{path}}}"{{#singleContentTypes}}{{#hasProduces}}, + value = {{classname}}.PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}{{#singleContentTypes}}{{#hasProduces}}, produces = { {{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}} }{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, produces = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }{{/hasProduces}}{{#hasConsumes}}, diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/MergedSpecBuilderTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/MergedSpecBuilderTest.java index f3feed5c1261..d0c4f6956cd7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/MergedSpecBuilderTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/MergedSpecBuilderTest.java @@ -75,7 +75,7 @@ private void assertFilesFromMergedSpec(String mergedSpec) throws IOException { .assertMethod("spec1OperationComplex") .hasReturnType("ResponseEntity") .assertMethodAnnotations() - .containsWithNameAndAttributes("RequestMapping", ImmutableMap.of("value", "\"/spec1/complex/{param1}/path\"")) + .containsWithNameAndAttributes("RequestMapping", ImmutableMap.of("value", "Spec1Api.PATH_SPEC1_OPERATION_COMPLEX")) .toMethod() .assertParameter("param1") .hasType("String") 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 37863f2659f5..cb4a760863c0 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 @@ -123,7 +123,7 @@ public void doAnnotateDatesOnModelParameters() throws IOException { .containsWithNameAndAttributes("Operation", ImmutableMap.of("operationId", "\"getZebras\"")) .containsWithNameAndAttributes("RequestMapping", ImmutableMap.of( "method", "RequestMethod.GET", - "value", "\"/zebras\"" + "value", "ZebrasApi.PATH_GET_ZEBRAS" )) .toMethod() .assertParameter("limit").hasType("BigDecimal") @@ -201,7 +201,7 @@ public void doAnnotateDatesOnModelParametersWithOptionalAndJsonNullable() throws .containsWithNameAndAttributes("Operation", ImmutableMap.of("operationId", "\"getZebras\"")) .containsWithNameAndAttributes("RequestMapping", ImmutableMap.of( "method", "RequestMethod.GET", - "value", "\"/zebras\"" + "value", "ZebrasApi.PATH_GET_ZEBRAS" )) .toMethod() .assertParameter("limit").hasType("Optional") @@ -1108,8 +1108,10 @@ public void testRequestMappingAnnotation() throws IOException { final Map files = generateFiles(codegen, "src/test/resources/2_0/petstore.yaml"); // Check that the @RequestMapping annotation is generated in the Api file - final File petApiFile = files.get("PetApi.java"); - assertFileContains(petApiFile.toPath(), "@RequestMapping(\"${openapi.openAPIPetstore.base-path:/v2}\")"); + JavaFileAssert.assertThat(files.get("PetApi.java")) + .fileContains("@RequestMapping(\"${openapi.openAPIPetstore.base-path:/v2}\")", + "public static final String PATH_ADD_PET = \"/pet\";", + "value = PetApi.PATH_ADD_PET"); // Check that the @RequestMapping annotation is not generated in the Controller file final File petApiControllerFile = files.get("PetApiController.java"); diff --git a/samples/client/petstore/spring-cloud-auth/src/main/java/org/openapitools/api/SomeApi.java b/samples/client/petstore/spring-cloud-auth/src/main/java/org/openapitools/api/SomeApi.java index 12a2eb46106b..9a3d9953742c 100644 --- a/samples/client/petstore/spring-cloud-auth/src/main/java/org/openapitools/api/SomeApi.java +++ b/samples/client/petstore/spring-cloud-auth/src/main/java/org/openapitools/api/SomeApi.java @@ -24,6 +24,7 @@ @Validated public interface SomeApi { + public static final String PATH_SOME_ENDPOINT_GET = "/some/endpoint"; /** * GET /some/endpoint * @@ -31,7 +32,7 @@ public interface SomeApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/some/endpoint" + value = SomeApi.PATH_SOME_ENDPOINT_GET ) ResponseEntity someEndpointGet( diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index 42d2d1feb85a..36ba8893f3c7 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -29,6 +29,7 @@ @Api(value = "Default", description = "the Default API") public interface DefaultApi { + public static final String PATH_GET = "/thingy/{date}"; /** * GET /thingy/{date} * @@ -48,7 +49,7 @@ public interface DefaultApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/thingy/{date}" + value = DefaultApi.PATH_GET ) ResponseEntity get( @@ -59,6 +60,7 @@ ResponseEntity get( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/thingy/{date}"; /** * POST /thingy/{date} * update with form data @@ -77,7 +79,7 @@ ResponseEntity get( }) @RequestMapping( method = RequestMethod.POST, - value = "/thingy/{date}", + value = DefaultApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java index 5fb06bc64480..5a15275ded60 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java @@ -38,6 +38,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = "application/json" ) @@ -68,6 +69,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -90,7 +92,7 @@ ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -99,6 +101,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -125,7 +128,7 @@ ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -134,6 +137,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -163,7 +167,7 @@ ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -172,6 +176,7 @@ ResponseEntity> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -200,7 +205,7 @@ ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -209,6 +214,7 @@ ResponseEntity getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -234,7 +240,7 @@ ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = "application/json" ) @@ -243,6 +249,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -266,7 +273,7 @@ ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -277,6 +284,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -302,7 +310,7 @@ ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java index 084aee444a42..9ddf13718599 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ @Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -58,7 +59,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -66,6 +67,7 @@ ResponseEntity deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -88,7 +90,7 @@ ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ ResponseEntity> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -122,7 +125,7 @@ ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -131,6 +134,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -154,7 +158,7 @@ ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java index 3f911c2cc134..39b98ddf8a20 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ @Tag(name = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -59,7 +60,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -68,6 +69,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -89,7 +91,7 @@ ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -98,6 +100,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -119,7 +122,7 @@ ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -128,6 +131,7 @@ ResponseEntity createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -151,7 +155,7 @@ ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -159,6 +163,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -184,7 +189,7 @@ ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -193,6 +198,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -217,7 +223,7 @@ ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -227,6 +233,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -247,7 +254,7 @@ ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -255,6 +262,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -279,7 +287,7 @@ ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java index 6f7bb012f915..3be906a3b716 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java @@ -28,6 +28,7 @@ @Api(value = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -55,7 +56,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -65,6 +66,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -90,7 +92,7 @@ ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -99,6 +101,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -126,7 +129,7 @@ ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -135,6 +138,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -164,7 +168,7 @@ ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -173,6 +177,7 @@ ResponseEntity> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -199,7 +204,7 @@ ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -208,6 +213,7 @@ ResponseEntity getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -241,7 +247,7 @@ ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -251,6 +257,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -277,7 +284,7 @@ ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -288,6 +295,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -315,7 +323,7 @@ ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java index 4a0897f7196c..2fd0b4476582 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java @@ -28,6 +28,7 @@ @Api(value = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -48,7 +49,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -56,6 +57,7 @@ ResponseEntity deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -78,7 +80,7 @@ ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -87,6 +89,7 @@ ResponseEntity> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -110,7 +113,7 @@ ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -119,6 +122,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -140,7 +144,7 @@ ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java index b42f36a16f88..5e83b5b367c1 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java @@ -28,6 +28,7 @@ @Api(value = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -49,7 +50,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -58,6 +59,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -79,7 +81,7 @@ ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -88,6 +90,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -109,7 +112,7 @@ ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -118,6 +121,7 @@ ResponseEntity createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -141,7 +145,7 @@ ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -149,6 +153,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -172,7 +177,7 @@ ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -181,6 +186,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -203,7 +209,7 @@ ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -213,6 +219,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -233,7 +240,7 @@ ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -241,6 +248,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -265,7 +273,7 @@ ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java index 6ade4b16251f..d59cc1e2c569 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java @@ -30,6 +30,7 @@ @Api(value = "pet tag", description = "the pet tag API") public interface PetController { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -53,7 +54,7 @@ public interface PetController { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetController.PATH_ADD_PET, consumes = "application/json" ) @@ -62,6 +63,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -86,7 +88,7 @@ ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetController.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -95,6 +97,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -123,7 +126,7 @@ ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetController.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -133,6 +136,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -163,7 +167,7 @@ ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetController.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -173,6 +177,7 @@ ResponseEntity> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -199,7 +204,7 @@ ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetController.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -208,6 +213,7 @@ ResponseEntity getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -235,7 +241,7 @@ ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetController.PATH_UPDATE_PET, consumes = "application/json" ) @@ -244,6 +250,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -269,7 +276,7 @@ ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetController.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -280,6 +287,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -306,7 +314,7 @@ ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetController.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java index a9f5e80e8612..4a20fe03624d 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java @@ -28,6 +28,7 @@ @Api(value = "store tag", description = "the store tag API") public interface StoreController { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -48,7 +49,7 @@ public interface StoreController { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreController.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -56,6 +57,7 @@ ResponseEntity deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -78,7 +80,7 @@ ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreController.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -87,6 +89,7 @@ ResponseEntity> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -110,7 +113,7 @@ ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreController.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -119,6 +122,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -139,7 +143,7 @@ ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreController.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" } ) diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java index ae0d424ef5ef..69fc12be6501 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java @@ -28,6 +28,7 @@ @Api(value = "user tag", description = "the user tag API") public interface UserController { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -46,7 +47,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserController.PATH_CREATE_USER ) ResponseEntity createUser( @@ -54,6 +55,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -71,7 +73,7 @@ ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserController.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) ResponseEntity createUsersWithArrayInput( @@ -79,6 +81,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -96,7 +99,7 @@ ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserController.PATH_CREATE_USERS_WITH_LIST_INPUT ) ResponseEntity createUsersWithListInput( @@ -104,6 +107,7 @@ ResponseEntity createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -124,7 +128,7 @@ ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserController.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -132,6 +136,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -154,7 +159,7 @@ ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserController.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -163,6 +168,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -184,7 +190,7 @@ ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserController.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -194,6 +200,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -210,7 +217,7 @@ ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserController.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -218,6 +225,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_LOGOUT_USER_OPTIONS = "/user/logout"; /** * OPTIONS /user/logout : logoutUserOptions * @@ -234,7 +242,7 @@ ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.OPTIONS, - value = "/user/logout" + value = UserController.PATH_LOGOUT_USER_OPTIONS ) ResponseEntity logoutUserOptions( @@ -242,6 +250,7 @@ ResponseEntity logoutUserOptions( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -263,7 +272,7 @@ ResponseEntity logoutUserOptions( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = UserController.PATH_UPDATE_USER ) ResponseEntity updateUser( diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 6f7bb012f915..3be906a3b716 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -28,6 +28,7 @@ @Api(value = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -55,7 +56,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -65,6 +66,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -90,7 +92,7 @@ ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -99,6 +101,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -126,7 +129,7 @@ ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -135,6 +138,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -164,7 +168,7 @@ ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -173,6 +177,7 @@ ResponseEntity> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -199,7 +204,7 @@ ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -208,6 +213,7 @@ ResponseEntity getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -241,7 +247,7 @@ ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -251,6 +257,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -277,7 +284,7 @@ ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -288,6 +295,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -315,7 +323,7 @@ ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 4a0897f7196c..2fd0b4476582 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -28,6 +28,7 @@ @Api(value = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -48,7 +49,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -56,6 +57,7 @@ ResponseEntity deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -78,7 +80,7 @@ ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -87,6 +89,7 @@ ResponseEntity> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -110,7 +113,7 @@ ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -119,6 +122,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -140,7 +144,7 @@ ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index b42f36a16f88..5e83b5b367c1 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -28,6 +28,7 @@ @Api(value = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -49,7 +50,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -58,6 +59,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -79,7 +81,7 @@ ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -88,6 +90,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -109,7 +112,7 @@ ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -118,6 +121,7 @@ ResponseEntity createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -141,7 +145,7 @@ ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -149,6 +153,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -172,7 +177,7 @@ ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -181,6 +186,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -203,7 +209,7 @@ ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -213,6 +219,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -233,7 +240,7 @@ ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -241,6 +248,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -265,7 +273,7 @@ ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java index 97d82109f81e..9d1d789c1ad8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java @@ -26,6 +26,7 @@ @Validated public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -36,7 +37,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -46,6 +47,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -56,7 +58,7 @@ ResponseEntity addPet( */ @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -65,6 +67,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -75,7 +78,7 @@ ResponseEntity deletePet( */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -84,6 +87,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -96,7 +100,7 @@ ResponseEntity> findPetsByStatus( @Deprecated @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -105,6 +109,7 @@ ResponseEntity> findPetsByTags( ); + public static final 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( */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -125,6 +130,7 @@ ResponseEntity getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -139,7 +145,7 @@ ResponseEntity getPetById( */ @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -149,6 +155,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -160,7 +167,7 @@ ResponseEntity updatePet( */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -171,6 +178,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -182,7 +190,7 @@ ResponseEntity updatePetWithForm( */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java index 4883f44d0dad..489bb31f753d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java @@ -26,6 +26,7 @@ @Validated public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : 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 { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -44,6 +45,7 @@ ResponseEntity deleteOrder( ); + public static final 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 @@ ResponseEntity deleteOrder( */ @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -61,6 +63,7 @@ ResponseEntity> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -72,7 +75,7 @@ ResponseEntity> getInventory( */ @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -81,6 +84,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -91,7 +95,7 @@ ResponseEntity getOrderById( */ @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java index c1b3d637e5c5..f95cce62419c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java @@ -26,6 +26,7 @@ @Validated public interface UserApi { + public static final 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 { */ @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -44,6 +45,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -53,7 +55,7 @@ ResponseEntity createUser( */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -62,6 +64,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -71,7 +74,7 @@ ResponseEntity createUsersWithArrayInput( */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -80,6 +83,7 @@ ResponseEntity createUsersWithListInput( ); + public static final 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 @@ ResponseEntity createUsersWithListInput( */ @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -98,6 +102,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -109,7 +114,7 @@ ResponseEntity deleteUser( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -118,6 +123,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -129,7 +135,7 @@ ResponseEntity getUserByName( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -139,6 +145,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -147,7 +154,7 @@ ResponseEntity loginUser( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -155,6 +162,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -166,7 +174,7 @@ ResponseEntity logoutUser( */ @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java index d1e1bc7a023f..3e47498cde4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java @@ -38,6 +38,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -64,7 +65,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -74,6 +75,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -96,7 +98,7 @@ ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -105,6 +107,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -131,7 +134,7 @@ ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -140,6 +143,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -169,7 +173,7 @@ ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -178,6 +182,7 @@ ResponseEntity> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -206,7 +211,7 @@ ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -215,6 +220,7 @@ ResponseEntity getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -248,7 +254,7 @@ ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -258,6 +264,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -281,7 +288,7 @@ ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -292,6 +299,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -317,7 +325,7 @@ ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java index 33bbe69249fd..4910ec092298 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ @Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -58,7 +59,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -66,6 +67,7 @@ ResponseEntity deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -88,7 +90,7 @@ ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ ResponseEntity> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -122,7 +125,7 @@ ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -131,6 +134,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -154,7 +158,7 @@ ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java index 9b23955148f2..4974c79be5f5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ @Tag(name = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -59,7 +60,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -68,6 +69,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -89,7 +91,7 @@ ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -98,6 +100,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -119,7 +122,7 @@ ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -128,6 +131,7 @@ ResponseEntity createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -151,7 +155,7 @@ ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -159,6 +163,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -184,7 +189,7 @@ ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -193,6 +198,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -217,7 +223,7 @@ ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -227,6 +233,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -247,7 +254,7 @@ ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -255,6 +262,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -279,7 +287,7 @@ ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index e0ccbebef374..2c1b7ab7fd3c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -39,6 +39,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -65,7 +66,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -75,6 +76,7 @@ CompletableFuture> addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -97,7 +99,7 @@ CompletableFuture> addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) CompletableFuture> deletePet( @@ -106,6 +108,7 @@ CompletableFuture> deletePet( ); + public static final 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 @@ -132,7 +135,7 @@ CompletableFuture> deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -141,6 +144,7 @@ CompletableFuture>> findPetsByStatus( ); + public static final 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. @@ -170,7 +174,7 @@ CompletableFuture>> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -179,6 +183,7 @@ CompletableFuture>> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -207,7 +212,7 @@ CompletableFuture>> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -216,6 +221,7 @@ CompletableFuture> getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -249,7 +255,7 @@ CompletableFuture> getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -259,6 +265,7 @@ CompletableFuture> updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -282,7 +289,7 @@ CompletableFuture> updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -293,6 +300,7 @@ CompletableFuture> updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -318,7 +326,7 @@ CompletableFuture> updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 056ae51dd1e6..553b06982fe3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -39,6 +39,7 @@ @Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -59,7 +60,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) CompletableFuture> deleteOrder( @@ -67,6 +68,7 @@ CompletableFuture> deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -89,7 +91,7 @@ CompletableFuture> deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ CompletableFuture>> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -123,7 +126,7 @@ CompletableFuture>> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -132,6 +135,7 @@ CompletableFuture> getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -155,7 +159,7 @@ CompletableFuture> getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 2ba635b53a72..753376f9adf1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -39,6 +39,7 @@ @Tag(name = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -60,7 +61,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -69,6 +70,7 @@ CompletableFuture> createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -90,7 +92,7 @@ CompletableFuture> createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -99,6 +101,7 @@ CompletableFuture> createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -120,7 +123,7 @@ CompletableFuture> createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -129,6 +132,7 @@ CompletableFuture> createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -152,7 +156,7 @@ CompletableFuture> createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) CompletableFuture> deleteUser( @@ -160,6 +164,7 @@ CompletableFuture> deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -185,7 +190,7 @@ CompletableFuture> deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -194,6 +199,7 @@ CompletableFuture> getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -218,7 +224,7 @@ CompletableFuture> getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -228,6 +234,7 @@ CompletableFuture> loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -248,7 +255,7 @@ CompletableFuture> loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) CompletableFuture> logoutUser( @@ -256,6 +263,7 @@ CompletableFuture> logoutUser( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -280,7 +288,7 @@ CompletableFuture> logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index 5fc50c6a8f95..c88b0bcd4d90 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -39,6 +39,7 @@ @Tag(name = "Default", description = "the Default API") public interface DefaultApi { + public static final String PATH_GET = "/thingy/{date}"; /** * GET /thingy/{date} * @@ -56,7 +57,7 @@ public interface DefaultApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/thingy/{date}" + value = DefaultApi.PATH_GET ) ResponseEntity get( @@ -67,6 +68,7 @@ ResponseEntity get( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/thingy/{date}"; /** * POST /thingy/{date} * update with form data @@ -84,7 +86,7 @@ ResponseEntity get( ) @RequestMapping( method = RequestMethod.POST, - value = "/thingy/{date}", + value = DefaultApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/api/PetApi.java index cc5b5014b896..8a1645729b8a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/api/PetApi.java @@ -37,6 +37,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -63,7 +64,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3c313ee6f493..a7b5e425f0d2 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -37,6 +37,7 @@ @Tag(name = "$another-fake?", description = "the $another-fake? API") public interface AnotherFakeApi { + public static final 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 @@ -57,7 +58,7 @@ public interface AnotherFakeApi { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index a3cd94a950c6..5e0b3dc8c76d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -47,6 +47,7 @@ @Tag(name = "fake", description = "the fake API") public interface FakeApi { + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -65,7 +66,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = "application/xml" ) @@ -74,6 +75,7 @@ ResponseEntity createXmlItem( ); + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -93,7 +95,7 @@ ResponseEntity createXmlItem( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = "application/json" ) @@ -103,6 +105,7 @@ ResponseEntity fakeOuterBooleanSerialize( ); + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -122,7 +125,7 @@ ResponseEntity fakeOuterBooleanSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = "application/json" ) @@ -132,6 +135,7 @@ ResponseEntity fakeOuterCompositeSerialize( ); + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -151,7 +155,7 @@ ResponseEntity fakeOuterCompositeSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = "application/json" ) @@ -161,6 +165,7 @@ ResponseEntity fakeOuterNumberSerialize( ); + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -180,7 +185,7 @@ ResponseEntity fakeOuterNumberSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = "application/json" ) @@ -190,6 +195,7 @@ ResponseEntity fakeOuterStringSerialize( ); + public static final 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`. @@ -207,7 +213,7 @@ ResponseEntity fakeOuterStringSerialize( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = "application/json" ) @@ -216,6 +222,7 @@ ResponseEntity testBodyWithFileSchema( ); + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -232,7 +239,7 @@ ResponseEntity testBodyWithFileSchema( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = "application/json" ) @@ -242,6 +249,7 @@ ResponseEntity testBodyWithQueryParams( ); + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -262,7 +270,7 @@ ResponseEntity testBodyWithQueryParams( ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = "application/json" ) @@ -272,6 +280,7 @@ ResponseEntity testClientModel( ); + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -308,7 +317,7 @@ ResponseEntity testClientModel( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = "application/x-www-form-urlencoded" ) @@ -330,6 +339,7 @@ ResponseEntity testEndpointParameters( ); + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -357,7 +367,7 @@ ResponseEntity testEndpointParameters( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = "application/x-www-form-urlencoded" ) @@ -373,6 +383,7 @@ ResponseEntity testEnumParameters( ); + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -396,7 +407,7 @@ ResponseEntity testEnumParameters( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) ResponseEntity testGroupParameters( @@ -409,6 +420,7 @@ ResponseEntity testGroupParameters( ); + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -427,7 +439,7 @@ ResponseEntity testGroupParameters( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = "application/json" ) @@ -436,6 +448,7 @@ ResponseEntity testInlineAdditionalProperties( ); + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -455,7 +468,7 @@ ResponseEntity testInlineAdditionalProperties( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = "application/x-www-form-urlencoded" ) @@ -465,6 +478,7 @@ ResponseEntity testJsonFormData( ); + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -483,7 +497,7 @@ ResponseEntity testJsonFormData( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = "application/json" ) @@ -492,6 +506,7 @@ ResponseEntity testNullable( ); + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -512,7 +527,7 @@ ResponseEntity testNullable( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) ResponseEntity testQueryParameterCollectionFormat( @@ -523,6 +538,7 @@ ResponseEntity testQueryParameterCollectionFormat( ); + public static final 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. @@ -541,7 +557,7 @@ ResponseEntity testQueryParameterCollectionFormat( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 18ecb514a833..50d21ea28cbb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -37,6 +37,7 @@ @Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") public interface FakeClassnameTags123Api { + public static final 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 @@ -60,7 +61,7 @@ public interface FakeClassnameTags123Api { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTags123Api.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java index 55f5f3889fff..63b1c00dbc29 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java @@ -40,6 +40,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -63,7 +64,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = "application/json" ) @@ -72,6 +73,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -96,7 +98,7 @@ ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -105,6 +107,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -131,7 +134,7 @@ ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -140,6 +143,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -169,7 +173,7 @@ ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -178,6 +182,7 @@ ResponseEntity> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -206,7 +211,7 @@ ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -215,6 +220,7 @@ ResponseEntity getPetById( ); + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -232,7 +238,7 @@ ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -241,6 +247,7 @@ ResponseEntity responseObjectDifferentNam ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -268,7 +275,7 @@ ResponseEntity responseObjectDifferentNam ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = "application/json" ) @@ -277,6 +284,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -300,7 +308,7 @@ ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -311,6 +319,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -336,7 +345,7 @@ ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) @@ -348,6 +357,7 @@ ResponseEntity uploadFile( ); + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -373,7 +383,7 @@ ResponseEntity uploadFile( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = PetApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java index bc746b268daf..5d83a5aa0739 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ @Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final 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 @@ -58,7 +59,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -66,6 +67,7 @@ ResponseEntity deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -88,7 +90,7 @@ ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ ResponseEntity> getInventory( ); + public static final 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 @@ -122,7 +125,7 @@ ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -131,6 +134,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -154,7 +158,7 @@ ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java index af82fa274292..1d999829343a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ @Tag(name = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -56,7 +57,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -65,6 +66,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -83,7 +85,7 @@ ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -92,6 +94,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -110,7 +113,7 @@ ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -119,6 +122,7 @@ ResponseEntity createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -139,7 +143,7 @@ ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -147,6 +151,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -172,7 +177,7 @@ ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -181,6 +186,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -205,7 +211,7 @@ ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -215,6 +221,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -232,7 +239,7 @@ ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -240,6 +247,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -261,7 +269,7 @@ ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 493551c0f863..b724febd23f8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -40,6 +40,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = "application/json" ) @@ -68,6 +69,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -88,7 +90,7 @@ ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -97,6 +99,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -123,7 +126,7 @@ ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -133,6 +136,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -162,7 +166,7 @@ ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -172,6 +176,7 @@ ResponseEntity> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -200,7 +205,7 @@ ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -209,6 +214,7 @@ ResponseEntity getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -232,7 +238,7 @@ ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = "application/json" ) @@ -241,6 +247,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -262,7 +269,7 @@ ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -273,6 +280,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -296,7 +304,7 @@ ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index dc2387875175..968c0eafcb88 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ @Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -58,7 +59,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -66,6 +67,7 @@ ResponseEntity deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -88,7 +90,7 @@ ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ ResponseEntity> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -122,7 +125,7 @@ ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -131,6 +134,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -152,7 +156,7 @@ ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" } ) diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index c44dac3b1e51..5b11cc612210 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ @Tag(name = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -56,7 +57,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) ResponseEntity createUser( @@ -64,6 +65,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -80,7 +82,7 @@ ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) ResponseEntity createUsersWithArrayInput( @@ -88,6 +90,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -104,7 +107,7 @@ ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) ResponseEntity createUsersWithListInput( @@ -112,6 +115,7 @@ ResponseEntity createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -132,7 +136,7 @@ ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -140,6 +144,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -163,7 +168,7 @@ ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -172,6 +177,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -194,7 +200,7 @@ ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -204,6 +210,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -219,7 +226,7 @@ ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -227,6 +234,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_LOGOUT_USER_OPTIONS = "/user/logout"; /** * OPTIONS /user/logout : logoutUserOptions * @@ -242,7 +250,7 @@ ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.OPTIONS, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER_OPTIONS ) ResponseEntity logoutUserOptions( @@ -250,6 +258,7 @@ ResponseEntity logoutUserOptions( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -271,7 +280,7 @@ ResponseEntity logoutUserOptions( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = UserApi.PATH_UPDATE_USER ) ResponseEntity updateUser( diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 232dbfd34545..7077916c1dce 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -38,6 +38,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -64,7 +65,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -74,6 +75,7 @@ ResponseEntity addPet( ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -96,7 +98,7 @@ ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -105,6 +107,7 @@ ResponseEntity deletePet( ); + public static final 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 @@ -131,7 +134,7 @@ ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -140,6 +143,7 @@ ResponseEntity> findPetsByStatus( ); + public static final 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. @@ -169,7 +173,7 @@ ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -178,6 +182,7 @@ ResponseEntity> findPetsByTags( ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -206,7 +211,7 @@ ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -215,6 +220,7 @@ ResponseEntity getPetById( ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -248,7 +254,7 @@ ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -258,6 +264,7 @@ ResponseEntity updatePet( ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -281,7 +288,7 @@ ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -292,6 +299,7 @@ ResponseEntity updatePetWithForm( ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -317,7 +325,7 @@ ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 084aee444a42..9ddf13718599 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ @Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -58,7 +59,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -66,6 +67,7 @@ ResponseEntity deleteOrder( ); + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -88,7 +90,7 @@ ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ ResponseEntity> getInventory( ); + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -122,7 +125,7 @@ ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -131,6 +134,7 @@ ResponseEntity getOrderById( ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -154,7 +158,7 @@ ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index d13e55c500d3..ef65dccd2370 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ @Tag(name = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -59,7 +60,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -68,6 +69,7 @@ ResponseEntity createUser( ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -89,7 +91,7 @@ ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -98,6 +100,7 @@ ResponseEntity createUsersWithArrayInput( ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -119,7 +122,7 @@ ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -128,6 +131,7 @@ ResponseEntity createUsersWithListInput( ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -151,7 +155,7 @@ ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -159,6 +163,7 @@ ResponseEntity deleteUser( ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -184,7 +189,7 @@ ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -193,6 +198,7 @@ ResponseEntity getUserByName( ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -217,7 +223,7 @@ ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -227,6 +233,7 @@ ResponseEntity loginUser( ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -247,7 +254,7 @@ ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -255,6 +262,7 @@ ResponseEntity logoutUser( ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -279,7 +287,7 @@ ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java index d11f7fa957c7..0e9ed54db08c 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java @@ -38,6 +38,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -64,7 +65,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -74,6 +75,7 @@ ResponseEntity addPet( ) throws Exception; + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -96,7 +98,7 @@ ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -105,6 +107,7 @@ ResponseEntity deletePet( ) throws Exception; + public static final 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 @@ -131,7 +134,7 @@ ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -140,6 +143,7 @@ ResponseEntity> findPetsByStatus( ) throws Exception; + public static final 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. @@ -169,7 +173,7 @@ ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -178,6 +182,7 @@ ResponseEntity> findPetsByTags( ) throws Exception; + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -206,7 +211,7 @@ ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -215,6 +220,7 @@ ResponseEntity getPetById( ) throws Exception; + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -248,7 +254,7 @@ ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -258,6 +264,7 @@ ResponseEntity updatePet( ) throws Exception; + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -281,7 +288,7 @@ ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -292,6 +299,7 @@ ResponseEntity updatePetWithForm( ) throws Exception; + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -317,7 +325,7 @@ ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java index 2aa8078d781b..56da675c8f14 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ @Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -58,7 +59,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -66,6 +67,7 @@ ResponseEntity deleteOrder( ) throws Exception; + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -88,7 +90,7 @@ ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ ResponseEntity> getInventory( ) throws Exception; + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -122,7 +125,7 @@ ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -131,6 +134,7 @@ ResponseEntity getOrderById( ) throws Exception; + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -154,7 +158,7 @@ ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java index 3e70289324cf..d05ff9183a84 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ @Tag(name = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -59,7 +60,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -68,6 +69,7 @@ ResponseEntity createUser( ) throws Exception; + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -89,7 +91,7 @@ ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -98,6 +100,7 @@ ResponseEntity createUsersWithArrayInput( ) throws Exception; + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -119,7 +122,7 @@ ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -128,6 +131,7 @@ ResponseEntity createUsersWithListInput( ) throws Exception; + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -151,7 +155,7 @@ ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -159,6 +163,7 @@ ResponseEntity deleteUser( ) throws Exception; + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -184,7 +189,7 @@ ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -193,6 +198,7 @@ ResponseEntity getUserByName( ) throws Exception; + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -217,7 +223,7 @@ ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -227,6 +233,7 @@ ResponseEntity loginUser( ) throws Exception; + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -247,7 +254,7 @@ ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -255,6 +262,7 @@ ResponseEntity logoutUser( ) throws Exception; + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -279,7 +287,7 @@ ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index d91e8552b82d..bf6567a4ceb4 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -68,7 +69,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -95,6 +96,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -117,7 +119,7 @@ default ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -129,6 +131,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -155,7 +158,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -181,6 +184,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -210,7 +214,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -236,6 +240,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -264,7 +269,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -290,6 +295,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -323,7 +329,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -350,6 +356,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -373,7 +380,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -387,6 +394,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -412,7 +420,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 820d2ee88788..d2a6626c9f97 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -62,7 +63,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -73,6 +74,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -95,7 +97,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -107,6 +109,7 @@ default ResponseEntity> getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -132,7 +135,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -158,6 +161,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -181,7 +185,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" }, consumes = "application/json" ) diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 7cb58229e57e..5f92391d821e 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -63,7 +64,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -75,6 +76,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -96,7 +98,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -108,6 +110,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -129,7 +132,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -141,6 +144,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -164,7 +168,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -175,6 +179,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -200,7 +205,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -226,6 +231,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -250,7 +256,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -263,6 +269,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -283,7 +290,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -294,6 +301,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -318,7 +326,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = "application/json" ) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java index aa4428deeb53..ab630763f58a 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_BAR = "/bar"; /** * POST /bar : Create a Bar * @@ -60,7 +61,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/bar", + value = BarApi.PATH_CREATE_BAR, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java index 180cb413c457..9241b64ab357 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_FOO = "/foo"; /** * POST /foo : Create a Foo * @@ -60,7 +61,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/foo", + value = FooApi.PATH_CREATE_FOO, produces = { "application/json" }, consumes = { "application/json;charset=utf-8" } ) @@ -82,6 +83,7 @@ default ResponseEntity createFoo( } + public static final String PATH_GET_ALL_FOOS = "/foo"; /** * GET /foo : GET all Foos * @@ -99,7 +101,7 @@ default ResponseEntity createFoo( ) @RequestMapping( method = RequestMethod.GET, - value = "/foo", + value = FooApi.PATH_GET_ALL_FOOS, produces = { "application/json;charset=utf-8" } ) diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java index 8c8f5b60b628..4c2199a6953a 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -68,7 +69,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -95,6 +96,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -117,7 +119,7 @@ default ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -129,6 +131,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -155,7 +158,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -181,6 +184,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -210,7 +214,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -236,6 +240,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -264,7 +269,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -290,6 +295,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -323,7 +329,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -350,6 +356,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -373,7 +380,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -387,6 +394,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -412,7 +420,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java index 2c59fbd75c9e..83e1454ec72f 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -62,7 +63,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -73,6 +74,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -95,7 +97,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -107,6 +109,7 @@ default ResponseEntity> getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -132,7 +135,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -158,6 +161,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -181,7 +185,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java index 434367cc4103..c4f1d6b54a6c 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -63,7 +64,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -75,6 +76,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -96,7 +98,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -108,6 +110,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -129,7 +132,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -141,6 +144,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -164,7 +168,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -175,6 +179,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -200,7 +205,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -226,6 +231,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -250,7 +256,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -263,6 +269,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -283,7 +290,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -294,6 +301,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -318,7 +326,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java index 041f50bed56e..c756ffa79be5 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -68,7 +69,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -95,6 +96,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -117,7 +119,7 @@ default ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -129,6 +131,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -155,7 +158,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -181,6 +184,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -210,7 +214,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -236,6 +240,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -264,7 +269,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -290,6 +295,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -323,7 +329,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -350,6 +356,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -373,7 +380,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -387,6 +394,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -412,7 +420,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java index b5552e4c7d20..8fdd01e844ce 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -62,7 +63,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -73,6 +74,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -95,7 +97,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -107,6 +109,7 @@ default ResponseEntity> getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -132,7 +135,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -158,6 +161,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -181,7 +185,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java index f87868e7d96f..929530690b49 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -63,7 +64,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -75,6 +76,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -96,7 +98,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -108,6 +110,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -129,7 +132,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -141,6 +144,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -164,7 +168,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -175,6 +179,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -200,7 +205,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -226,6 +231,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -250,7 +256,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -263,6 +269,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -283,7 +290,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -294,6 +301,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -318,7 +326,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 60bba927a545..fb011956314c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -37,6 +37,7 @@ default AnotherFakeApiDelegate getDelegate() { return new AnotherFakeApiDelegate() {}; } + public static final 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 @@ -57,7 +58,7 @@ default AnotherFakeApiDelegate getDelegate() { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index a8f5116a6b6a..4faf2205697c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -49,6 +49,7 @@ default FakeApiDelegate getDelegate() { return new FakeApiDelegate() {}; } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -67,7 +68,7 @@ default FakeApiDelegate getDelegate() { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -78,6 +79,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -97,7 +99,7 @@ default ResponseEntity createXmlItem( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -109,6 +111,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -128,7 +131,7 @@ default ResponseEntity fakeOuterBooleanSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -140,6 +143,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -159,7 +163,7 @@ default ResponseEntity fakeOuterCompositeSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -171,6 +175,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -190,7 +195,7 @@ default ResponseEntity fakeOuterNumberSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -202,6 +207,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -219,7 +225,7 @@ default ResponseEntity fakeOuterStringSerialize( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -230,6 +236,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -247,7 +254,7 @@ default ResponseEntity responseObjectDiff ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -258,6 +265,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -274,7 +282,7 @@ default ResponseEntity testBodyWithFileSchema( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -286,6 +294,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -306,7 +315,7 @@ default ResponseEntity testBodyWithQueryParams( ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -318,6 +327,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -354,7 +364,7 @@ default ResponseEntity testClientModel( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -378,6 +388,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -405,7 +416,7 @@ default ResponseEntity testEndpointParameters( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -423,6 +434,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -446,7 +458,7 @@ default ResponseEntity testEnumParameters( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -461,6 +473,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -479,7 +492,7 @@ default ResponseEntity testGroupParameters( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -490,6 +503,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -509,7 +523,7 @@ default ResponseEntity testInlineAdditionalProperties( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -521,6 +535,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -539,7 +554,7 @@ default ResponseEntity testJsonFormData( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -550,6 +565,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -570,7 +586,7 @@ default ResponseEntity testNullable( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -583,6 +599,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -601,7 +618,7 @@ default ResponseEntity testQueryParameterCollectionFormat( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -612,6 +629,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -637,7 +655,7 @@ default ResponseEntity testWithResultExample( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2ace7848df2d..ab3b844f7e40 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -37,6 +37,7 @@ default FakeClassnameTestApiDelegate getDelegate() { return new FakeClassnameTestApiDelegate() {}; } + public static final 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 @@ -60,7 +61,7 @@ default FakeClassnameTestApiDelegate getDelegate() { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 8618161871a3..bfdc02735771 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -39,6 +39,7 @@ default PetApiDelegate getDelegate() { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -62,7 +63,7 @@ default PetApiDelegate getDelegate() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -73,6 +74,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -97,7 +99,7 @@ default ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -108,6 +110,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -134,7 +137,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -145,6 +148,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -174,7 +178,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -185,6 +189,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -213,7 +218,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -224,6 +229,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -251,7 +257,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -262,6 +268,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -285,7 +292,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -298,6 +305,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -323,7 +331,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 3427d95a598d..24a130a45bfa 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ default StoreApiDelegate getDelegate() { return new StoreApiDelegate() {}; } + public static final 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 @@ -58,7 +59,7 @@ default StoreApiDelegate getDelegate() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -68,6 +69,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -90,7 +92,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -101,6 +103,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -126,7 +129,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -137,6 +140,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -160,7 +164,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index a949bb11bdf1..ef2c39562a33 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -56,7 +57,7 @@ default UserApiDelegate getDelegate() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -67,6 +68,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -85,7 +87,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -96,6 +98,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -114,7 +117,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -125,6 +128,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -145,7 +149,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -155,6 +159,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -180,7 +185,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -191,6 +196,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -215,7 +221,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -227,6 +233,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -244,7 +251,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -254,6 +261,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -275,7 +283,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 516d54fe77e8..2af18428c6df 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -41,6 +41,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -61,7 +62,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 7e8be9a3d290..e8c9ce6d6d84 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -53,6 +53,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -71,7 +72,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -83,6 +84,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -102,7 +104,7 @@ default ResponseEntity createXmlItem( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -115,6 +117,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -134,7 +137,7 @@ default ResponseEntity fakeOuterBooleanSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -156,6 +159,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -175,7 +179,7 @@ default ResponseEntity fakeOuterCompositeSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -188,6 +192,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -207,7 +212,7 @@ default ResponseEntity fakeOuterNumberSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -220,6 +225,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -237,7 +243,7 @@ default ResponseEntity fakeOuterStringSerialize( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -258,6 +264,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -275,7 +282,7 @@ default ResponseEntity responseObjectDiff ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -287,6 +294,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -303,7 +311,7 @@ default ResponseEntity testBodyWithFileSchema( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -316,6 +324,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -336,7 +345,7 @@ default ResponseEntity testBodyWithQueryParams( ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -358,6 +367,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -394,7 +404,7 @@ default ResponseEntity testClientModel( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -419,6 +429,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -448,7 +459,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -465,6 +476,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -490,7 +502,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -504,6 +516,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -522,7 +535,7 @@ default ResponseEntity testGroupParameters( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -534,6 +547,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -553,7 +567,7 @@ default ResponseEntity testInlineAdditionalProperties( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -566,6 +580,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -584,7 +599,7 @@ default ResponseEntity testJsonFormData( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -596,6 +611,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -616,7 +632,7 @@ default ResponseEntity testNullable( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -630,6 +646,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -648,7 +665,7 @@ default ResponseEntity testQueryParameterCollectionFormat( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -669,6 +686,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -694,7 +712,7 @@ default ResponseEntity testWithResultExample( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f39c65b9c536..213453629193 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -41,6 +41,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -64,7 +65,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index cd70496423fd..e4fb41f48823 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -66,7 +67,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -78,6 +79,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -104,7 +106,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -115,6 +117,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -141,7 +144,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -167,6 +170,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -196,7 +200,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -222,6 +226,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -250,7 +255,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -276,6 +281,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -303,7 +309,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -315,6 +321,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -338,7 +345,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -352,6 +359,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -377,7 +385,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index e6060bcab3ca..5182b6c349ff 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -62,7 +63,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -73,6 +74,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -95,7 +97,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -107,6 +109,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -132,7 +135,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -158,6 +161,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -181,7 +185,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 0fd03831f79f..b73ff1379806 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -60,7 +61,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -72,6 +73,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -90,7 +92,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -102,6 +104,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -120,7 +123,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -132,6 +135,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -152,7 +156,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -163,6 +167,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -188,7 +193,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -214,6 +219,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -238,7 +244,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -251,6 +257,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -268,7 +275,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -279,6 +286,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -300,7 +308,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java index a43efcf5dfea..3573b523261e 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java @@ -30,6 +30,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -40,7 +41,7 @@ default Optional getRequest() { */ @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -67,6 +68,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -77,7 +79,7 @@ default ResponseEntity addPet( */ @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -89,6 +91,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -99,7 +102,7 @@ default ResponseEntity deletePet( */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -125,6 +128,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -137,7 +141,7 @@ default ResponseEntity> findPetsByStatus( @Deprecated @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -163,6 +167,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -174,7 +179,7 @@ default ResponseEntity> findPetsByTags( */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -200,6 +205,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -214,7 +220,7 @@ default ResponseEntity getPetById( */ @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -241,6 +247,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -252,7 +259,7 @@ default ResponseEntity updatePet( */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -266,6 +273,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -277,7 +285,7 @@ default ResponseEntity updatePetWithForm( */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java index 500f0473e738..43a666f252c8 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java @@ -30,6 +30,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -40,7 +41,7 @@ default Optional getRequest() { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -51,6 +52,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -59,7 +61,7 @@ default ResponseEntity deleteOrder( */ @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -71,6 +73,7 @@ default ResponseEntity> getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -82,7 +85,7 @@ default ResponseEntity> getInventory( */ @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -108,6 +111,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -118,7 +122,7 @@ default ResponseEntity getOrderById( */ @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java index 285c8dac7eb2..0be99ef9f72d 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java @@ -30,6 +30,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -39,7 +40,7 @@ default Optional getRequest() { */ @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -51,6 +52,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -60,7 +62,7 @@ default ResponseEntity createUser( */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -72,6 +74,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -81,7 +84,7 @@ default ResponseEntity createUsersWithArrayInput( */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -93,6 +96,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -103,7 +107,7 @@ default ResponseEntity createUsersWithListInput( */ @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -114,6 +118,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -125,7 +130,7 @@ default ResponseEntity deleteUser( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -151,6 +156,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -162,7 +168,7 @@ default ResponseEntity getUserByName( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -175,6 +181,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -183,7 +190,7 @@ default ResponseEntity loginUser( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -194,6 +201,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -205,7 +213,7 @@ default ResponseEntity logoutUser( */ @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 3422ff149ea3..34b3ae7a3c6d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -69,7 +70,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -96,6 +97,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -118,7 +120,7 @@ default ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -130,6 +132,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -156,7 +159,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -182,6 +185,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -211,7 +215,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -237,6 +241,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -265,7 +270,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -291,6 +296,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -324,7 +330,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -351,6 +357,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -374,7 +381,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -388,6 +395,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -413,7 +421,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 09fa4918ade4..4e5020ef7f31 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -63,7 +64,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -74,6 +75,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -96,7 +98,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -108,6 +110,7 @@ default ResponseEntity> getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -133,7 +136,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -159,6 +162,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -182,7 +186,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 1803521dddc2..6f866a86b8d0 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -64,7 +65,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -76,6 +77,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -97,7 +99,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -109,6 +111,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -130,7 +133,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -142,6 +145,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -165,7 +169,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -176,6 +180,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -201,7 +206,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -227,6 +232,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -251,7 +257,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -264,6 +270,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -284,7 +291,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -295,6 +302,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -319,7 +327,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java index 2c860314ad22..7c5815581702 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -37,6 +37,7 @@ @Tag(name = "$another-fake?", description = "the $another-fake? API") public interface AnotherFakeApi { + public static final 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 @@ -57,7 +58,7 @@ public interface AnotherFakeApi { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java index 0462ad19af4c..fec7aed4df18 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java @@ -49,6 +49,7 @@ @Tag(name = "fake", description = "the fake API") public interface FakeApi { + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -67,7 +68,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -76,6 +77,7 @@ ResponseEntity createXmlItem( ) throws Exception; + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -95,7 +97,7 @@ ResponseEntity createXmlItem( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -105,6 +107,7 @@ ResponseEntity fakeOuterBooleanSerialize( ) throws Exception; + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -124,7 +127,7 @@ ResponseEntity fakeOuterBooleanSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -134,6 +137,7 @@ ResponseEntity fakeOuterCompositeSerialize( ) throws Exception; + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -153,7 +157,7 @@ ResponseEntity fakeOuterCompositeSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -163,6 +167,7 @@ ResponseEntity fakeOuterNumberSerialize( ) throws Exception; + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -182,7 +187,7 @@ ResponseEntity fakeOuterNumberSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -192,6 +197,7 @@ ResponseEntity fakeOuterStringSerialize( ) throws Exception; + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -209,7 +215,7 @@ ResponseEntity fakeOuterStringSerialize( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -218,6 +224,7 @@ ResponseEntity responseObjectDifferentNam ) throws Exception; + public static final 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`. @@ -235,7 +242,7 @@ ResponseEntity responseObjectDifferentNam ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -244,6 +251,7 @@ ResponseEntity testBodyWithFileSchema( ) throws Exception; + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -260,7 +268,7 @@ ResponseEntity testBodyWithFileSchema( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -270,6 +278,7 @@ ResponseEntity testBodyWithQueryParams( ) throws Exception; + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -290,7 +299,7 @@ ResponseEntity testBodyWithQueryParams( ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -300,6 +309,7 @@ ResponseEntity testClientModel( ) throws Exception; + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -336,7 +346,7 @@ ResponseEntity testClientModel( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -358,6 +368,7 @@ ResponseEntity testEndpointParameters( ) throws Exception; + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -385,7 +396,7 @@ ResponseEntity testEndpointParameters( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -401,6 +412,7 @@ ResponseEntity testEnumParameters( ) throws Exception; + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -424,7 +436,7 @@ ResponseEntity testEnumParameters( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) ResponseEntity testGroupParameters( @@ -437,6 +449,7 @@ ResponseEntity testGroupParameters( ) throws Exception; + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -455,7 +468,7 @@ ResponseEntity testGroupParameters( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -464,6 +477,7 @@ ResponseEntity testInlineAdditionalProperties( ) throws Exception; + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -483,7 +497,7 @@ ResponseEntity testInlineAdditionalProperties( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -493,6 +507,7 @@ ResponseEntity testJsonFormData( ) throws Exception; + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -511,7 +526,7 @@ ResponseEntity testJsonFormData( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -520,6 +535,7 @@ ResponseEntity testNullable( ) throws Exception; + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -540,7 +556,7 @@ ResponseEntity testNullable( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) ResponseEntity testQueryParameterCollectionFormat( @@ -551,6 +567,7 @@ ResponseEntity testQueryParameterCollectionFormat( ) throws Exception; + public static final 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. @@ -569,7 +586,7 @@ ResponseEntity testQueryParameterCollectionFormat( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -578,6 +595,7 @@ ResponseEntity testWithResultExample( ) throws Exception; + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -603,7 +621,7 @@ ResponseEntity testWithResultExample( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 877b53414183..962d1d204b17 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -37,6 +37,7 @@ @Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") public interface FakeClassnameTestApi { + public static final 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 @@ -60,7 +61,7 @@ public interface FakeClassnameTestApi { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java index 8918a0958b3c..8a33f4bf64ba 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java @@ -39,6 +39,7 @@ @Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -62,7 +63,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -71,6 +72,7 @@ ResponseEntity addPet( ) throws Exception; + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -95,7 +97,7 @@ ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -104,6 +106,7 @@ ResponseEntity deletePet( ) throws Exception; + public static final 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 @@ -130,7 +133,7 @@ ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -139,6 +142,7 @@ ResponseEntity> findPetsByStatus( ) throws Exception; + public static final 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. @@ -168,7 +172,7 @@ ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -177,6 +181,7 @@ ResponseEntity> findPetsByTags( ) throws Exception; + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -205,7 +210,7 @@ ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -214,6 +219,7 @@ ResponseEntity getPetById( ) throws Exception; + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -241,7 +247,7 @@ ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -250,6 +256,7 @@ ResponseEntity updatePet( ) throws Exception; + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -273,7 +280,7 @@ ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -284,6 +291,7 @@ ResponseEntity updatePetWithForm( ) throws Exception; + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -309,7 +317,7 @@ ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java index b49eff7f4531..6d0cbd808700 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ @Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { + public static final 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 @@ -58,7 +59,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -66,6 +67,7 @@ ResponseEntity deleteOrder( ) throws Exception; + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -88,7 +90,7 @@ ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ ResponseEntity> getInventory( ) throws Exception; + public static final 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 @@ -122,7 +125,7 @@ ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -131,6 +134,7 @@ ResponseEntity getOrderById( ) throws Exception; + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -154,7 +158,7 @@ ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java index 0b799a471af8..e9f3445c6e72 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ @Tag(name = "user", description = "Operations about user") public interface UserApi { + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -56,7 +57,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -65,6 +66,7 @@ ResponseEntity createUser( ) throws Exception; + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -83,7 +85,7 @@ ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -92,6 +94,7 @@ ResponseEntity createUsersWithArrayInput( ) throws Exception; + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -110,7 +113,7 @@ ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -119,6 +122,7 @@ ResponseEntity createUsersWithListInput( ) throws Exception; + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -139,7 +143,7 @@ ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -147,6 +151,7 @@ ResponseEntity deleteUser( ) throws Exception; + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -172,7 +177,7 @@ ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -181,6 +186,7 @@ ResponseEntity getUserByName( ) throws Exception; + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -205,7 +211,7 @@ ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -215,6 +221,7 @@ ResponseEntity loginUser( ) throws Exception; + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -232,7 +239,7 @@ ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -240,6 +247,7 @@ ResponseEntity logoutUser( ) throws Exception; + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -261,7 +269,7 @@ ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java index b14ddd9e6aad..e54c9710d48b 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java @@ -41,6 +41,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_NULLABLE_TEST = "/nullable"; /** * POST /nullable * nullable test @@ -59,7 +60,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/nullable", + value = NullableApi.PATH_NULLABLE_TEST, consumes = "application/json" ) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index ecf0d3be7b4f..30375af2d319 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 1e3c25fcfed9..4727a134a3dd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -61,7 +62,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -73,6 +74,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -92,7 +94,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -105,6 +107,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -124,7 +127,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -165,7 +169,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -178,6 +182,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -197,7 +202,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -210,6 +215,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -228,7 +234,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -249,6 +255,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -267,7 +274,7 @@ default ResponseEntity responseObjectDiff }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -279,6 +286,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -297,7 +305,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -310,6 +318,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -329,7 +338,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -351,6 +360,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -387,7 +397,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -412,6 +422,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -439,7 +450,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -458,6 +469,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -481,7 +493,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -497,6 +509,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -515,7 +528,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -527,6 +540,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -546,7 +560,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -559,6 +573,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -577,7 +592,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -589,6 +604,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -610,7 +626,7 @@ default ResponseEntity testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -624,6 +640,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -642,7 +659,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -663,6 +680,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -690,7 +708,7 @@ default ResponseEntity testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index cb99581190c2..3e9adf9818d5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -53,7 +54,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index baf9427af913..78e92e6e6bfb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -33,6 +33,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -71,6 +72,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -110,6 +112,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -138,7 +141,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -164,6 +167,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -194,7 +198,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -220,6 +224,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -246,7 +251,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -272,6 +277,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -302,7 +308,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -314,6 +320,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -340,7 +347,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -354,6 +361,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -381,7 +389,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index b5573b20d3a2..6e4e57c7a802 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -52,7 +53,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -63,6 +64,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -85,7 +87,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -120,7 +123,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -167,7 +171,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 5092b04f682a..062652dc3443 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -62,6 +63,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -80,7 +82,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -92,6 +94,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -110,7 +113,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -122,6 +125,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -142,7 +146,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -153,6 +157,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -176,7 +181,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -202,6 +207,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -224,7 +230,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -237,6 +243,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -254,7 +261,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -265,6 +272,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -286,7 +294,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index ecf0d3be7b4f..30375af2d319 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 1e3c25fcfed9..4727a134a3dd 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -61,7 +62,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -73,6 +74,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -92,7 +94,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -105,6 +107,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -124,7 +127,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -165,7 +169,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -178,6 +182,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -197,7 +202,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -210,6 +215,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -228,7 +234,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -249,6 +255,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -267,7 +274,7 @@ default ResponseEntity responseObjectDiff }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -279,6 +286,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -297,7 +305,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -310,6 +318,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -329,7 +338,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -351,6 +360,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -387,7 +397,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -412,6 +422,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -439,7 +450,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -458,6 +469,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -481,7 +493,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -497,6 +509,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -515,7 +528,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -527,6 +540,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -546,7 +560,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -559,6 +573,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -577,7 +592,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -589,6 +604,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -610,7 +626,7 @@ default ResponseEntity testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -624,6 +640,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -642,7 +659,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -663,6 +680,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -690,7 +708,7 @@ default ResponseEntity testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index cb99581190c2..3e9adf9818d5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -53,7 +54,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index baf9427af913..78e92e6e6bfb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -33,6 +33,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -71,6 +72,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -110,6 +112,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -138,7 +141,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -164,6 +167,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -194,7 +198,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -220,6 +224,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -246,7 +251,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -272,6 +277,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -302,7 +308,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -314,6 +320,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -340,7 +347,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -354,6 +361,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -381,7 +389,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index b5573b20d3a2..6e4e57c7a802 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -52,7 +53,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -63,6 +64,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -85,7 +87,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -120,7 +123,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -167,7 +171,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 5092b04f682a..062652dc3443 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -62,6 +63,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -80,7 +82,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -92,6 +94,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -110,7 +113,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -122,6 +125,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -142,7 +146,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -153,6 +157,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -176,7 +181,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -202,6 +207,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -224,7 +230,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -237,6 +243,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -254,7 +261,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -265,6 +272,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -286,7 +294,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index c213106b20e1..7bc8dd9cf660 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,6 +27,7 @@ default AnotherFakeApiDelegate getDelegate() { return new AnotherFakeApiDelegate() {}; } + public static final 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 @@ -46,7 +47,7 @@ default AnotherFakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 5649ea55c511..f8c29e794b12 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -39,6 +39,7 @@ default FakeApiDelegate getDelegate() { return new FakeApiDelegate() {}; } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -57,7 +58,7 @@ default FakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -68,6 +69,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -87,7 +89,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -99,6 +101,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -118,7 +121,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -130,6 +133,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -149,7 +153,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -161,6 +165,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -180,7 +185,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -192,6 +197,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -210,7 +216,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -221,6 +227,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -239,7 +246,7 @@ default ResponseEntity responseObjectDiff }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -250,6 +257,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -268,7 +276,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -280,6 +288,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -299,7 +308,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -311,6 +320,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -347,7 +357,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -371,6 +381,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -398,7 +409,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -416,6 +427,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -439,7 +451,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -454,6 +466,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -472,7 +485,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -483,6 +496,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -502,7 +516,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -514,6 +528,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -532,7 +547,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -543,6 +558,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -564,7 +580,7 @@ default ResponseEntity testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -577,6 +593,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -595,7 +612,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -606,6 +623,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -633,7 +651,7 @@ default ResponseEntity testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8c278c73e602..d14e74cde093 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -27,6 +27,7 @@ default FakeClassnameTestApiDelegate getDelegate() { return new FakeClassnameTestApiDelegate() {}; } + public static final 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 @@ -49,7 +50,7 @@ default FakeClassnameTestApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 11a91e1ae047..d62d779aa249 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -29,6 +29,7 @@ default PetApiDelegate getDelegate() { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -55,7 +56,7 @@ default PetApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -66,6 +67,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -93,7 +95,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -104,6 +106,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -132,7 +135,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -143,6 +146,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -173,7 +177,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -184,6 +188,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -210,7 +215,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -221,6 +226,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -251,7 +257,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -262,6 +268,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -288,7 +295,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -301,6 +308,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -328,7 +336,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 871e496f64d7..59b45263d001 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -28,6 +28,7 @@ default StoreApiDelegate getDelegate() { return new StoreApiDelegate() {}; } + public static final 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 @@ -48,7 +49,7 @@ default StoreApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -58,6 +59,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -80,7 +82,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -91,6 +93,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -114,7 +117,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -125,6 +128,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -146,7 +150,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index f3c9c7f5adf7..706083d9d7f3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -28,6 +28,7 @@ default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -46,7 +47,7 @@ default UserApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -57,6 +58,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -75,7 +77,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -86,6 +88,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -104,7 +107,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -115,6 +118,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -135,7 +139,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -145,6 +149,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -168,7 +173,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -179,6 +184,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -201,7 +207,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -213,6 +219,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -230,7 +237,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -240,6 +247,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -261,7 +269,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java index aa347f25c77c..d368a8154365 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java @@ -28,6 +28,7 @@ default PetApiDelegate getDelegate() { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -55,7 +56,7 @@ default PetApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -68,6 +69,7 @@ default Pet addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -93,7 +95,7 @@ default Pet addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -105,6 +107,7 @@ default void deletePet( } + public static final 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 @@ -132,7 +135,7 @@ default void deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -144,6 +147,7 @@ default List findPetsByStatus( } + public static final 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. @@ -173,7 +177,7 @@ default List findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -185,6 +189,7 @@ default List findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -211,7 +216,7 @@ default List findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -223,6 +228,7 @@ default Pet getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -256,7 +262,7 @@ default Pet getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -269,6 +275,7 @@ default Pet updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -295,7 +302,7 @@ default Pet updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @@ -309,6 +316,7 @@ default void updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -336,7 +344,7 @@ default void updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java index 4a7c630273b6..fc2832836f07 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java @@ -28,6 +28,7 @@ default StoreApiDelegate getDelegate() { return new StoreApiDelegate() {}; } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -48,7 +49,7 @@ default StoreApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -59,6 +60,7 @@ default void deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -81,7 +83,7 @@ default void deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -93,6 +95,7 @@ default Map getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -116,7 +119,7 @@ default Map getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -128,6 +131,7 @@ default Order getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -149,7 +153,7 @@ default Order getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java index b403166a56b2..c05d1a2a2cdf 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java @@ -28,6 +28,7 @@ default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -49,7 +50,7 @@ default UserApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -61,6 +62,7 @@ default void createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -82,7 +84,7 @@ default void createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -94,6 +96,7 @@ default void createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -115,7 +118,7 @@ default void createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -127,6 +130,7 @@ default void createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -150,7 +154,7 @@ default void createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -161,6 +165,7 @@ default void deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -184,7 +189,7 @@ default void deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -196,6 +201,7 @@ default User getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -218,7 +224,7 @@ default User getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -231,6 +237,7 @@ default String loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -251,7 +258,7 @@ default String loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) @ResponseStatus(HttpStatus.OK) @@ -262,6 +269,7 @@ default void logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -286,7 +294,7 @@ default void logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index c213106b20e1..7bc8dd9cf660 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,6 +27,7 @@ default AnotherFakeApiDelegate getDelegate() { return new AnotherFakeApiDelegate() {}; } + public static final 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 @@ -46,7 +47,7 @@ default AnotherFakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 5649ea55c511..f8c29e794b12 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -39,6 +39,7 @@ default FakeApiDelegate getDelegate() { return new FakeApiDelegate() {}; } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -57,7 +58,7 @@ default FakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -68,6 +69,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -87,7 +89,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -99,6 +101,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -118,7 +121,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -130,6 +133,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -149,7 +153,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -161,6 +165,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -180,7 +185,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -192,6 +197,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -210,7 +216,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -221,6 +227,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -239,7 +246,7 @@ default ResponseEntity responseObjectDiff }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -250,6 +257,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -268,7 +276,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -280,6 +288,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -299,7 +308,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -311,6 +320,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -347,7 +357,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -371,6 +381,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -398,7 +409,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -416,6 +427,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -439,7 +451,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -454,6 +466,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -472,7 +485,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -483,6 +496,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -502,7 +516,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -514,6 +528,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -532,7 +547,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -543,6 +558,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -564,7 +580,7 @@ default ResponseEntity testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -577,6 +593,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -595,7 +612,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -606,6 +623,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -633,7 +651,7 @@ default ResponseEntity testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8c278c73e602..d14e74cde093 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -27,6 +27,7 @@ default FakeClassnameTestApiDelegate getDelegate() { return new FakeClassnameTestApiDelegate() {}; } + public static final 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 @@ -49,7 +50,7 @@ default FakeClassnameTestApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 11a91e1ae047..d62d779aa249 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -29,6 +29,7 @@ default PetApiDelegate getDelegate() { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -55,7 +56,7 @@ default PetApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -66,6 +67,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -93,7 +95,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -104,6 +106,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -132,7 +135,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -143,6 +146,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -173,7 +177,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -184,6 +188,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -210,7 +215,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -221,6 +226,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -251,7 +257,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -262,6 +268,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -288,7 +295,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -301,6 +308,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -328,7 +336,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 871e496f64d7..59b45263d001 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -28,6 +28,7 @@ default StoreApiDelegate getDelegate() { return new StoreApiDelegate() {}; } + public static final 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 @@ -48,7 +49,7 @@ default StoreApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -58,6 +59,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -80,7 +82,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -91,6 +93,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -114,7 +117,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -125,6 +128,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -146,7 +150,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index f3c9c7f5adf7..706083d9d7f3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -28,6 +28,7 @@ default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -46,7 +47,7 @@ default UserApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -57,6 +58,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -75,7 +77,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -86,6 +88,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -104,7 +107,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -115,6 +118,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -135,7 +139,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -145,6 +149,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -168,7 +173,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -179,6 +184,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -201,7 +207,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -213,6 +219,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -230,7 +237,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -240,6 +247,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -261,7 +269,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApi.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApi.java index 8ac62706c095..c2138762bca6 100644 --- a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApi.java +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApi.java @@ -37,6 +37,7 @@ default DummyApiDelegate getDelegate() { return new DummyApiDelegate() {}; } + public static final String PATH_UPLOAD_FILE = "/dummy"; /** * POST /dummy * @@ -53,7 +54,7 @@ default DummyApiDelegate getDelegate() { ) @RequestMapping( method = RequestMethod.POST, - value = "/dummy", + value = DummyApi.PATH_UPLOAD_FILE, consumes = { "application/octet-stream" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java index cd30505618be..5702175607e8 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java @@ -30,6 +30,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -40,7 +41,7 @@ default Optional getRequest() { */ @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -67,6 +68,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -76,7 +78,7 @@ default ResponseEntity addPet( */ @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -87,6 +89,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -97,7 +100,7 @@ default ResponseEntity deletePet( */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -123,6 +126,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -135,7 +139,7 @@ default ResponseEntity> findPetsByStatus( @Deprecated @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -161,6 +165,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -172,7 +177,7 @@ default ResponseEntity> findPetsByTags( */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -198,6 +203,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -212,7 +218,7 @@ default ResponseEntity getPetById( */ @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -239,6 +245,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -250,7 +257,7 @@ default ResponseEntity updatePet( */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -264,6 +271,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -275,7 +283,7 @@ default ResponseEntity updatePetWithForm( */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java index 500f0473e738..43a666f252c8 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java @@ -30,6 +30,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -40,7 +41,7 @@ default Optional getRequest() { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -51,6 +52,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -59,7 +61,7 @@ default ResponseEntity deleteOrder( */ @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -71,6 +73,7 @@ default ResponseEntity> getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -82,7 +85,7 @@ default ResponseEntity> getInventory( */ @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -108,6 +111,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -118,7 +122,7 @@ default ResponseEntity getOrderById( */ @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java index 285c8dac7eb2..0be99ef9f72d 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java @@ -30,6 +30,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -39,7 +40,7 @@ default Optional getRequest() { */ @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -51,6 +52,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -60,7 +62,7 @@ default ResponseEntity createUser( */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -72,6 +74,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -81,7 +84,7 @@ default ResponseEntity createUsersWithArrayInput( */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -93,6 +96,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -103,7 +107,7 @@ default ResponseEntity createUsersWithListInput( */ @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -114,6 +118,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -125,7 +130,7 @@ default ResponseEntity deleteUser( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -151,6 +156,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -162,7 +168,7 @@ default ResponseEntity getUserByName( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -175,6 +181,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -183,7 +190,7 @@ default ResponseEntity loginUser( */ @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -194,6 +201,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -205,7 +213,7 @@ default ResponseEntity logoutUser( */ @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index ecf0d3be7b4f..30375af2d319 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index b0a4af36d26e..9f9beb16c1c3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -61,7 +62,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -73,6 +74,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -92,7 +94,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -105,6 +107,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -124,7 +127,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -165,7 +169,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -178,6 +182,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -197,7 +202,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -210,6 +215,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -228,7 +234,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -249,6 +255,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -267,7 +274,7 @@ default ResponseEntity responseObjectDiff }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -279,6 +286,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -297,7 +305,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -310,6 +318,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -329,7 +338,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -351,6 +360,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -387,7 +397,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -412,6 +422,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -441,7 +452,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -458,6 +469,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -483,7 +495,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -497,6 +509,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -515,7 +528,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -527,6 +540,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -546,7 +560,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -559,6 +573,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -577,7 +592,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -589,6 +604,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -610,7 +626,7 @@ default ResponseEntity testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -624,6 +640,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -642,7 +659,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -663,6 +680,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -690,7 +708,7 @@ default ResponseEntity testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index cb99581190c2..3e9adf9818d5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -53,7 +54,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 201ea5054424..419e10f603ec 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -33,6 +33,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -71,6 +72,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -100,7 +102,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -111,6 +113,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -139,7 +142,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -165,6 +168,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -195,7 +199,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -221,6 +225,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -247,7 +252,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -273,6 +278,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -303,7 +309,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -315,6 +321,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -341,7 +348,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -355,6 +362,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -382,7 +390,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index b5573b20d3a2..6e4e57c7a802 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -52,7 +53,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -63,6 +64,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -85,7 +87,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -120,7 +123,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -167,7 +171,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 5092b04f682a..062652dc3443 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -62,6 +63,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -80,7 +82,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -92,6 +94,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -110,7 +113,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -122,6 +125,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -142,7 +146,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -153,6 +157,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -176,7 +181,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -202,6 +207,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -224,7 +230,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -237,6 +243,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -254,7 +261,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -265,6 +272,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -286,7 +294,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/PetApi.java index 8c8f5b60b628..4c2199a6953a 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/PetApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -68,7 +69,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -95,6 +96,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -117,7 +119,7 @@ default ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -129,6 +131,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -155,7 +158,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -181,6 +184,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -210,7 +214,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -236,6 +240,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -264,7 +269,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -290,6 +295,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -323,7 +329,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -350,6 +356,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -373,7 +380,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -387,6 +394,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -412,7 +420,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/StoreApi.java index 2c59fbd75c9e..83e1454ec72f 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/StoreApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -62,7 +63,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -73,6 +74,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -95,7 +97,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -107,6 +109,7 @@ default ResponseEntity> getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -132,7 +135,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -158,6 +161,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -181,7 +185,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/UserApi.java index 434367cc4103..c4f1d6b54a6c 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/UserApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -63,7 +64,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -75,6 +76,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -96,7 +98,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -108,6 +110,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -129,7 +132,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -141,6 +144,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -164,7 +168,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -175,6 +179,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -200,7 +205,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -226,6 +231,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -250,7 +256,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -263,6 +269,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -283,7 +290,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -294,6 +301,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -318,7 +326,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/PetApi.java index 041f50bed56e..c756ffa79be5 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/PetApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -68,7 +69,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -95,6 +96,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -117,7 +119,7 @@ default ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -129,6 +131,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -155,7 +158,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -181,6 +184,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -210,7 +214,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -236,6 +240,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -264,7 +269,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -290,6 +295,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -323,7 +329,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -350,6 +356,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -373,7 +380,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -387,6 +394,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -412,7 +420,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/StoreApi.java index b5552e4c7d20..8fdd01e844ce 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/StoreApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_DELETE_ORDER = "/store/order/{orderId}"; /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -62,7 +63,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -73,6 +74,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -95,7 +97,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -107,6 +109,7 @@ default ResponseEntity> getInventory( } + public static final String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}"; /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -132,7 +135,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -158,6 +161,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -181,7 +185,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/UserApi.java index f87868e7d96f..929530690b49 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/UserApi.java @@ -42,6 +42,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -63,7 +64,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -75,6 +76,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -96,7 +98,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -108,6 +110,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -129,7 +132,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -141,6 +144,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -164,7 +168,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -175,6 +179,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -200,7 +205,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -226,6 +231,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -250,7 +256,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -263,6 +269,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -283,7 +290,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -294,6 +301,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -318,7 +326,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java index c0f77d6996e8..730a06d3133e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,6 +32,7 @@ default AnotherFakeApiDelegate getDelegate() { return new AnotherFakeApiDelegate() {}; } + public static final 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 @@ -51,7 +52,7 @@ default AnotherFakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index 6cd2183fcc4f..e1474439d647 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -44,6 +44,7 @@ default FakeApiDelegate getDelegate() { return new FakeApiDelegate() {}; } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -62,7 +63,7 @@ default FakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @ResponseStatus(HttpStatus.OK) @@ -75,6 +76,7 @@ default Mono createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -94,7 +96,7 @@ default Mono createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -108,6 +110,7 @@ default Mono fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -127,7 +130,7 @@ default Mono fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -141,6 +144,7 @@ default Mono fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -160,7 +164,7 @@ default Mono fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -174,6 +178,7 @@ default Mono fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -193,7 +198,7 @@ default Mono fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -207,6 +212,7 @@ default Mono fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -225,7 +231,7 @@ default Mono fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -238,6 +244,7 @@ default Mono responseObjectDifferentNames } + public static final 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`. @@ -256,7 +263,7 @@ default Mono responseObjectDifferentNames }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -269,6 +276,7 @@ default Mono testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -287,7 +295,7 @@ default Mono testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -301,6 +309,7 @@ default Mono testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -320,7 +329,7 @@ default Mono testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -334,6 +343,7 @@ default Mono testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -370,7 +380,7 @@ default Mono testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -396,6 +406,7 @@ default Mono testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -423,7 +434,7 @@ default Mono testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -443,6 +454,7 @@ default Mono testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -466,7 +478,7 @@ default Mono testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -483,6 +495,7 @@ default Mono testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -501,7 +514,7 @@ default Mono testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -514,6 +527,7 @@ default Mono testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -533,7 +547,7 @@ default Mono testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.OK) @@ -547,6 +561,7 @@ default Mono testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -565,7 +580,7 @@ default Mono testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -578,6 +593,7 @@ default Mono testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -599,7 +615,7 @@ default Mono testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) @ResponseStatus(HttpStatus.OK) @@ -614,6 +630,7 @@ default Mono testQueryParameterCollectionFormat( } + public static final 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. @@ -632,7 +649,7 @@ default Mono testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -644,6 +661,7 @@ default Mono testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -671,7 +689,7 @@ default Mono testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f99f4188f59a..cb10e4d49b12 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,6 +32,7 @@ default FakeClassnameTestApiDelegate getDelegate() { return new FakeClassnameTestApiDelegate() {}; } + public static final 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 @@ -54,7 +55,7 @@ default FakeClassnameTestApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java index fbfbf333d2eb..aa455be46413 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java @@ -34,6 +34,7 @@ default PetApiDelegate getDelegate() { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ default PetApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) @@ -73,6 +74,7 @@ default Mono addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -100,7 +102,7 @@ default Mono addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) @ResponseStatus(HttpStatus.OK) @@ -113,6 +115,7 @@ default Mono deletePet( } + public static final 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 @@ -141,7 +144,7 @@ default Mono deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -154,6 +157,7 @@ default Flux findPetsByStatus( } + public static final 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. @@ -184,7 +188,7 @@ default Flux findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -197,6 +201,7 @@ default Flux findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -223,7 +228,7 @@ default Flux findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -236,6 +241,7 @@ default Mono getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -266,7 +272,7 @@ default Mono getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) @@ -279,6 +285,7 @@ default Mono updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -305,7 +312,7 @@ default Mono updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @@ -320,6 +327,7 @@ default Mono updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -347,7 +355,7 @@ default Mono updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java index 45d7d9caff67..c9809948b6ff 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java @@ -33,6 +33,7 @@ default StoreApiDelegate getDelegate() { return new StoreApiDelegate() {}; } + public static final 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 @@ -53,7 +54,7 @@ default StoreApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -65,6 +66,7 @@ default Mono deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -87,7 +89,7 @@ default Mono deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -99,6 +101,7 @@ default Mono> getInventory( } + public static final 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 @@ -122,7 +125,7 @@ default Mono> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -135,6 +138,7 @@ default Mono getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -156,7 +160,7 @@ default Mono getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java index 7460f0980921..c5a92f6dd8f3 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java @@ -33,6 +33,7 @@ default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -51,7 +52,7 @@ default UserApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -64,6 +65,7 @@ default Mono createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -82,7 +84,7 @@ default Mono createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -95,6 +97,7 @@ default Mono createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -113,7 +116,7 @@ default Mono createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -126,6 +129,7 @@ default Mono createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -146,7 +150,7 @@ default Mono createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -158,6 +162,7 @@ default Mono deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -181,7 +186,7 @@ default Mono deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -194,6 +199,7 @@ default Mono getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -216,7 +222,7 @@ default Mono getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -230,6 +236,7 @@ default Mono loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -247,7 +254,7 @@ default Mono loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) @ResponseStatus(HttpStatus.OK) @@ -258,6 +265,7 @@ default Mono logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -279,7 +287,7 @@ default Mono logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 96fa84de7d4d..06511702699d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,6 +32,7 @@ default AnotherFakeApiDelegate getDelegate() { return new AnotherFakeApiDelegate() {}; } + public static final 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 @@ -51,7 +52,7 @@ default AnotherFakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 66416d0392d7..e2e5a29e96b0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -44,6 +44,7 @@ default FakeApiDelegate getDelegate() { return new FakeApiDelegate() {}; } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -62,7 +63,7 @@ default FakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -74,6 +75,7 @@ default Mono> createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -93,7 +95,7 @@ default Mono> createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -106,6 +108,7 @@ default Mono> fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -125,7 +128,7 @@ default Mono> fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -138,6 +141,7 @@ default Mono> fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -157,7 +161,7 @@ default Mono> fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -170,6 +174,7 @@ default Mono> fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -189,7 +194,7 @@ default Mono> fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -202,6 +207,7 @@ default Mono> fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -220,7 +226,7 @@ default Mono> fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -232,6 +238,7 @@ default Mono> responseObje } + public static final 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`. @@ -250,7 +257,7 @@ default Mono> responseObje }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -262,6 +269,7 @@ default Mono> testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -280,7 +288,7 @@ default Mono> testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -293,6 +301,7 @@ default Mono> testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -312,7 +321,7 @@ default Mono> testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -325,6 +334,7 @@ default Mono> testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -361,7 +371,7 @@ default Mono> testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -386,6 +396,7 @@ default Mono> testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -413,7 +424,7 @@ default Mono> testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -432,6 +443,7 @@ default Mono> testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -455,7 +467,7 @@ default Mono> testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default Mono> testGroupParameters( @@ -471,6 +483,7 @@ default Mono> testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -489,7 +502,7 @@ default Mono> testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -501,6 +514,7 @@ default Mono> testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -520,7 +534,7 @@ default Mono> testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -533,6 +547,7 @@ default Mono> testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -551,7 +566,7 @@ default Mono> testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -563,6 +578,7 @@ default Mono> testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -584,7 +600,7 @@ default Mono> testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default Mono> testQueryParameterCollectionFormat( @@ -598,6 +614,7 @@ default Mono> testQueryParameterCollectionFormat( } + public static final 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. @@ -616,7 +633,7 @@ default Mono> testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -627,6 +644,7 @@ default Mono> testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -654,7 +672,7 @@ default Mono> testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 181eaeacab3e..a8564dc38c43 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,6 +32,7 @@ default FakeClassnameTestApiDelegate getDelegate() { return new FakeClassnameTestApiDelegate() {}; } + public static final 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 @@ -54,7 +55,7 @@ default FakeClassnameTestApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 8fedcddcaaec..422a6ad70825 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -34,6 +34,7 @@ default PetApiDelegate getDelegate() { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ default PetApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ default Mono> addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -99,7 +101,7 @@ default Mono> addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default Mono> deletePet( @@ -111,6 +113,7 @@ default Mono> deletePet( } + public static final 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 @@ -139,7 +142,7 @@ default Mono> deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -151,6 +154,7 @@ default Mono>> findPetsByStatus( } + public static final 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. @@ -181,7 +185,7 @@ default Mono>> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -193,6 +197,7 @@ default Mono>> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -219,7 +224,7 @@ default Mono>> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -231,6 +236,7 @@ default Mono> getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -261,7 +267,7 @@ default Mono> getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -273,6 +279,7 @@ default Mono> updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -299,7 +306,7 @@ default Mono> updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -313,6 +320,7 @@ default Mono> updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -340,7 +348,7 @@ default Mono> updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index b2fdd98fcea9..2fc990b8ae0b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -33,6 +33,7 @@ default StoreApiDelegate getDelegate() { return new StoreApiDelegate() {}; } + public static final 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 @@ -53,7 +54,7 @@ default StoreApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default Mono> deleteOrder( @@ -64,6 +65,7 @@ default Mono> deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -86,7 +88,7 @@ default Mono> deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ default Mono>> getInventory( } + public static final 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 @@ -120,7 +123,7 @@ default Mono>> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -132,6 +135,7 @@ default Mono> getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -153,7 +157,7 @@ default Mono> getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 9de78ab83862..d8bc62113dea 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -33,6 +33,7 @@ default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -51,7 +52,7 @@ default UserApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -63,6 +64,7 @@ default Mono> createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -81,7 +83,7 @@ default Mono> createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -93,6 +95,7 @@ default Mono> createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -111,7 +114,7 @@ default Mono> createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -123,6 +126,7 @@ default Mono> createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -143,7 +147,7 @@ default Mono> createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default Mono> deleteUser( @@ -154,6 +158,7 @@ default Mono> deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -177,7 +182,7 @@ default Mono> deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -189,6 +194,7 @@ default Mono> getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -211,7 +217,7 @@ default Mono> getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -224,6 +230,7 @@ default Mono> loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -241,7 +248,7 @@ default Mono> loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default Mono> logoutUser( @@ -251,6 +258,7 @@ default Mono> logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -272,7 +280,7 @@ default Mono> logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index e7c68bfba0db..9b7112d246c0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,6 +27,7 @@ default AnotherFakeApiDelegate getDelegate() { return new AnotherFakeApiDelegate() {}; } + public static final 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 @@ -46,7 +47,7 @@ default AnotherFakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 437a3e8871bc..fb277d5c35cc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -37,6 +37,7 @@ default FakeApiDelegate getDelegate() { return new FakeApiDelegate() {}; } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -55,7 +56,7 @@ default FakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -66,6 +67,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -85,7 +87,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) @@ -96,6 +98,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -115,7 +118,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) @@ -126,6 +129,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -145,7 +149,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) @@ -156,6 +160,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -175,7 +180,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) @@ -186,6 +191,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final 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`. @@ -204,7 +210,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -215,6 +221,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -233,7 +240,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -245,6 +252,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -264,7 +272,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -276,6 +284,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -312,7 +321,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -336,6 +345,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -363,7 +373,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -381,6 +391,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -404,7 +415,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -419,6 +430,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -436,7 +448,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -447,6 +459,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -465,7 +478,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -477,6 +490,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -499,7 +513,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -513,6 +527,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -539,7 +554,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8fc44b77c1fe..e8424293b3f3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -27,6 +27,7 @@ default FakeClassnameTestApiDelegate getDelegate() { return new FakeClassnameTestApiDelegate() {}; } + public static final 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 @@ -49,7 +50,7 @@ default FakeClassnameTestApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index e4ae3f70a8c6..871f68a98cde 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -30,6 +30,7 @@ default PetApiDelegate getDelegate() { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -55,7 +56,7 @@ default PetApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -66,6 +67,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -92,7 +94,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -103,6 +105,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -131,7 +134,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -143,6 +146,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -173,7 +177,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -185,6 +189,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -211,7 +216,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -222,6 +227,7 @@ default ResponseEntity getPetById( } + public static final String PATH_LIST_ALL_PETS = "/pet/all"; /** * GET /pet/all : List all pets * @@ -248,7 +254,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/all", + value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) @@ -259,6 +265,7 @@ default ResponseEntity> listAllPets( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -288,7 +295,7 @@ default ResponseEntity> listAllPets( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -299,6 +306,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -324,7 +332,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -337,6 +345,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -363,7 +372,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 9b7522afe871..225c95bfcf1b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -28,6 +28,7 @@ default StoreApiDelegate getDelegate() { return new StoreApiDelegate() {}; } + public static final 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 @@ -48,7 +49,7 @@ default StoreApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -58,6 +59,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -80,7 +82,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -91,6 +93,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -114,7 +117,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -125,6 +128,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -145,7 +149,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index c24dbf51eaa7..3fed7d9a8dd3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -28,6 +28,7 @@ default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -46,7 +47,7 @@ default UserApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) default ResponseEntity createUser( @@ -56,6 +57,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -73,7 +75,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) default ResponseEntity createUsersWithArrayInput( @@ -83,6 +85,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -100,7 +103,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) default ResponseEntity createUsersWithListInput( @@ -110,6 +113,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -130,7 +134,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -140,6 +144,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -162,7 +167,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -173,6 +178,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -194,7 +200,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -206,6 +212,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -222,7 +229,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -232,6 +239,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -253,7 +261,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = UserApi.PATH_UPDATE_USER ) default ResponseEntity updateUser( diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java index 618c465e924f..edeabd5b76e8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java @@ -27,6 +27,7 @@ default VersioningApiDelegate getDelegate() { return new VersioningApiDelegate() {}; } + public static final String PATH_VERSIONING_HEADERS = "/versioning/headers"; /** * POST /versioning/headers * @@ -47,7 +48,7 @@ default VersioningApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/headers", + value = VersioningApi.PATH_VERSIONING_HEADERS, produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) @@ -61,6 +62,7 @@ default ResponseEntity versioningHeaders( } + public static final String PATH_VERSIONING_MIX = "/versioning/mix"; /** * POST /versioning/mix * @@ -83,7 +85,7 @@ default ResponseEntity versioningHeaders( }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/mix", + value = VersioningApi.PATH_VERSIONING_MIX, produces = { "*/*" }, headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } @@ -100,6 +102,7 @@ default ResponseEntity versioningMix( } + public static final String PATH_VERSIONING_QUERY_PARAMS = "/versioning/query-params"; /** * POST /versioning/query-params * @@ -120,7 +123,7 @@ default ResponseEntity versioningMix( }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/query-params", + value = VersioningApi.PATH_VERSIONING_QUERY_PARAMS, produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index e7c68bfba0db..9b7112d246c0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,6 +27,7 @@ default AnotherFakeApiDelegate getDelegate() { return new AnotherFakeApiDelegate() {}; } + public static final 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 @@ -46,7 +47,7 @@ default AnotherFakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 437a3e8871bc..fb277d5c35cc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -37,6 +37,7 @@ default FakeApiDelegate getDelegate() { return new FakeApiDelegate() {}; } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -55,7 +56,7 @@ default FakeApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -66,6 +67,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -85,7 +87,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) @@ -96,6 +98,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -115,7 +118,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) @@ -126,6 +129,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -145,7 +149,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) @@ -156,6 +160,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -175,7 +180,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) @@ -186,6 +191,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final 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`. @@ -204,7 +210,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -215,6 +221,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -233,7 +240,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -245,6 +252,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -264,7 +272,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -276,6 +284,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -312,7 +321,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -336,6 +345,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -363,7 +373,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -381,6 +391,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -404,7 +415,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -419,6 +430,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -436,7 +448,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -447,6 +459,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -465,7 +478,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -477,6 +490,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -499,7 +513,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -513,6 +527,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -539,7 +554,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8fc44b77c1fe..e8424293b3f3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -27,6 +27,7 @@ default FakeClassnameTestApiDelegate getDelegate() { return new FakeClassnameTestApiDelegate() {}; } + public static final 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 @@ -49,7 +50,7 @@ default FakeClassnameTestApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index e4ae3f70a8c6..871f68a98cde 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -30,6 +30,7 @@ default PetApiDelegate getDelegate() { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -55,7 +56,7 @@ default PetApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -66,6 +67,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -92,7 +94,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -103,6 +105,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -131,7 +134,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -143,6 +146,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -173,7 +177,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -185,6 +189,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -211,7 +216,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -222,6 +227,7 @@ default ResponseEntity getPetById( } + public static final String PATH_LIST_ALL_PETS = "/pet/all"; /** * GET /pet/all : List all pets * @@ -248,7 +254,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/all", + value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) @@ -259,6 +265,7 @@ default ResponseEntity> listAllPets( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -288,7 +295,7 @@ default ResponseEntity> listAllPets( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -299,6 +306,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -324,7 +332,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -337,6 +345,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -363,7 +372,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 9b7522afe871..225c95bfcf1b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -28,6 +28,7 @@ default StoreApiDelegate getDelegate() { return new StoreApiDelegate() {}; } + public static final 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 @@ -48,7 +49,7 @@ default StoreApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -58,6 +59,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -80,7 +82,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -91,6 +93,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -114,7 +117,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -125,6 +128,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -145,7 +149,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index c24dbf51eaa7..3fed7d9a8dd3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -28,6 +28,7 @@ default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -46,7 +47,7 @@ default UserApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) default ResponseEntity createUser( @@ -56,6 +57,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -73,7 +75,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) default ResponseEntity createUsersWithArrayInput( @@ -83,6 +85,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -100,7 +103,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) default ResponseEntity createUsersWithListInput( @@ -110,6 +113,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -130,7 +134,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -140,6 +144,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -162,7 +167,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -173,6 +178,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -194,7 +200,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -206,6 +212,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -222,7 +229,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -232,6 +239,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -253,7 +261,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = UserApi.PATH_UPDATE_USER ) default ResponseEntity updateUser( diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java index 115510dd1ee0..2c22dd8ce424 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java @@ -27,6 +27,7 @@ default VersioningApiDelegate getDelegate() { return new VersioningApiDelegate() {}; } + public static final String PATH_VERSIONING_HEADERS = "/versioning/headers"; /** * POST /versioning/headers * @@ -49,7 +50,7 @@ default VersioningApiDelegate getDelegate() { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/headers", + value = VersioningApi.PATH_VERSIONING_HEADERS, produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) @@ -61,6 +62,7 @@ default ResponseEntity versioningHeaders( } + public static final String PATH_VERSIONING_MIX = "/versioning/mix"; /** * POST /versioning/mix * @@ -85,7 +87,7 @@ default ResponseEntity versioningHeaders( }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/mix", + value = VersioningApi.PATH_VERSIONING_MIX, produces = { "*/*" }, headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } @@ -100,6 +102,7 @@ default ResponseEntity versioningMix( } + public static final String PATH_VERSIONING_QUERY_PARAMS = "/versioning/query-params"; /** * POST /versioning/query-params * @@ -120,7 +123,7 @@ default ResponseEntity versioningMix( }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/query-params", + value = VersioningApi.PATH_VERSIONING_QUERY_PARAMS, produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8c2e3e627f22..2fcec5b28f2e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index bbe3ee56b633..ef69ed3ce6c6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -41,6 +41,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -71,6 +72,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -90,7 +92,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) @@ -102,6 +104,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -121,7 +124,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) @@ -142,6 +145,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -161,7 +165,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) @@ -173,6 +177,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -192,7 +197,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) @@ -204,6 +209,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final 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`. @@ -222,7 +228,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -234,6 +240,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -252,7 +259,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -265,6 +272,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -284,7 +292,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -306,6 +314,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -342,7 +351,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -367,6 +376,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -394,7 +404,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -413,6 +423,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -436,7 +447,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -452,6 +463,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -469,7 +481,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -481,6 +493,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -499,7 +512,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -512,6 +525,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -534,7 +548,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -549,6 +563,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -575,7 +590,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d5efa487c074..aeada30320ca 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -53,7 +54,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index bd019f0194fa..f5076ea35f96 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -34,6 +34,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -71,6 +72,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -97,7 +99,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -109,6 +111,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -137,7 +140,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -164,6 +167,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -194,7 +198,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -221,6 +225,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -247,7 +252,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -273,6 +278,7 @@ default ResponseEntity getPetById( } + public static final String PATH_LIST_ALL_PETS = "/pet/all"; /** * GET /pet/all : List all pets * @@ -299,7 +305,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/all", + value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) @@ -325,6 +331,7 @@ default ResponseEntity> listAllPets( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -354,7 +361,7 @@ default ResponseEntity> listAllPets( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -366,6 +373,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -391,7 +399,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -405,6 +413,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -431,7 +440,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index a7c9fba95eac..de8f558db446 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -52,7 +53,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -63,6 +64,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -85,7 +87,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -120,7 +123,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -166,7 +170,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 7589b656508a..4e1694965c17 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) default ResponseEntity createUser( @@ -61,6 +62,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -78,7 +80,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) default ResponseEntity createUsersWithArrayInput( @@ -89,6 +91,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -106,7 +109,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) default ResponseEntity createUsersWithListInput( @@ -117,6 +120,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -137,7 +141,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -148,6 +152,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -170,7 +175,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -196,6 +201,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -217,7 +223,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -230,6 +236,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -246,7 +253,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -257,6 +264,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -278,7 +286,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = UserApi.PATH_UPDATE_USER ) default ResponseEntity updateUser( diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java index a5d10a4085e4..d4b1494e4939 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_VERSIONING_HEADERS = "/versioning/headers"; /** * POST /versioning/headers * @@ -51,7 +52,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/headers", + value = VersioningApi.PATH_VERSIONING_HEADERS, produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) @@ -75,6 +76,7 @@ default ResponseEntity versioningHeaders( } + public static final String PATH_VERSIONING_MIX = "/versioning/mix"; /** * POST /versioning/mix * @@ -97,7 +99,7 @@ default ResponseEntity versioningHeaders( }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/mix", + value = VersioningApi.PATH_VERSIONING_MIX, produces = { "*/*" }, headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } @@ -124,6 +126,7 @@ default ResponseEntity versioningMix( } + public static final String PATH_VERSIONING_QUERY_PARAMS = "/versioning/query-params"; /** * POST /versioning/query-params * @@ -144,7 +147,7 @@ default ResponseEntity versioningMix( }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/query-params", + value = VersioningApi.PATH_VERSIONING_QUERY_PARAMS, produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8c2e3e627f22..2fcec5b28f2e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index bbe3ee56b633..ef69ed3ce6c6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -41,6 +41,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -71,6 +72,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -90,7 +92,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) @@ -102,6 +104,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -121,7 +124,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) @@ -142,6 +145,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -161,7 +165,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) @@ -173,6 +177,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -192,7 +197,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) @@ -204,6 +209,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final 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`. @@ -222,7 +228,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -234,6 +240,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -252,7 +259,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -265,6 +272,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -284,7 +292,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -306,6 +314,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -342,7 +351,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -367,6 +376,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -394,7 +404,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -413,6 +423,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -436,7 +447,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -452,6 +463,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -469,7 +481,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -481,6 +493,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -499,7 +512,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -512,6 +525,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -534,7 +548,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -549,6 +563,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -575,7 +590,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d5efa487c074..aeada30320ca 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -53,7 +54,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index bd019f0194fa..f5076ea35f96 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -34,6 +34,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -71,6 +72,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -97,7 +99,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -109,6 +111,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -137,7 +140,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -164,6 +167,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -194,7 +198,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -221,6 +225,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -247,7 +252,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -273,6 +278,7 @@ default ResponseEntity getPetById( } + public static final String PATH_LIST_ALL_PETS = "/pet/all"; /** * GET /pet/all : List all pets * @@ -299,7 +305,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/all", + value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) @@ -325,6 +331,7 @@ default ResponseEntity> listAllPets( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -354,7 +361,7 @@ default ResponseEntity> listAllPets( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -366,6 +373,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -391,7 +399,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -405,6 +413,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -431,7 +440,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index a7c9fba95eac..de8f558db446 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -52,7 +53,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -63,6 +64,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -85,7 +87,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -120,7 +123,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -166,7 +170,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" } ) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 7589b656508a..4e1694965c17 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) default ResponseEntity createUser( @@ -61,6 +62,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -78,7 +80,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) default ResponseEntity createUsersWithArrayInput( @@ -89,6 +91,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -106,7 +109,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) default ResponseEntity createUsersWithListInput( @@ -117,6 +120,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -137,7 +141,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -148,6 +152,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -170,7 +175,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -196,6 +201,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -217,7 +223,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -230,6 +236,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -246,7 +253,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -257,6 +264,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -278,7 +286,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = UserApi.PATH_UPDATE_USER ) default ResponseEntity updateUser( diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java index 29d0447fa166..07bbe4f184b3 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_VERSIONING_HEADERS = "/versioning/headers"; /** * POST /versioning/headers * @@ -53,7 +54,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/headers", + value = VersioningApi.PATH_VERSIONING_HEADERS, produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) @@ -75,6 +76,7 @@ default ResponseEntity versioningHeaders( } + public static final String PATH_VERSIONING_MIX = "/versioning/mix"; /** * POST /versioning/mix * @@ -99,7 +101,7 @@ default ResponseEntity versioningHeaders( }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/mix", + value = VersioningApi.PATH_VERSIONING_MIX, produces = { "*/*" }, headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } @@ -124,6 +126,7 @@ default ResponseEntity versioningMix( } + public static final String PATH_VERSIONING_QUERY_PARAMS = "/versioning/query-params"; /** * POST /versioning/query-params * @@ -144,7 +147,7 @@ default ResponseEntity versioningMix( }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/query-params", + value = VersioningApi.PATH_VERSIONING_QUERY_PARAMS, produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/api/UserApi.java index c18b43bd44aa..3448fe698b8b 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/api/UserApi.java @@ -46,6 +46,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -67,7 +68,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json" } ) @@ -85,6 +86,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -100,7 +102,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index ecf0d3be7b4f..30375af2d319 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 50a6dabf2874..66368586aa0c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -61,7 +62,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -73,6 +74,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -92,7 +94,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -105,6 +107,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -124,7 +127,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -165,7 +169,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -178,6 +182,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -197,7 +202,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -210,6 +215,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -228,7 +234,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -249,6 +255,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -267,7 +274,7 @@ default ResponseEntity responseObjectDiff }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -279,6 +286,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -297,7 +305,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -310,6 +318,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -329,7 +338,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -351,6 +360,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -387,7 +397,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -412,6 +422,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -439,7 +450,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -458,6 +469,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -481,7 +493,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -497,6 +509,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -515,7 +528,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -527,6 +540,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -546,7 +560,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -559,6 +573,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -577,7 +592,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -589,6 +604,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -610,7 +626,7 @@ default ResponseEntity testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -624,6 +640,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -642,7 +659,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -663,6 +680,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -690,7 +708,7 @@ default ResponseEntity testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index cb99581190c2..3e9adf9818d5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -53,7 +54,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index cd3dd8f888a3..dbc11ef1af9b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -33,6 +33,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -71,6 +72,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -110,6 +112,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -138,7 +141,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -164,6 +167,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -194,7 +198,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -220,6 +224,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -246,7 +251,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -272,6 +277,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -302,7 +308,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -314,6 +320,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -340,7 +347,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -354,6 +361,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -381,7 +389,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index b5573b20d3a2..6e4e57c7a802 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -52,7 +53,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -63,6 +64,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -85,7 +87,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -120,7 +123,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -167,7 +171,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 5092b04f682a..062652dc3443 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -62,6 +63,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -80,7 +82,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -92,6 +94,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -110,7 +113,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -122,6 +125,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -142,7 +146,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -153,6 +157,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -176,7 +181,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -202,6 +207,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -224,7 +230,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -237,6 +243,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -254,7 +261,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -265,6 +272,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -286,7 +294,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 4c36b15cefa7..b0daab17ac6e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -44,6 +44,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -65,7 +66,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index e0fa877832c0..0ca29aa945d5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -56,6 +56,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -75,7 +76,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -87,6 +88,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -107,7 +109,7 @@ default ResponseEntity createXmlItem( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -120,6 +122,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -140,7 +143,7 @@ default ResponseEntity fakeOuterBooleanSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -162,6 +165,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -182,7 +186,7 @@ default ResponseEntity fakeOuterCompositeSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -195,6 +199,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -215,7 +220,7 @@ default ResponseEntity fakeOuterNumberSerialize( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -228,6 +233,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -246,7 +252,7 @@ default ResponseEntity fakeOuterStringSerialize( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -267,6 +273,7 @@ default ResponseEntity responseObjectDiff } + public static final 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`. @@ -285,7 +292,7 @@ default ResponseEntity responseObjectDiff ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -297,6 +304,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -314,7 +322,7 @@ default ResponseEntity testBodyWithFileSchema( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -327,6 +335,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -348,7 +357,7 @@ default ResponseEntity testBodyWithQueryParams( ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -370,6 +379,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -407,7 +417,7 @@ default ResponseEntity testClientModel( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -432,6 +442,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -460,7 +471,7 @@ default ResponseEntity testEndpointParameters( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -479,6 +490,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -503,7 +515,7 @@ default ResponseEntity testEnumParameters( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -519,6 +531,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -538,7 +551,7 @@ default ResponseEntity testGroupParameters( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -550,6 +563,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -570,7 +584,7 @@ default ResponseEntity testInlineAdditionalProperties( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -583,6 +597,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -602,7 +617,7 @@ default ResponseEntity testJsonFormData( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -614,6 +629,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -635,7 +651,7 @@ default ResponseEntity testNullable( ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -649,6 +665,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -668,7 +685,7 @@ default ResponseEntity testQueryParameterCollectionFormat( ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -689,6 +706,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -715,7 +733,7 @@ default ResponseEntity testWithResultExample( ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index a70edaf5fcff..8908fe59adf5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -44,6 +44,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -68,7 +69,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 911fa95dd203..7f40f1c0c6f0 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -46,6 +46,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -70,7 +71,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -82,6 +83,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -107,7 +109,7 @@ default ResponseEntity addPet( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -119,6 +121,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -146,7 +149,7 @@ default ResponseEntity deletePet( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -172,6 +175,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -202,7 +206,7 @@ default ResponseEntity> findPetsByStatus( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -228,6 +232,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -257,7 +262,7 @@ default ResponseEntity> findPetsByTags( ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -283,6 +288,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -311,7 +317,7 @@ default ResponseEntity getPetById( ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -323,6 +329,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -347,7 +354,7 @@ default ResponseEntity updatePet( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -361,6 +368,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -387,7 +395,7 @@ default ResponseEntity updatePetWithForm( ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index e8e2207f7771..a98498c63272 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -45,6 +45,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -66,7 +67,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -77,6 +78,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -100,7 +102,7 @@ default ResponseEntity deleteOrder( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -112,6 +114,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -138,7 +141,7 @@ default ResponseEntity> getInventory( ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -164,6 +167,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -188,7 +192,7 @@ default ResponseEntity getOrderById( ) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index bf006d9b4a91..964753760949 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -45,6 +45,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -64,7 +65,7 @@ default Optional getRequest() { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -76,6 +77,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -95,7 +97,7 @@ default ResponseEntity createUser( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -107,6 +109,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -126,7 +129,7 @@ default ResponseEntity createUsersWithArrayInput( ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -138,6 +141,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -159,7 +163,7 @@ default ResponseEntity createUsersWithListInput( ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -170,6 +174,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -196,7 +201,7 @@ default ResponseEntity deleteUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -222,6 +227,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -247,7 +253,7 @@ default ResponseEntity getUserByName( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -260,6 +266,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -278,7 +285,7 @@ default ResponseEntity loginUser( ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -289,6 +296,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -311,7 +319,7 @@ default ResponseEntity logoutUser( ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index b4e405ff3af5..3846056ab2ba 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/another-fake/dummy", + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 0560b96b5728..0d7b015a147b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -43,6 +43,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_XML_ITEM = "/fake/create_xml_item"; /** * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem @@ -61,7 +62,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/create_xml_item", + value = FakeApi.PATH_CREATE_XML_ITEM, consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @@ -73,6 +74,7 @@ default ResponseEntity createXmlItem( } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -92,7 +94,7 @@ default ResponseEntity createXmlItem( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -105,6 +107,7 @@ default ResponseEntity fakeOuterBooleanSerialize( } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -124,7 +127,7 @@ default ResponseEntity fakeOuterBooleanSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity fakeOuterCompositeSerialize( } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -165,7 +169,7 @@ default ResponseEntity fakeOuterCompositeSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -178,6 +182,7 @@ default ResponseEntity fakeOuterNumberSerialize( } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -197,7 +202,7 @@ default ResponseEntity fakeOuterNumberSerialize( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -210,6 +215,7 @@ default ResponseEntity fakeOuterStringSerialize( } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -228,7 +234,7 @@ default ResponseEntity fakeOuterStringSerialize( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -249,6 +255,7 @@ default ResponseEntity responseObjectD } + public static final 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`. @@ -267,7 +274,7 @@ default ResponseEntity responseObjectD }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -279,6 +286,7 @@ default ResponseEntity testBodyWithFileSchema( } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -297,7 +305,7 @@ default ResponseEntity testBodyWithFileSchema( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -310,6 +318,7 @@ default ResponseEntity testBodyWithQueryParams( } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -329,7 +338,7 @@ default ResponseEntity testBodyWithQueryParams( }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -351,6 +360,7 @@ default ResponseEntity testClientModel( } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -387,7 +397,7 @@ default ResponseEntity testClientModel( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -412,6 +422,7 @@ default ResponseEntity testEndpointParameters( } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -439,7 +450,7 @@ default ResponseEntity testEndpointParameters( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -458,6 +469,7 @@ default ResponseEntity testEnumParameters( } + public static final String PATH_TEST_GROUP_PARAMETERS = "/fake"; /** * DELETE /fake : Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -481,7 +493,7 @@ default ResponseEntity testEnumParameters( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -497,6 +509,7 @@ default ResponseEntity testGroupParameters( } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -515,7 +528,7 @@ default ResponseEntity testGroupParameters( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -527,6 +540,7 @@ default ResponseEntity testInlineAdditionalProperties( } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -546,7 +560,7 @@ default ResponseEntity testInlineAdditionalProperties( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -559,6 +573,7 @@ default ResponseEntity testJsonFormData( } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -577,7 +592,7 @@ default ResponseEntity testJsonFormData( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -589,6 +604,7 @@ default ResponseEntity testNullable( } + public static final String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; /** * PUT /fake/test-query-parameters * To test the collection format in query parameters @@ -610,7 +626,7 @@ default ResponseEntity testNullable( }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -624,6 +640,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } + public static final 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. @@ -642,7 +659,7 @@ default ResponseEntity testQueryParameterCollectionFormat( }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -663,6 +680,7 @@ default ResponseEntity testWithResultExample( } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -690,7 +708,7 @@ default ResponseEntity testWithResultExample( }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 53ded942682c..0656a62409f7 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,6 +31,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -53,7 +54,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake_classname_test", + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, produces = { "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index c83462a60240..28d1ef762370 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -33,6 +33,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -59,7 +60,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -71,6 +72,7 @@ default ResponseEntity addPet( } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ default ResponseEntity addPet( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -110,6 +112,7 @@ default ResponseEntity deletePet( } + public static final 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 @@ -138,7 +141,7 @@ default ResponseEntity deletePet( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -164,6 +167,7 @@ default ResponseEntity> findPetsByStatus( } + public static final 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. @@ -194,7 +198,7 @@ default ResponseEntity> findPetsByStatus( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -220,6 +224,7 @@ default ResponseEntity> findPetsByTags( } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -246,7 +251,7 @@ default ResponseEntity> findPetsByTags( }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -272,6 +277,7 @@ default ResponseEntity getPetById( } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -302,7 +308,7 @@ default ResponseEntity getPetById( }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -314,6 +320,7 @@ default ResponseEntity updatePet( } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -340,7 +347,7 @@ default ResponseEntity updatePet( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -354,6 +361,7 @@ default ResponseEntity updatePetWithForm( } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -381,7 +389,7 @@ default ResponseEntity updatePetWithForm( }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = { "multipart/form-data" } ) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 1f41b10841d6..7a3b5a4f4829 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final 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 @@ -52,7 +53,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -63,6 +64,7 @@ default ResponseEntity deleteOrder( } + public static final String PATH_GET_INVENTORY = "/store/inventory"; /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities @@ -85,7 +87,7 @@ default ResponseEntity deleteOrder( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -97,6 +99,7 @@ default ResponseEntity> getInventory( } + public static final 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 @@ -120,7 +123,7 @@ default ResponseEntity> getInventory( }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -146,6 +149,7 @@ default ResponseEntity getOrderById( } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -167,7 +171,7 @@ default ResponseEntity getOrderById( }) @RequestMapping( method = RequestMethod.POST, - value = "/store/order", + value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 984fd05897bb..0bc788d2e05a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -32,6 +32,7 @@ default Optional getRequest() { return Optional.empty(); } + public static final String PATH_CREATE_USER = "/user"; /** * POST /user : Create user * This can only be done by the logged in user. @@ -50,7 +51,7 @@ default Optional getRequest() { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -62,6 +63,7 @@ default ResponseEntity createUser( } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -80,7 +82,7 @@ default ResponseEntity createUser( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -92,6 +94,7 @@ default ResponseEntity createUsersWithArrayInput( } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -110,7 +113,7 @@ default ResponseEntity createUsersWithArrayInput( }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -122,6 +125,7 @@ default ResponseEntity createUsersWithListInput( } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -142,7 +146,7 @@ default ResponseEntity createUsersWithListInput( }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -153,6 +157,7 @@ default ResponseEntity deleteUser( } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -176,7 +181,7 @@ default ResponseEntity deleteUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -202,6 +207,7 @@ default ResponseEntity getUserByName( } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -224,7 +230,7 @@ default ResponseEntity getUserByName( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -237,6 +243,7 @@ default ResponseEntity loginUser( } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -254,7 +261,7 @@ default ResponseEntity loginUser( }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -265,6 +272,7 @@ default ResponseEntity logoutUser( } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -286,7 +294,7 @@ default ResponseEntity logoutUser( }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } )