From 117be2ca4c5db5fe0a4a8c42bcd9aba154f1185e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Vasek?= Date: Wed, 9 Jul 2025 10:26:52 +0200 Subject: [PATCH] 1385 Generate constants for path in spring boot @RequestMapping (#19782) --- .../languages/AbstractJavaCodegen.java | 2 + .../main/resources/JavaSpring/api.mustache | 3 +- .../codegen/config/MergedSpecBuilderTest.java | 2 +- .../java/spring/SpringCodegenTest.java | 10 ++-- .../java/org/openapitools/api/SomeApi.java | 3 +- .../java/org/openapitools/api/DefaultApi.java | 6 ++- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/PetController.java | 24 ++++++--- .../org/openapitools/api/StoreController.java | 12 +++-- .../org/openapitools/api/UserController.java | 27 ++++++---- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/DefaultApi.java | 6 ++- .../java/org/openapitools/api/PetApi.java | 3 +- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 48 +++++++++++------ .../api/FakeClassnameTags123Api.java | 3 +- .../java/org/openapitools/api/PetApi.java | 30 +++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 27 ++++++---- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/BarApi.java | 3 +- .../java/org/openapitools/api/FooApi.java | 6 ++- .../java/org/openapitools/api/BarApi.java | 3 +- .../java/org/openapitools/api/FooApi.java | 6 ++- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/NullableApi.java | 3 +- .../java/org/openapitools/api/DogsApi.java | 3 +- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/DummyApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++------ .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 27 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/VersioningApi.java | 9 ++-- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++------ .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 27 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/VersioningApi.java | 9 ++-- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++------ .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 27 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/VersioningApi.java | 9 ++-- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 45 ++++++++++------ .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 27 ++++++---- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/VersioningApi.java | 9 ++-- .../java/org/openapitools/api/UserApi.java | 6 ++- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- .../virtualan/api/AnotherFakeApi.java | 3 +- .../openapitools/virtualan/api/FakeApi.java | 54 ++++++++++++------- .../virtualan/api/FakeClassnameTestApi.java | 3 +- .../openapitools/virtualan/api/PetApi.java | 24 ++++++--- .../openapitools/virtualan/api/StoreApi.java | 12 +++-- .../openapitools/virtualan/api/UserApi.java | 24 ++++++--- .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 54 ++++++++++++------- .../api/FakeClassnameTestApi.java | 3 +- .../java/org/openapitools/api/PetApi.java | 24 ++++++--- .../java/org/openapitools/api/StoreApi.java | 12 +++-- .../java/org/openapitools/api/UserApi.java | 24 ++++++--- 194 files changed, 2377 insertions(+), 1189 deletions(-) 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 613caacda67..733ba2bced9 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 @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; 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; @@ -50,6 +51,7 @@ import org.openapitools.codegen.model.ModelMap; 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 5fce1060d5a..053cecf3855 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -129,6 +129,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}} @@ -246,7 +247,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 5a19c6f78d8..db4a33a2d4b 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 @@ -73,7 +73,7 @@ public class MergedSpecBuilderTest { .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 0036c39ec9c..54b0e81ac9d 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 class SpringCodegenTest { .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 class SpringCodegenTest { .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 class SpringCodegenTest { 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 aa4bd5ad535..72409f754cd 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 @@ -25,6 +25,7 @@ import javax.annotation.Generated; @Validated public interface SomeApi { + public static final String PATH_SOME_ENDPOINT_GET = "/some/endpoint"; /** * GET /some/endpoint * @@ -32,7 +33,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 4cb927198bf..1244350b6aa 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 @@ -30,6 +30,7 @@ import javax.annotation.Generated; @Api(value = "Default", description = "the Default API") public interface DefaultApi { + public static final String PATH_GET = "/thingy/{date}"; /** * GET /thingy/{date} * @@ -49,7 +50,7 @@ public interface DefaultApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/thingy/{date}" + value = DefaultApi.PATH_GET ) ResponseEntity get( @@ -60,6 +61,7 @@ public interface DefaultApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/thingy/{date}"; /** * POST /thingy/{date} * update with form data @@ -78,7 +80,7 @@ public interface DefaultApi { }) @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 1424fb90bef..208031e1c11 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 * @@ -61,7 +62,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = "application/json" ) @@ -70,6 +71,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -92,7 +94,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -101,6 +103,7 @@ public interface PetApi { ); + 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 @@ -127,7 +130,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -136,6 +139,7 @@ public interface PetApi { ); + 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. @@ -165,7 +169,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -174,6 +178,7 @@ public interface PetApi { ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -202,7 +207,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -211,6 +216,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -236,7 +242,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = "application/json" ) @@ -245,6 +251,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -268,7 +275,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -279,6 +286,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -304,7 +312,7 @@ public interface PetApi { ) @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 990e61b2e57..6854e3594c5 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -68,6 +69,7 @@ public interface StoreApi { ); + 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 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -99,6 +101,7 @@ public interface StoreApi { ); + 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 @@ -124,7 +127,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -133,6 +136,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -156,7 +160,7 @@ public interface StoreApi { ) @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 3983e09a8c4..0595191b018 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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. @@ -61,7 +62,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -70,6 +71,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -91,7 +93,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -100,6 +102,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -121,7 +124,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -130,6 +133,7 @@ public interface UserApi { ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -153,7 +157,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -161,6 +165,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -186,7 +191,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -195,6 +200,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -219,7 +225,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -229,6 +235,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -249,7 +256,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -257,6 +264,7 @@ public interface UserApi { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -281,7 +289,7 @@ public interface UserApi { ) @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 2deab146067..68fca2a404d 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 @@ -29,6 +29,7 @@ import javax.annotation.Generated; @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 * @@ -56,7 +57,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -66,6 +67,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -91,7 +93,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -100,6 +102,7 @@ public interface PetApi { ); + 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 @@ -127,7 +130,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -136,6 +139,7 @@ public interface PetApi { ); + 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. @@ -165,7 +169,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -174,6 +178,7 @@ public interface PetApi { ); + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -209,6 +214,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -242,7 +248,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -252,6 +258,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -278,7 +285,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -289,6 +296,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -316,7 +324,7 @@ public interface PetApi { }) @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 80793806f76..a07169b0224 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 @@ -29,6 +29,7 @@ import javax.annotation.Generated; @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 @@ -49,7 +50,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -57,6 +58,7 @@ public interface StoreApi { ); + 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 @@ -79,7 +81,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -88,6 +90,7 @@ public interface StoreApi { ); + 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 @@ -111,7 +114,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -120,6 +123,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -141,7 +145,7 @@ public interface StoreApi { }) @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 71de8c9aff0..454119052e1 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 @@ -29,6 +29,7 @@ import javax.annotation.Generated; @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. @@ -50,7 +51,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -59,6 +60,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -89,6 +91,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -119,6 +122,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -150,6 +154,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -173,7 +178,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -182,6 +187,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -204,7 +210,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -214,6 +220,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -234,7 +241,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -242,6 +249,7 @@ public interface UserApi { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -266,7 +274,7 @@ public interface UserApi { }) @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 5641e3f27f1..1024e01461d 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 @@ -31,6 +31,7 @@ import javax.annotation.Generated; @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 * @@ -54,7 +55,7 @@ public interface PetController { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetController.PATH_ADD_PET, consumes = "application/json" ) @@ -63,6 +64,7 @@ public interface PetController { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -87,7 +89,7 @@ public interface PetController { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetController.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -96,6 +98,7 @@ public interface PetController { ); + 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 @@ -124,7 +127,7 @@ public interface PetController { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetController.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -134,6 +137,7 @@ public interface PetController { ); + 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 @@ public interface PetController { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetController.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -174,6 +178,7 @@ public interface PetController { ); + 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 @@ public interface PetController { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetController.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -209,6 +214,7 @@ public interface PetController { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -236,7 +242,7 @@ public interface PetController { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetController.PATH_UPDATE_PET, consumes = "application/json" ) @@ -245,6 +251,7 @@ public interface PetController { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -270,7 +277,7 @@ public interface PetController { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetController.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -281,6 +288,7 @@ public interface PetController { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -307,7 +315,7 @@ public interface PetController { }) @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 64bc1096fd5..56512e8ed92 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 @@ -29,6 +29,7 @@ import javax.annotation.Generated; @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 @@ -49,7 +50,7 @@ public interface StoreController { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreController.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -57,6 +58,7 @@ public interface StoreController { ); + 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 @@ -79,7 +81,7 @@ public interface StoreController { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreController.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -88,6 +90,7 @@ public interface StoreController { ); + 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 @@ -111,7 +114,7 @@ public interface StoreController { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreController.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -120,6 +123,7 @@ public interface StoreController { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -140,7 +144,7 @@ public interface StoreController { }) @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 c5cd68d56b4..dff0e27f1e1 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 @@ -29,6 +29,7 @@ import javax.annotation.Generated; @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. @@ -47,7 +48,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserController.PATH_CREATE_USER ) ResponseEntity createUser( @@ -55,6 +56,7 @@ public interface UserController { ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -72,7 +74,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserController.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) ResponseEntity createUsersWithArrayInput( @@ -80,6 +82,7 @@ public interface UserController { ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -97,7 +100,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserController.PATH_CREATE_USERS_WITH_LIST_INPUT ) ResponseEntity createUsersWithListInput( @@ -105,6 +108,7 @@ public interface UserController { ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -125,7 +129,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserController.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -133,6 +137,7 @@ public interface UserController { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -155,7 +160,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserController.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -164,6 +169,7 @@ public interface UserController { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -185,7 +191,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserController.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -195,6 +201,7 @@ public interface UserController { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -211,7 +218,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserController.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -219,6 +226,7 @@ public interface UserController { ); + public static final String PATH_LOGOUT_USER_OPTIONS = "/user/logout"; /** * OPTIONS /user/logout : logoutUserOptions * @@ -235,7 +243,7 @@ public interface UserController { }) @RequestMapping( method = RequestMethod.OPTIONS, - value = "/user/logout" + value = UserController.PATH_LOGOUT_USER_OPTIONS ) ResponseEntity logoutUserOptions( @@ -243,6 +251,7 @@ public interface UserController { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -264,7 +273,7 @@ public interface UserController { }) @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 2deab146067..68fca2a404d 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 @@ -29,6 +29,7 @@ import javax.annotation.Generated; @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 * @@ -56,7 +57,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -66,6 +67,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -91,7 +93,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -100,6 +102,7 @@ public interface PetApi { ); + 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 @@ -127,7 +130,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -136,6 +139,7 @@ public interface PetApi { ); + 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. @@ -165,7 +169,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -174,6 +178,7 @@ public interface PetApi { ); + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -209,6 +214,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -242,7 +248,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -252,6 +258,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -278,7 +285,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -289,6 +296,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -316,7 +324,7 @@ public interface PetApi { }) @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 80793806f76..a07169b0224 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 @@ -29,6 +29,7 @@ import javax.annotation.Generated; @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 @@ -49,7 +50,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -57,6 +58,7 @@ public interface StoreApi { ); + 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 @@ -79,7 +81,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -88,6 +90,7 @@ public interface StoreApi { ); + 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 @@ -111,7 +114,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -120,6 +123,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -141,7 +145,7 @@ public interface StoreApi { }) @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 71de8c9aff0..454119052e1 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 @@ -29,6 +29,7 @@ import javax.annotation.Generated; @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. @@ -50,7 +51,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -59,6 +60,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -89,6 +91,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -119,6 +122,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -150,6 +154,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -173,7 +178,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -182,6 +187,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -204,7 +210,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -214,6 +220,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -234,7 +241,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -242,6 +249,7 @@ public interface UserApi { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -266,7 +274,7 @@ public interface UserApi { }) @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 227a7119971..da7848a43a5 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 @@ -27,6 +27,7 @@ import jakarta.annotation.Generated; @Validated public interface PetApi { + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -37,7 +38,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -47,6 +48,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -57,7 +59,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -66,6 +68,7 @@ public interface PetApi { ); + 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 @@ -76,7 +79,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -85,6 +88,7 @@ public interface PetApi { ); + 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. @@ -97,7 +101,7 @@ public interface PetApi { @Deprecated @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -106,6 +110,7 @@ public interface PetApi { ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -117,7 +122,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -126,6 +131,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -140,7 +146,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -150,6 +156,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -161,7 +168,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -172,6 +179,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -183,7 +191,7 @@ public interface PetApi { */ @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 3284aa1ade2..8dd6c2fc6b5 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 @@ -27,6 +27,7 @@ import jakarta.annotation.Generated; @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 @@ -37,7 +38,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -45,6 +46,7 @@ public interface StoreApi { ); + 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 @@ -53,7 +55,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -62,6 +64,7 @@ public interface StoreApi { ); + 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 @@ -73,7 +76,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -82,6 +85,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -92,7 +96,7 @@ public interface StoreApi { */ @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 719aa5dfa27..031a026f374 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 @@ -27,6 +27,7 @@ import jakarta.annotation.Generated; @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. @@ -36,7 +37,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -45,6 +46,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -54,7 +56,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -63,6 +65,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -72,7 +75,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -81,6 +84,7 @@ public interface UserApi { ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -91,7 +95,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -99,6 +103,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -110,7 +115,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -119,6 +124,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -130,7 +136,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -140,6 +146,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -148,7 +155,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -156,6 +163,7 @@ public interface UserApi { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -167,7 +175,7 @@ public interface UserApi { */ @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 2aa26800174..6fe5a7e3e9c 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 @@ -40,6 +40,7 @@ import jakarta.annotation.Generated; @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 * @@ -66,7 +67,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -76,6 +77,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -107,6 +109,7 @@ public interface PetApi { ); + 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 @@ -133,7 +136,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -142,6 +145,7 @@ public interface PetApi { ); + 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. @@ -171,7 +175,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -180,6 +184,7 @@ public interface PetApi { ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -208,7 +213,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -217,6 +222,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -250,7 +256,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -260,6 +266,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -283,7 +290,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -294,6 +301,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -319,7 +327,7 @@ public interface PetApi { ) @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 aa32da12287..3f33ce8daa5 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 @@ -40,6 +40,7 @@ import jakarta.annotation.Generated; @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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -68,6 +69,7 @@ public interface StoreApi { ); + 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 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -99,6 +101,7 @@ public interface StoreApi { ); + 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 @@ -124,7 +127,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -133,6 +136,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -156,7 +160,7 @@ public interface StoreApi { ) @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 16aeea9b7eb..bd48f3736a1 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 @@ -40,6 +40,7 @@ import jakarta.annotation.Generated; @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. @@ -61,7 +62,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -70,6 +71,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -91,7 +93,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -100,6 +102,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -121,7 +124,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -130,6 +133,7 @@ public interface UserApi { ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -153,7 +157,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -161,6 +165,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -186,7 +191,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -195,6 +200,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -219,7 +225,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -229,6 +235,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -249,7 +256,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -257,6 +264,7 @@ public interface UserApi { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -281,7 +289,7 @@ public interface UserApi { ) @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 57698a6a2eb..d4cd36138e8 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 @@ -41,6 +41,7 @@ import javax.annotation.Generated; @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 * @@ -67,7 +68,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -77,6 +78,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -99,7 +101,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) CompletableFuture> deletePet( @@ -108,6 +110,7 @@ public interface PetApi { ); + 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 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -143,6 +146,7 @@ public interface PetApi { ); + 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. @@ -172,7 +176,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -181,6 +185,7 @@ public interface PetApi { ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -209,7 +214,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -218,6 +223,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -251,7 +257,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -261,6 +267,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -284,7 +291,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -295,6 +302,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -320,7 +328,7 @@ public interface PetApi { ) @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 926a0a1f22e..c712661b878 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 @@ -41,6 +41,7 @@ import javax.annotation.Generated; @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 @@ -61,7 +62,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) CompletableFuture> deleteOrder( @@ -69,6 +70,7 @@ public interface StoreApi { ); + 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 @@ -91,7 +93,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -100,6 +102,7 @@ public interface StoreApi { ); + 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 @@ -125,7 +128,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -134,6 +137,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -157,7 +161,7 @@ public interface StoreApi { ) @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 a51b8bf71cc..4c4c0a0fed0 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 @@ -41,6 +41,7 @@ import javax.annotation.Generated; @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. @@ -62,7 +63,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -71,6 +72,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -92,7 +94,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -101,6 +103,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -122,7 +125,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -131,6 +134,7 @@ public interface UserApi { ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -154,7 +158,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) CompletableFuture> deleteUser( @@ -162,6 +166,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -187,7 +192,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -196,6 +201,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -220,7 +226,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -230,6 +236,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -250,7 +257,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) CompletableFuture> logoutUser( @@ -258,6 +265,7 @@ public interface UserApi { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -282,7 +290,7 @@ public interface UserApi { ) @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 7cfb7285f88..501eb60b3d1 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 @@ -41,6 +41,7 @@ import javax.annotation.Generated; @Tag(name = "Default", description = "the Default API") public interface DefaultApi { + public static final String PATH_GET = "/thingy/{date}"; /** * GET /thingy/{date} * @@ -58,7 +59,7 @@ public interface DefaultApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/thingy/{date}" + value = DefaultApi.PATH_GET ) ResponseEntity get( @@ -69,6 +70,7 @@ public interface DefaultApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/thingy/{date}"; /** * POST /thingy/{date} * update with form data @@ -86,7 +88,7 @@ public interface DefaultApi { ) @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 4259c5d16e2..8890594b256 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 @@ -39,6 +39,7 @@ import javax.annotation.Generated; @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" ) 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 db4489ebe7f..171cc024cdc 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 @@ -39,6 +39,7 @@ import javax.annotation.Generated; @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 @@ -59,7 +60,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 7dc5012b4e1..41a7c0a2131 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 @@ -49,6 +49,7 @@ import javax.annotation.Generated; @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" ) @@ -76,6 +77,7 @@ public interface FakeApi { ); + 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 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = "application/json" ) @@ -105,6 +107,7 @@ public interface FakeApi { ); + 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 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = "application/json" ) @@ -134,6 +137,7 @@ public interface FakeApi { ); + 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 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = "application/json" ) @@ -163,6 +167,7 @@ public interface FakeApi { ); + 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 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = "application/json" ) @@ -192,6 +197,7 @@ public interface FakeApi { ); + 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`. @@ -209,7 +215,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = "application/json" ) @@ -218,6 +224,7 @@ public interface FakeApi { ); + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -234,7 +241,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = "application/json" ) @@ -244,6 +251,7 @@ public interface FakeApi { ); + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -264,7 +272,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = "application/json" ) @@ -274,6 +282,7 @@ public interface FakeApi { ); + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -310,7 +319,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = "application/x-www-form-urlencoded" ) @@ -332,6 +341,7 @@ public interface FakeApi { ); + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -359,7 +369,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = "application/x-www-form-urlencoded" ) @@ -375,6 +385,7 @@ public interface FakeApi { ); + 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) @@ -398,7 +409,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) ResponseEntity testGroupParameters( @@ -411,6 +422,7 @@ public interface FakeApi { ); + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -429,7 +441,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = "application/json" ) @@ -438,6 +450,7 @@ public interface FakeApi { ); + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -457,7 +470,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = "application/x-www-form-urlencoded" ) @@ -467,6 +480,7 @@ public interface FakeApi { ); + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -485,7 +499,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = "application/json" ) @@ -494,6 +508,7 @@ public interface FakeApi { ); + 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 @@ -514,7 +529,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) ResponseEntity testQueryParameterCollectionFormat( @@ -525,6 +540,7 @@ public interface FakeApi { ); + 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. @@ -543,7 +559,7 @@ public interface FakeApi { ) @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 635dccb8d71..b2bf9672875 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 @@ -39,6 +39,7 @@ import javax.annotation.Generated; @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 @@ -62,7 +63,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 f75d4234d56..bbaa18c779b 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 @@ -42,6 +42,7 @@ import javax.annotation.Generated; @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, consumes = "application/json" ) @@ -74,6 +75,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -107,6 +109,7 @@ public interface PetApi { ); + 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 @@ -133,7 +136,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -142,6 +145,7 @@ public interface PetApi { ); + 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. @@ -171,7 +175,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -180,6 +184,7 @@ public interface PetApi { ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -208,7 +213,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -217,6 +222,7 @@ public interface PetApi { ); + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -234,7 +240,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -243,6 +249,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -270,7 +277,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = "application/json" ) @@ -279,6 +286,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -302,7 +310,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -313,6 +321,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -338,7 +347,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", + value = PetApi.PATH_UPLOAD_FILE, produces = { "application/json" }, consumes = "multipart/form-data" ) @@ -350,6 +359,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -375,7 +385,7 @@ public interface PetApi { ) @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 bf03bbbf2f3..222982c9043 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -68,6 +69,7 @@ public interface StoreApi { ); + 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 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -99,6 +101,7 @@ public interface StoreApi { ); + 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 @@ -124,7 +127,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -133,6 +136,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -156,7 +160,7 @@ public interface StoreApi { ) @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 7e53fed6a9e..cce37f349b6 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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. @@ -58,7 +59,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -67,6 +68,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -94,6 +96,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -112,7 +115,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -121,6 +124,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -149,6 +153,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -174,7 +179,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -183,6 +188,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -207,7 +213,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -217,6 +223,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -234,7 +241,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -242,6 +249,7 @@ public interface UserApi { ); + 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 +271,7 @@ public interface UserApi { ) @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 6360ac37f82..41b79508e45 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 @@ -42,6 +42,7 @@ import javax.annotation.Generated; @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 * @@ -61,7 +62,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = "application/json" ) @@ -70,6 +71,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -90,7 +92,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -99,6 +101,7 @@ public interface PetApi { ); + 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 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -135,6 +138,7 @@ public interface PetApi { ); + 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. @@ -165,7 +169,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -176,6 +180,7 @@ public interface PetApi { ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -204,7 +209,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -213,6 +218,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -236,7 +242,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = "application/json" ) @@ -245,6 +251,7 @@ public interface PetApi { ); + 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 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -277,6 +284,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -300,7 +308,7 @@ public interface PetApi { ) @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 ab85f7e1257..d05d6308163 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -68,6 +69,7 @@ public interface StoreApi { ); + 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 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -99,6 +101,7 @@ public interface StoreApi { ); + 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 @@ -124,7 +127,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -133,6 +136,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -154,7 +158,7 @@ public interface StoreApi { ) @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 f8f5172d7d2..bdb0a860a27 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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. @@ -58,7 +59,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) ResponseEntity createUser( @@ -66,6 +67,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) ResponseEntity createUsersWithArrayInput( @@ -90,6 +92,7 @@ public interface UserApi { ); + 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 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) ResponseEntity createUsersWithListInput( @@ -114,6 +117,7 @@ public interface UserApi { ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -134,7 +138,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -142,6 +146,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -165,7 +170,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -174,6 +179,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -196,7 +202,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -206,6 +212,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -221,7 +228,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -229,6 +236,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER_OPTIONS = "/user/logout"; /** * OPTIONS /user/logout : logoutUserOptions * @@ -244,7 +252,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.OPTIONS, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER_OPTIONS ) ResponseEntity logoutUserOptions( @@ -252,6 +260,7 @@ public interface UserApi { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -273,7 +282,7 @@ public interface UserApi { ) @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 112c15d4361..694edd0e868 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 * @@ -66,7 +67,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -76,6 +77,7 @@ public interface PetApi { ); + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -107,6 +109,7 @@ public interface PetApi { ); + 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 @@ -133,7 +136,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -142,6 +145,7 @@ public interface PetApi { ); + 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. @@ -171,7 +175,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -180,6 +184,7 @@ public interface PetApi { ); + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -208,7 +213,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -217,6 +222,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -250,7 +256,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -260,6 +266,7 @@ public interface PetApi { ); + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -283,7 +290,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -294,6 +301,7 @@ public interface PetApi { ); + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -319,7 +327,7 @@ public interface PetApi { ) @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 990e61b2e57..6854e3594c5 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -68,6 +69,7 @@ public interface StoreApi { ); + 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 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -99,6 +101,7 @@ public interface StoreApi { ); + 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 @@ -124,7 +127,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -133,6 +136,7 @@ public interface StoreApi { ); + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -156,7 +160,7 @@ public interface StoreApi { ) @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 30af764b6c7..61937cc0f1f 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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. @@ -61,7 +62,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -70,6 +71,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -91,7 +93,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -100,6 +102,7 @@ public interface UserApi { ); + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -121,7 +124,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -130,6 +133,7 @@ public interface UserApi { ); + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -153,7 +157,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -161,6 +165,7 @@ public interface UserApi { ); + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -186,7 +191,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -195,6 +200,7 @@ public interface UserApi { ); + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -219,7 +225,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -229,6 +235,7 @@ public interface UserApi { ); + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -249,7 +256,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -257,6 +264,7 @@ public interface UserApi { ); + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -281,7 +289,7 @@ public interface UserApi { ) @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 a5d319f15ad..4d6ef02cf3d 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 * @@ -66,7 +67,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -76,6 +77,7 @@ public interface PetApi { ) throws Exception; + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -107,6 +109,7 @@ public interface PetApi { ) 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 @@ -133,7 +136,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -142,6 +145,7 @@ public interface PetApi { ) 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. @@ -171,7 +175,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -180,6 +184,7 @@ public interface PetApi { ) throws Exception; + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -208,7 +213,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -217,6 +222,7 @@ public interface PetApi { ) throws Exception; + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -250,7 +256,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -260,6 +266,7 @@ public interface PetApi { ) 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 * @@ -283,7 +290,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -294,6 +301,7 @@ public interface PetApi { ) throws Exception; + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -319,7 +327,7 @@ public interface PetApi { ) @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 5ce6b801a50..b0e178c5927 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -68,6 +69,7 @@ public interface StoreApi { ) 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 @@ -90,7 +92,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -99,6 +101,7 @@ public interface StoreApi { ) 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 @@ -124,7 +127,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -133,6 +136,7 @@ public interface StoreApi { ) throws Exception; + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -156,7 +160,7 @@ public interface StoreApi { ) @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 6b4b52fa3e1..23e4a513e0a 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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. @@ -61,7 +62,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -70,6 +71,7 @@ public interface UserApi { ) 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 * @@ -91,7 +93,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -100,6 +102,7 @@ public interface UserApi { ) 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 * @@ -121,7 +124,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -130,6 +133,7 @@ public interface UserApi { ) 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. @@ -153,7 +157,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -161,6 +165,7 @@ public interface UserApi { ) throws Exception; + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -186,7 +191,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -195,6 +200,7 @@ public interface UserApi { ) throws Exception; + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -219,7 +225,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -229,6 +235,7 @@ public interface UserApi { ) throws Exception; + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -249,7 +256,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -257,6 +264,7 @@ public interface UserApi { ) 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. @@ -281,7 +289,7 @@ public interface UserApi { ) @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 901ccfc6ab1..570707e3191 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 @@ -44,6 +44,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -70,7 +71,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -97,6 +98,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -119,7 +121,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -131,6 +133,7 @@ public interface PetApi { } + 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 @@ -157,7 +160,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) @@ -183,6 +186,7 @@ public interface PetApi { } + 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. @@ -212,7 +216,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) @@ -238,6 +242,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -266,7 +271,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) @@ -292,6 +297,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -325,7 +331,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/json", "application/xml" }, consumes = "application/json" ) @@ -352,6 +358,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -375,7 +382,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = "application/x-www-form-urlencoded" ) @@ -389,6 +396,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -414,7 +422,7 @@ public interface PetApi { ) @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 7776ec71fed..0349bb379b6 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 @@ -44,6 +44,7 @@ public interface StoreApi { 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 @@ -64,7 +65,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -75,6 +76,7 @@ public interface StoreApi { } + 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 @@ -97,7 +99,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -109,6 +111,7 @@ public interface StoreApi { } + 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 @@ -134,7 +137,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) @@ -160,6 +163,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -183,7 +187,7 @@ public interface StoreApi { ) @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 5e09fa7e15b..8f67974821e 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 @@ -44,6 +44,7 @@ public interface UserApi { 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. @@ -65,7 +66,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = "application/json" ) @@ -77,6 +78,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -98,7 +100,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = "application/json" ) @@ -110,6 +112,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -131,7 +134,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = "application/json" ) @@ -143,6 +146,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -166,7 +170,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -177,6 +181,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -202,7 +207,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) @@ -228,6 +233,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -252,7 +258,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) @@ -265,6 +271,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -285,7 +292,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -296,6 +303,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -320,7 +328,7 @@ public interface UserApi { ) @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-sealed/src/main/java/org/openapitools/api/BarApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/BarApi.java index 5a1d6c7b57e..8b46ead7589 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/BarApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/BarApi.java @@ -44,6 +44,7 @@ public interface BarApi { return Optional.empty(); } + public static final String PATH_CREATE_BAR = "/bar"; /** * POST /bar : Create a Bar * @@ -62,7 +63,7 @@ public interface BarApi { ) @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-sealed/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/FooApi.java index e0c6c57862d..a3f3d24217f 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/FooApi.java @@ -44,6 +44,7 @@ public interface FooApi { return Optional.empty(); } + public static final String PATH_CREATE_FOO = "/foo"; /** * POST /foo : Create a Foo * @@ -62,7 +63,7 @@ public interface FooApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/foo", + value = FooApi.PATH_CREATE_FOO, produces = { "application/json" }, consumes = { "application/json;charset=utf-8" } ) @@ -84,6 +85,7 @@ public interface FooApi { } + public static final String PATH_GET_ALL_FOOS = "/foo"; /** * GET /foo : GET all Foos * @@ -101,7 +103,7 @@ public interface FooApi { ) @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-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 5a1d6c7b57e..8b46ead7589 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 @@ -44,6 +44,7 @@ public interface BarApi { return Optional.empty(); } + public static final String PATH_CREATE_BAR = "/bar"; /** * POST /bar : Create a Bar * @@ -62,7 +63,7 @@ public interface BarApi { ) @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 e0c6c57862d..a3f3d24217f 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 @@ -44,6 +44,7 @@ public interface FooApi { return Optional.empty(); } + public static final String PATH_CREATE_FOO = "/foo"; /** * POST /foo : Create a Foo * @@ -62,7 +63,7 @@ public interface FooApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/foo", + value = FooApi.PATH_CREATE_FOO, produces = { "application/json" }, consumes = { "application/json;charset=utf-8" } ) @@ -84,6 +85,7 @@ public interface FooApi { } + public static final String PATH_GET_ALL_FOOS = "/foo"; /** * GET /foo : GET all Foos * @@ -101,7 +103,7 @@ public interface FooApi { ) @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 dd081d14ed3..b1cdf230e03 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 @@ -44,6 +44,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -70,7 +71,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -97,6 +98,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -119,7 +121,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -131,6 +133,7 @@ public interface PetApi { } + 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 @@ -157,7 +160,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -183,6 +186,7 @@ public interface PetApi { } + 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. @@ -212,7 +216,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -238,6 +242,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -266,7 +271,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -292,6 +297,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -325,7 +331,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -352,6 +358,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -375,7 +382,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -389,6 +396,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -414,7 +422,7 @@ public interface PetApi { ) @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 353cc67308a..d5f3f61cdab 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 @@ -44,6 +44,7 @@ public interface StoreApi { 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 @@ -64,7 +65,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -75,6 +76,7 @@ public interface StoreApi { } + 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 @@ -97,7 +99,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -109,6 +111,7 @@ public interface StoreApi { } + 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 @@ -134,7 +137,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -160,6 +163,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -183,7 +187,7 @@ public interface StoreApi { ) @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 423569074fa..3a6d014d315 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 @@ -44,6 +44,7 @@ public interface UserApi { 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. @@ -65,7 +66,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -77,6 +78,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -98,7 +100,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -110,6 +112,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -131,7 +134,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -143,6 +146,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -166,7 +170,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -177,6 +181,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -202,7 +207,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -228,6 +233,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -252,7 +258,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -265,6 +271,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -285,7 +292,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -296,6 +303,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -320,7 +328,7 @@ public interface UserApi { ) @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 3e89b503df3..9657ad1bfd7 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 @@ -44,6 +44,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -70,7 +71,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -97,6 +98,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -119,7 +121,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -131,6 +133,7 @@ public interface PetApi { } + 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 @@ -157,7 +160,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -183,6 +186,7 @@ public interface PetApi { } + 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. @@ -212,7 +216,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -238,6 +242,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -266,7 +271,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -292,6 +297,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -325,7 +331,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -352,6 +358,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -375,7 +382,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -389,6 +396,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -414,7 +422,7 @@ public interface PetApi { ) @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 2f9e7679682..6fba7805428 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 @@ -44,6 +44,7 @@ public interface StoreApi { 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 @@ -64,7 +65,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -75,6 +76,7 @@ public interface StoreApi { } + 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 @@ -97,7 +99,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -109,6 +111,7 @@ public interface StoreApi { } + 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 @@ -134,7 +137,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -160,6 +163,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -183,7 +187,7 @@ public interface StoreApi { ) @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 3b7ae610ebc..6ebb8dc559a 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 @@ -44,6 +44,7 @@ public interface UserApi { 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. @@ -65,7 +66,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -77,6 +78,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -98,7 +100,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -110,6 +112,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -131,7 +134,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -143,6 +146,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -166,7 +170,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -177,6 +181,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -202,7 +207,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -228,6 +233,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -252,7 +258,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -265,6 +271,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -285,7 +292,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -296,6 +303,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -320,7 +328,7 @@ public interface UserApi { ) @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 8564c2e1ca7..06d958cecef 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 @@ -39,6 +39,7 @@ public interface AnotherFakeApi { 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 @@ -59,7 +60,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/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 93264187c76..fe3094df7c6 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 @@ -51,6 +51,7 @@ public interface FakeApi { 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 @@ -69,7 +70,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" } ) @@ -80,6 +81,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -99,7 +101,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -111,6 +113,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -130,7 +133,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -142,6 +145,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -173,6 +177,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -204,6 +209,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -221,7 +227,7 @@ public interface FakeApi { ) @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 @@ public interface FakeApi { } + 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`. @@ -249,7 +256,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -260,6 +267,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -276,7 +284,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -288,6 +296,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -308,7 +317,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -320,6 +329,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -356,7 +366,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -380,6 +390,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -407,7 +418,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -425,6 +436,7 @@ public interface FakeApi { } + 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) @@ -448,7 +460,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -463,6 +475,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -481,7 +494,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -492,6 +505,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -511,7 +525,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -523,6 +537,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -541,7 +556,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -552,6 +567,7 @@ public interface FakeApi { } + 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 @@ -572,7 +588,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -585,6 +601,7 @@ public interface FakeApi { } + 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. @@ -603,7 +620,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -614,6 +631,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -639,7 +657,7 @@ public interface FakeApi { ) @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 876d6b296fa..578bb3a7e96 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 @@ -39,6 +39,7 @@ public interface FakeClassnameTestApi { 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 @@ -62,7 +63,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/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 ff233d6f9f7..6be9fc3bae8 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 @@ -41,6 +41,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + 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, consumes = { "application/json", "application/xml" } ) @@ -75,6 +76,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -99,7 +101,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -110,6 +112,7 @@ public interface PetApi { } + 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 @@ -136,7 +139,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface PetApi { } + 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. @@ -176,7 +180,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -187,6 +191,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -215,7 +220,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -226,6 +231,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -253,7 +259,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -264,6 +270,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -287,7 +294,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -300,6 +307,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -325,7 +333,7 @@ public interface PetApi { ) @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 f3c2bd5e298..d4819b781de 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 @@ -40,6 +40,7 @@ public interface StoreApi { 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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -70,6 +71,7 @@ public interface StoreApi { } + 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 @@ -92,7 +94,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -103,6 +105,7 @@ public interface StoreApi { } + 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 @@ -128,7 +131,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -139,6 +142,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -162,7 +166,7 @@ public interface StoreApi { ) @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 6f3c2b2f1df..63cffd67642 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 @@ -40,6 +40,7 @@ public interface UserApi { 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. @@ -58,7 +59,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -69,6 +70,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -87,7 +89,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -98,6 +100,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -116,7 +119,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -127,6 +130,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -147,7 +151,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -157,6 +161,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -182,7 +187,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -193,6 +198,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -217,7 +223,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -229,6 +235,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -246,7 +253,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -256,6 +263,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -277,7 +285,7 @@ public interface UserApi { ) @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 91ed040f736..f32dee0faac 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 @@ -43,6 +43,7 @@ public interface AnotherFakeApi { 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 @@ -63,7 +64,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/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 a9685d77ed7..6de781cf175 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 @@ -55,6 +55,7 @@ public interface FakeApi { 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 @@ -73,7 +74,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" } ) @@ -85,6 +86,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -104,7 +106,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -117,6 +119,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -136,7 +139,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -158,6 +161,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -177,7 +181,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -190,6 +194,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -209,7 +214,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -222,6 +227,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -239,7 +245,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -260,6 +266,7 @@ public interface FakeApi { } + 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`. @@ -277,7 +284,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -289,6 +296,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -305,7 +313,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -318,6 +326,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -338,7 +347,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -360,6 +369,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -396,7 +406,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -421,6 +431,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -450,7 +461,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -467,6 +478,7 @@ public interface FakeApi { } + 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) @@ -492,7 +504,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -506,6 +518,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -524,7 +537,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -536,6 +549,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -555,7 +569,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -568,6 +582,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -586,7 +601,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -598,6 +613,7 @@ public interface FakeApi { } + 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 @@ -618,7 +634,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -632,6 +648,7 @@ public interface FakeApi { } + 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. @@ -650,7 +667,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -671,6 +688,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -696,7 +714,7 @@ public interface FakeApi { ) @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 e22c7a4231d..dbbce7cdd9a 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 @@ -43,6 +43,7 @@ public interface FakeClassnameTestApi { 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 @@ -66,7 +67,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/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 4763b21311d..3c563161c1e 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 @@ -45,6 +45,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -68,7 +69,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -80,6 +81,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -106,7 +108,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -117,6 +119,7 @@ public interface PetApi { } + 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 @@ -143,7 +146,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -169,6 +172,7 @@ public interface PetApi { } + 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. @@ -198,7 +202,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -224,6 +228,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -252,7 +257,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -278,6 +283,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -305,7 +311,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -317,6 +323,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -354,6 +361,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -379,7 +387,7 @@ public interface PetApi { ) @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 e938ae8c6ab..ff9f87ac7e8 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 @@ -44,6 +44,7 @@ public interface StoreApi { 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 @@ -64,7 +65,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -75,6 +76,7 @@ public interface StoreApi { } + 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 @@ -97,7 +99,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -109,6 +111,7 @@ public interface StoreApi { } + 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 @@ -134,7 +137,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -160,6 +163,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -183,7 +187,7 @@ public interface StoreApi { ) @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 345e38ea42d..7852bc1fabd 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 @@ -44,6 +44,7 @@ public interface UserApi { 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. @@ -62,7 +63,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -74,6 +75,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -92,7 +94,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -104,6 +106,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -122,7 +125,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -134,6 +137,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -154,7 +158,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -165,6 +169,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -190,7 +195,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -216,6 +221,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -240,7 +246,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -253,6 +259,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -270,7 +277,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -281,6 +288,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -302,7 +310,7 @@ public interface UserApi { ) @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 a91aabe38b7..015e6bf7f8b 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 @@ -31,6 +31,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -41,7 +42,7 @@ public interface PetApi { */ @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 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -78,7 +80,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -90,6 +92,7 @@ public interface PetApi { } + 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 @@ -100,7 +103,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -126,6 +129,7 @@ public interface PetApi { } + 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. @@ -138,7 +142,7 @@ public interface PetApi { @Deprecated @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -164,6 +168,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -175,7 +180,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -201,6 +206,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -215,7 +221,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -242,6 +248,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -253,7 +260,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -267,6 +274,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -278,7 +286,7 @@ public interface PetApi { */ @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 d00c0865b22..9f90fd69856 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 @@ -31,6 +31,7 @@ public interface StoreApi { 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 @@ -41,7 +42,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -52,6 +53,7 @@ public interface StoreApi { } + 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 @@ -60,7 +62,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -72,6 +74,7 @@ public interface StoreApi { } + 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 @@ -83,7 +86,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -109,6 +112,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -119,7 +123,7 @@ public interface StoreApi { */ @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 55fc0fc0cb1..cc48b749738 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 @@ -31,6 +31,7 @@ public interface UserApi { 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. @@ -40,7 +41,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -52,6 +53,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -61,7 +63,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -73,6 +75,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -82,7 +85,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -94,6 +97,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -104,7 +108,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -115,6 +119,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -126,7 +131,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -152,6 +157,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -163,7 +169,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -176,6 +182,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -184,7 +191,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -195,6 +202,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -206,7 +214,7 @@ public interface UserApi { */ @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 d8434abd250..eb3f753553d 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 @@ -45,6 +45,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -71,7 +72,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -98,6 +99,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -120,7 +122,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -132,6 +134,7 @@ public interface PetApi { } + 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 @@ -158,7 +161,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -184,6 +187,7 @@ public interface PetApi { } + 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. @@ -213,7 +217,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -239,6 +243,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -267,7 +272,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -293,6 +298,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -326,7 +332,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -353,6 +359,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -376,7 +383,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -390,6 +397,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -415,7 +423,7 @@ public interface PetApi { ) @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 82886353f97..1c7e2ae0b14 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 @@ -45,6 +45,7 @@ public interface StoreApi { 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 @@ -65,7 +66,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -76,6 +77,7 @@ public interface StoreApi { } + 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 @@ -98,7 +100,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -110,6 +112,7 @@ public interface StoreApi { } + 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 @@ -135,7 +138,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -161,6 +164,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -184,7 +188,7 @@ public interface StoreApi { ) @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 d9349e0689e..222117fcf03 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 @@ -45,6 +45,7 @@ public interface UserApi { 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. @@ -66,7 +67,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -78,6 +79,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -99,7 +101,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -111,6 +113,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -132,7 +135,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -144,6 +147,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -167,7 +171,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -178,6 +182,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -203,7 +208,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -229,6 +234,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -253,7 +259,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -266,6 +272,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -286,7 +293,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -297,6 +304,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -321,7 +329,7 @@ public interface UserApi { ) @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 0c27ce366ce..2125e208614 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 @@ -39,6 +39,7 @@ import javax.annotation.Generated; @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 @@ -59,7 +60,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 3f146eb399d..1ec706ea864 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 @@ -51,6 +51,7 @@ import javax.annotation.Generated; @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 @@ -69,7 +70,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" } ) @@ -78,6 +79,7 @@ public interface FakeApi { ) throws Exception; + 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 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -107,6 +109,7 @@ public interface FakeApi { ) 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 @@ -126,7 +129,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -136,6 +139,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -155,7 +159,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -165,6 +169,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -184,7 +189,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -194,6 +199,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -211,7 +217,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -220,6 +226,7 @@ public interface FakeApi { ) 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`. @@ -237,7 +244,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -246,6 +253,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -262,7 +270,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -272,6 +280,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -292,7 +301,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -302,6 +311,7 @@ public interface FakeApi { ) 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 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -338,7 +348,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -360,6 +370,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -387,7 +398,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -403,6 +414,7 @@ public interface FakeApi { ) 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) @@ -426,7 +438,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) ResponseEntity testGroupParameters( @@ -439,6 +451,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -457,7 +470,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -466,6 +479,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -485,7 +499,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -495,6 +509,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -513,7 +528,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -522,6 +537,7 @@ public interface FakeApi { ) 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 @@ -542,7 +558,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) ResponseEntity testQueryParameterCollectionFormat( @@ -553,6 +569,7 @@ public interface FakeApi { ) 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. @@ -571,7 +588,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -580,6 +597,7 @@ public interface FakeApi { ) throws Exception; + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -605,7 +623,7 @@ public interface FakeApi { ) @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 25aacec2964..4405b93432c 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 @@ -39,6 +39,7 @@ import javax.annotation.Generated; @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 @@ -62,7 +63,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 885a43d4075..bcf2bc37ec5 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 @@ -41,6 +41,7 @@ import javax.annotation.Generated; @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, consumes = { "application/json", "application/xml" } ) @@ -73,6 +74,7 @@ public interface PetApi { ) throws Exception; + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -97,7 +99,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) ResponseEntity deletePet( @@ -106,6 +108,7 @@ public interface PetApi { ) 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 @@ -132,7 +135,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -141,6 +144,7 @@ public interface PetApi { ) 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. @@ -170,7 +174,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -179,6 +183,7 @@ public interface PetApi { ) throws Exception; + 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 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -216,6 +221,7 @@ public interface PetApi { ) throws Exception; + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -243,7 +249,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -252,6 +258,7 @@ public interface PetApi { ) 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 * @@ -275,7 +282,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -286,6 +293,7 @@ public interface PetApi { ) throws Exception; + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -311,7 +319,7 @@ public interface PetApi { ) @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 5a629db0cfb..c5d36c4129a 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) ResponseEntity deleteOrder( @@ -68,6 +69,7 @@ public interface StoreApi { ) 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 @@ -90,7 +92,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -99,6 +101,7 @@ public interface StoreApi { ) 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 @@ -124,7 +127,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -133,6 +136,7 @@ public interface StoreApi { ) throws Exception; + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -156,7 +160,7 @@ public interface StoreApi { ) @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 c65042d321a..7bf3fe6617b 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 @@ -40,6 +40,7 @@ import javax.annotation.Generated; @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. @@ -58,7 +59,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -67,6 +68,7 @@ public interface UserApi { ) 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 * @@ -85,7 +87,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -94,6 +96,7 @@ public interface UserApi { ) 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 * @@ -112,7 +115,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -121,6 +124,7 @@ public interface UserApi { ) 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. @@ -141,7 +145,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) ResponseEntity deleteUser( @@ -149,6 +153,7 @@ public interface UserApi { ) throws Exception; + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -174,7 +179,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -183,6 +188,7 @@ public interface UserApi { ) throws Exception; + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -207,7 +213,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -217,6 +223,7 @@ public interface UserApi { ) throws Exception; + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -234,7 +241,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) ResponseEntity logoutUser( @@ -242,6 +249,7 @@ public interface UserApi { ) 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. @@ -263,7 +271,7 @@ public interface UserApi { ) @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 1d98a26f9b9..c46e01e697e 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 @@ -43,6 +43,7 @@ public interface NullableApi { return Optional.empty(); } + public static final String PATH_NULLABLE_TEST = "/nullable"; /** * POST /nullable * nullable test @@ -61,7 +62,7 @@ public interface NullableApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/nullable", + value = NullableApi.PATH_NULLABLE_TEST, consumes = "application/json" ) diff --git a/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApi.java b/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApi.java index 6d9a404037a..e4a0be8b08b 100644 --- a/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApi.java +++ b/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApi.java @@ -40,6 +40,7 @@ public interface DogsApi { return new DogsApiDelegate() {}; } + public static final String PATH_CREATE_DOG = "/dogs"; /** * POST /dogs : Create a dog * @@ -75,7 +76,7 @@ public interface DogsApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/dogs", + value = DogsApi.PATH_CREATE_DOG, produces = { "application/json" }, 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 1051bee1c37..6a70bda9a0f 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 @@ -32,6 +32,7 @@ public interface AnotherFakeApi { 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 @@ -51,7 +52,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/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 e071ab79812..65a4dcffe17 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 @@ -44,6 +44,7 @@ public interface FakeApi { 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 @@ -62,7 +63,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" } ) @@ -74,6 +75,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -106,6 +108,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -147,6 +150,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -166,7 +170,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -179,6 +183,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -198,7 +203,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -211,6 +216,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -229,7 +235,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -250,6 +256,7 @@ public interface FakeApi { } + 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`. @@ -268,7 +275,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -280,6 +287,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -298,7 +306,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -311,6 +319,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -330,7 +339,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -352,6 +361,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -388,7 +398,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -413,6 +423,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -440,7 +451,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -459,6 +470,7 @@ public interface FakeApi { } + 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) @@ -482,7 +494,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -498,6 +510,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -516,7 +529,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -528,6 +541,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -547,7 +561,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -560,6 +574,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -578,7 +593,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -590,6 +605,7 @@ public interface FakeApi { } + 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 @@ -611,7 +627,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -625,6 +641,7 @@ public interface FakeApi { } + 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. @@ -643,7 +660,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -664,6 +681,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -691,7 +709,7 @@ public interface FakeApi { }) @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 8d3ff3ea956..d560ba0b964 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 @@ -32,6 +32,7 @@ public interface FakeClassnameTestApi { 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 @@ -54,7 +55,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/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 b6d6df5b249..fbba28d962c 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 @@ -34,6 +34,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -99,7 +101,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -111,6 +113,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -165,6 +168,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -221,6 +225,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -273,6 +278,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -303,7 +309,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -315,6 +321,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -355,6 +362,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -382,7 +390,7 @@ public interface PetApi { }) @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 86c90b02904..c0f6736fb4a 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 @@ -33,6 +33,7 @@ public interface StoreApi { 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 @@ -53,7 +54,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -64,6 +65,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -168,7 +172,7 @@ public interface StoreApi { }) @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 c59ba9f03c7..4a975e2f93a 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 @@ -33,6 +33,7 @@ public interface UserApi { 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. @@ -51,7 +52,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -63,6 +64,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -93,6 +95,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -123,6 +126,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -154,6 +158,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -177,7 +182,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -203,6 +208,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -225,7 +231,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -238,6 +244,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -255,7 +262,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -266,6 +273,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -287,7 +295,7 @@ public interface UserApi { }) @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 1051bee1c37..6a70bda9a0f 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 @@ -32,6 +32,7 @@ public interface AnotherFakeApi { 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 @@ -51,7 +52,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/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 e071ab79812..65a4dcffe17 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 @@ -44,6 +44,7 @@ public interface FakeApi { 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 @@ -62,7 +63,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" } ) @@ -74,6 +75,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -106,6 +108,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -147,6 +150,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -166,7 +170,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -179,6 +183,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -198,7 +203,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -211,6 +216,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -229,7 +235,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -250,6 +256,7 @@ public interface FakeApi { } + 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`. @@ -268,7 +275,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -280,6 +287,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -298,7 +306,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -311,6 +319,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -330,7 +339,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -352,6 +361,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -388,7 +398,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -413,6 +423,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -440,7 +451,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -459,6 +470,7 @@ public interface FakeApi { } + 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) @@ -482,7 +494,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -498,6 +510,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -516,7 +529,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -528,6 +541,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -547,7 +561,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -560,6 +574,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -578,7 +593,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -590,6 +605,7 @@ public interface FakeApi { } + 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 @@ -611,7 +627,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -625,6 +641,7 @@ public interface FakeApi { } + 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. @@ -643,7 +660,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -664,6 +681,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -691,7 +709,7 @@ public interface FakeApi { }) @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 8d3ff3ea956..d560ba0b964 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 @@ -32,6 +32,7 @@ public interface FakeClassnameTestApi { 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 @@ -54,7 +55,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/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 b6d6df5b249..fbba28d962c 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 @@ -34,6 +34,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -99,7 +101,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -111,6 +113,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -165,6 +168,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -221,6 +225,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -273,6 +278,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -303,7 +309,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -315,6 +321,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -355,6 +362,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -382,7 +390,7 @@ public interface PetApi { }) @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 86c90b02904..c0f6736fb4a 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 @@ -33,6 +33,7 @@ public interface StoreApi { 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 @@ -53,7 +54,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -64,6 +65,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -168,7 +172,7 @@ public interface StoreApi { }) @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 c59ba9f03c7..4a975e2f93a 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 @@ -33,6 +33,7 @@ public interface UserApi { 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. @@ -51,7 +52,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -63,6 +64,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -93,6 +95,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -123,6 +126,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -154,6 +158,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -177,7 +182,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -203,6 +208,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -225,7 +231,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -238,6 +244,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -255,7 +262,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -266,6 +273,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -287,7 +295,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java index a91de554c13..75823efd51c 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,6 +32,7 @@ public interface AnotherFakeApi { 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 @@ -51,7 +52,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/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java index 3c65ea38562..9a010d13c5c 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -44,6 +44,7 @@ public interface FakeApi { 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 @@ -62,7 +63,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" } ) @@ -74,6 +75,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -106,6 +108,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -147,6 +150,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -166,7 +170,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -179,6 +183,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -198,7 +203,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -211,6 +216,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -229,7 +235,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -250,6 +256,7 @@ public interface FakeApi { } + 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`. @@ -268,7 +275,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -280,6 +287,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -298,7 +306,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -311,6 +319,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -330,7 +339,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -352,6 +361,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -388,7 +398,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -413,6 +423,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -440,7 +451,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -459,6 +470,7 @@ public interface FakeApi { } + 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) @@ -482,7 +494,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -498,6 +510,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -516,7 +529,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -528,6 +541,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -547,7 +561,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -560,6 +574,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -578,7 +593,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -590,6 +605,7 @@ public interface FakeApi { } + 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 @@ -611,7 +627,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -625,6 +641,7 @@ public interface FakeApi { } + 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. @@ -643,7 +660,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -664,6 +681,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -691,7 +709,7 @@ public interface FakeApi { }) @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-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f5963b21501..6087a40184a 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,6 +32,7 @@ public interface FakeClassnameTestApi { 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 @@ -54,7 +55,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/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java index 0475621700a..2713ad3075a 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java @@ -34,6 +34,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -99,7 +101,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -111,6 +113,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -165,6 +168,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -221,6 +225,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -273,6 +278,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -303,7 +309,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -315,6 +321,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -355,6 +362,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -382,7 +390,7 @@ public interface PetApi { }) @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-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java index 67b3cae982a..f659eb65648 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java @@ -33,6 +33,7 @@ public interface StoreApi { 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 @@ -53,7 +54,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -64,6 +65,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -168,7 +172,7 @@ public interface StoreApi { }) @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-builtin-validation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java index 54981da58cd..f8048e309ce 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java @@ -33,6 +33,7 @@ public interface UserApi { 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. @@ -51,7 +52,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -63,6 +64,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -93,6 +95,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -123,6 +126,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -154,6 +158,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -177,7 +182,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -203,6 +208,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -225,7 +231,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -238,6 +244,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -255,7 +262,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -266,6 +273,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -287,7 +295,7 @@ public interface UserApi { }) @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 848a3186439..3845f11b2c7 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 @@ -28,6 +28,7 @@ public interface AnotherFakeApi { 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 @@ -47,7 +48,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/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 2b1bbdda28c..7df333b9123 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 @@ -40,6 +40,7 @@ public interface FakeApi { 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 @@ -58,7 +59,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" } ) @@ -69,6 +70,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -88,7 +90,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -100,6 +102,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -119,7 +122,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -131,6 +134,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -150,7 +154,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -162,6 +166,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -181,7 +186,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -193,6 +198,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -211,7 +217,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -222,6 +228,7 @@ public interface FakeApi { } + 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`. @@ -240,7 +247,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -251,6 +258,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -269,7 +277,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -281,6 +289,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -300,7 +309,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -312,6 +321,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -348,7 +358,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -372,6 +382,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -399,7 +410,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -417,6 +428,7 @@ public interface FakeApi { } + 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) @@ -440,7 +452,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -455,6 +467,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -473,7 +486,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -484,6 +497,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -503,7 +517,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -515,6 +529,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -533,7 +548,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -544,6 +559,7 @@ public interface FakeApi { } + 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 @@ -565,7 +581,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -578,6 +594,7 @@ public interface FakeApi { } + 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. @@ -596,7 +613,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -607,6 +624,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -634,7 +652,7 @@ public interface FakeApi { }) @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 cd055f61e49..0dc6ddecc51 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 @@ -28,6 +28,7 @@ public interface FakeClassnameTestApi { 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 @@ -50,7 +51,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/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 dd905ee2dc3..c98f404b307 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 @@ -30,6 +30,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -56,7 +57,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -67,6 +68,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -94,7 +96,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -105,6 +107,7 @@ public interface PetApi { } + 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 @@ -133,7 +136,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -144,6 +147,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -185,6 +189,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -222,6 +227,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -252,7 +258,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -263,6 +269,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -289,7 +296,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -302,6 +309,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -329,7 +337,7 @@ public interface PetApi { }) @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 4e6e9395433..29fe08ba907 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 @@ -29,6 +29,7 @@ public interface StoreApi { 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 @@ -49,7 +50,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -59,6 +60,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -92,6 +94,7 @@ public interface StoreApi { } + 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 @@ -115,7 +118,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -126,6 +129,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -147,7 +151,7 @@ public interface StoreApi { }) @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 a260269077f..f6ef145834e 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 @@ -29,6 +29,7 @@ public interface UserApi { 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. @@ -47,7 +48,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -58,6 +59,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -76,7 +78,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -87,6 +89,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -105,7 +108,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -116,6 +119,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -136,7 +140,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -146,6 +150,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -169,7 +174,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -180,6 +185,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -202,7 +208,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -214,6 +220,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -231,7 +238,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -241,6 +248,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -262,7 +270,7 @@ public interface UserApi { }) @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 bb2f44d9958..b9c1fd9ed98 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 @@ -29,6 +29,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -56,7 +57,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -69,6 +70,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -94,7 +96,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -106,6 +108,7 @@ public interface PetApi { } + 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 @@ -133,7 +136,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -145,6 +148,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -186,6 +190,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -212,7 +217,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -224,6 +229,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -257,7 +263,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -270,6 +276,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -296,7 +303,7 @@ public interface PetApi { }) @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) @@ -310,6 +317,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -337,7 +345,7 @@ public interface PetApi { }) @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 632f61728e6..1067fce34ba 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 @@ -29,6 +29,7 @@ public interface StoreApi { 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 @@ -49,7 +50,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -60,6 +61,7 @@ public interface StoreApi { } + 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 @@ -82,7 +84,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -94,6 +96,7 @@ public interface StoreApi { } + 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 @@ -117,7 +120,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -129,6 +132,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -150,7 +154,7 @@ public interface StoreApi { }) @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 4ef8d3cb49d..0701d5b64a7 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 @@ -29,6 +29,7 @@ public interface UserApi { 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. @@ -50,7 +51,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -62,6 +63,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @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 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -116,7 +119,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -128,6 +131,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -162,6 +166,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -185,7 +190,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -197,6 +202,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -219,7 +225,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -232,6 +238,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -252,7 +259,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) @ResponseStatus(HttpStatus.OK) @@ -263,6 +270,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -287,7 +295,7 @@ public interface UserApi { }) @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 848a3186439..3845f11b2c7 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 @@ -28,6 +28,7 @@ public interface AnotherFakeApi { 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 @@ -47,7 +48,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/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 2b1bbdda28c..7df333b9123 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 @@ -40,6 +40,7 @@ public interface FakeApi { 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 @@ -58,7 +59,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" } ) @@ -69,6 +70,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -88,7 +90,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -100,6 +102,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -119,7 +122,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -131,6 +134,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -150,7 +154,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -162,6 +166,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -181,7 +186,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -193,6 +198,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -211,7 +217,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -222,6 +228,7 @@ public interface FakeApi { } + 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`. @@ -240,7 +247,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -251,6 +258,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -269,7 +277,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -281,6 +289,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -300,7 +309,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -312,6 +321,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -348,7 +358,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -372,6 +382,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -399,7 +410,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -417,6 +428,7 @@ public interface FakeApi { } + 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) @@ -440,7 +452,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -455,6 +467,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -473,7 +486,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -484,6 +497,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -503,7 +517,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -515,6 +529,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -533,7 +548,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -544,6 +559,7 @@ public interface FakeApi { } + 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 @@ -565,7 +581,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -578,6 +594,7 @@ public interface FakeApi { } + 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. @@ -596,7 +613,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -607,6 +624,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -634,7 +652,7 @@ public interface FakeApi { }) @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 cd055f61e49..0dc6ddecc51 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 @@ -28,6 +28,7 @@ public interface FakeClassnameTestApi { 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 @@ -50,7 +51,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/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 dd905ee2dc3..c98f404b307 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 @@ -30,6 +30,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -56,7 +57,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -67,6 +68,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -94,7 +96,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -105,6 +107,7 @@ public interface PetApi { } + 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 @@ -133,7 +136,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -144,6 +147,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -185,6 +189,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -222,6 +227,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -252,7 +258,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -263,6 +269,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -289,7 +296,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -302,6 +309,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -329,7 +337,7 @@ public interface PetApi { }) @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 4e6e9395433..29fe08ba907 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 @@ -29,6 +29,7 @@ public interface StoreApi { 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 @@ -49,7 +50,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -59,6 +60,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -92,6 +94,7 @@ public interface StoreApi { } + 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 @@ -115,7 +118,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -126,6 +129,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -147,7 +151,7 @@ public interface StoreApi { }) @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 a260269077f..f6ef145834e 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 @@ -29,6 +29,7 @@ public interface UserApi { 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. @@ -47,7 +48,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -58,6 +59,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -76,7 +78,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -87,6 +89,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -105,7 +108,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -116,6 +119,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -136,7 +140,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -146,6 +150,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -169,7 +174,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -180,6 +185,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -202,7 +208,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -214,6 +220,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -231,7 +238,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -241,6 +248,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -262,7 +270,7 @@ public interface UserApi { }) @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 5bc496f2058..c2c3bb3ac11 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 @@ -39,6 +39,7 @@ public interface DummyApi { return new DummyApiDelegate() {}; } + public static final String PATH_UPLOAD_FILE = "/dummy"; /** * POST /dummy * @@ -55,7 +56,7 @@ public interface DummyApi { ) @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 4f8a7b065f4..d98dfa7ed02 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 @@ -31,6 +31,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -41,7 +42,7 @@ public interface PetApi { */ @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 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -77,7 +79,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -88,6 +90,7 @@ public interface PetApi { } + 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 @@ -98,7 +101,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -124,6 +127,7 @@ public interface PetApi { } + 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. @@ -136,7 +140,7 @@ public interface PetApi { @Deprecated @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -162,6 +166,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -173,7 +178,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -199,6 +204,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -213,7 +219,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -240,6 +246,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -251,7 +258,7 @@ public interface PetApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -265,6 +272,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -276,7 +284,7 @@ public interface PetApi { */ @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 d00c0865b22..9f90fd69856 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 @@ -31,6 +31,7 @@ public interface StoreApi { 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 @@ -41,7 +42,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -52,6 +53,7 @@ public interface StoreApi { } + 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 @@ -60,7 +62,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -72,6 +74,7 @@ public interface StoreApi { } + 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 @@ -83,7 +86,7 @@ public interface StoreApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -109,6 +112,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -119,7 +123,7 @@ public interface StoreApi { */ @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 55fc0fc0cb1..cc48b749738 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 @@ -31,6 +31,7 @@ public interface UserApi { 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. @@ -40,7 +41,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -52,6 +53,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -61,7 +63,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -73,6 +75,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -82,7 +85,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -94,6 +97,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -104,7 +108,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -115,6 +119,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -126,7 +131,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -152,6 +157,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -163,7 +169,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -176,6 +182,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -184,7 +191,7 @@ public interface UserApi { */ @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -195,6 +202,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -206,7 +214,7 @@ public interface UserApi { */ @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 1051bee1c37..6a70bda9a0f 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 @@ -32,6 +32,7 @@ public interface AnotherFakeApi { 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 @@ -51,7 +52,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/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 18148a3c133..a5866f04e51 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 @@ -44,6 +44,7 @@ public interface FakeApi { 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 @@ -62,7 +63,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" } ) @@ -74,6 +75,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -106,6 +108,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -147,6 +150,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -166,7 +170,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -179,6 +183,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -198,7 +203,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -211,6 +216,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -229,7 +235,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -250,6 +256,7 @@ public interface FakeApi { } + 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`. @@ -268,7 +275,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -280,6 +287,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -298,7 +306,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -311,6 +319,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -330,7 +339,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -352,6 +361,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -388,7 +398,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -413,6 +423,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -442,7 +453,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -459,6 +470,7 @@ public interface FakeApi { } + 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) @@ -484,7 +496,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -498,6 +510,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -516,7 +529,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -528,6 +541,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -547,7 +561,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -560,6 +574,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -578,7 +593,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -590,6 +605,7 @@ public interface FakeApi { } + 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 @@ -611,7 +627,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -625,6 +641,7 @@ public interface FakeApi { } + 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. @@ -643,7 +660,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -664,6 +681,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -691,7 +709,7 @@ public interface FakeApi { }) @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 8d3ff3ea956..d560ba0b964 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 @@ -32,6 +32,7 @@ public interface FakeClassnameTestApi { 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 @@ -54,7 +55,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/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 97d9ea36e6b..3399a48e0f7 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 @@ -34,6 +34,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -101,7 +103,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -112,6 +114,7 @@ public interface PetApi { } + 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 @@ -140,7 +143,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -166,6 +169,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -222,6 +226,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -248,7 +253,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -274,6 +279,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -304,7 +310,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -316,6 +322,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -342,7 +349,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -356,6 +363,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -383,7 +391,7 @@ public interface PetApi { }) @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 86c90b02904..c0f6736fb4a 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 @@ -33,6 +33,7 @@ public interface StoreApi { 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 @@ -53,7 +54,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -64,6 +65,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -168,7 +172,7 @@ public interface StoreApi { }) @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 c59ba9f03c7..4a975e2f93a 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 @@ -33,6 +33,7 @@ public interface UserApi { 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. @@ -51,7 +52,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -63,6 +64,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -93,6 +95,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -123,6 +126,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -154,6 +158,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -177,7 +182,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -203,6 +208,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -225,7 +231,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -238,6 +244,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -255,7 +262,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -266,6 +273,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -287,7 +295,7 @@ public interface UserApi { }) @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 dd081d14ed3..b1cdf230e03 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 @@ -44,6 +44,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -70,7 +71,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -97,6 +98,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -119,7 +121,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -131,6 +133,7 @@ public interface PetApi { } + 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 @@ -157,7 +160,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -183,6 +186,7 @@ public interface PetApi { } + 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. @@ -212,7 +216,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -238,6 +242,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -266,7 +271,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -292,6 +297,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -325,7 +331,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -352,6 +358,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -375,7 +382,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -389,6 +396,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -414,7 +422,7 @@ public interface PetApi { ) @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 353cc67308a..d5f3f61cdab 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 @@ -44,6 +44,7 @@ public interface StoreApi { 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 @@ -64,7 +65,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -75,6 +76,7 @@ public interface StoreApi { } + 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 @@ -97,7 +99,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -109,6 +111,7 @@ public interface StoreApi { } + 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 @@ -134,7 +137,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -160,6 +163,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -183,7 +187,7 @@ public interface StoreApi { ) @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 423569074fa..3a6d014d315 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 @@ -44,6 +44,7 @@ public interface UserApi { 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. @@ -65,7 +66,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -77,6 +78,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -98,7 +100,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -110,6 +112,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -131,7 +134,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -143,6 +146,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -166,7 +170,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -177,6 +181,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -202,7 +207,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -228,6 +233,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -252,7 +258,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -265,6 +271,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -285,7 +292,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -296,6 +303,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -320,7 +328,7 @@ public interface UserApi { ) @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 3e89b503df3..9657ad1bfd7 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 @@ -44,6 +44,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -70,7 +71,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -97,6 +98,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -119,7 +121,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -131,6 +133,7 @@ public interface PetApi { } + 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 @@ -157,7 +160,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -183,6 +186,7 @@ public interface PetApi { } + 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. @@ -212,7 +216,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -238,6 +242,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -266,7 +271,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -292,6 +297,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -325,7 +331,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -352,6 +358,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -375,7 +382,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -389,6 +396,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -414,7 +422,7 @@ public interface PetApi { ) @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 2f9e7679682..6fba7805428 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 @@ -44,6 +44,7 @@ public interface StoreApi { 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 @@ -64,7 +65,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -75,6 +76,7 @@ public interface StoreApi { } + 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 @@ -97,7 +99,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -109,6 +111,7 @@ public interface StoreApi { } + 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 @@ -134,7 +137,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -160,6 +163,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -183,7 +187,7 @@ public interface StoreApi { ) @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 3b7ae610ebc..6ebb8dc559a 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 @@ -44,6 +44,7 @@ public interface UserApi { 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. @@ -65,7 +66,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -77,6 +78,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -98,7 +100,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -110,6 +112,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -131,7 +134,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -143,6 +146,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -166,7 +170,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -177,6 +181,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -202,7 +207,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -228,6 +233,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -252,7 +258,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -265,6 +271,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -285,7 +292,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -296,6 +303,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -320,7 +328,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } ) diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApi.java index 51b7c218b51..01c8a2c11cd 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApi.java @@ -40,6 +40,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -76,7 +77,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -88,6 +89,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -110,7 +112,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -121,6 +123,7 @@ public interface PetApi { } + 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 @@ -153,7 +156,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -164,6 +167,7 @@ public interface PetApi { } + 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. @@ -193,7 +197,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -204,6 +208,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -232,7 +237,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -243,6 +248,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -276,7 +282,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) @@ -288,6 +294,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -311,7 +318,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -324,6 +331,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -349,7 +357,7 @@ public interface PetApi { ) @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-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApi.java index d71c1402393..737d0a187f0 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApi.java @@ -40,6 +40,7 @@ public interface StoreApi { 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 @@ -60,7 +61,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{orderId}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -70,6 +71,7 @@ public interface StoreApi { } + 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 @@ -92,7 +94,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -103,6 +105,7 @@ public interface StoreApi { } + 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 @@ -128,7 +131,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{orderId}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -139,6 +142,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -162,7 +166,7 @@ public interface StoreApi { ) @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-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApi.java index 0ed5a08d45c..772a3254879 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApi.java @@ -40,6 +40,7 @@ public interface UserApi { 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. @@ -61,7 +62,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -72,6 +73,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -93,7 +95,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -104,6 +106,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -125,7 +128,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -136,6 +139,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -169,6 +173,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -194,7 +199,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -205,6 +210,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -229,7 +235,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -241,6 +247,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -261,7 +268,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -271,6 +278,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -295,7 +303,7 @@ public interface UserApi { ) @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 c89976a3075..3f598f1d88d 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 @@ -33,6 +33,7 @@ public interface AnotherFakeApi { 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 @@ -52,7 +53,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/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 9d3d6f0e24d..60d0de61581 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 @@ -45,6 +45,7 @@ public interface FakeApi { 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 @@ -63,7 +64,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" } ) @ResponseStatus(HttpStatus.OK) @@ -76,6 +77,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -109,6 +111,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -142,6 +145,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -175,6 +179,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -194,7 +199,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -208,6 +213,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -226,7 +232,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -239,6 +245,7 @@ public interface FakeApi { } + 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`. @@ -257,7 +264,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -270,6 +277,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -288,7 +296,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -302,6 +310,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -321,7 +330,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -335,6 +344,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -371,7 +381,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -397,6 +407,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -424,7 +435,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -444,6 +455,7 @@ public interface FakeApi { } + 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) @@ -467,7 +479,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -484,6 +496,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -502,7 +515,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -515,6 +528,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -534,7 +548,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.OK) @@ -548,6 +562,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -566,7 +581,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -579,6 +594,7 @@ public interface FakeApi { } + 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 @@ -600,7 +616,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) @ResponseStatus(HttpStatus.OK) @@ -615,6 +631,7 @@ public interface FakeApi { } + 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. @@ -633,7 +650,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -645,6 +662,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -672,7 +690,7 @@ public interface FakeApi { }) @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 b5605ceff6f..2fa82cd4f9c 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 @@ -33,6 +33,7 @@ public interface FakeClassnameTestApi { 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 @@ -55,7 +56,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/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 d0236c7bf33..3475b09b8c0 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 @@ -35,6 +35,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -61,7 +62,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) @@ -74,6 +75,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -101,7 +103,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) @ResponseStatus(HttpStatus.OK) @@ -114,6 +116,7 @@ public interface PetApi { } + 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 @@ -142,7 +145,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -155,6 +158,7 @@ public interface PetApi { } + 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. @@ -185,7 +189,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -198,6 +202,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -224,7 +229,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -237,6 +242,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -267,7 +273,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) @@ -280,6 +286,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -306,7 +313,7 @@ public interface PetApi { }) @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) @@ -321,6 +328,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -348,7 +356,7 @@ public interface PetApi { }) @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 3a7274a97a4..af6f5780f91 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 @@ -34,6 +34,7 @@ public interface StoreApi { 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 @@ -54,7 +55,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -66,6 +67,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -100,6 +102,7 @@ public interface StoreApi { } + 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 @@ -123,7 +126,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -136,6 +139,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -157,7 +161,7 @@ public interface StoreApi { }) @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 aae5a307cc8..2b609bf3ce3 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 @@ -34,6 +34,7 @@ public interface UserApi { 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. @@ -52,7 +53,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -65,6 +66,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -96,6 +98,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @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 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -147,7 +151,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) @ResponseStatus(HttpStatus.BAD_REQUEST) @@ -159,6 +163,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -182,7 +187,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -195,6 +200,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -217,7 +223,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) @@ -231,6 +237,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -248,7 +255,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) @ResponseStatus(HttpStatus.OK) @@ -259,6 +266,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @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 a286214a60a..b7bdfad45ac 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 @@ -33,6 +33,7 @@ public interface AnotherFakeApi { 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 @@ -52,7 +53,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/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 9a64925bec5..095446b714b 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 @@ -45,6 +45,7 @@ public interface FakeApi { 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 @@ -63,7 +64,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" } ) @@ -75,6 +76,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -107,6 +109,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -126,7 +129,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -139,6 +142,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -158,7 +162,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -171,6 +175,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -203,6 +208,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -221,7 +227,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -233,6 +239,7 @@ public interface FakeApi { } + 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`. @@ -251,7 +258,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -263,6 +270,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -281,7 +289,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -294,6 +302,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -313,7 +322,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -326,6 +335,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -362,7 +372,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -387,6 +397,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -414,7 +425,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -433,6 +444,7 @@ public interface FakeApi { } + 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) @@ -456,7 +468,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default Mono> testGroupParameters( @@ -472,6 +484,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -490,7 +503,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -502,6 +515,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -521,7 +535,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -534,6 +548,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -552,7 +567,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -564,6 +579,7 @@ public interface FakeApi { } + 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 @@ -585,7 +601,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default Mono> testQueryParameterCollectionFormat( @@ -599,6 +615,7 @@ public interface FakeApi { } + 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. @@ -617,7 +634,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -628,6 +645,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -655,7 +673,7 @@ public interface FakeApi { }) @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 cb4134b374c..ef1a5e20456 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 @@ -33,6 +33,7 @@ public interface FakeClassnameTestApi { 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 @@ -55,7 +56,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/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 0bf836e9c49..9889c361702 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 @@ -35,6 +35,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -61,7 +62,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -73,6 +74,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -100,7 +102,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default Mono> deletePet( @@ -112,6 +114,7 @@ public interface PetApi { } + 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 @@ -140,7 +143,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -152,6 +155,7 @@ public interface PetApi { } + 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. @@ -182,7 +186,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -194,6 +198,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -220,7 +225,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -232,6 +237,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -262,7 +268,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -274,6 +280,7 @@ public interface PetApi { } + 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 +307,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -314,6 +321,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -341,7 +349,7 @@ public interface PetApi { }) @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 b397684dc62..06305559fa6 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 @@ -34,6 +34,7 @@ public interface StoreApi { 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 @@ -54,7 +55,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default Mono> deleteOrder( @@ -65,6 +66,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -133,6 +136,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -154,7 +158,7 @@ public interface StoreApi { }) @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 50244f72269..90d8a87342e 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 @@ -34,6 +34,7 @@ public interface UserApi { 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. @@ -52,7 +53,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -64,6 +65,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -94,6 +96,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -112,7 +115,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -124,6 +127,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -144,7 +148,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default Mono> deleteUser( @@ -155,6 +159,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -178,7 +183,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -190,6 +195,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -212,7 +218,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -225,6 +231,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -242,7 +249,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default Mono> logoutUser( @@ -252,6 +259,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -273,7 +281,7 @@ public interface UserApi { }) @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 0d135e99f03..07025cf4a1a 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 @@ -28,6 +28,7 @@ public interface AnotherFakeApi { 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 @@ -47,7 +48,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/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 d3931045e9a..10ee00b2e05 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 @@ -38,6 +38,7 @@ public interface FakeApi { 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 @@ -56,7 +57,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" } ) @@ -67,6 +68,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -86,7 +88,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) @@ -97,6 +99,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -116,7 +119,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) @@ -127,6 +130,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -146,7 +150,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) @@ -157,6 +161,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -176,7 +181,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) @@ -187,6 +192,7 @@ public interface FakeApi { } + 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`. @@ -205,7 +211,7 @@ public interface FakeApi { }) @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 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -234,7 +241,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -246,6 +253,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -265,7 +273,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -277,6 +285,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -313,7 +322,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -337,6 +346,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -364,7 +374,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -382,6 +392,7 @@ public interface FakeApi { } + 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) @@ -405,7 +416,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -420,6 +431,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -437,7 +449,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -448,6 +460,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -466,7 +479,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -478,6 +491,7 @@ public interface FakeApi { } + 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 @@ -500,7 +514,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -514,6 +528,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -540,7 +555,7 @@ public interface FakeApi { }) @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 d81c21e2fb2..f456f663f64 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 @@ -28,6 +28,7 @@ public interface FakeClassnameTestApi { 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 @@ -50,7 +51,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/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 f380b742b6b..3374e379dd5 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 @@ -31,6 +31,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -56,7 +57,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -67,6 +68,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -93,7 +95,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -104,6 +106,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -144,6 +147,7 @@ public interface PetApi { } + 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. @@ -175,7 +179,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -188,6 +192,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -214,7 +219,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -225,6 +230,7 @@ public interface PetApi { } + public static final String PATH_LIST_ALL_PETS = "/pet/all"; /** * GET /pet/all : List all pets * @@ -251,7 +257,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/all", + value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) @@ -262,6 +268,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -291,7 +298,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -302,6 +309,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -327,7 +335,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -340,6 +348,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -366,7 +375,7 @@ public interface PetApi { }) @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 d8f00d648df..1202a78fc5e 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 @@ -29,6 +29,7 @@ public interface StoreApi { 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 @@ -49,7 +50,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -59,6 +60,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -92,6 +94,7 @@ public interface StoreApi { } + 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 @@ -115,7 +118,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -126,6 +129,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -146,7 +150,7 @@ public interface StoreApi { }) @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 77355ad7de2..75f74365a9a 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 @@ -29,6 +29,7 @@ public interface UserApi { 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. @@ -47,7 +48,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) default ResponseEntity createUser( @@ -57,6 +58,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -74,7 +76,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) default ResponseEntity createUsersWithArrayInput( @@ -84,6 +86,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -101,7 +104,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) default ResponseEntity createUsersWithListInput( @@ -111,6 +114,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -131,7 +135,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -141,6 +145,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -163,7 +168,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -174,6 +179,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -195,7 +201,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -207,6 +213,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -223,7 +230,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -233,6 +240,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -254,7 +262,7 @@ public interface UserApi { }) @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 b852ca29ff4..a731b35576a 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 @@ -28,6 +28,7 @@ public interface VersioningApi { return new VersioningApiDelegate() {}; } + public static final String PATH_VERSIONING_HEADERS = "/versioning/headers"; /** * POST /versioning/headers * @@ -48,7 +49,7 @@ public interface VersioningApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/headers", + value = VersioningApi.PATH_VERSIONING_HEADERS, produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) @@ -62,6 +63,7 @@ public interface VersioningApi { } + public static final String PATH_VERSIONING_MIX = "/versioning/mix"; /** * POST /versioning/mix * @@ -84,7 +86,7 @@ public interface VersioningApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/mix", + value = VersioningApi.PATH_VERSIONING_MIX, produces = { "*/*" }, headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } @@ -101,6 +103,7 @@ public interface VersioningApi { } + public static final String PATH_VERSIONING_QUERY_PARAMS = "/versioning/query-params"; /** * POST /versioning/query-params * @@ -121,7 +124,7 @@ public interface VersioningApi { }) @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 0d135e99f03..07025cf4a1a 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 @@ -28,6 +28,7 @@ public interface AnotherFakeApi { 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 @@ -47,7 +48,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/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 d3931045e9a..10ee00b2e05 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 @@ -38,6 +38,7 @@ public interface FakeApi { 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 @@ -56,7 +57,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" } ) @@ -67,6 +68,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -86,7 +88,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) @@ -97,6 +99,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -116,7 +119,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) @@ -127,6 +130,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -146,7 +150,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) @@ -157,6 +161,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -176,7 +181,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) @@ -187,6 +192,7 @@ public interface FakeApi { } + 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`. @@ -205,7 +211,7 @@ public interface FakeApi { }) @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 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -234,7 +241,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -246,6 +253,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -265,7 +273,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -277,6 +285,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -313,7 +322,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -337,6 +346,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -364,7 +374,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -382,6 +392,7 @@ public interface FakeApi { } + 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) @@ -405,7 +416,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -420,6 +431,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -437,7 +449,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -448,6 +460,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -466,7 +479,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -478,6 +491,7 @@ public interface FakeApi { } + 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 @@ -500,7 +514,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -514,6 +528,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -540,7 +555,7 @@ public interface FakeApi { }) @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 d81c21e2fb2..f456f663f64 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 @@ -28,6 +28,7 @@ public interface FakeClassnameTestApi { 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 @@ -50,7 +51,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/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 f380b742b6b..3374e379dd5 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 @@ -31,6 +31,7 @@ public interface PetApi { return new PetApiDelegate() {}; } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -56,7 +57,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -67,6 +68,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -93,7 +95,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -104,6 +106,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -144,6 +147,7 @@ public interface PetApi { } + 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. @@ -175,7 +179,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -188,6 +192,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -214,7 +219,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -225,6 +230,7 @@ public interface PetApi { } + public static final String PATH_LIST_ALL_PETS = "/pet/all"; /** * GET /pet/all : List all pets * @@ -251,7 +257,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/all", + value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) @@ -262,6 +268,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -291,7 +298,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -302,6 +309,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -327,7 +335,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -340,6 +348,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -366,7 +375,7 @@ public interface PetApi { }) @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 d8f00d648df..1202a78fc5e 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 @@ -29,6 +29,7 @@ public interface StoreApi { 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 @@ -49,7 +50,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -59,6 +60,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -92,6 +94,7 @@ public interface StoreApi { } + 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 @@ -115,7 +118,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -126,6 +129,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -146,7 +150,7 @@ public interface StoreApi { }) @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 77355ad7de2..75f74365a9a 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 @@ -29,6 +29,7 @@ public interface UserApi { 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. @@ -47,7 +48,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) default ResponseEntity createUser( @@ -57,6 +58,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; /** * POST /user/createWithArray : Creates list of users with given input array * @@ -74,7 +76,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) default ResponseEntity createUsersWithArrayInput( @@ -84,6 +86,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -101,7 +104,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) default ResponseEntity createUsersWithListInput( @@ -111,6 +114,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -131,7 +135,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -141,6 +145,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -163,7 +168,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -174,6 +179,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -195,7 +201,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -207,6 +213,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -223,7 +230,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -233,6 +240,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -254,7 +262,7 @@ public interface UserApi { }) @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 48df3368527..ab32fd04010 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 @@ -28,6 +28,7 @@ public interface VersioningApi { return new VersioningApiDelegate() {}; } + public static final String PATH_VERSIONING_HEADERS = "/versioning/headers"; /** * POST /versioning/headers * @@ -50,7 +51,7 @@ public interface VersioningApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/headers", + value = VersioningApi.PATH_VERSIONING_HEADERS, produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) @@ -62,6 +63,7 @@ public interface VersioningApi { } + public static final String PATH_VERSIONING_MIX = "/versioning/mix"; /** * POST /versioning/mix * @@ -86,7 +88,7 @@ public interface VersioningApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/mix", + value = VersioningApi.PATH_VERSIONING_MIX, produces = { "*/*" }, headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } @@ -101,6 +103,7 @@ public interface VersioningApi { } + public static final String PATH_VERSIONING_QUERY_PARAMS = "/versioning/query-params"; /** * POST /versioning/query-params * @@ -121,7 +124,7 @@ public interface VersioningApi { }) @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 5b7e007de81..8a992a88aef 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 @@ -32,6 +32,7 @@ public interface AnotherFakeApi { 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 @@ -51,7 +52,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/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 cbf4c409161..5e116d0b070 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 @@ -42,6 +42,7 @@ public interface FakeApi { 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 @@ -60,7 +61,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" } ) @@ -72,6 +73,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -91,7 +93,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) @@ -103,6 +105,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) @@ -143,6 +146,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -162,7 +166,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) @@ -174,6 +178,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) @@ -205,6 +210,7 @@ public interface FakeApi { } + 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`. @@ -223,7 +229,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -235,6 +241,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -253,7 +260,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -266,6 +273,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -285,7 +293,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -307,6 +315,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -343,7 +352,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -368,6 +377,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -395,7 +405,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -414,6 +424,7 @@ public interface FakeApi { } + 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) @@ -437,7 +448,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -453,6 +464,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -470,7 +482,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -482,6 +494,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -500,7 +513,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -513,6 +526,7 @@ public interface FakeApi { } + 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 @@ -535,7 +549,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -550,6 +564,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -576,7 +591,7 @@ public interface FakeApi { }) @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 23eb03166a8..b3f729b4d99 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 @@ -32,6 +32,7 @@ public interface FakeClassnameTestApi { 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 @@ -54,7 +55,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/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 e39c781d4f9..4775e33b6cf 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 @@ -35,6 +35,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -110,6 +112,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -165,6 +168,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -224,6 +228,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -276,6 +281,7 @@ public interface PetApi { } + public static final String PATH_LIST_ALL_PETS = "/pet/all"; /** * GET /pet/all : List all pets * @@ -302,7 +308,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/all", + value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) @@ -328,6 +334,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -357,7 +364,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -369,6 +376,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -394,7 +402,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -408,6 +416,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -434,7 +443,7 @@ public interface PetApi { }) @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 117dabd655f..b7a394a3d50 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 @@ -33,6 +33,7 @@ public interface StoreApi { 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 @@ -53,7 +54,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -64,6 +65,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -167,7 +171,7 @@ public interface StoreApi { }) @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 d9b7b1fdb00..6b5ade2db4c 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 @@ -33,6 +33,7 @@ public interface UserApi { 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. @@ -51,7 +52,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) default ResponseEntity createUser( @@ -62,6 +63,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) default ResponseEntity createUsersWithArrayInput( @@ -90,6 +92,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -107,7 +110,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) default ResponseEntity createUsersWithListInput( @@ -118,6 +121,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -138,7 +142,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -149,6 +153,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -171,7 +176,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -197,6 +202,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -218,7 +224,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -231,6 +237,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -247,7 +254,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -258,6 +265,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @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 82ba1aa4c1b..fc2ae556561 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 @@ -32,6 +32,7 @@ public interface VersioningApi { return Optional.empty(); } + public static final String PATH_VERSIONING_HEADERS = "/versioning/headers"; /** * POST /versioning/headers * @@ -52,7 +53,7 @@ public interface VersioningApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/headers", + value = VersioningApi.PATH_VERSIONING_HEADERS, produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) @@ -76,6 +77,7 @@ public interface VersioningApi { } + public static final String PATH_VERSIONING_MIX = "/versioning/mix"; /** * POST /versioning/mix * @@ -98,7 +100,7 @@ public interface VersioningApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/mix", + value = VersioningApi.PATH_VERSIONING_MIX, produces = { "*/*" }, headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } @@ -125,6 +127,7 @@ public interface VersioningApi { } + public static final String PATH_VERSIONING_QUERY_PARAMS = "/versioning/query-params"; /** * POST /versioning/query-params * @@ -145,7 +148,7 @@ public interface VersioningApi { }) @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 5b7e007de81..8a992a88aef 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 @@ -32,6 +32,7 @@ public interface AnotherFakeApi { 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 @@ -51,7 +52,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/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 cbf4c409161..5e116d0b070 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 @@ -42,6 +42,7 @@ public interface FakeApi { 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 @@ -60,7 +61,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" } ) @@ -72,6 +73,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -91,7 +93,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) @@ -103,6 +105,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) @@ -143,6 +146,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -162,7 +166,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) @@ -174,6 +178,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) @@ -205,6 +210,7 @@ public interface FakeApi { } + 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`. @@ -223,7 +229,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -235,6 +241,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -253,7 +260,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -266,6 +273,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -285,7 +293,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -307,6 +315,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -343,7 +352,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -368,6 +377,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -395,7 +405,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -414,6 +424,7 @@ public interface FakeApi { } + 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) @@ -437,7 +448,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -453,6 +464,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -470,7 +482,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -482,6 +494,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -500,7 +513,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -513,6 +526,7 @@ public interface FakeApi { } + 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 @@ -535,7 +549,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -550,6 +564,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -576,7 +591,7 @@ public interface FakeApi { }) @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 23eb03166a8..b3f729b4d99 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 @@ -32,6 +32,7 @@ public interface FakeClassnameTestApi { 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 @@ -54,7 +55,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/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 e39c781d4f9..4775e33b6cf 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 @@ -35,6 +35,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -98,7 +100,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -110,6 +112,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -165,6 +168,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -224,6 +228,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -276,6 +281,7 @@ public interface PetApi { } + public static final String PATH_LIST_ALL_PETS = "/pet/all"; /** * GET /pet/all : List all pets * @@ -302,7 +308,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/all", + value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) @@ -328,6 +334,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -357,7 +364,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -369,6 +376,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -394,7 +402,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -408,6 +416,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -434,7 +443,7 @@ public interface PetApi { }) @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 117dabd655f..b7a394a3d50 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 @@ -33,6 +33,7 @@ public interface StoreApi { 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 @@ -53,7 +54,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -64,6 +65,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -167,7 +171,7 @@ public interface StoreApi { }) @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 d9b7b1fdb00..6b5ade2db4c 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 @@ -33,6 +33,7 @@ public interface UserApi { 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. @@ -51,7 +52,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = UserApi.PATH_CREATE_USER ) default ResponseEntity createUser( @@ -62,6 +63,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT ) default ResponseEntity createUsersWithArrayInput( @@ -90,6 +92,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -107,7 +110,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT ) default ResponseEntity createUsersWithListInput( @@ -118,6 +121,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -138,7 +142,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -149,6 +153,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -171,7 +176,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -197,6 +202,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -218,7 +224,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -231,6 +237,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -247,7 +254,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -258,6 +265,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @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 e8cd0aa09ad..2b2c6f1c767 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 @@ -32,6 +32,7 @@ public interface VersioningApi { return Optional.empty(); } + public static final String PATH_VERSIONING_HEADERS = "/versioning/headers"; /** * POST /versioning/headers * @@ -54,7 +55,7 @@ public interface VersioningApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/headers", + value = VersioningApi.PATH_VERSIONING_HEADERS, produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) @@ -76,6 +77,7 @@ public interface VersioningApi { } + public static final String PATH_VERSIONING_MIX = "/versioning/mix"; /** * POST /versioning/mix * @@ -100,7 +102,7 @@ public interface VersioningApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/versioning/mix", + value = VersioningApi.PATH_VERSIONING_MIX, produces = { "*/*" }, headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } @@ -125,6 +127,7 @@ public interface VersioningApi { } + public static final String PATH_VERSIONING_QUERY_PARAMS = "/versioning/query-params"; /** * POST /versioning/query-params * @@ -145,7 +148,7 @@ public interface VersioningApi { }) @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 2c296e43d72..cbce5472533 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 @@ -48,6 +48,7 @@ public interface UserApi { return Optional.empty(); } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -69,7 +70,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/json" } ) @@ -87,6 +88,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -102,7 +104,7 @@ public interface UserApi { ) @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 1051bee1c37..6a70bda9a0f 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 @@ -32,6 +32,7 @@ public interface AnotherFakeApi { 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 @@ -51,7 +52,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/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 40b98fb6bc4..d65628be0af 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 @@ -44,6 +44,7 @@ public interface FakeApi { 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 @@ -62,7 +63,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" } ) @@ -74,6 +75,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -106,6 +108,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -147,6 +150,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -166,7 +170,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -179,6 +183,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -198,7 +203,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -211,6 +216,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -229,7 +235,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -250,6 +256,7 @@ public interface FakeApi { } + 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`. @@ -268,7 +275,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -280,6 +287,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -298,7 +306,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -311,6 +319,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -330,7 +339,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -352,6 +361,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -388,7 +398,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -413,6 +423,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -440,7 +451,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -459,6 +470,7 @@ public interface FakeApi { } + 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) @@ -482,7 +494,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -498,6 +510,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -516,7 +529,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -528,6 +541,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -547,7 +561,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -560,6 +574,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -578,7 +593,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -590,6 +605,7 @@ public interface FakeApi { } + 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 @@ -611,7 +627,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -625,6 +641,7 @@ public interface FakeApi { } + 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. @@ -643,7 +660,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -664,6 +681,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -691,7 +709,7 @@ public interface FakeApi { }) @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 8d3ff3ea956..d560ba0b964 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 @@ -32,6 +32,7 @@ public interface FakeClassnameTestApi { 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 @@ -54,7 +55,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/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 4374f8f5a95..ce86cce4bc1 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 @@ -34,6 +34,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -99,7 +101,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -111,6 +113,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -165,6 +168,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -221,6 +225,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -273,6 +278,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -303,7 +309,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -315,6 +321,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -355,6 +362,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -382,7 +390,7 @@ public interface PetApi { }) @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 86c90b02904..c0f6736fb4a 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 @@ -33,6 +33,7 @@ public interface StoreApi { 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 @@ -53,7 +54,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -64,6 +65,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -168,7 +172,7 @@ public interface StoreApi { }) @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 c59ba9f03c7..4a975e2f93a 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 @@ -33,6 +33,7 @@ public interface UserApi { 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. @@ -51,7 +52,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -63,6 +64,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -93,6 +95,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -123,6 +126,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -154,6 +158,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -177,7 +182,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -203,6 +208,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -225,7 +231,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -238,6 +244,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -255,7 +262,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -266,6 +273,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -287,7 +295,7 @@ public interface UserApi { }) @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 0ca4be70761..55edb177c80 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 @@ -46,6 +46,7 @@ public interface AnotherFakeApi { 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 @@ -67,7 +68,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/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 2389f983190..4d2a73f3651 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 @@ -58,6 +58,7 @@ public interface FakeApi { 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 @@ -77,7 +78,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" } ) @@ -89,6 +90,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; /** * POST /fake/outer/boolean * Test serialization of outer boolean types @@ -109,7 +111,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -122,6 +124,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; /** * POST /fake/outer/composite * Test serialization of object with outer number type @@ -142,7 +145,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -164,6 +167,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -184,7 +188,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -197,6 +201,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -217,7 +222,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -230,6 +235,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -248,7 +254,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -269,6 +275,7 @@ public interface FakeApi { } + 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`. @@ -287,7 +294,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -299,6 +306,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -316,7 +324,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -329,6 +337,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -350,7 +359,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -372,6 +381,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -409,7 +419,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -434,6 +444,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -462,7 +473,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -481,6 +492,7 @@ public interface FakeApi { } + 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) @@ -505,7 +517,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -521,6 +533,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -540,7 +553,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -552,6 +565,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -572,7 +586,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -585,6 +599,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -604,7 +619,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -616,6 +631,7 @@ public interface FakeApi { } + 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 @@ -637,7 +653,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -651,6 +667,7 @@ public interface FakeApi { } + 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. @@ -670,7 +687,7 @@ public interface FakeApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -691,6 +708,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -717,7 +735,7 @@ public interface FakeApi { ) @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 b59d82fe57d..64373990205 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 @@ -46,6 +46,7 @@ public interface FakeClassnameTestApi { 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 @@ -70,7 +71,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/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 7d28815f34f..cdb42cbbd15 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 @@ -48,6 +48,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -72,7 +73,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -84,6 +85,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -109,7 +111,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -121,6 +123,7 @@ public interface PetApi { } + 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 @@ -148,7 +151,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -174,6 +177,7 @@ public interface PetApi { } + 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. @@ -204,7 +208,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -230,6 +234,7 @@ public interface PetApi { } + public static final String PATH_GET_PET_BY_ID = "/pet/{petId}"; /** * GET /pet/{petId} : Find pet by ID * Returns a single pet @@ -259,7 +264,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -285,6 +290,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -313,7 +319,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -325,6 +331,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; /** * POST /pet/{petId} : Updates a pet in the store with form data * @@ -349,7 +356,7 @@ public interface PetApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -363,6 +370,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -389,7 +397,7 @@ public interface PetApi { ) @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 7b0aedc0904..17c3e6bbebc 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 @@ -47,6 +47,7 @@ public interface StoreApi { 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 @@ -68,7 +69,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -79,6 +80,7 @@ public interface StoreApi { } + 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 @@ -102,7 +104,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -114,6 +116,7 @@ public interface StoreApi { } + 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 @@ -140,7 +143,7 @@ public interface StoreApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -166,6 +169,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -190,7 +194,7 @@ public interface StoreApi { ) @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 bc54f8da44c..8c3e79e3ebb 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 @@ -47,6 +47,7 @@ public interface UserApi { 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. @@ -66,7 +67,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -78,6 +79,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -109,6 +111,7 @@ public interface UserApi { } + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; /** * POST /user/createWithList : Creates list of users with given input array * @@ -128,7 +131,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -140,6 +143,7 @@ public interface UserApi { } + public static final String PATH_DELETE_USER = "/user/{username}"; /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. @@ -161,7 +165,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -172,6 +176,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -198,7 +203,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -224,6 +229,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -249,7 +255,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -262,6 +268,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -280,7 +287,7 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -291,6 +298,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -313,7 +321,7 @@ public interface UserApi { ) @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 2a22a80302c..919859470e0 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 @@ -32,6 +32,7 @@ public interface AnotherFakeApi { 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 @@ -51,7 +52,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/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 82df5097213..7bf6669673d 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 @@ -44,6 +44,7 @@ public interface FakeApi { 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 @@ -62,7 +63,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" } ) @@ -74,6 +75,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/boolean", + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -106,6 +108,7 @@ public interface FakeApi { } + 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 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/composite", + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -147,6 +150,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; /** * POST /fake/outer/number * Test serialization of outer number types @@ -166,7 +170,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/number", + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -179,6 +183,7 @@ public interface FakeApi { } + public static final String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; /** * POST /fake/outer/string * Test serialization of outer string types @@ -198,7 +203,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/outer/string", + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" }, consumes = { "application/json" } ) @@ -211,6 +216,7 @@ public interface FakeApi { } + public static final String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names"; /** * GET /fake/{petId}/response-object-different-names * @@ -229,7 +235,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/{petId}/response-object-different-names", + value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) @@ -250,6 +256,7 @@ public interface FakeApi { } + 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`. @@ -268,7 +275,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, consumes = { "application/json" } ) @@ -280,6 +287,7 @@ public interface FakeApi { } + public static final String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; /** * PUT /fake/body-with-query-params * @@ -298,7 +306,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/body-with-query-params", + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, consumes = { "application/json" } ) @@ -311,6 +319,7 @@ public interface FakeApi { } + public static final String PATH_TEST_CLIENT_MODEL = "/fake"; /** * PATCH /fake : To test \"client\" model * To test \"client\" model @@ -330,7 +339,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PATCH, - value = "/fake", + value = FakeApi.PATH_TEST_CLIENT_MODEL, produces = { "application/json" }, consumes = { "application/json" } ) @@ -352,6 +361,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; /** * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -388,7 +398,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake", + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -413,6 +423,7 @@ public interface FakeApi { } + public static final String PATH_TEST_ENUM_PARAMETERS = "/fake"; /** * GET /fake : To test enum parameters * To test enum parameters @@ -440,7 +451,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake", + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, consumes = { "application/x-www-form-urlencoded" } ) @@ -459,6 +470,7 @@ public interface FakeApi { } + 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) @@ -482,7 +494,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/fake" + value = FakeApi.PATH_TEST_GROUP_PARAMETERS ) default ResponseEntity testGroupParameters( @@ -498,6 +510,7 @@ public interface FakeApi { } + public static final String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; /** * POST /fake/inline-additionalProperties : test inline additionalProperties * @@ -516,7 +529,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) @@ -528,6 +541,7 @@ public interface FakeApi { } + public static final String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; /** * GET /fake/jsonFormData : test json serialization of form data * @@ -547,7 +561,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/jsonFormData", + value = FakeApi.PATH_TEST_JSON_FORM_DATA, consumes = { "application/x-www-form-urlencoded" } ) @@ -560,6 +574,7 @@ public interface FakeApi { } + public static final String PATH_TEST_NULLABLE = "/fake/nullable"; /** * POST /fake/nullable : test nullable parent property * @@ -578,7 +593,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/fake/nullable", + value = FakeApi.PATH_TEST_NULLABLE, consumes = { "application/json" } ) @@ -590,6 +605,7 @@ public interface FakeApi { } + 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 @@ -611,7 +627,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/fake/test-query-parameters" + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT ) default ResponseEntity testQueryParameterCollectionFormat( @@ -625,6 +641,7 @@ public interface FakeApi { } + 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. @@ -643,7 +660,7 @@ public interface FakeApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/fake/response-with-example", + value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) @@ -664,6 +681,7 @@ public interface FakeApi { } + public static final String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) * @@ -691,7 +709,7 @@ public interface FakeApi { }) @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 8d1d4652a52..06f526c3fef 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 @@ -32,6 +32,7 @@ public interface FakeClassnameTestApi { 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 @@ -54,7 +55,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/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 28120e525ec..ee9d5170fa4 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 @@ -34,6 +34,7 @@ public interface PetApi { return Optional.empty(); } + public static final String PATH_ADD_PET = "/pet"; /** * POST /pet : Add a new pet to the store * @@ -60,7 +61,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet", + value = PetApi.PATH_ADD_PET, consumes = { "application/json", "application/xml" } ) @@ -72,6 +73,7 @@ public interface PetApi { } + public static final String PATH_DELETE_PET = "/pet/{petId}"; /** * DELETE /pet/{petId} : Deletes a pet * @@ -99,7 +101,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/pet/{petId}" + value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( @@ -111,6 +113,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByStatus", + value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) @@ -165,6 +168,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/findByTags", + value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) @@ -221,6 +225,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/pet/{petId}", + value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) @@ -273,6 +278,7 @@ public interface PetApi { } + public static final String PATH_UPDATE_PET = "/pet"; /** * PUT /pet : Update an existing pet * @@ -303,7 +309,7 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/pet", + value = PetApi.PATH_UPDATE_PET, consumes = { "application/json", "application/xml" } ) @@ -315,6 +321,7 @@ public interface PetApi { } + 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 @@ public interface PetApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/pet/{petId}", + value = PetApi.PATH_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) @@ -355,6 +362,7 @@ public interface PetApi { } + public static final String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; /** * POST /pet/{petId}/uploadImage : uploads an image * @@ -382,7 +390,7 @@ public interface PetApi { }) @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 770c7e8f1ba..c4ce379b34f 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 @@ -33,6 +33,7 @@ public interface StoreApi { 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 @@ -53,7 +54,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/store/order/{order_id}" + value = StoreApi.PATH_DELETE_ORDER ) default ResponseEntity deleteOrder( @@ -64,6 +65,7 @@ public interface StoreApi { } + 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 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/inventory", + value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) @@ -98,6 +100,7 @@ public interface StoreApi { } + 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 @@ -121,7 +124,7 @@ public interface StoreApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/store/order/{order_id}", + value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) @@ -147,6 +150,7 @@ public interface StoreApi { } + public static final String PATH_PLACE_ORDER = "/store/order"; /** * POST /store/order : Place an order for a pet * @@ -168,7 +172,7 @@ public interface StoreApi { }) @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 d015c889e25..e88aa19fcf3 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 @@ -33,6 +33,7 @@ public interface UserApi { 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. @@ -51,7 +52,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user", + value = UserApi.PATH_CREATE_USER, consumes = { "application/json" } ) @@ -63,6 +64,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray", + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, consumes = { "application/json" } ) @@ -93,6 +95,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList", + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, consumes = { "application/json" } ) @@ -123,6 +126,7 @@ public interface UserApi { } + 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 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.DELETE, - value = "/user/{username}" + value = UserApi.PATH_DELETE_USER ) default ResponseEntity deleteUser( @@ -154,6 +158,7 @@ public interface UserApi { } + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; /** * GET /user/{username} : Get user by user name * @@ -177,7 +182,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/{username}", + value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) @@ -203,6 +208,7 @@ public interface UserApi { } + public static final String PATH_LOGIN_USER = "/user/login"; /** * GET /user/login : Logs user into the system * @@ -225,7 +231,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/login", + value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) @@ -238,6 +244,7 @@ public interface UserApi { } + public static final String PATH_LOGOUT_USER = "/user/logout"; /** * GET /user/logout : Logs out current logged in user session * @@ -255,7 +262,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.GET, - value = "/user/logout" + value = UserApi.PATH_LOGOUT_USER ) default ResponseEntity logoutUser( @@ -266,6 +273,7 @@ public interface UserApi { } + public static final String PATH_UPDATE_USER = "/user/{username}"; /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. @@ -287,7 +295,7 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}", + value = UserApi.PATH_UPDATE_USER, consumes = { "application/json" } )