From 7f25af0cdbbb017ccab94ee529f7fc4409584f25 Mon Sep 17 00:00:00 2001 From: Kathrin Geilmann <16289455+kgeilmann@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:18:57 +0100 Subject: [PATCH 01/11] Simplify test setup by using already available methods to configure and instantiate the generator. This fixes the different behavior between Test and CLI seen in https://github.com/OpenAPITools/openapi-generator/pull/17273#issuecomment-1859249543 --- .../java/spring/SpringCodegenTest.java | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) 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 0645b61eafb5..03ed08441027 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 @@ -4476,30 +4476,9 @@ public void multiLineTagDescription() throws IOException { @Test public void testSSEOperationSupport() throws Exception { - - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/sse.yaml"); - final SpringCodegen codegen = new SpringCodegen(); - codegen.setOpenAPI(openAPI); - codegen.setOutputDir(output.getAbsolutePath()); - - codegen.additionalProperties().put(SSE, "true"); - codegen.additionalProperties().put(REACTIVE, "true"); - codegen.additionalProperties().put(INTERFACE_ONLY, "false"); - codegen.additionalProperties().put(DELEGATE_PATTERN, "true"); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGenerateMetadata(false); - - Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + Map additionalProperties = Map.of(SSE, true, REACTIVE, "true", INTERFACE_ONLY, "false", + DELEGATE_PATTERN, "true"); + Map files = generateFromContract("src/test/resources/3_0/sse.yaml", "spring-boot", additionalProperties); MapAssert.assertThatMap(files).isNotEmpty(); File api = files.get("PathApi.java"); From baf0175bb01f386216c5df8152e4bb34feb36ac4 Mon Sep 17 00:00:00 2001 From: Kathrin Geilmann <16289455+kgeilmann@users.noreply.github.com> Date: Tue, 11 Feb 2025 00:20:34 +0100 Subject: [PATCH 02/11] Added more test cases for generating server sent event endpoints. The ones failing or crashing the generator are ignored for the moment. --- .../java/spring/SpringCodegenTest.java | 149 +++++++++++++---- .../src/test/resources/3_0/sse.yaml | 152 +++++++++++++++--- .../3_0/sse_but_incompatible_item_types.yaml | 40 +++++ .../resources/3_0/sse_but_missing_format.yaml | 23 +++ .../3_0/sse_but_multiple_media_types.yaml | 28 ++++ 5 files changed, 342 insertions(+), 50 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/sse_but_incompatible_item_types.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/sse_but_missing_format.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/sse_but_multiple_media_types.yaml 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 03ed08441027..accc4f792096 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 @@ -58,6 +58,7 @@ import static java.util.stream.Collectors.groupingBy; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.openapitools.codegen.TestUtils.*; import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_BUILDERS; import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS; @@ -4476,8 +4477,12 @@ public void multiLineTagDescription() throws IOException { @Test public void testSSEOperationSupport() throws Exception { - Map additionalProperties = Map.of(SSE, true, REACTIVE, "true", INTERFACE_ONLY, "false", - DELEGATE_PATTERN, "true"); + Map additionalProperties = Map.of( + SSE, true, + REACTIVE, "true", + INTERFACE_ONLY, "false", + DELEGATE_PATTERN, "true" + ); Map files = generateFromContract("src/test/resources/3_0/sse.yaml", "spring-boot", additionalProperties); MapAssert.assertThatMap(files).isNotEmpty(); @@ -4485,37 +4490,127 @@ public void testSSEOperationSupport() throws Exception { File delegate = files.get("PathApiDelegate.java"); JavaFileAssert.assertThat(api) - .assertMethod("sseVariant1", "ServerWebExchange") - .isNotNull() - .hasReturnType("Flux") - .toFileAssert() - .assertMethod("sseVariant2", "ServerWebExchange") - .isNotNull() - .hasReturnType("Flux") - .toFileAssert() - .assertMethod("nonSSE", "ServerWebExchange") - .isNotNull() - .hasReturnType("Mono>"); + .assertMethod("sse1", "ServerWebExchange") + .hasReturnType("Flux") + .toFileAssert() + .assertMethod("sse2", "ServerWebExchange") + .hasReturnType("Flux") + .toFileAssert() + // FIXME: Generator Crash + // .assertMethod("sse3", "ServerWebExchange") + // .hasReturnType("Flux") + // .toFileAssert() + .assertMethod("sse4", "ServerWebExchange") + .hasReturnType("Flux") + .toFileAssert() + // FIXME: Generator Crash, see #17271 + // .assertMethod("sse5", "ServerWebExchange") + // .hasReturnType("Flux") + // .toFileAssert() + + // FIXME: Generator Crash + // .assertMethod("notSse1", "ServerWebExchange") + // .hasReturnType("Mono>") + // .toFileAssert() + // FIXME: Generator Crash + // .assertMethod("notSse2", "ServerWebExchange") + // .hasReturnType("Mono>>") + // .toFileAssert() + .assertMethod("notSse3", "ServerWebExchange") + .hasReturnType("Mono>") + .toFileAssert() + .assertMethod("notSse5", "ServerWebExchange") + .hasReturnType("Mono>") + .toFileAssert() + .assertMethod("notSse7", "ServerWebExchange") + .hasReturnType("Mono>") + .toFileAssert() + // FIXME: Generator Crash + // .assertMethod("notSse8", "ServerWebExchange") + // .hasReturnType("Mono>") + ; JavaFileAssert.assertThat(delegate) - .assertMethod("sseVariant1", "ServerWebExchange") - .isNotNull() - .hasReturnType("Flux") - .bodyContainsLines("return Flux.empty();") - .toFileAssert() - .assertMethod("sseVariant2", "ServerWebExchange") - .isNotNull() - .hasReturnType("Flux") - .bodyContainsLines("return Flux.empty();") - .toFileAssert() - .assertMethod("nonSSE", "ServerWebExchange") - .isNotNull() - .hasReturnType("Mono>") - .bodyContainsLines("return result.then(Mono.empty());") + .assertMethod("sse1", "ServerWebExchange") + .hasReturnType("Flux") + .bodyContainsLines("return Flux.empty();") + .toFileAssert() + .assertMethod("sse2", "ServerWebExchange") + .hasReturnType("Flux") + .bodyContainsLines("return Flux.empty();") + .toFileAssert() + // FIXME: Generator Crash + // .assertMethod("sse3", "ServerWebExchange") + // .hasReturnType("Flux") + // .bodyContainsLines("return Flux.empty();") + // .toFileAssert() + .assertMethod("sse4", "ServerWebExchange") + .hasReturnType("Flux") + .bodyContainsLines("return Flux.empty();") + .toFileAssert() + // FIXME: Generator Crash + // .assertMethod("sse5", "ServerWebExchange") + // .hasReturnType("Flux") + // .bodyContainsLines("return Flux.empty();") + // .toFileAssert() + + // FIXME: Generator Crash + // .assertMethod("notSse1", "ServerWebExchange") + // .hasReturnType("Mono>") + // .bodyContainsLines("return result.then(Mono.empty());") + // .toFileAssert() + // FIXME: Generator Crash + // .assertMethod("notSse2", "ServerWebExchange") + // .hasReturnType("Mono>>") + // .bodyContainsLines("return result.then(Mono.empty());") + // .toFileAssert() + .assertMethod("notSse3", "ServerWebExchange") + .hasReturnType("Mono>") + .bodyContainsLines("return result.then(Mono.empty());") + .toFileAssert() + .assertMethod("notSse5", "ServerWebExchange") + .hasReturnType("Mono>") + .bodyContainsLines("return result.then(Mono.empty());") + .toFileAssert() + .assertMethod("notSse7", "ServerWebExchange") + .hasReturnType("Mono>") + .bodyContainsLines("return result.then(Mono.empty());") + .toFileAssert() + // FIXME: Generator Crash + // .assertMethod("notSse8", "ServerWebExchange") + // .hasReturnType("Mono>") + // .bodyContainsLines("return result.then(Mono.empty());") ; } + @DataProvider(name = "invalid sse endpoints") + public static Object[][] specsWithInvalidSSEEndpoints() { + return new Object[][] { + {"sse_but_missing_format.yaml", "schema format 'event-stream' is required, when SSE is detected"}, + // FIXME: spec does not generate correct code, but not detected + // {"sse_but_multiple_media_types.yaml", "only 1 response media type supported, when SSE is detected"}, + {"sse_but_incompatible_item_types.yaml", "only single item type is supported, when SSE is detected"} + }; + } + + @Test(dataProvider = "invalid sse endpoints") + public void testSSEOperationSupport_forInvalidSSEEndpointSpecs(String inputSpec, String expectedError) { + // checks the design decision, that if the specs looks like it should be an SSE endpoint but it is not + // matching the required format, an exception is thrown containing a descriptive error message + Map additionalProperties = Map.of( + SSE, true, + REACTIVE, "true", + INTERFACE_ONLY, "false", + DELEGATE_PATTERN, "true" + ); + String input = "src/test/resources/3_0/" + inputSpec; + assertThatThrownBy(() -> generateFromContract(input, "spring-boot", additionalProperties)) + .rootCause() + .isInstanceOf(RuntimeException.class) + .hasMessage(expectedError); + } + @Test public void givenMultipartForm_whenGenerateReactiveServer_thenParameterAreCreatedAsRequestPart() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); diff --git a/modules/openapi-generator/src/test/resources/3_0/sse.yaml b/modules/openapi-generator/src/test/resources/3_0/sse.yaml index cdc613b2a4ed..7601ed1960d2 100644 --- a/modules/openapi-generator/src/test/resources/3_0/sse.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/sse.yaml @@ -4,18 +4,16 @@ info: description: SSE test cases version: 1.0.0 servers: - - url: 'https' + - url: 'https://' tags: - name: sse paths: - /path/variant1: - post: - operationId: sseVariant1 - tags: - - sse + /path/sse/1: + get: + operationId: sse_1 responses: - '200': - description: acknowledged + "200": + description: easiest case content: text/event-stream: schema: @@ -23,34 +21,109 @@ paths: format: event-stream items: type: string - /path/variant2: - post: - operationId: sseVariant2 - tags: - - sse + /path/sse/2: + get: + operationId: sse_2 responses: - '200': - description: acknowledged + "200": + description: using reference for array items content: text/event-stream: schema: type: array format: event-stream items: - $ref: '#/components/schemas/EventType' - /path/variant3: - post: - operationId: nonSSE - tags: - - sse + $ref: "#/components/schemas/EventType" + # FIXME: Generator Crash + # /path/sse/3: + # get: + # operationId: sse_3 + # responses: + # "200": + # description: using reference for schema + # content: + # text/event-stream: + # schema: + # $ref: "#/components/schemas/EventTypeStream" + /path/sse/4: + get: + operationId: sse_4 + responses: + "200": + $ref: "#/components/responses/EventTypeResponse" + # FIXME: generator crash + # /path/sse/5: + # post: + # operationId: sse_5 + # description: indirect references, see Issue 17271 + # responses: + # '200': + # $ref: '#/components/responses/EventTypeResponseWithReference' + + # FIXME: generator crash + # /path/notsse/1: + # get: + # operationId: not_sse_1 + # responses: + # '200': + # description: no schema defined, but this is a valid OpenAPI Specification + # FIXME: generator crash + # /path/notsse/2: + # get: + # operationId: not_sse_2 + # responses: + # '200': + # description: wrong media type + # content: + # application/json: + # schema: + # type: array + # format: event-stream + # items: + # type: string + /path/notsse/3: + get: + operationId: not_sse_3 responses: '200': - description: acknowledged + description: schema not of type array content: text/event-stream: schema: type: string format: event-stream + /path/notsse/5: + get: + operationId: not_sse_5 + responses: + '400': + description: sse only intended for success status codes not for errors + content: + text/event-stream: + schema: + type: array + format: event-stream + items: + type: string + /path/notsse/7: + get: + operationId: not_sse_7 + description: referenced response object does not match + responses: + '200': + $ref: "#/components/responses/NotAStreamResponse" +# FIXME: Generator Crashed +# /path/notsse/8: +# get: +# operationId: not_sse_8 +# responses: +# "200": +# description: referenced schema does not match +# content: +# text/event-stream: +# schema: +# $ref: "#/components/schemas/NotAStreamType" + components: schemas: EventType: @@ -58,5 +131,38 @@ components: properties: attribute1: type: string + EventTypeStream: + type: array + format: event-stream + items: + type: string + NotAStreamType: + type: string + format: event-stream + + + responses: + EventTypeResponse: + description: response + content: + text/event-stream: + schema: + type: array + format: event-stream + items: + type: string + + EventTypeResponseWithReference: + description: acknowledged + content: + text/event-stream: + schema: + $ref: '#/components/schemas/EventTypeStream' - + NotAStreamResponse: + description: response + content: + text/event-stream: + schema: + type: string + format: event-stream diff --git a/modules/openapi-generator/src/test/resources/3_0/sse_but_incompatible_item_types.yaml b/modules/openapi-generator/src/test/resources/3_0/sse_but_incompatible_item_types.yaml new file mode 100644 index 000000000000..96035dbda069 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/sse_but_incompatible_item_types.yaml @@ -0,0 +1,40 @@ +openapi: 3.0.1 +info: + title: SSE test + description: SSE test cases + version: 1.0.0 +servers: + - url: 'https://' +tags: + - name: sse +paths: + /path/sse: + get: + operationId: sse + responses: + '200': + description: multiple different success results, all sse but with different item types + content: + text/event-stream: + schema: + type: array + format: event-stream + items: + type: string + '201': + description: multiple different success results, all sse but with different item types + content: + text/event-stream: + schema: + type: array + format: event-stream + items: + $ref: "#/components/schemas/EventType" + +components: + schemas: + EventType: + type: object + properties: + attribute1: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/sse_but_missing_format.yaml b/modules/openapi-generator/src/test/resources/3_0/sse_but_missing_format.yaml new file mode 100644 index 000000000000..514584032e64 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/sse_but_missing_format.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.1 +info: + title: SSE test + description: SSE test cases + version: 1.0.0 +servers: + - url: 'https://' +tags: + - name: sse +paths: + # Generator assumes that it is supposed to be an sse endpoint, but the format value is wrong, thus it throws an exception with an error message telling so + /path/sse: + get: + operationId: sse + responses: + '200': + description: format not event-stream + content: + text/event-stream: + schema: + type: array + items: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/sse_but_multiple_media_types.yaml b/modules/openapi-generator/src/test/resources/3_0/sse_but_multiple_media_types.yaml new file mode 100644 index 000000000000..f95e7adf20c9 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/sse_but_multiple_media_types.yaml @@ -0,0 +1,28 @@ +openapi: 3.0.1 +info: + title: SSE test + description: SSE test cases + version: 1.0.0 +servers: + - url: 'https://' +tags: + - name: sse +paths: + # Generator detects this as SSE, which is ok in the first place, but it cannot generate correct code for this case, thus it should throw an exception with an error message, like for notSse4 + # Code looks like this is tried but fails in this case + /path/sse: + get: + operationId: sse + responses: + '200': + description: multiple media types defined + content: + application/json: + schema: + type: string + text/event-stream: + schema: + type: array + format: event-stream + items: + type: string From 4ca8a393688cb4cc4721b0095c83694a4661ef27 Mon Sep 17 00:00:00 2001 From: Kathrin Geilmann <16289455+kgeilmann@users.noreply.github.com> Date: Tue, 11 Feb 2025 01:51:28 +0100 Subject: [PATCH 03/11] Fixing NPEs when schemas are referenced and not directly included in the specification of a sse endpoint. Fixes #17271 --- .../codegen/languages/SpringCodegen.java | 2 + .../java/spring/SpringCodegenTest.java | 32 ++++++------ .../src/test/resources/3_0/sse.yaml | 49 ++++++++++--------- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 9a613c3bb67b..f2c489c369d0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -70,6 +70,7 @@ import org.openapitools.codegen.templating.mustache.SplitStringLambda; import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda; import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda; +import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; @@ -1044,6 +1045,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation .filter(p -> p.getRight().is2xx) // consider only success .map(p -> p.getLeft().getContent().get(MEDIA_EVENT_STREAM)) .map(MediaType::getSchema) + .map(s -> ModelUtils.unaliasSchema(openAPI, s)) .collect(Collectors.toList()).stream() .collect(Collectors.groupingBy(Schema::getType)); if(schemaTypes.containsKey("array")) { 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 accc4f792096..cf14883b1c02 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 @@ -4496,17 +4496,15 @@ public void testSSEOperationSupport() throws Exception { .assertMethod("sse2", "ServerWebExchange") .hasReturnType("Flux") .toFileAssert() - // FIXME: Generator Crash - // .assertMethod("sse3", "ServerWebExchange") - // .hasReturnType("Flux") - // .toFileAssert() + .assertMethod("sse3", "ServerWebExchange") + .hasReturnType("Flux") + .toFileAssert() .assertMethod("sse4", "ServerWebExchange") .hasReturnType("Flux") .toFileAssert() - // FIXME: Generator Crash, see #17271 - // .assertMethod("sse5", "ServerWebExchange") - // .hasReturnType("Flux") - // .toFileAssert() + .assertMethod("sse5", "ServerWebExchange") + .hasReturnType("Flux") + .toFileAssert() // FIXME: Generator Crash // .assertMethod("notSse1", "ServerWebExchange") @@ -4539,20 +4537,18 @@ public void testSSEOperationSupport() throws Exception { .hasReturnType("Flux") .bodyContainsLines("return Flux.empty();") .toFileAssert() - // FIXME: Generator Crash - // .assertMethod("sse3", "ServerWebExchange") - // .hasReturnType("Flux") - // .bodyContainsLines("return Flux.empty();") - // .toFileAssert() + .assertMethod("sse3", "ServerWebExchange") + .hasReturnType("Flux") + .bodyContainsLines("return Flux.empty();") + .toFileAssert() .assertMethod("sse4", "ServerWebExchange") .hasReturnType("Flux") .bodyContainsLines("return Flux.empty();") .toFileAssert() - // FIXME: Generator Crash - // .assertMethod("sse5", "ServerWebExchange") - // .hasReturnType("Flux") - // .bodyContainsLines("return Flux.empty();") - // .toFileAssert() + .assertMethod("sse5", "ServerWebExchange") + .hasReturnType("Flux") + .bodyContainsLines("return Flux.empty();") + .toFileAssert() // FIXME: Generator Crash // .assertMethod("notSse1", "ServerWebExchange") diff --git a/modules/openapi-generator/src/test/resources/3_0/sse.yaml b/modules/openapi-generator/src/test/resources/3_0/sse.yaml index 7601ed1960d2..2e942d29d1b3 100644 --- a/modules/openapi-generator/src/test/resources/3_0/sse.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/sse.yaml @@ -34,31 +34,29 @@ paths: format: event-stream items: $ref: "#/components/schemas/EventType" - # FIXME: Generator Crash - # /path/sse/3: - # get: - # operationId: sse_3 - # responses: - # "200": - # description: using reference for schema - # content: - # text/event-stream: - # schema: - # $ref: "#/components/schemas/EventTypeStream" + /path/sse/3: + get: + operationId: sse_3 + responses: + "200": + description: using reference for schema + content: + text/event-stream: + schema: + $ref: "#/components/schemas/Stream" /path/sse/4: get: operationId: sse_4 responses: "200": - $ref: "#/components/responses/EventTypeResponse" - # FIXME: generator crash - # /path/sse/5: - # post: - # operationId: sse_5 - # description: indirect references, see Issue 17271 - # responses: - # '200': - # $ref: '#/components/responses/EventTypeResponseWithReference' + $ref: "#/components/responses/StreamResponse" + /path/sse/5: + post: + operationId: sse_5 + description: indirect references, see Issue 17271 + responses: + '200': + $ref: '#/components/responses/StreamResponseWithReference' # FIXME: generator crash # /path/notsse/1: @@ -132,6 +130,11 @@ components: attribute1: type: string EventTypeStream: + type: array + format: event-stream + items: + $ref: '#/components/schemas/EventType' + Stream: type: array format: event-stream items: @@ -142,7 +145,7 @@ components: responses: - EventTypeResponse: + StreamResponse: description: response content: text/event-stream: @@ -152,8 +155,8 @@ components: items: type: string - EventTypeResponseWithReference: - description: acknowledged + StreamResponseWithReference: + description: response content: text/event-stream: schema: From 0da2bd9745d3fd931dfde2b01beb2d275242dc57 Mon Sep 17 00:00:00 2001 From: Kathrin Geilmann <16289455+kgeilmann@users.noreply.github.com> Date: Tue, 11 Feb 2025 20:29:49 +0100 Subject: [PATCH 04/11] Fixing NPEs when the response does not contain a text/event-stream entry. Fixing NPE when the response does not contain any schema --- .../codegen/languages/SpringCodegen.java | 2 + .../java/spring/SpringCodegenTest.java | 58 ++++++++--------- .../src/test/resources/3_0/sse.yaml | 62 +++++++++---------- 3 files changed, 58 insertions(+), 64 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index f2c489c369d0..70ab079f6ef9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -1041,9 +1041,11 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation $ref: */ Map> schemaTypes = operation.getResponses().entrySet().stream() + .filter(p -> p.getValue().getContent() != null || p.getValue().get$ref() != null) .map(e -> Pair.of(e.getValue(), fromResponse(e.getKey(), e.getValue()))) .filter(p -> p.getRight().is2xx) // consider only success .map(p -> p.getLeft().getContent().get(MEDIA_EVENT_STREAM)) + .filter(Objects::nonNull) .map(MediaType::getSchema) .map(s -> ModelUtils.unaliasSchema(openAPI, s)) .collect(Collectors.toList()).stream() 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 cf14883b1c02..f24ebd5f1a43 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 @@ -4489,6 +4489,7 @@ public void testSSEOperationSupport() throws Exception { File api = files.get("PathApi.java"); File delegate = files.get("PathApiDelegate.java"); + // SSE Endpoints JavaFileAssert.assertThat(api) .assertMethod("sse1", "ServerWebExchange") .hasReturnType("Flux") @@ -4503,17 +4504,15 @@ public void testSSEOperationSupport() throws Exception { .hasReturnType("Flux") .toFileAssert() .assertMethod("sse5", "ServerWebExchange") - .hasReturnType("Flux") + .hasReturnType("Flux"); + //Non SSE Endpoints + JavaFileAssert.assertThat(api) + .assertMethod("notSse1", "ServerWebExchange") + .hasReturnType("Mono>") + .toFileAssert() + .assertMethod("notSse2", "ServerWebExchange") + .hasReturnType("Mono>>") .toFileAssert() - - // FIXME: Generator Crash - // .assertMethod("notSse1", "ServerWebExchange") - // .hasReturnType("Mono>") - // .toFileAssert() - // FIXME: Generator Crash - // .assertMethod("notSse2", "ServerWebExchange") - // .hasReturnType("Mono>>") - // .toFileAssert() .assertMethod("notSse3", "ServerWebExchange") .hasReturnType("Mono>") .toFileAssert() @@ -4523,11 +4522,10 @@ public void testSSEOperationSupport() throws Exception { .assertMethod("notSse7", "ServerWebExchange") .hasReturnType("Mono>") .toFileAssert() - // FIXME: Generator Crash - // .assertMethod("notSse8", "ServerWebExchange") - // .hasReturnType("Mono>") - ; + .assertMethod("notSse8", "ServerWebExchange") + .hasReturnType("Mono>"); + // SSE Endpoints JavaFileAssert.assertThat(delegate) .assertMethod("sse1", "ServerWebExchange") .hasReturnType("Flux") @@ -4547,19 +4545,18 @@ public void testSSEOperationSupport() throws Exception { .toFileAssert() .assertMethod("sse5", "ServerWebExchange") .hasReturnType("Flux") - .bodyContainsLines("return Flux.empty();") - .toFileAssert() + .bodyContainsLines("return Flux.empty();"); - // FIXME: Generator Crash - // .assertMethod("notSse1", "ServerWebExchange") - // .hasReturnType("Mono>") - // .bodyContainsLines("return result.then(Mono.empty());") - // .toFileAssert() - // FIXME: Generator Crash - // .assertMethod("notSse2", "ServerWebExchange") - // .hasReturnType("Mono>>") - // .bodyContainsLines("return result.then(Mono.empty());") - // .toFileAssert() + // Non SSE Endpoints + JavaFileAssert.assertThat(delegate) + .assertMethod("notSse1", "ServerWebExchange") + .hasReturnType("Mono>") + .bodyContainsLines("return result.then(Mono.empty());") + .toFileAssert() + .assertMethod("notSse2", "ServerWebExchange") + .hasReturnType("Mono>>") + .bodyContainsLines("return result.then(Mono.empty());") + .toFileAssert() .assertMethod("notSse3", "ServerWebExchange") .hasReturnType("Mono>") .bodyContainsLines("return result.then(Mono.empty());") @@ -4572,12 +4569,9 @@ public void testSSEOperationSupport() throws Exception { .hasReturnType("Mono>") .bodyContainsLines("return result.then(Mono.empty());") .toFileAssert() - // FIXME: Generator Crash - // .assertMethod("notSse8", "ServerWebExchange") - // .hasReturnType("Mono>") - // .bodyContainsLines("return result.then(Mono.empty());") - ; - + .assertMethod("notSse8", "ServerWebExchange") + .hasReturnType("Mono>") + .bodyContainsLines("return result.then(Mono.empty());"); } @DataProvider(name = "invalid sse endpoints") diff --git a/modules/openapi-generator/src/test/resources/3_0/sse.yaml b/modules/openapi-generator/src/test/resources/3_0/sse.yaml index 2e942d29d1b3..6c03f2bf309a 100644 --- a/modules/openapi-generator/src/test/resources/3_0/sse.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/sse.yaml @@ -58,27 +58,26 @@ paths: '200': $ref: '#/components/responses/StreamResponseWithReference' - # FIXME: generator crash - # /path/notsse/1: - # get: - # operationId: not_sse_1 - # responses: - # '200': - # description: no schema defined, but this is a valid OpenAPI Specification - # FIXME: generator crash - # /path/notsse/2: - # get: - # operationId: not_sse_2 - # responses: - # '200': - # description: wrong media type - # content: - # application/json: - # schema: - # type: array - # format: event-stream - # items: - # type: string + + /path/notsse/1: + get: + operationId: not_sse_1 + responses: + '200': + description: no schema defined, but this is a valid OpenAPI Specification + /path/notsse/2: + get: + operationId: not_sse_2 + responses: + '200': + description: wrong media type + content: + application/json: + schema: + type: array + format: event-stream + items: + type: string /path/notsse/3: get: operationId: not_sse_3 @@ -110,17 +109,16 @@ paths: responses: '200': $ref: "#/components/responses/NotAStreamResponse" -# FIXME: Generator Crashed -# /path/notsse/8: -# get: -# operationId: not_sse_8 -# responses: -# "200": -# description: referenced schema does not match -# content: -# text/event-stream: -# schema: -# $ref: "#/components/schemas/NotAStreamType" + /path/notsse/8: + get: + operationId: not_sse_8 + responses: + "200": + description: referenced schema does not match + content: + text/event-stream: + schema: + $ref: "#/components/schemas/NotAStreamType" components: schemas: From 4cb07d218a55554781b8f532f905b0eea2053784 Mon Sep 17 00:00:00 2001 From: Kathrin Geilmann <16289455+kgeilmann@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:10:19 +0100 Subject: [PATCH 05/11] Extended Fake Pet Store Specification with sse endpoint and added a new sample to check generation --- ...spring-boot-reactive-serverSentEvents.yaml | 12 + ...ith-fake-endpoints-models-for-testing.yaml | 15 + .../java/org/openapitools/api/FakeApi.java | 17 + .../java/org/openapitools/api/FakeApi.java | 17 + .../java/org/openapitools/api/FakeApi.java | 16 + .../java/org/openapitools/api/FakeApi.java | 16 + .../java/org/openapitools/api/FakeApi.java | 26 + .../java/org/openapitools/api/FakeApi.java | 28 + .../org/openapitools/api/FakeApiDelegate.java | 21 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 38 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 26 + .../java/org/openapitools/api/FakeApi.java | 40 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 40 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 30 + .../org/openapitools/api/FakeApiDelegate.java | 21 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 30 + .../org/openapitools/api/FakeApiDelegate.java | 21 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 40 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 31 + .../org/openapitools/api/FakeApiDelegate.java | 21 + .../src/main/resources/openapi.yaml | 19 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 80 + .../.openapi-generator/VERSION | 1 + .../README.md | 27 + .../pom.xml | 91 + .../OpenApiGeneratorApplication.java | 30 + .../org/openapitools/RFC3339DateFormat.java | 38 + .../org/openapitools/api/AnotherFakeApi.java | 66 + .../api/AnotherFakeApiController.java | 45 + .../api/AnotherFakeApiDelegate.java | 56 + .../java/org/openapitools/api/ApiUtil.java | 20 + .../java/org/openapitools/api/FakeApi.java | 701 +++++ .../openapitools/api/FakeApiController.java | 58 + .../org/openapitools/api/FakeApiDelegate.java | 443 +++ .../api/FakeClassnameTestApi.java | 69 + .../api/FakeClassnameTestApiController.java | 45 + .../api/FakeClassnameTestApiDelegate.java | 56 + .../java/org/openapitools/api/PetApi.java | 357 +++ .../openapitools/api/PetApiController.java | 47 + .../org/openapitools/api/PetApiDelegate.java | 227 ++ .../java/org/openapitools/api/StoreApi.java | 168 ++ .../openapitools/api/StoreApiController.java | 46 + .../openapitools/api/StoreApiDelegate.java | 124 + .../java/org/openapitools/api/UserApi.java | 287 ++ .../openapitools/api/UserApiController.java | 46 + .../org/openapitools/api/UserApiDelegate.java | 181 ++ .../EnumConverterConfiguration.java | 32 + .../configuration/HomeController.java | 37 + .../model/AdditionalPropertiesAnyType.java | 129 + .../model/AdditionalPropertiesArray.java | 130 + .../model/AdditionalPropertiesBoolean.java | 129 + .../model/AdditionalPropertiesClass.java | 415 +++ .../model/AdditionalPropertiesInteger.java | 129 + .../model/AdditionalPropertiesNumber.java | 130 + .../model/AdditionalPropertiesObject.java | 130 + .../model/AdditionalPropertiesString.java | 129 + .../java/org/openapitools/model/Animal.java | 134 + .../model/ArrayOfArrayOfNumberOnly.java | 98 + .../openapitools/model/ArrayOfNumberOnly.java | 98 + .../org/openapitools/model/ArrayTest.java | 164 ++ .../java/org/openapitools/model/BigCat.java | 158 ++ .../openapitools/model/Capitalization.java | 205 ++ .../main/java/org/openapitools/model/Cat.java | 121 + .../java/org/openapitools/model/Category.java | 120 + .../openapitools/model/ChildWithNullable.java | 116 + .../org/openapitools/model/ClassModel.java | 86 + .../java/org/openapitools/model/Client.java | 85 + .../model/ContainerDefaultValue.java | 221 ++ .../main/java/org/openapitools/model/Dog.java | 113 + .../org/openapitools/model/EnumArrays.java | 192 ++ .../org/openapitools/model/EnumClass.java | 57 + .../java/org/openapitools/model/EnumTest.java | 340 +++ .../java/org/openapitools/model/File.java | 86 + .../model/FileSchemaTestClass.java | 122 + .../org/openapitools/model/FormatTest.java | 431 +++ .../openapitools/model/HasOnlyReadOnly.java | 111 + .../java/org/openapitools/model/MapTest.java | 231 ++ ...ropertiesAndAdditionalPropertiesClass.java | 149 + .../openapitools/model/Model200Response.java | 112 + .../openapitools/model/ModelApiResponse.java | 135 + .../org/openapitools/model/ModelList.java | 87 + .../org/openapitools/model/ModelReturn.java | 88 + .../java/org/openapitools/model/Name.java | 169 ++ .../model/NullableMapProperty.java | 110 + .../org/openapitools/model/NumberOnly.java | 86 + .../java/org/openapitools/model/Order.java | 246 ++ .../openapitools/model/OuterComposite.java | 134 + .../org/openapitools/model/OuterEnum.java | 57 + .../model/ParentWithNullable.java | 169 ++ .../main/java/org/openapitools/model/Pet.java | 289 ++ .../org/openapitools/model/ReadOnlyFirst.java | 109 + ...ResponseObjectWithDifferentFieldNames.java | 157 ++ .../openapitools/model/SpecialModelName.java | 87 + .../main/java/org/openapitools/model/Tag.java | 109 + .../openapitools/model/TypeHolderDefault.java | 209 ++ .../openapitools/model/TypeHolderExample.java | 234 ++ .../java/org/openapitools/model/User.java | 253 ++ .../java/org/openapitools/model/XmlItem.java | 842 ++++++ .../src/main/resources/application.properties | 3 + .../src/main/resources/openapi.yaml | 2462 +++++++++++++++++ .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + .../java/org/openapitools/api/FakeApi.java | 30 + .../org/openapitools/api/FakeApiDelegate.java | 21 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 40 + .../src/main/resources/openapi.yaml | 19 + .../openapitools/virtualan/api/FakeApi.java | 39 + .../src/main/resources/openapi.yaml | 19 + .../java/org/openapitools/api/FakeApi.java | 40 + .../src/main/resources/openapi.yaml | 19 + 119 files changed, 15284 insertions(+) create mode 100644 bin/configs/spring-boot-reactive-serverSentEvents.yaml create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator-ignore create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/VERSION create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/README.md create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/pom.xml create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/RFC3339DateFormat.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/ApiUtil.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApi.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApiController.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApiDelegate.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApi.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApi.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApiController.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApiDelegate.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApi.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApiController.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApiDelegate.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApi.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApiController.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApiDelegate.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/configuration/HomeController.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesString.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Animal.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayTest.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Capitalization.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Cat.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Category.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ChildWithNullable.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ClassModel.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Client.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ContainerDefaultValue.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Dog.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumArrays.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumClass.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumTest.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/File.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/FileSchemaTestClass.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/FormatTest.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/HasOnlyReadOnly.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/MapTest.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Model200Response.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelApiResponse.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelList.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelReturn.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Name.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/NullableMapProperty.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/NumberOnly.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Order.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/OuterComposite.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/OuterEnum.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ParentWithNullable.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Pet.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ReadOnlyFirst.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/SpecialModelName.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Tag.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/TypeHolderDefault.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/TypeHolderExample.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/User.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/XmlItem.java create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/application.properties create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-reactive-serverSentEvents/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/bin/configs/spring-boot-reactive-serverSentEvents.yaml b/bin/configs/spring-boot-reactive-serverSentEvents.yaml new file mode 100644 index 000000000000..d691f15c83fc --- /dev/null +++ b/bin/configs/spring-boot-reactive-serverSentEvents.yaml @@ -0,0 +1,12 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-reactive-serverSentEvents +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + groupId: org.openapitools.openapi3 + artifactId: springboot-reactive-serverSentEvents + documentationProvider: springfox + reactive: "true" + hideGenerationTimestamp: "true" + delegatePattern: "true" + serverSentEvents: "true" diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml index ee2e1b442a12..75d088f8cd76 100644 --- a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1142,6 +1142,21 @@ paths: application/json: schema: $ref: "#/components/schemas/ResponseObjectWithDifferentFieldNames" + /fake/sse: + get: + tags: + - fake + operationId: sse + responses: + 200: + description: an sse endpoint + content: + text/event-stream: + schema: + type: array + format: event-stream + items: + $ref: "#/components/schemas/Pet" servers: - url: http://petstore.swagger.io:80/v2 components: diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index ad7af7042d81..e69473bad030 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -14,6 +14,7 @@ import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.PetDto; import org.openapitools.model.UserDto; import org.openapitools.model.XmlItemDto; import org.springframework.http.HttpStatus; @@ -125,6 +126,22 @@ String fakeOuterStringSerialize( ); + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ResponseStatus(HttpStatus.OK) + @HttpExchange( + method = "GET", + value = "/fake/sse", + accept = { "text/event-stream" } + ) + List sse( + + ); + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index cd137113836f..97368c46c268 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -14,6 +14,7 @@ import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -129,6 +130,22 @@ Mono fakeOuterStringSerialize( ); + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ResponseStatus(HttpStatus.OK) + @HttpExchange( + method = "GET", + value = "/fake/sse", + accept = { "text/event-stream" } + ) + Flux sse( + + ); + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java index 6ae64882b8ea..00440dc413f4 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -14,6 +14,7 @@ import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.ResponseEntity; @@ -124,6 +125,21 @@ Mono> fakeOuterStringSerialize( ); + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/fake/sse", + accept = { "text/event-stream" } + ) + Mono>> sse( + + ); + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java index 771aa0eff5ab..8da3294e7150 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java @@ -14,6 +14,7 @@ import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.PetDto; import org.openapitools.model.UserDto; import org.openapitools.model.XmlItemDto; import org.springframework.http.ResponseEntity; @@ -120,6 +121,21 @@ ResponseEntity fakeOuterStringSerialize( ); + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/fake/sse", + accept = { "text/event-stream" } + ) + ResponseEntity> sse( + + ); + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. 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 32493ef99cee..c930cbce267b 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 @@ -14,6 +14,7 @@ import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.ExternalDocumentation; @@ -190,6 +191,31 @@ ResponseEntity fakeOuterStringSerialize( ); + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @Operation( + operationId = "sse", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "an sse endpoint", content = { + @Content(mediaType = "text/event-stream", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + ResponseEntity> sse( + + ); + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. 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 30ac3d9a5785..6d5cc8f6b259 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -230,6 +231,33 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @Operation( + operationId = "sse", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "an sse endpoint", content = { + @Content(mediaType = "text/event-stream", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + return getDelegate().sse(); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index 1ce37b37149a..6949630301ca 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -10,6 +10,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -132,6 +133,26 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + * @see FakeApi#sse + */ + default ResponseEntity> sse() { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 037ee28263ef..ebd5d186ee57 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -258,6 +259,43 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @Operation( + operationId = "sse", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "an sse endpoint", content = { + @Content(mediaType = "text/event-stream", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 bfe01537faea..0788180725cd 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -218,6 +219,31 @@ ResponseEntity responseObjectDifferentNam ) throws Exception; + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @Operation( + operationId = "sse", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "an sse endpoint", content = { + @Content(mediaType = "text/event-stream", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + ResponseEntity> sse( + + ) throws Exception; + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. 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 aaebef870d53..38651505b44d 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -249,6 +250,45 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 aaebef870d53..38651505b44d 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -249,6 +250,45 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 cbcd67ba2c65..d67dab5a8bf0 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -221,6 +222,35 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + return getDelegate().sse(); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index 1ce37b37149a..6949630301ca 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -10,6 +10,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -132,6 +133,26 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + * @see FakeApi#sse + */ + default ResponseEntity> sse() { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 cbcd67ba2c65..d67dab5a8bf0 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -221,6 +222,35 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + return getDelegate().sse(); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index 1ce37b37149a..6949630301ca 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -10,6 +10,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -132,6 +133,26 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + * @see FakeApi#sse + */ + default ResponseEntity> sse() { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 f4cee2076200..76e7ec2648d1 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -249,6 +250,45 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 4c32d095ae2f..f74066efe409 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 @@ -16,6 +16,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -238,6 +239,36 @@ default Mono responseObjectDifferentNames } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + @ResponseStatus(HttpStatus.OK) + + default Flux sse( + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().sse(exchange); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiDelegate.java index fd8b9272342f..1902f16d1275 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -11,6 +11,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -150,6 +151,26 @@ default Mono responseObjectDifferentNames } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + * @see FakeApi#sse + */ + default Flux sse(ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf(""), exampleString); + break; + } + } + return result.thenMany(Flux.empty()); + + } + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator-ignore b/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/FILES new file mode 100644 index 000000000000..3e46ab1a618e --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/FILES @@ -0,0 +1,80 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenApiGeneratorApplication.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeApiDelegate.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/PetApiDelegate.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/StoreApiDelegate.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/api/UserApiDelegate.java +src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ChildWithNullable.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/File.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelList.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NullableMapProperty.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/ParentWithNullable.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties +src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/VERSION new file mode 100644 index 000000000000..de37f5c4cf59 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.12.0-SNAPSHOT diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/README.md b/samples/server/petstore/springboot-reactive-serverSentEvents/README.md new file mode 100644 index 000000000000..6721bbc28ca4 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/README.md @@ -0,0 +1,27 @@ +# OpenAPI generated server + +Spring Boot Server + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. +This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + + +Start your server as a simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:80/swagger-ui.html + +Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/pom.xml b/samples/server/petstore/springboot-reactive-serverSentEvents/pom.xml new file mode 100644 index 000000000000..04eb7b23075d --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/pom.xml @@ -0,0 +1,91 @@ + + 4.0.0 + org.openapitools.openapi3 + springboot-reactive-serverSentEvents + jar + springboot-reactive-serverSentEvents + 1.0.0 + + 1.8 + ${java.version} + ${java.version} + UTF-8 + 2.9.2 + 5.3.1 + + + org.springframework.boot + spring-boot-starter-parent + 2.5.14 + + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.data + spring-data-commons + + + + io.springfox + springfox-swagger2 + ${springfox.version} + + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.6 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..97252a8a9402 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,30 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; +import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; + +@SpringBootApplication( + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +@ComponentScan( + basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean(name = "org.openapitools.OpenApiGeneratorApplication.jsonNullableModule") + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/RFC3339DateFormat.java new file mode 100644 index 000000000000..bcd3936d8b34 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/RFC3339DateFormat.java @@ -0,0 +1,38 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApi.java new file mode 100644 index 000000000000..16fb1a768c05 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -0,0 +1,66 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.12.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.Client; +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Validated +@Api(value = "$another-fake?", description = "the $another-fake? API") +public interface AnotherFakeApi { + + default AnotherFakeApiDelegate getDelegate() { + return new AnotherFakeApiDelegate() {}; + } + + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param client client model (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "$another-fake?" }, + value = "To test special tags", + nickname = "call123testSpecialTags", + notes = "To test special tags and operation ID starting with number", + response = Client.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default Mono> call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().call123testSpecialTags(client, exchange); + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApiController.java new file mode 100644 index 000000000000..62bd36473206 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -0,0 +1,45 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.Client; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class AnotherFakeApiController implements AnotherFakeApi { + + private final AnotherFakeApiDelegate delegate; + + public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); + } + + @Override + public AnotherFakeApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java new file mode 100644 index 000000000000..b2e50232c00e --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -0,0 +1,56 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.Client; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link AnotherFakeApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public interface AnotherFakeApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param client client model (required) + * @return successful operation (status code 200) + * @see AnotherFakeApi#call123testSpecialTags + */ + default Mono> call123testSpecialTags(Mono client, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + } + return result.then(client).then(Mono.empty()); + + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 000000000000..7ed3b0ab28d9 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,20 @@ +package org.openapitools.api; + +import java.nio.charset.StandardCharsets; +import org.springframework.core.io.buffer.DefaultDataBuffer; +import org.springframework.core.io.buffer.DefaultDataBufferFactory; +import org.springframework.http.MediaType; +import org.springframework.http.server.reactive.ServerHttpResponse; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +public class ApiUtil { + public static Mono getExampleResponse(ServerWebExchange exchange, MediaType mediaType, String example) { + ServerHttpResponse response = exchange.getResponse(); + response.getHeaders().setContentType(mediaType); + + byte[] exampleBytes = example.getBytes(StandardCharsets.UTF_8); + DefaultDataBuffer data = new DefaultDataBufferFactory().wrap(exampleBytes); + return response.writeWith(Mono.just(data)); + } +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApi.java new file mode 100644 index 000000000000..7838b2b71900 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApi.java @@ -0,0 +1,701 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.12.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullable; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Validated +@Api(value = "fake", description = "the fake API") +public interface FakeApi { + + default FakeApiDelegate getDelegate() { + return new FakeApiDelegate() {}; + } + + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "creates an XmlItem", + nickname = "createXmlItem", + notes = "this route creates an XmlItem" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/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" } + ) + + default Mono> createXmlItem( + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().createXmlItem(xmlItem, exchange); + } + + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeOuterBooleanSerialize", + notes = "Test serialization of outer boolean types", + response = Boolean.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/outer/boolean", + produces = { "*/*" }, + consumes = { "application/json" } + ) + + default Mono> fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().fakeOuterBooleanSerialize(body, exchange); + } + + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param outerComposite Input composite as post body (optional) + * @return Output composite (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeOuterCompositeSerialize", + notes = "Test serialization of object with outer number type", + response = OuterComposite.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/outer/composite", + produces = { "*/*" }, + consumes = { "application/json" } + ) + + default Mono> fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().fakeOuterCompositeSerialize(outerComposite, exchange); + } + + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeOuterNumberSerialize", + notes = "Test serialization of outer number types", + response = BigDecimal.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/outer/number", + produces = { "*/*" }, + consumes = { "application/json" } + ) + + default Mono> fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().fakeOuterNumberSerialize(body, exchange); + } + + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeOuterStringSerialize", + notes = "Test serialization of outer string types", + response = String.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output string", response = String.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/outer/string", + produces = { "*/*" }, + consumes = { "application/json" } + ) + + default Mono> fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().fakeOuterStringSerialize(body, exchange); + } + + + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNames.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + + default Mono> responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().responseObjectDifferentNames(petId, exchange); + } + + + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + @ResponseBody + default Flux sse( + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().sse(exchange); + } + + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param fileSchemaTestClass (required) + * @return Success (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "testBodyWithFileSchema", + notes = "For this test, the body for this request much reference a schema named `File`." + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Success") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = "/fake/body-with-file-schema", + consumes = { "application/json" } + ) + + default Mono> testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass, exchange); + } + + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param user (required) + * @return Success (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "testBodyWithQueryParams", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Success") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = "/fake/body-with-query-params", + consumes = { "application/json" } + ) + + default Mono> testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody Mono user, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testBodyWithQueryParams(query, user, exchange); + } + + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param client client model (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "To test \"client\" model", + nickname = "testClientModel", + notes = "To test \"client\" model", + response = Client.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/fake", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default Mono> testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testClientModel(client, exchange); + } + + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "fake" }, + value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + nickname = "testEndpointParameters", + notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + authorizations = { + @Authorization(value = "http_basic_test") + } + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake", + consumes = { "application/x-www-form-urlencoded" } + ) + + default Mono> testEndpointParameters( + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) Flux binary, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); + } + + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + */ + @ApiOperation( + tags = { "fake" }, + value = "To test enum parameters", + nickname = "testEnumParameters", + notes = "To test enum parameters" + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake", + consumes = { "application/x-www-form-urlencoded" } + ) + + default Mono> testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); + } + + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Something wrong (status code 400) + */ + @ApiOperation( + tags = { "fake" }, + value = "Fake endpoint to test group parameters (optional)", + nickname = "testGroupParameters", + notes = "Fake endpoint to test group parameters (optional)" + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Something wrong") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/fake" + ) + + default Mono> testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); + } + + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * + * @param requestBody request body (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test inline additionalProperties", + nickname = "testInlineAdditionalProperties", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/inline-additionalProperties", + consumes = { "application/json" } + ) + + default Mono> testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> requestBody, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testInlineAdditionalProperties(requestBody, exchange); + } + + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test json serialization of form data", + nickname = "testJsonFormData", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/jsonFormData", + consumes = { "application/x-www-form-urlencoded" } + ) + + default Mono> testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testJsonFormData(param, param2, exchange); + } + + + /** + * POST /fake/nullable : test nullable parent property + * + * + * @param childWithNullable request body (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test nullable parent property", + nickname = "testNullable", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/nullable", + consumes = { "application/json" } + ) + + default Mono> testNullable( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono childWithNullable, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testNullable(childWithNullable, exchange); + } + + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "testQueryParameterCollectionFormat", + notes = "To test the collection format in query parameters" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Success") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = "/fake/test-query-parameters" + ) + + default Mono> testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context, exchange); + } + + + /** + * GET /fake/response-with-example + * This endpoint defines an example value for its response schema. + * + * @return Success (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "testWithResultExample", + notes = "This endpoint defines an example value for its response schema.", + response = Integer.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Success", response = Integer.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/response-with-example", + produces = { "application/json" } + ) + + default Mono> testWithResultExample( + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testWithResultExample(exchange); + } + + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "uploads an image (required)", + nickname = "uploadFileWithRequiredFile", + notes = "", + response = ModelApiResponse.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/fake/{petId}/uploadImageWithRequiredFile", + produces = { "application/json" }, + consumes = { "multipart/form-data" } + ) + + default Mono> uploadFileWithRequiredFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Flux requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApiController.java new file mode 100644 index 000000000000..7edcf6a4e200 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApiController.java @@ -0,0 +1,58 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullable; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class FakeApiController implements FakeApi { + + private final FakeApiDelegate delegate; + + public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); + } + + @Override + public FakeApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApiDelegate.java new file mode 100644 index 000000000000..cd8ae1e73760 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -0,0 +1,443 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullable; +import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; +import org.openapitools.model.User; +import org.openapitools.model.XmlItem; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link FakeApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public interface FakeApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + * @return successful operation (status code 200) + * @see FakeApi#createXmlItem + */ + default Mono> createXmlItem(Mono xmlItem, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(xmlItem).then(Mono.empty()); + + } + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + * @see FakeApi#fakeOuterBooleanSerialize + */ + default Mono> fakeOuterBooleanSerialize(Mono body, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(body).then(Mono.empty()); + + } + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param outerComposite Input composite as post body (optional) + * @return Output composite (status code 200) + * @see FakeApi#fakeOuterCompositeSerialize + */ + default Mono> fakeOuterCompositeSerialize(Mono outerComposite, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + } + return result.then(outerComposite).then(Mono.empty()); + + } + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + * @see FakeApi#fakeOuterNumberSerialize + */ + default Mono> fakeOuterNumberSerialize(Mono body, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(body).then(Mono.empty()); + + } + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + * @see FakeApi#fakeOuterStringSerialize + */ + default Mono> fakeOuterStringSerialize(Mono body, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(body).then(Mono.empty()); + + } + + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + * @see FakeApi#responseObjectDifferentNames + */ + default Mono> responseObjectDifferentNames(Long petId, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + * @see FakeApi#sse + */ + default Flux sse(ServerWebExchange exchange) { + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return Flux.empty(); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param fileSchemaTestClass (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + default Mono> testBodyWithFileSchema(Mono fileSchemaTestClass, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(fileSchemaTestClass).then(Mono.empty()); + + } + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param user (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithQueryParams + */ + default Mono> testBodyWithQueryParams(String query, + Mono user, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(user).then(Mono.empty()); + + } + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param client client model (required) + * @return successful operation (status code 200) + * @see FakeApi#testClientModel + */ + default Mono> testClientModel(Mono client, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + } + return result.then(client).then(Mono.empty()); + + } + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see FakeApi#testEndpointParameters + */ + default Mono> testEndpointParameters(BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Integer integer, + Integer int32, + Long int64, + Float _float, + String string, + Flux binary, + LocalDate date, + OffsetDateTime dateTime, + String password, + String paramCallback, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + * @see FakeApi#testEnumParameters + */ + default Mono> testEnumParameters(List enumHeaderStringArray, + String enumHeaderString, + List enumQueryStringArray, + String enumQueryString, + Integer enumQueryInteger, + Double enumQueryDouble, + List enumFormStringArray, + String enumFormString, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Something wrong (status code 400) + * @see FakeApi#testGroupParameters + */ + default Mono> testGroupParameters(Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Integer stringGroup, + Boolean booleanGroup, + Long int64Group, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * + * @param requestBody request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testInlineAdditionalProperties + */ + default Mono> testInlineAdditionalProperties(Mono> requestBody, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(requestBody).then(Mono.empty()); + + } + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + * @see FakeApi#testJsonFormData + */ + default Mono> testJsonFormData(String param, + String param2, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * POST /fake/nullable : test nullable parent property + * + * + * @param childWithNullable request body (required) + * @return successful operation (status code 200) + * @see FakeApi#testNullable + */ + default Mono> testNullable(Mono childWithNullable, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(childWithNullable).then(Mono.empty()); + + } + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + * @see FakeApi#testQueryParameterCollectionFormat + */ + default Mono> testQueryParameterCollectionFormat(List pipe, + List http, + List url, + List context, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * GET /fake/response-with-example + * This endpoint defines an example value for its response schema. + * + * @return Success (status code 200) + * @see FakeApi#testWithResultExample + */ + default Mono> testWithResultExample(ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "42"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + * @see FakeApi#uploadFileWithRequiredFile + */ + default Mono> uploadFileWithRequiredFile(Long petId, + Flux requiredFile, + String additionalMetadata, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApi.java new file mode 100644 index 000000000000..1da1233a61d8 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -0,0 +1,69 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.12.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.Client; +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Validated +@Api(value = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") +public interface FakeClassnameTestApi { + + default FakeClassnameTestApiDelegate getDelegate() { + return new FakeClassnameTestApiDelegate() {}; + } + + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param client client model (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake_classname_tags 123#$%^" }, + value = "To test class name in snake case", + nickname = "testClassname", + notes = "To test class name in snake case", + response = Client.class, + authorizations = { + @Authorization(value = "api_key_query") + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) + @RequestMapping( + method = RequestMethod.PATCH, + value = "/fake_classname_test", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default Mono> testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().testClassname(client, exchange); + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java new file mode 100644 index 000000000000..2c1243ab97de --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -0,0 +1,45 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.Client; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class FakeClassnameTestApiController implements FakeClassnameTestApi { + + private final FakeClassnameTestApiDelegate delegate; + + public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); + } + + @Override + public FakeClassnameTestApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java new file mode 100644 index 000000000000..2d32a35776bc --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -0,0 +1,56 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.Client; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link FakeClassnameTestApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public interface FakeClassnameTestApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param client client model (required) + * @return successful operation (status code 200) + * @see FakeClassnameTestApi#testClassname + */ + default Mono> testClassname(Mono client, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + } + return result.then(client).then(Mono.empty()); + + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 000000000000..c2f5646221a7 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,357 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.12.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Validated +@Api(value = "pet", description = "Everything about your Pets") +public interface PetApi { + + default PetApiDelegate getDelegate() { + return new PetApiDelegate() {}; + } + + /** + * POST /pet : Add a new pet to the store + * + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + */ + @ApiOperation( + tags = { "pet" }, + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 405, message = "Invalid input") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet", + consumes = { "application/json", "application/xml" } + ) + + default Mono> addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().addPet(pet, exchange); + } + + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + */ + @ApiOperation( + tags = { "pet" }, + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/pet/{petId}" + ) + + default Mono> deletePet( + @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().deletePet(petId, apiKey, exchange); + } + + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + */ + @ApiOperation( + tags = { "pet" }, + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet.class, + responseContainer = "List", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByStatus", + produces = { "application/xml", "application/json" } + ) + + default Mono>> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().findPetsByStatus(status, exchange); + } + + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + */ + @Deprecated + @ApiOperation( + tags = { "pet" }, + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet.class, + responseContainer = "Set", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByTags", + produces = { "application/xml", "application/json" } + ) + + default Mono>> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().findPetsByTags(tags, exchange); + } + + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + */ + @ApiOperation( + tags = { "pet" }, + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet.class, + authorizations = { + @Authorization(value = "api_key") + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/{petId}", + produces = { "application/xml", "application/json" } + ) + + default Mono> getPetById( + @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().getPetById(petId, exchange); + } + + + /** + * PUT /pet : Update an existing pet + * + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + */ + @ApiOperation( + tags = { "pet" }, + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = "/pet", + consumes = { "application/json", "application/xml" } + ) + + default Mono> updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().updatePet(pet, exchange); + } + + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + */ + @ApiOperation( + tags = { "pet" }, + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 405, message = "Invalid input") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}", + consumes = { "application/x-www-form-urlencoded" } + ) + + default Mono> updatePetWithForm( + @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().updatePetWithForm(petId, name, status, exchange); + } + + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ModelApiResponse.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}/uploadImage", + produces = { "application/json" }, + consumes = { "multipart/form-data" } + ) + + default Mono> uploadFile( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) Flux file, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApiController.java new file mode 100644 index 000000000000..9d1c406000ec --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApiController.java @@ -0,0 +1,47 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class PetApiController implements PetApi { + + private final PetApiDelegate delegate; + + public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); + } + + @Override + public PetApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApiDelegate.java new file mode 100644 index 000000000000..3e7e47e6b77b --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -0,0 +1,227 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public interface PetApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /pet : Add a new pet to the store + * + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + default Mono> addPet(Mono pet, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(pet).then(Mono.empty()); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + default Mono> deletePet(Long petId, + String apiKey, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + default Mono>> findPetsByStatus(List status, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/xml"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + @Deprecated + default Mono>> findPetsByTags(Set tags, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/xml"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + default Mono> getPetById(Long petId, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/xml"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + + /** + * PUT /pet : Update an existing pet + * + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + default Mono> updatePet(Mono pet, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(pet).then(Mono.empty()); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + default Mono> updatePetWithForm(Long petId, + String name, + String status, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + default Mono> uploadFile(Long petId, + String additionalMetadata, + Flux file, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 000000000000..b712a40da44b --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,168 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.12.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import org.openapitools.model.Order; +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Validated +@Api(value = "store", description = "Access to Petstore orders") +public interface StoreApi { + + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() {}; + } + + /** + * 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 + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @ApiOperation( + tags = { "store" }, + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/store/order/{order_id}" + ) + + default Mono> deleteOrder( + @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().deleteOrder(orderId, exchange); + } + + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "store" }, + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = Integer.class, + responseContainer = "Map", + authorizations = { + @Authorization(value = "api_key") + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/inventory", + produces = { "application/json" } + ) + + default Mono>> getInventory( + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().getInventory(exchange); + } + + + /** + * 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 + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @ApiOperation( + tags = { "store" }, + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", + response = Order.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/order/{order_id}", + produces = { "application/xml", "application/json" } + ) + + default Mono> getOrderById( + @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().getOrderById(orderId, exchange); + } + + + /** + * POST /store/order : Place an order for a pet + * + * + * @param order order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + */ + @ApiOperation( + tags = { "store" }, + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = Order.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/store/order", + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } + ) + + default Mono> placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().placeOrder(order, exchange); + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApiController.java new file mode 100644 index 000000000000..fc49b06e4750 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import org.openapitools.model.Order; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class StoreApiController implements StoreApi { + + private final StoreApiDelegate delegate; + + public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); + } + + @Override + public StoreApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApiDelegate.java new file mode 100644 index 000000000000..7d2b21c1d9d4 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -0,0 +1,124 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.util.Map; +import org.openapitools.model.Order; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public interface StoreApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * 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 + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + default Mono> deleteOrder(String orderId, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + default Mono>> getInventory(ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * 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 + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + default Mono> getOrderById(Long orderId, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/xml"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + + /** + * POST /store/order : Place an order for a pet + * + * + * @param order order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + default Mono> placeOrder(Mono order, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/xml"), exampleString); + break; + } + } + return result.then(order).then(Mono.empty()); + + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 000000000000..528d345c7d71 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,287 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.12.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.time.OffsetDateTime; +import org.openapitools.model.User; +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Validated +@Api(value = "user", description = "Operations about user") +public interface UserApi { + + default UserApiDelegate getDelegate() { + return new UserApiDelegate() {}; + } + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/user", + consumes = { "application/json" } + ) + + default Mono> createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono user, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().createUser(user, exchange); + } + + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * + * @param user List of user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithArray", + consumes = { "application/json" } + ) + + default Mono> createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().createUsersWithArrayInput(user, exchange); + } + + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * + * @param user List of user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithList", + consumes = { "application/json" } + ) + + default Mono> createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().createUsersWithListInput(user, exchange); + } + + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/user/{username}" + ) + + default Mono> deleteUser( + @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().deleteUser(username, exchange); + } + + + /** + * GET /user/{username} : Get user by user name + * + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + response = User.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/{username}", + produces = { "application/xml", "application/json" } + ) + + default Mono> getUserByName( + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().getUserByName(username, exchange); + } + + + /** + * GET /user/login : Logs user into the system + * + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + @ApiOperation( + tags = { "user" }, + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = String.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/login", + produces = { "application/xml", "application/json" } + ) + + default Mono> loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().loginUser(username, password, exchange); + } + + + /** + * GET /user/logout : Logs out current logged in user session + * + * + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/logout" + ) + + default Mono> logoutUser( + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().logoutUser(exchange); + } + + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = "/user/{username}", + consumes = { "application/json" } + ) + + default Mono> updateUser( + @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono user, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().updateUser(username, user, exchange); + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApiController.java new file mode 100644 index 000000000000..18120b8a8f4d --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.time.OffsetDateTime; +import org.openapitools.model.User; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class UserApiController implements UserApi { + + private final UserApiDelegate delegate; + + public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); + } + + @Override + public UserApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApiDelegate.java new file mode 100644 index 000000000000..d8ac0455219a --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -0,0 +1,181 @@ +package org.openapitools.api; + +import springfox.documentation.annotations.ApiIgnore; +import java.time.OffsetDateTime; +import org.openapitools.model.User; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public interface UserApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + default Mono> createUser(Mono user, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(user).then(Mono.empty()); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + default Mono> createUsersWithArrayInput(Flux user, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.thenMany(user).then(Mono.empty()); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + default Mono> createUsersWithListInput(Flux user, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.thenMany(user).then(Mono.empty()); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + default Mono> deleteUser(String username, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * GET /user/{username} : Get user by user name + * + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + default Mono> getUserByName(String username, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/json"), exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf("application/xml"), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + + /** + * GET /user/login : Logs user into the system + * + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + default Mono> loginUser(String username, + String password, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + default Mono> logoutUser(ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + default Mono> updateUser(String username, + Mono user, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(user).then(Mono.empty()); + + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 000000000000..b257cf0a16c7 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +package org.openapitools.configuration; + +import org.openapitools.model.EnumClass; +import org.openapitools.model.OuterEnum; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.convert.converter.Converter; + +@Configuration +public class EnumConverterConfiguration { + + @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter") + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter") + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/configuration/HomeController.java new file mode 100644 index 000000000000..f8f80d182c2d --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/configuration/HomeController.java @@ -0,0 +1,37 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.ServerResponse; +import java.net.URI; + +import static org.springframework.web.reactive.function.server.RequestPredicates.GET; +import static org.springframework.web.reactive.function.server.RouterFunctions.route; + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +public class HomeController { + + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + + @Bean + RouterFunction index() { + return route( + GET("/"), + req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build() + ); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java new file mode 100644 index 000000000000..2e4585a53233 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -0,0 +1,129 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesAnyType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AdditionalPropertiesAnyType { + + private @Nullable String name; + + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesAnyType putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(this.name, additionalPropertiesAnyType.name) && + Objects.equals(this.additionalProperties, additionalPropertiesAnyType.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java new file mode 100644 index 000000000000..5fa04ab54d34 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -0,0 +1,130 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesArray + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AdditionalPropertiesArray { + + private @Nullable String name; + + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesArray putAdditionalProperty(String key, List value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public List getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(this.name, additionalPropertiesArray.name) && + Objects.equals(this.additionalProperties, additionalPropertiesArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java new file mode 100644 index 000000000000..e05fa1a46dea --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -0,0 +1,129 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesBoolean + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AdditionalPropertiesBoolean { + + private @Nullable String name; + + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesBoolean putAdditionalProperty(String key, Boolean value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Boolean getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(this.name, additionalPropertiesBoolean.name) && + Objects.equals(this.additionalProperties, additionalPropertiesBoolean.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..d7b16275812c --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -0,0 +1,415 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AdditionalPropertiesClass { + + @Valid + private Map mapString = new HashMap<>(); + + @Valid + private Map mapNumber = new HashMap<>(); + + @Valid + private Map mapInteger = new HashMap<>(); + + @Valid + private Map mapBoolean = new HashMap<>(); + + @Valid + private Map> mapArrayInteger = new HashMap<>(); + + @Valid + private Map> mapArrayAnytype = new HashMap<>(); + + @Valid + private Map> mapMapString = new HashMap<>(); + + @Valid + private Map> mapMapAnytype = new HashMap<>(); + + private @Nullable Object anytype1; + + private JsonNullable anytype2 = JsonNullable.undefined(); + + private @Nullable Object anytype3; + + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; + return this; + } + + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap<>(); + } + this.mapString.put(key, mapStringItem); + return this; + } + + /** + * Get mapString + * @return mapString + */ + + @ApiModelProperty(value = "") + @JsonProperty("map_string") + public Map getMapString() { + return mapString; + } + + public void setMapString(Map mapString) { + this.mapString = mapString; + } + + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + return this; + } + + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap<>(); + } + this.mapNumber.put(key, mapNumberItem); + return this; + } + + /** + * Get mapNumber + * @return mapNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map_number") + public Map getMapNumber() { + return mapNumber; + } + + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap<>(); + } + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + /** + * Get mapInteger + * @return mapInteger + */ + + @ApiModelProperty(value = "") + @JsonProperty("map_integer") + public Map getMapInteger() { + return mapInteger; + } + + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap<>(); + } + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + /** + * Get mapBoolean + * @return mapBoolean + */ + + @ApiModelProperty(value = "") + @JsonProperty("map_boolean") + public Map getMapBoolean() { + return mapBoolean; + } + + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap<>(); + } + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + /** + * Get mapArrayInteger + * @return mapArrayInteger + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap<>(); + } + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + /** + * Get mapArrayAnytype + * @return mapArrayAnytype + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap<>(); + } + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + /** + * Get mapMapString + * @return mapMapString + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map_map_string") + public Map> getMapMapString() { + return mapMapString; + } + + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap<>(); + } + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + /** + * Get mapMapAnytype + * @return mapMapAnytype + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + */ + + @ApiModelProperty(value = "") + @JsonProperty("anytype_1") + public Object getAnytype1() { + return anytype1; + } + + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = JsonNullable.of(anytype2); + return this; + } + + /** + * Get anytype2 + * @return anytype2 + */ + + @ApiModelProperty(value = "") + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { + return anytype2; + } + + public void setAnytype2(JsonNullable anytype2) { + this.anytype2 = anytype2; + } + + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + /** + * Get anytype3 + * @return anytype3 + */ + + @ApiModelProperty(value = "") + @JsonProperty("anytype_3") + public Object getAnytype3() { + return anytype3; + } + + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && + Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java new file mode 100644 index 000000000000..b872d9d15b7d --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -0,0 +1,129 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesInteger + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AdditionalPropertiesInteger { + + private @Nullable String name; + + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesInteger putAdditionalProperty(String key, Integer value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Integer getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(this.name, additionalPropertiesInteger.name) && + Objects.equals(this.additionalProperties, additionalPropertiesInteger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java new file mode 100644 index 000000000000..8a7a2bd67fea --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -0,0 +1,130 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesNumber + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AdditionalPropertiesNumber { + + private @Nullable String name; + + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesNumber putAdditionalProperty(String key, BigDecimal value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public BigDecimal getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(this.name, additionalPropertiesNumber.name) && + Objects.equals(this.additionalProperties, additionalPropertiesNumber.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java new file mode 100644 index 000000000000..0aaa1c3f2f8b --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -0,0 +1,130 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Map; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesObject + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AdditionalPropertiesObject { + + private @Nullable String name; + + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesObject putAdditionalProperty(String key, Map value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Map getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(this.name, additionalPropertiesObject.name) && + Objects.equals(this.additionalProperties, additionalPropertiesObject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesString.java new file mode 100644 index 000000000000..ab5d3b2f0935 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -0,0 +1,129 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesString + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class AdditionalPropertiesString { + + private @Nullable String name; + + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesString putAdditionalProperty(String key, String value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public String getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(this.name, additionalPropertiesString.name) && + Objects.equals(this.additionalProperties, additionalPropertiesString.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Animal.java new file mode 100644 index 000000000000..c2835b003564 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Animal.java @@ -0,0 +1,134 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Animal + */ + +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = Dog.class, name = "Dog") +}) + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Animal { + + private String className; + + private String color = "red"; + + public Animal() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Animal(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("className") + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + */ + + @ApiModelProperty(value = "") + @JsonProperty("color") + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..7cbb7d2edf91 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,98 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayOfArrayOfNumberOnly + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ArrayOfArrayOfNumberOnly { + + @Valid + private List> arrayArrayNumber = new ArrayList<>(); + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..0718d842c48b --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -0,0 +1,98 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayOfNumberOnly + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ArrayOfNumberOnly { + + @Valid + private List arrayNumber = new ArrayList<>(); + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayTest.java new file mode 100644 index 000000000000..9e6fa319435d --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ArrayTest.java @@ -0,0 +1,164 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.ReadOnlyFirst; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayTest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ArrayTest { + + @Valid + private List arrayOfString = new ArrayList<>(); + + @Valid + private List> arrayArrayOfInteger = new ArrayList<>(); + + @Valid + private List> arrayArrayOfModel = new ArrayList<>(); + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + */ + + @ApiModelProperty(value = "") + @JsonProperty("array_of_string") + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..2e444ccf0169 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/BigCat.java @@ -0,0 +1,158 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Cat; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BigCat + */ + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class BigCat extends Cat { + + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable KindEnum kind; + + public BigCat() { + super(); + } + + /** + * Constructor with only required parameters + */ + public BigCat(String className) { + super(className); + } + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + public BigCat declawed(Boolean declawed) { + super.declawed(declawed); + return this; + } + + public BigCat className(String className) { + super.className(className); + return this; + } + + public BigCat color(String color) { + super.color(color); + return this; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Capitalization.java new file mode 100644 index 000000000000..40535fb1f656 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Capitalization.java @@ -0,0 +1,205 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Capitalization + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Capitalization { + + private @Nullable String smallCamel; + + private @Nullable String capitalCamel; + + private @Nullable String smallSnake; + + private @Nullable String capitalSnake; + + private @Nullable String scAETHFlowPoints; + + private @Nullable String ATT_NAME; + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + */ + + @ApiModelProperty(value = "") + @JsonProperty("smallCamel") + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + */ + + @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + */ + + @ApiModelProperty(value = "") + @JsonProperty("small_Snake") + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + */ + + @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + */ + + @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + */ + + @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Cat.java new file mode 100644 index 000000000000..97e0eb725a12 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Cat.java @@ -0,0 +1,121 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Animal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Cat + */ + +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat") +}) + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Cat extends Animal { + + private @Nullable Boolean declawed; + + public Cat() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Cat(String className) { + super(className); + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + */ + + @ApiModelProperty(value = "") + @JsonProperty("declawed") + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + public Cat className(String className) { + super.className(className); + return this; + } + + public Cat color(String color) { + super.color(color); + return this; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 000000000000..47e63bc8d588 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,120 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Category + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Category { + + private @Nullable Long id; + + private String name = "default-name"; + + public Category() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Category(String name) { + this.name = name; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ChildWithNullable.java new file mode 100644 index 000000000000..b63502abb78b --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -0,0 +1,116 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.model.ParentWithNullable; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ChildWithNullable + */ + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ChildWithNullable extends ParentWithNullable { + + private @Nullable String otherProperty; + + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + /** + * Get otherProperty + * @return otherProperty + */ + + @ApiModelProperty(value = "") + @JsonProperty("otherProperty") + public String getOtherProperty() { + return otherProperty; + } + + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + + public ChildWithNullable type(TypeEnum type) { + super.type(type); + return this; + } + + public ChildWithNullable nullableProperty(String nullableProperty) { + super.nullableProperty(nullableProperty); + return this; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullable childWithNullable = (ChildWithNullable) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ClassModel.java new file mode 100644 index 000000000000..c2efcdefa078 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ClassModel.java @@ -0,0 +1,86 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model with \"_class\" property + */ + +@ApiModel(description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ClassModel { + + private @Nullable String propertyClass; + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @ApiModelProperty(value = "") + @JsonProperty("_class") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Client.java new file mode 100644 index 000000000000..7def0e600a35 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Client.java @@ -0,0 +1,85 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Client + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Client { + + private @Nullable String client; + + public Client client(String client) { + this.client = client; + return this; + } + + /** + * Get client + * @return client + */ + + @ApiModelProperty(value = "") + @JsonProperty("client") + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 000000000000..04601701b52b --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,221 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.>undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); + + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Dog.java new file mode 100644 index 000000000000..9a989c9717a7 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Dog.java @@ -0,0 +1,113 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Animal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Dog + */ + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Dog extends Animal { + + private @Nullable String breed; + + public Dog() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Dog(String className) { + super(className); + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + */ + + @ApiModelProperty(value = "") + @JsonProperty("breed") + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + + public Dog className(String className) { + super.className(className); + return this; + } + + public Dog color(String color) { + super.color(color); + return this; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumArrays.java new file mode 100644 index 000000000000..7690cc27f606 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumArrays.java @@ -0,0 +1,192 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EnumArrays + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class EnumArrays { + + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @Valid + private List arrayEnum = new ArrayList<>(); + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + */ + + @ApiModelProperty(value = "") + @JsonProperty("just_symbol") + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + */ + + @ApiModelProperty(value = "") + @JsonProperty("array_enum") + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumClass.java new file mode 100644 index 000000000000..170fbc883996 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumClass.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumTest.java new file mode 100644 index 000000000000..f28337bb2d6d --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/EnumTest.java @@ -0,0 +1,340 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.OuterEnum; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EnumTest + */ + +@JsonTypeName("Enum_Test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class EnumTest { + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable EnumNumberEnum enumNumber; + + private @Nullable OuterEnum outerEnum; + + public EnumTest() { + super(); + } + + /** + * Constructor with only required parameters + */ + public EnumTest(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + */ + + @ApiModelProperty(value = "") + @JsonProperty("enum_string") + public EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + */ + + @ApiModelProperty(value = "") + @JsonProperty("enum_integer") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + */ + + @ApiModelProperty(value = "") + @JsonProperty("enum_number") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("outerEnum") + public OuterEnum getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/File.java new file mode 100644 index 000000000000..38b41a406a0f --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/File.java @@ -0,0 +1,86 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Must be named `File` for test. + */ + +@ApiModel(description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class File { + + private @Nullable String sourceURI; + + public File sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + */ + + @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") + public String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + File file = (File) o; + return Objects.equals(this.sourceURI, file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class File {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..202fa5241f97 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -0,0 +1,122 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FileSchemaTestClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class FileSchemaTestClass { + + private @Nullable File file; + + @Valid + private List<@Valid File> files = new ArrayList<>(); + + public FileSchemaTestClass file(File file) { + this.file = file; + return this; + } + + /** + * Get file + * @return file + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("file") + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } + + public FileSchemaTestClass files(List<@Valid File> files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("files") + public List<@Valid File> getFiles() { + return files; + } + + public void setFiles(List<@Valid File> files) { + this.files = files; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/FormatTest.java new file mode 100644 index 000000000000..c0b9b3226d66 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/FormatTest.java @@ -0,0 +1,431 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FormatTest + */ + +@JsonTypeName("format_test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class FormatTest { + + private @Nullable Integer integer; + + private @Nullable Integer int32; + + private @Nullable Long int64; + + private BigDecimal number; + + private @Nullable Float _float; + + private @Nullable Double _double; + + private @Nullable String string; + + private byte[] _byte; + + private @Nullable org.springframework.core.io.Resource binary; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate date; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime dateTime; + + private @Nullable UUID uuid; + + private String password; + + private @Nullable BigDecimal bigDecimal; + + public FormatTest() { + super(); + } + + /** + * Constructor with only required parameters + */ + public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) { + this.number = number; + this._byte = _byte; + this.date = date; + this.password = password; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + */ + @Min(10) @Max(100) + @ApiModelProperty(value = "") + @JsonProperty("integer") + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + */ + @Min(20) @Max(200) + @ApiModelProperty(value = "") + @JsonProperty("int32") + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + */ + + @ApiModelProperty(value = "") + @JsonProperty("int64") + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @ApiModelProperty(required = true, value = "") + @JsonProperty("number") + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + */ + @DecimalMin("54.3") @DecimalMax("987.6") + @ApiModelProperty(value = "") + @JsonProperty("float") + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + */ + @DecimalMin("67.8") @DecimalMax("123.4") + @ApiModelProperty(value = "") + @JsonProperty("double") + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @Pattern(regexp = "/[a-z]/i") + @ApiModelProperty(value = "") + @JsonProperty("string") + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(org.springframework.core.io.Resource binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("binary") + public org.springframework.core.io.Resource getBinary() { + return binary; + } + + public void setBinary(org.springframework.core.io.Resource binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @NotNull @Valid + @ApiModelProperty(required = true, value = "") + @JsonProperty("date") + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("dateTime") + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @Valid + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @NotNull @Size(min = 10, max = 64) + @ApiModelProperty(required = true, value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + /** + * Get bigDecimal + * @return bigDecimal + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.bigDecimal, formatTest.bigDecimal); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..240629a044e9 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -0,0 +1,111 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * HasOnlyReadOnly + */ + +@JsonTypeName("hasOnlyReadOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class HasOnlyReadOnly { + + private @Nullable String bar; + + private @Nullable String foo; + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + /** + * Get foo + * @return foo + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") + public String getFoo() { + return foo; + } + + public void setFoo(String foo) { + this.foo = foo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/MapTest.java new file mode 100644 index 000000000000..f96cbad52bbd --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/MapTest.java @@ -0,0 +1,231 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * MapTest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class MapTest { + + @Valid + private Map> mapMapOfString = new HashMap<>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @Valid + private Map mapOfEnumString = new HashMap<>(); + + @Valid + private Map directMap = new HashMap<>(); + + @Valid + private Map indirectMap = new HashMap<>(); + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + */ + + @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + */ + + @ApiModelProperty(value = "") + @JsonProperty("direct_map") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + */ + + @ApiModelProperty(value = "") + @JsonProperty("indirect_map") + public Map getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..02489cb71351 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,149 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class MixedPropertiesAndAdditionalPropertiesClass { + + private @Nullable UUID uuid; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime dateTime; + + @Valid + private Map map = new HashMap<>(); + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("uuid") + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("dateTime") + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map") + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Model200Response.java new file mode 100644 index 000000000000..49e15d52edb0 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Model200Response.java @@ -0,0 +1,112 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model name starting with number + */ + +@ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Model200Response { + + private @Nullable Integer name; + + private @Nullable String propertyClass; + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @ApiModelProperty(value = "") + @JsonProperty("class") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 000000000000..54d406f8ec81 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,135 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ModelApiResponse + */ + +@JsonTypeName("ApiResponse") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ModelApiResponse { + + private @Nullable Integer code; + + private @Nullable String type; + + private @Nullable String message; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @ApiModelProperty(value = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @ApiModelProperty(value = "") + @JsonProperty("type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + + @ApiModelProperty(value = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelList.java new file mode 100644 index 000000000000..0fc1ebe0defa --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelList.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ModelList + */ + +@JsonTypeName("List") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ModelList { + + private @Nullable String _123list; + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + */ + + @ApiModelProperty(value = "") + @JsonProperty("123-list") + public String get123list() { + return _123list; + } + + public void set123list(String _123list) { + this._123list = _123list; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelReturn.java new file mode 100644 index 000000000000..67b65936e9b5 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ModelReturn.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing reserved words + */ + +@ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ModelReturn { + + private @Nullable Integer _return; + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + */ + + @ApiModelProperty(value = "") + @JsonProperty("return") + public Integer getReturn() { + return _return; + } + + public void setReturn(Integer _return) { + this._return = _return; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Name.java new file mode 100644 index 000000000000..d465545fc1aa --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Name.java @@ -0,0 +1,169 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model name same as property name + */ + +@ApiModel(description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Name { + + private Integer name; + + private @Nullable Integer snakeCase; + + private @Nullable String property; + + private @Nullable Integer _123number; + + public Name() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Name(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("name") + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") + public Integer getSnakeCase() { + return snakeCase; + } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + */ + + @ApiModelProperty(value = "") + @JsonProperty("property") + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + + /** + * Get _123number + * @return _123number + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") + public Integer get123number() { + return _123number; + } + + public void set123number(Integer _123number) { + this._123number = _123number; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/NullableMapProperty.java new file mode 100644 index 000000000000..7a7af3df6957 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * NullableMapProperty + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class NullableMapProperty { + + @Valid + private JsonNullable> languageValues = JsonNullable.>undefined(); + + public NullableMapProperty languageValues(Map languageValues) { + this.languageValues = JsonNullable.of(languageValues); + return this; + } + + public NullableMapProperty putLanguageValuesItem(String key, String languageValuesItem) { + if (this.languageValues == null || !this.languageValues.isPresent()) { + this.languageValues = JsonNullable.of(new HashMap<>()); + } + this.languageValues.get().put(key, languageValuesItem); + return this; + } + + /** + * Get languageValues + * @return languageValues + */ + + @ApiModelProperty(value = "") + @JsonProperty("languageValues") + public JsonNullable> getLanguageValues() { + return languageValues; + } + + public void setLanguageValues(JsonNullable> languageValues) { + this.languageValues = languageValues; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableMapProperty nullableMapProperty = (NullableMapProperty) o; + return equalsNullable(this.languageValues, nullableMapProperty.languageValues); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(languageValues)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableMapProperty {\n"); + sb.append(" languageValues: ").append(toIndentedString(languageValues)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/NumberOnly.java new file mode 100644 index 000000000000..c6503f9c2df2 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/NumberOnly.java @@ -0,0 +1,86 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * NumberOnly + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class NumberOnly { + + private @Nullable BigDecimal justNumber; + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("JustNumber") + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 000000000000..188eb1dd4d87 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,246 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Order + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Order { + + private @Nullable Long id; + + private @Nullable Long petId; + + private @Nullable Integer quantity; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable StatusEnum status; + + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + */ + + @ApiModelProperty(value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + */ + + @ApiModelProperty(value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("shipDate") + public OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + + @ApiModelProperty(value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + + @ApiModelProperty(value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/OuterComposite.java new file mode 100644 index 000000000000..857f510b84fc --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/OuterComposite.java @@ -0,0 +1,134 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * OuterComposite + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class OuterComposite { + + private @Nullable BigDecimal myNumber; + + private @Nullable String myString; + + private @Nullable Boolean myBoolean; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("my_number") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + */ + + @ApiModelProperty(value = "") + @JsonProperty("my_string") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + */ + + @ApiModelProperty(value = "") + @JsonProperty("my_boolean") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/OuterEnum.java new file mode 100644 index 000000000000..6f257240a52f --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/OuterEnum.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ParentWithNullable.java new file mode 100644 index 000000000000..9f4976587fd5 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -0,0 +1,169 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ParentWithNullable + */ + +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullable.class, name = "ChildWithNullable") +}) + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ParentWithNullable { + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHILD_WITH_NULLABLE("ChildWithNullable"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable TypeEnum type; + + private JsonNullable nullableProperty = JsonNullable.undefined(); + + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @ApiModelProperty(value = "") + @JsonProperty("type") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = JsonNullable.of(nullableProperty); + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullableProperty") + public JsonNullable getNullableProperty() { + return nullableProperty; + } + + public void setNullableProperty(JsonNullable nullableProperty) { + this.nullableProperty = nullableProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullable parentWithNullable = (ParentWithNullable) o; + return Objects.equals(this.type, parentWithNullable.type) && + equalsNullable(this.nullableProperty, parentWithNullable.nullableProperty); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(type, hashCodeNullable(nullableProperty)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 000000000000..122110d9e20c --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,289 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Pet + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Pet { + + private @Nullable Long id; + + private @Nullable Category category; + + private String name; + + @Valid + private Set photoUrls = new LinkedHashSet<>(); + + @Valid + private List<@Valid Tag> tags = new ArrayList<>(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @Deprecated + private @Nullable StatusEnum status; + + public Pet() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Pet(String name, Set photoUrls) { + this.name = name; + this.photoUrls = photoUrls; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") + public Set getPhotoUrls() { + return photoUrls; + } + + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List<@Valid Tag> tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("tags") + public List<@Valid Tag> getTags() { + return tags; + } + + public void setTags(List<@Valid Tag> tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + * @deprecated + */ + + @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") + @Deprecated + public StatusEnum getStatus() { + return status; + } + + /** + * @deprecated + */ + @Deprecated + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..ddc3d05879f1 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -0,0 +1,109 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ReadOnlyFirst + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ReadOnlyFirst { + + private @Nullable String bar; + + private @Nullable String baz; + + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + */ + + @ApiModelProperty(value = "") + @JsonProperty("baz") + public String getBaz() { + return baz; + } + + public void setBaz(String baz) { + this.baz = baz; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 000000000000..90a913e1550d --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,157 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class ResponseObjectWithDifferentFieldNames { + + private @Nullable String normalPropertyName; + + private @Nullable String UPPER_CASE_PROPERTY_SNAKE; + + private @Nullable String lowerCasePropertyDashes; + + private @Nullable String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/SpecialModelName.java new file mode 100644 index 000000000000..5cfcd064c515 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/SpecialModelName.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * SpecialModelName + */ + +@JsonTypeName("_special_model.name_") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class SpecialModelName { + + private @Nullable Long $specialPropertyName; + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 000000000000..4b3016b180ee --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,109 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Tag + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class Tag { + + private @Nullable Long id; + + private @Nullable String name; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/TypeHolderDefault.java new file mode 100644 index 000000000000..b324cd142baa --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -0,0 +1,209 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TypeHolderDefault + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class TypeHolderDefault { + + private String stringItem = "what"; + + private BigDecimal numberItem = new BigDecimal("1.234"); + + private Integer integerItem = -2; + + private Boolean boolItem = true; + + @Valid + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + + public TypeHolderDefault() { + super(); + } + + /** + * Constructor with only required parameters + */ + public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { + this.stringItem = stringItem; + this.numberItem = numberItem; + this.integerItem = integerItem; + this.boolItem = boolItem; + this.arrayItem = arrayItem; + } + + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + */ + @NotNull @Valid + @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && + Objects.equals(this.numberItem, typeHolderDefault.numberItem) && + Objects.equals(this.integerItem, typeHolderDefault.integerItem) && + Objects.equals(this.boolItem, typeHolderDefault.boolItem) && + Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/TypeHolderExample.java new file mode 100644 index 000000000000..596721ca1545 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -0,0 +1,234 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TypeHolderExample + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class TypeHolderExample { + + private String stringItem; + + private BigDecimal numberItem; + + private Float floatItem; + + private Integer integerItem; + + private Boolean boolItem; + + @Valid + private List arrayItem = new ArrayList<>(); + + public TypeHolderExample() { + super(); + } + + /** + * Constructor with only required parameters + */ + public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { + this.stringItem = stringItem; + this.numberItem = numberItem; + this.floatItem = floatItem; + this.integerItem = integerItem; + this.boolItem = boolItem; + this.arrayItem = arrayItem; + } + + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + */ + @NotNull + @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + */ + @NotNull @Valid + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + */ + @NotNull + @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + */ + @NotNull + @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + */ + @NotNull + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(this.stringItem, typeHolderExample.stringItem) && + Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && + Objects.equals(this.integerItem, typeHolderExample.integerItem) && + Objects.equals(this.boolItem, typeHolderExample.boolItem) && + Objects.equals(this.arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/User.java new file mode 100644 index 000000000000..844e1395cba5 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,253 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * User + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class User { + + private @Nullable Long id; + + private @Nullable String username; + + private @Nullable String firstName; + + private @Nullable String lastName; + + private @Nullable String email; + + private @Nullable String password; + + private @Nullable String phone; + + private @Nullable Integer userStatus; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + + @ApiModelProperty(value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + + @ApiModelProperty(value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + + @ApiModelProperty(value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + + @ApiModelProperty(value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + + @ApiModelProperty(value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + */ + + @ApiModelProperty(value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + */ + + @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/XmlItem.java new file mode 100644 index 000000000000..ac912816ad82 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/java/org/openapitools/model/XmlItem.java @@ -0,0 +1,842 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * XmlItem + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") +public class XmlItem { + + private @Nullable String attributeString; + + private @Nullable BigDecimal attributeNumber; + + private @Nullable Integer attributeInteger; + + private @Nullable Boolean attributeBoolean; + + @Valid + private List wrappedArray = new ArrayList<>(); + + private @Nullable String nameString; + + private @Nullable BigDecimal nameNumber; + + private @Nullable Integer nameInteger; + + private @Nullable Boolean nameBoolean; + + @Valid + private List nameArray = new ArrayList<>(); + + @Valid + private List nameWrappedArray = new ArrayList<>(); + + private @Nullable String prefixString; + + private @Nullable BigDecimal prefixNumber; + + private @Nullable Integer prefixInteger; + + private @Nullable Boolean prefixBoolean; + + @Valid + private List prefixArray = new ArrayList<>(); + + @Valid + private List prefixWrappedArray = new ArrayList<>(); + + private @Nullable String namespaceString; + + private @Nullable BigDecimal namespaceNumber; + + private @Nullable Integer namespaceInteger; + + private @Nullable Boolean namespaceBoolean; + + @Valid + private List namespaceArray = new ArrayList<>(); + + @Valid + private List namespaceWrappedArray = new ArrayList<>(); + + private @Nullable String prefixNsString; + + private @Nullable BigDecimal prefixNsNumber; + + private @Nullable Integer prefixNsInteger; + + private @Nullable Boolean prefixNsBoolean; + + @Valid + private List prefixNsArray = new ArrayList<>(); + + @Valid + private List prefixNsWrappedArray = new ArrayList<>(); + + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + /** + * Get attributeString + * @return attributeString + */ + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") + public String getAttributeString() { + return attributeString; + } + + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + /** + * Get attributeNumber + * @return attributeNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + /** + * Get attributeInteger + * @return attributeInteger + */ + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") + public Integer getAttributeInteger() { + return attributeInteger; + } + + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + /** + * Get attributeBoolean + * @return attributeBoolean + */ + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList<>(); + } + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * @return wrappedArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") + public List getWrappedArray() { + return wrappedArray; + } + + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + */ + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") + public String getNameString() { + return nameString; + } + + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") + public BigDecimal getNameNumber() { + return nameNumber; + } + + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + */ + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") + public Integer getNameInteger() { + return nameInteger; + } + + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + */ + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") + public Boolean getNameBoolean() { + return nameBoolean; + } + + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList<>(); + } + this.nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * @return nameArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("name_array") + public List getNameArray() { + return nameArray; + } + + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList<>(); + } + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * @return nameWrappedArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") + public List getNameWrappedArray() { + return nameWrappedArray; + } + + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + */ + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") + public String getPrefixString() { + return prefixString; + } + + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + */ + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") + public Integer getPrefixInteger() { + return prefixInteger; + } + + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + */ + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList<>(); + } + this.prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * @return prefixArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("prefix_array") + public List getPrefixArray() { + return prefixArray; + } + + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList<>(); + } + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * @return prefixWrappedArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + */ + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") + public String getNamespaceString() { + return namespaceString; + } + + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + */ + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + */ + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList<>(); + } + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * @return namespaceArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("namespace_array") + public List getNamespaceArray() { + return namespaceArray; + } + + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList<>(); + } + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * @return namespaceWrappedArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + */ + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") + public String getPrefixNsString() { + return prefixNsString; + } + + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + */ + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + */ + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList<>(); + } + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * @return prefixNsArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") + public List getPrefixNsArray() { + return prefixNsArray; + } + + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList<>(); + } + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * @return prefixNsWrappedArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(this.attributeString, xmlItem.attributeString) && + Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && + Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && + Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && + Objects.equals(this.nameString, xmlItem.nameString) && + Objects.equals(this.nameNumber, xmlItem.nameNumber) && + Objects.equals(this.nameInteger, xmlItem.nameInteger) && + Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && + Objects.equals(this.nameArray, xmlItem.nameArray) && + Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(this.prefixString, xmlItem.prefixString) && + Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && + Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && + Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(this.prefixArray, xmlItem.prefixArray) && + Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(this.namespaceString, xmlItem.namespaceString) && + Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && + Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && + Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/application.properties b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/application.properties new file mode 100644 index 000000000000..9d06609db665 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/application.properties @@ -0,0 +1,3 @@ +server.port=80 +spring.jackson.date-format=org.openapitools.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..93eede0f3788 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/openapi.yaml @@ -0,0 +1,2462 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: + - application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: + - application/json + x-tags: + - tag: store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: + - application/json + - application/xml + x-tags: + - tag: store + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: + - application/json + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: + - application/json + - application/xml + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: + - application/json + - application/xml + x-tags: + - tag: user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: + - application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: + - application/json + x-tags: + - tag: user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: + - application/json + - application/xml + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake_classname_tags 123#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: + - application/json + x-tags: + - tag: fake + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + "200": + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-content-type: application/xml + x-accepts: + - application/json + x-tags: + - tag: fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/response-with-example: + get: + description: This endpoint defines an example value for its response schema. + operationId: testWithResultExample + responses: + "200": + content: + application/json: + schema: + example: 42 + type: integer + description: Success + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + x-tags: + - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: + - application/json + x-tags: + - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + deprecated: true + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + maxLength: 36 + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + BigDecimal: + format: number + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + additionalProperties: + type: string + type: object + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + type: object + type: array + type: object + map_map_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_anytype: + additionalProperties: + additionalProperties: + type: object + type: object + type: object + anytype_1: + type: object + anytype_2: {} + anytype_3: + properties: {} + type: object + type: object + AdditionalPropertiesString: + additionalProperties: + type: string + properties: + name: + type: string + type: object + AdditionalPropertiesInteger: + additionalProperties: + type: integer + properties: + name: + type: string + type: object + AdditionalPropertiesNumber: + additionalProperties: + type: number + properties: + name: + type: string + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: + type: string + type: object + AdditionalPropertiesArray: + additionalProperties: + items: + type: object + type: array + properties: + name: + type: string + type: object + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + type: object + type: object + properties: + name: + type: string + type: object + AdditionalPropertiesAnyType: + additionalProperties: + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + default: 1.234 + type: number + integer_item: + default: -2 + type: integer + bool_item: + default: true + type: boolean + array_item: + default: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + properties: + string_item: + example: what + type: string + number_item: + example: 1.234 + type: number + float_item: + example: 1.234 + format: float + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - float_item + - integer_item + - number_item + - string_item + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object + NullableMapProperty: + properties: + languageValues: + additionalProperties: + type: string + nullable: true + type: object + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
+ + + + + + diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-reactive-serverSentEvents/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file 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 888a615a9022..5e4c77a00ceb 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 @@ -16,6 +16,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -232,6 +233,35 @@ default Mono> responseObje } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default Mono>> sse( + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().sse(exchange); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index 11296053a151..3b72b4e7bcd4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -11,6 +11,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -151,6 +152,26 @@ default Mono> responseObje } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + * @see FakeApi#sse + */ + default Mono>> sse(ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + result = ApiUtil.getExampleResponse(exchange, MediaType.valueOf(""), exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 bc97bbc20843..b134201b8234 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 @@ -15,6 +15,7 @@ import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; @@ -249,6 +250,45 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = Pet.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = Pet.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 26ddac6254a4..d11a1e72e0b3 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 @@ -15,6 +15,7 @@ import org.openapitools.virtualan.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.virtualan.model.OuterComposite; +import org.openapitools.virtualan.model.Pet; import org.openapitools.virtualan.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.virtualan.model.User; import org.openapitools.virtualan.model.XmlItem; @@ -267,6 +268,44 @@ default ResponseEntity responseObjectDiff } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiVirtual + @Operation( + operationId = "sse", + tags = { "fake" }, + responses = { + @ApiResponse(responseCode = "200", description = "an sse endpoint", content = { + @Content(mediaType = "text/event-stream", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml index f26422f84ebf..93eede0f3788 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: 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 236225810096..38ae04816d34 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 @@ -15,6 +15,7 @@ import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.PetDto; import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto; import org.openapitools.model.UserDto; import org.openapitools.model.XmlItemDto; @@ -249,6 +250,45 @@ default ResponseEntity responseObjectD } + /** + * GET /fake/sse + * + * @return an sse endpoint (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "sse", + notes = "", + response = PetDto.class, + responseContainer = "List" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "an sse endpoint", response = PetDto.class, responseContainer = "List") + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/sse", + produces = { "text/event-stream" } + ) + + default ResponseEntity> sse( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf(""))) { + String exampleString = ""; + ApiUtil.setExampleResponse(request, "", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml index 8e4565fad645..dea827ef67a5 100644 --- a/samples/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -1284,6 +1284,25 @@ paths: - application/json x-tags: - tag: pet + /fake/sse: + get: + operationId: sse + responses: + "200": + content: + text/event-stream: + schema: + format: event-stream + items: + $ref: '#/components/schemas/Pet' + type: array + description: an sse endpoint + tags: + - fake + x-accepts: + - text/event-stream + x-tags: + - tag: fake components: requestBodies: UserArray: From d5e6a416c40b5df5ef4a4c964a09f5d25e1a5fad Mon Sep 17 00:00:00 2001 From: Kathrin Geilmann <16289455+kgeilmann@users.noreply.github.com> Date: Wed, 12 Feb 2025 23:20:06 +0100 Subject: [PATCH 06/11] Removed test scenario that cannot be implemented in a backward compatible way. --- .../codegen/languages/SpringCodegen.java | 14 ++++------ .../java/spring/SpringCodegenTest.java | 14 +++++----- .../3_0/sse_but_multiple_media_types.yaml | 28 ------------------- 3 files changed, 13 insertions(+), 43 deletions(-) delete mode 100644 modules/openapi-generator/src/test/resources/3_0/sse_but_multiple_media_types.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 70ab079f6ef9..d963276fa967 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -1034,11 +1034,11 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation content: text/event-stream: schema: - type: array - format: event-stream - items: - type: or - $ref: + type: array + format: event-stream + items: + type: or + $ref: */ Map> schemaTypes = operation.getResponses().entrySet().stream() .filter(p -> p.getValue().getContent() != null || p.getValue().get$ref() != null) @@ -1046,9 +1046,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation .filter(p -> p.getRight().is2xx) // consider only success .map(p -> p.getLeft().getContent().get(MEDIA_EVENT_STREAM)) .filter(Objects::nonNull) - .map(MediaType::getSchema) - .map(s -> ModelUtils.unaliasSchema(openAPI, s)) - .collect(Collectors.toList()).stream() + .map(s -> ModelUtils.unaliasSchema(openAPI, s.getSchema())) .collect(Collectors.groupingBy(Schema::getType)); if(schemaTypes.containsKey("array")) { // we have a match with SSE pattern 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 f24ebd5f1a43..ec7a01f2043f 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 @@ -4577,17 +4577,16 @@ public void testSSEOperationSupport() throws Exception { @DataProvider(name = "invalid sse endpoints") public static Object[][] specsWithInvalidSSEEndpoints() { return new Object[][] { - {"sse_but_missing_format.yaml", "schema format 'event-stream' is required, when SSE is detected"}, - // FIXME: spec does not generate correct code, but not detected - // {"sse_but_multiple_media_types.yaml", "only 1 response media type supported, when SSE is detected"}, - {"sse_but_incompatible_item_types.yaml", "only single item type is supported, when SSE is detected"} + {"sse_but_missing_format.yaml", "schema format 'event-stream' is required"}, + {"sse_but_incompatible_item_types.yaml", "only single item type is supported"} }; } @Test(dataProvider = "invalid sse endpoints") public void testSSEOperationSupport_forInvalidSSEEndpointSpecs(String inputSpec, String expectedError) { - // checks the design decision, that if the specs looks like it should be an SSE endpoint but it is not - // matching the required format, an exception is thrown containing a descriptive error message + // checks the design decision, that if the specs looks like it should be an SSE endpoint, but it + // does not match the required format, an exception is thrown containing a descriptive error + // message Map additionalProperties = Map.of( SSE, true, REACTIVE, "true", @@ -4598,7 +4597,8 @@ public void testSSEOperationSupport_forInvalidSSEEndpointSpecs(String inputSpec, assertThatThrownBy(() -> generateFromContract(input, "spring-boot", additionalProperties)) .rootCause() .isInstanceOf(RuntimeException.class) - .hasMessage(expectedError); + .message() + .contains(expectedError); } @Test diff --git a/modules/openapi-generator/src/test/resources/3_0/sse_but_multiple_media_types.yaml b/modules/openapi-generator/src/test/resources/3_0/sse_but_multiple_media_types.yaml deleted file mode 100644 index f95e7adf20c9..000000000000 --- a/modules/openapi-generator/src/test/resources/3_0/sse_but_multiple_media_types.yaml +++ /dev/null @@ -1,28 +0,0 @@ -openapi: 3.0.1 -info: - title: SSE test - description: SSE test cases - version: 1.0.0 -servers: - - url: 'https://' -tags: - - name: sse -paths: - # Generator detects this as SSE, which is ok in the first place, but it cannot generate correct code for this case, thus it should throw an exception with an error message, like for notSse4 - # Code looks like this is tried but fails in this case - /path/sse: - get: - operationId: sse - responses: - '200': - description: multiple media types defined - content: - application/json: - schema: - type: string - text/event-stream: - schema: - type: array - format: event-stream - items: - type: string From 40e5b793d070154d7652a88d692ffee24e346b17 Mon Sep 17 00:00:00 2001 From: Ross Sullivan Date: Tue, 11 Feb 2025 13:55:57 +0900 Subject: [PATCH 07/11] [Rust] Fixed Rust default `isAnyType` causing compiler issues. (#20631) * Fixed Rust default `isAnyType` causing compiler issues. * Added tests for Rust isAnyType's * Fixed thread_test.rs --- .../codegen/languages/RustClientCodegen.java | 12 +++++++++ .../src/test/resources/3_0/rust/petstore.yaml | 11 ++++++++ .../hyper/petstore/.openapi-generator/FILES | 2 ++ .../petstore/rust/hyper/petstore/README.md | 1 + .../rust/hyper/petstore/docs/AnyTypeTest.md | 11 ++++++++ .../rust/hyper/petstore/docs/FakeApi.md | 3 ++- .../rust/hyper/petstore/src/apis/fake_api.rs | 5 ++-- .../petstore/src/models/any_type_test.rs | 27 +++++++++++++++++++ .../rust/hyper/petstore/src/models/mod.rs | 2 ++ .../rust/hyper/petstore/tests/thread_test.rs | 2 +- .../hyper0x/petstore/.openapi-generator/FILES | 2 ++ .../petstore/rust/hyper0x/petstore/README.md | 1 + .../rust/hyper0x/petstore/docs/AnyTypeTest.md | 11 ++++++++ .../rust/hyper0x/petstore/docs/FakeApi.md | 3 ++- .../hyper0x/petstore/src/apis/fake_api.rs | 5 ++-- .../petstore/src/models/any_type_test.rs | 27 +++++++++++++++++++ .../rust/hyper0x/petstore/src/models/mod.rs | 2 ++ .../petstore/.openapi-generator/FILES | 2 ++ .../rust/reqwest-trait/petstore/README.md | 1 + .../petstore/docs/AnyTypeTest.md | 11 ++++++++ .../reqwest-trait/petstore/docs/FakeApi.md | 3 ++- .../petstore/src/apis/fake_api.rs | 5 ++-- .../petstore/src/models/any_type_test.rs | 27 +++++++++++++++++++ .../reqwest-trait/petstore/src/models/mod.rs | 2 ++ .../.openapi-generator/FILES | 2 ++ .../petstore-async-middleware/README.md | 1 + .../docs/AnyTypeTest.md | 11 ++++++++ .../petstore-async-middleware/docs/FakeApi.md | 3 ++- .../src/apis/fake_api.rs | 2 ++ .../src/models/any_type_test.rs | 27 +++++++++++++++++++ .../src/models/mod.rs | 2 ++ .../.openapi-generator/FILES | 2 ++ .../petstore-async-tokensource/README.md | 1 + .../docs/AnyTypeTest.md | 11 ++++++++ .../docs/FakeApi.md | 3 ++- .../src/apis/fake_api.rs | 2 ++ .../src/models/any_type_test.rs | 27 +++++++++++++++++++ .../src/models/mod.rs | 2 ++ .../petstore-async/.openapi-generator/FILES | 2 ++ .../rust/reqwest/petstore-async/README.md | 1 + .../petstore-async/docs/AnyTypeTest.md | 11 ++++++++ .../reqwest/petstore-async/docs/FakeApi.md | 3 ++- .../petstore-async/src/apis/fake_api.rs | 2 ++ .../src/models/any_type_test.rs | 27 +++++++++++++++++++ .../reqwest/petstore-async/src/models/mod.rs | 2 ++ .../.openapi-generator/FILES | 2 ++ .../rust/reqwest/petstore-avoid-box/README.md | 1 + .../petstore-avoid-box/docs/AnyTypeTest.md | 11 ++++++++ .../petstore-avoid-box/docs/FakeApi.md | 3 ++- .../petstore-avoid-box/src/apis/fake_api.rs | 2 ++ .../src/models/any_type_test.rs | 27 +++++++++++++++++++ .../petstore-avoid-box/src/models/mod.rs | 2 ++ .../.openapi-generator/FILES | 2 ++ .../reqwest/petstore-awsv4signature/README.md | 1 + .../docs/AnyTypeTest.md | 11 ++++++++ .../petstore-awsv4signature/docs/FakeApi.md | 3 ++- .../src/apis/fake_api.rs | 4 ++- .../src/models/any_type_test.rs | 27 +++++++++++++++++++ .../petstore-awsv4signature/src/models/mod.rs | 2 ++ .../.openapi-generator/FILES | 2 ++ .../petstore-model-name-prefix/README.md | 1 + .../docs/FakeApi.md | 3 ++- .../docs/FooAnyTypeTest.md | 11 ++++++++ .../src/apis/fake_api.rs | 4 ++- .../src/models/foo_any_type_test.rs | 27 +++++++++++++++++++ .../src/models/mod.rs | 2 ++ .../reqwest/petstore/.openapi-generator/FILES | 2 ++ .../petstore/rust/reqwest/petstore/README.md | 1 + .../rust/reqwest/petstore/docs/AnyTypeTest.md | 11 ++++++++ .../rust/reqwest/petstore/docs/FakeApi.md | 3 ++- .../reqwest/petstore/src/apis/fake_api.rs | 4 ++- .../petstore/src/models/any_type_test.rs | 27 +++++++++++++++++++ .../rust/reqwest/petstore/src/models/mod.rs | 2 ++ 73 files changed, 500 insertions(+), 20 deletions(-) create mode 100644 samples/client/petstore/rust/hyper/petstore/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/hyper/petstore/src/models/any_type_test.rs create mode 100644 samples/client/petstore/rust/hyper0x/petstore/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/hyper0x/petstore/src/models/any_type_test.rs create mode 100644 samples/client/petstore/rust/reqwest-trait/petstore/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/reqwest-trait/petstore/src/models/any_type_test.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/any_type_test.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/any_type_test.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async/src/models/any_type_test.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/any_type_test.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/any_type_test.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooAnyTypeTest.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_any_type_test.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore/docs/AnyTypeTest.md create mode 100644 samples/client/petstore/rust/reqwest/petstore/src/models/any_type_test.rs diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 9a287f7a3fd0..18c6e48a636a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -633,6 +633,18 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List operations = objectMap.getOperation(); for (CodegenOperation operation : operations) { if (operation.pathParams != null && operation.pathParams.size() > 0) { + + // For types with `isAnyType` we assume it's a `serde_json::Value` type. + // However for path, query, and headers it's unlikely to be JSON so we default to `String`. + // Note that we keep the default `serde_json::Value` for body parameters. + for (var param : operation.allParams) { + if (param.isAnyType && (param.isPathParam || param.isQueryParam || param.isHeaderParam)) { + param.dataType = "String"; + param.isPrimitiveType = true; + param.isString = true; + } + } + for (var pathParam : operation.pathParams) { if (!pathParam.baseName.contains("-")) { continue; diff --git a/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml index a282c5456be9..0e50c34403bd 100644 --- a/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml @@ -615,6 +615,11 @@ paths: description: To test escaping of parameters in rust code works schema: type: string + # For testing `isAnyType` types + - name: anyType + in: query + required: true + schema: {} responses: '200': description: successful operation @@ -996,3 +1001,9 @@ components: properties: dummy: type: string + AnyTypeTest: + type: object + properties: + foo: {} + required: ["foo"] + diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES index 078bc10bcb44..5767a23c8ba5 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -37,6 +38,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/hyper/petstore/README.md b/samples/client/petstore/rust/hyper/petstore/README.md index 3c26db515d26..f6319d46f240 100644 --- a/samples/client/petstore/rust/hyper/petstore/README.md +++ b/samples/client/petstore/rust/hyper/petstore/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/AnyTypeTest.md b/samples/client/petstore/rust/hyper/petstore/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/hyper/petstore/docs/FakeApi.md b/samples/client/petstore/rust/hyper/petstore/docs/FakeApi.md index 7f8beb91115b..9dcab81e5dc9 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/FakeApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs index b1e78f2c5f5a..8e422ef9d4bc 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs @@ -37,19 +37,20 @@ impl FakeApiClient } pub trait FakeApi: Send + Sync { - fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Pin> + Send>>; + fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Pin> + Send>>; } implFakeApi for FakeApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Pin> + Send>> { + fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Pin> + Send>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/fake/user/{user_name}".to_string()) ; if let Some(ref s) = content { let query_value = s.to_string(); req = req.with_query_param("content".to_string(), query_value); } + req = req.with_query_param("anyType".to_string(), any_type.to_string()); req = req.with_path_param("user_name".to_string(), user_name.to_string()); match dummy_required_nullable_param { Some(param_value) => { req = req.with_header_param("dummy_required_nullable_param".to_string(), param_value.to_string()); }, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/any_type_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; diff --git a/samples/client/petstore/rust/hyper/petstore/tests/thread_test.rs b/samples/client/petstore/rust/hyper/petstore/tests/thread_test.rs index 8329988a18bf..d0bc025ce50b 100644 --- a/samples/client/petstore/rust/hyper/petstore/tests/thread_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/tests/thread_test.rs @@ -11,7 +11,7 @@ mod tests { let handle = thread::spawn(move || { let _ = client .fake_api() - .test_nullable_required_param("username", None, None, None); + .test_nullable_required_param("username", None, "any_type", None, None); }); handle.join().expect("Thread panicked!"); diff --git a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES index 6d5eacd5c073..d935311d38c8 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/hyper0x/petstore/README.md b/samples/client/petstore/rust/hyper0x/petstore/README.md index 0143eb0f8137..c41a4d7e0e90 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/README.md +++ b/samples/client/petstore/rust/hyper0x/petstore/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/AnyTypeTest.md b/samples/client/petstore/rust/hyper0x/petstore/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/FakeApi.md b/samples/client/petstore/rust/hyper0x/petstore/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/FakeApi.md +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/fake_api.rs index 12a59925332f..099602bb22a7 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/fake_api.rs @@ -36,19 +36,20 @@ impl FakeApiClient } pub trait FakeApi { - fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Pin>>>; + fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Pin>>>; } implFakeApi for FakeApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Pin>>> { + fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/fake/user/{user_name}".to_string()) ; if let Some(ref s) = content { let query_value = s.to_string(); req = req.with_query_param("content".to_string(), query_value); } + req = req.with_query_param("anyType".to_string(), any_type.to_string()); req = req.with_path_param("user_name".to_string(), user_name.to_string()); match dummy_required_nullable_param { Some(param_value) => { req = req.with_header_param("dummy_required_nullable_param".to_string(), param_value.to_string()); }, diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/any_type_test.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES index 6d5eacd5c073..d935311d38c8 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/README.md b/samples/client/petstore/rust/reqwest-trait/petstore/README.md index d4fe770230cf..abfb091ca356 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/README.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/AnyTypeTest.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/reqwest-trait/petstore/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/FakeApi.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/FakeApi.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/fake_api.rs index 6dd5512c1982..7368946bb46f 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/fake_api.rs @@ -23,7 +23,7 @@ use super::{Error, configuration}; pub trait FakeApi: Send + Sync { /// GET /fake/user/{user_name} - async fn test_nullable_required_param<'user_name, 'dummy_required_nullable_param, 'uppercase, 'content>(&self, user_name: &'user_name str, dummy_required_nullable_param: Option<&'dummy_required_nullable_param str>, uppercase: Option<&'uppercase str>, content: Option<&'content str>) -> Result<(), Error>; + async fn test_nullable_required_param<'user_name, 'dummy_required_nullable_param, 'any_type, 'uppercase, 'content>(&self, user_name: &'user_name str, dummy_required_nullable_param: Option<&'dummy_required_nullable_param str>, any_type: &'any_type str, uppercase: Option<&'uppercase str>, content: Option<&'content str>) -> Result<(), Error>; } pub struct FakeApiClient { @@ -41,7 +41,7 @@ impl FakeApiClient { #[async_trait] impl FakeApi for FakeApiClient { /// - async fn test_nullable_required_param<'user_name, 'dummy_required_nullable_param, 'uppercase, 'content>(&self, user_name: &'user_name str, dummy_required_nullable_param: Option<&'dummy_required_nullable_param str>, uppercase: Option<&'uppercase str>, content: Option<&'content str>) -> Result<(), Error> { + async fn test_nullable_required_param<'user_name, 'dummy_required_nullable_param, 'any_type, 'uppercase, 'content>(&self, user_name: &'user_name str, dummy_required_nullable_param: Option<&'dummy_required_nullable_param str>, any_type: &'any_type str, uppercase: Option<&'uppercase str>, content: Option<&'content str>) -> Result<(), Error> { let local_var_configuration = &self.configuration; let local_var_client = &local_var_configuration.client; @@ -52,6 +52,7 @@ impl FakeApi for FakeApiClient { if let Some(ref local_var_str) = content { local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]); } + local_var_req_builder = local_var_req_builder.query(&[("anyType", &any_type.to_string())]); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/any_type_test.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES index 6d5eacd5c073..d935311d38c8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md index 32d4fa4e5da7..f478f035b2b8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/AnyTypeTest.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/FakeApi.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/FakeApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs index dbc4858a0eed..be9503699260 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs @@ -21,6 +21,7 @@ pub struct TestNullableRequiredParamParams { pub user_name: String, /// To test nullable required parameters pub dummy_required_nullable_param: Option, + pub any_type: String, /// To test parameter names in upper case pub uppercase: Option, /// To test escaping of parameters in rust code works @@ -55,6 +56,7 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu if let Some(ref param_value) = params.content { req_builder = req_builder.query(&[("content", ¶m_value.to_string())]); } + req_builder = req_builder.query(&[("anyType", ¶ms.any_type.to_string())]); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/any_type_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES index 6d5eacd5c073..d935311d38c8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md index 1517c8be4854..e38f79988b82 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/AnyTypeTest.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/FakeApi.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/FakeApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/fake_api.rs index dbc4858a0eed..be9503699260 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/fake_api.rs @@ -21,6 +21,7 @@ pub struct TestNullableRequiredParamParams { pub user_name: String, /// To test nullable required parameters pub dummy_required_nullable_param: Option, + pub any_type: String, /// To test parameter names in upper case pub uppercase: Option, /// To test escaping of parameters in rust code works @@ -55,6 +56,7 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu if let Some(ref param_value) = params.content { req_builder = req_builder.query(&[("content", ¶m_value.to_string())]); } + req_builder = req_builder.query(&[("anyType", ¶ms.any_type.to_string())]); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/any_type_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES index 6d5eacd5c073..d935311d38c8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-async/README.md b/samples/client/petstore/rust/reqwest/petstore-async/README.md index 8975bbb48926..72996d36543f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/AnyTypeTest.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/FakeApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/FakeApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs index dbc4858a0eed..be9503699260 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs @@ -21,6 +21,7 @@ pub struct TestNullableRequiredParamParams { pub user_name: String, /// To test nullable required parameters pub dummy_required_nullable_param: Option, + pub any_type: String, /// To test parameter names in upper case pub uppercase: Option, /// To test escaping of parameters in rust code works @@ -55,6 +56,7 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu if let Some(ref param_value) = params.content { req_builder = req_builder.query(&[("content", ¶m_value.to_string())]); } + req_builder = req_builder.query(&[("anyType", ¶ms.any_type.to_string())]); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/any_type_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES index 6d5eacd5c073..d935311d38c8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md index 03f217550a46..3dd5fd8df914 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/AnyTypeTest.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/FakeApi.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/FakeApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs index dbc4858a0eed..be9503699260 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs @@ -21,6 +21,7 @@ pub struct TestNullableRequiredParamParams { pub user_name: String, /// To test nullable required parameters pub dummy_required_nullable_param: Option, + pub any_type: String, /// To test parameter names in upper case pub uppercase: Option, /// To test escaping of parameters in rust code works @@ -55,6 +56,7 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu if let Some(ref param_value) = params.content { req_builder = req_builder.query(&[("content", ¶m_value.to_string())]); } + req_builder = req_builder.query(&[("anyType", ¶ms.any_type.to_string())]); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/any_type_test.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES index 6d5eacd5c073..d935311d38c8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md index 494104867fad..5ed03ffe8db8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/AnyTypeTest.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/FakeApi.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/FakeApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs index f607b9b069d4..84059e46e596 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs @@ -26,10 +26,11 @@ pub enum TestNullableRequiredParamError { /// -pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error> { +pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_user_name = user_name; let p_dummy_required_nullable_param = dummy_required_nullable_param; + let p_any_type = any_type; let p_uppercase = uppercase; let p_content = content; @@ -39,6 +40,7 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration if let Some(ref param_value) = p_content { req_builder = req_builder.query(&[("content", ¶m_value.to_string())]); } + req_builder = req_builder.query(&[("anyType", &p_any_type.to_string())]); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/any_type_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES index 13e753f39020..1c83a6638ad2 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES @@ -4,6 +4,7 @@ Cargo.toml README.md docs/FakeApi.md docs/FooActionContainer.md +docs/FooAnyTypeTest.md docs/FooApiResponse.md docs/FooArrayItemRefTest.md docs/FooBaz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/foo_action_container.rs +src/models/foo_any_type_test.rs src/models/foo_api_response.rs src/models/foo_array_item_ref_test.rs src/models/foo_baz.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md index a1383c0003e7..1303b7a8174e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [FooActionContainer](docs/FooActionContainer.md) + - [FooAnyTypeTest](docs/FooAnyTypeTest.md) - [FooApiResponse](docs/FooApiResponse.md) - [FooArrayItemRefTest](docs/FooArrayItemRefTest.md) - [FooBaz](docs/FooBaz.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FakeApi.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FakeApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooAnyTypeTest.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooAnyTypeTest.md new file mode 100644 index 000000000000..ca27b3a52bc1 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooAnyTypeTest.md @@ -0,0 +1,11 @@ +# FooAnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/fake_api.rs index f607b9b069d4..84059e46e596 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/fake_api.rs @@ -26,10 +26,11 @@ pub enum TestNullableRequiredParamError { /// -pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error> { +pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_user_name = user_name; let p_dummy_required_nullable_param = dummy_required_nullable_param; + let p_any_type = any_type; let p_uppercase = uppercase; let p_content = content; @@ -39,6 +40,7 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration if let Some(ref param_value) = p_content { req_builder = req_builder.query(&[("content", ¶m_value.to_string())]); } + req_builder = req_builder.query(&[("anyType", &p_any_type.to_string())]); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_any_type_test.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_any_type_test.rs new file mode 100644 index 000000000000..6f0cbd7a74ac --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FooAnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl FooAnyTypeTest { + pub fn new(foo: Option) -> FooAnyTypeTest { + FooAnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs index 11d4654e7908..256941bfbc1e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod foo_action_container; pub use self::foo_action_container::FooActionContainer; +pub mod foo_any_type_test; +pub use self::foo_any_type_test::FooAnyTypeTest; pub mod foo_api_response; pub use self::foo_api_response::FooApiResponse; pub mod foo_array_item_ref_test; diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES index 6d5eacd5c073..d935311d38c8 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES @@ -3,6 +3,7 @@ Cargo.toml README.md docs/ActionContainer.md +docs/AnyTypeTest.md docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md @@ -35,6 +36,7 @@ src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs src/models/action_container.rs +src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs diff --git a/samples/client/petstore/rust/reqwest/petstore/README.md b/samples/client/petstore/rust/reqwest/petstore/README.md index d4fe770230cf..abfb091ca356 100644 --- a/samples/client/petstore/rust/reqwest/petstore/README.md +++ b/samples/client/petstore/rust/reqwest/petstore/README.md @@ -54,6 +54,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ActionContainer](docs/ActionContainer.md) + - [AnyTypeTest](docs/AnyTypeTest.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/AnyTypeTest.md b/samples/client/petstore/rust/reqwest/petstore/docs/AnyTypeTest.md new file mode 100644 index 000000000000..cfcbd80fed0e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/docs/AnyTypeTest.md @@ -0,0 +1,11 @@ +# AnyTypeTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**serde_json::Value**](.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/FakeApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/FakeApi.md index c41f7d7b0e2f..ac1e9f40c105 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/FakeApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/FakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## test_nullable_required_param -> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content) +> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content) To test nullable required parameters @@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | **dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**any_type** | **String** | | [required] | **uppercase** | Option<**String**> | To test parameter names in upper case | | **content** | Option<**String**> | To test escaping of parameters in rust code works | | diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs index f607b9b069d4..84059e46e596 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs @@ -26,10 +26,11 @@ pub enum TestNullableRequiredParamError { /// -pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error> { +pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_user_name = user_name; let p_dummy_required_nullable_param = dummy_required_nullable_param; + let p_any_type = any_type; let p_uppercase = uppercase; let p_content = content; @@ -39,6 +40,7 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration if let Some(ref param_value) = p_content { req_builder = req_builder.query(&[("content", ¶m_value.to_string())]); } + req_builder = req_builder.query(&[("anyType", &p_any_type.to_string())]); if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/any_type_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/any_type_test.rs new file mode 100644 index 000000000000..8a873991fd42 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/any_type_test.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnyTypeTest { + #[serde(rename = "foo", deserialize_with = "Option::deserialize")] + pub foo: Option, +} + +impl AnyTypeTest { + pub fn new(foo: Option) -> AnyTypeTest { + AnyTypeTest { + foo, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs index b7e684d8071d..da642be6a19c 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs @@ -1,5 +1,7 @@ pub mod action_container; pub use self::action_container::ActionContainer; +pub mod any_type_test; +pub use self::any_type_test::AnyTypeTest; pub mod api_response; pub use self::api_response::ApiResponse; pub mod array_item_ref_test; From 3f608aa537e3342d85c1bf1ad26b05836c9d744a Mon Sep 17 00:00:00 2001 From: zaenk Date: Wed, 12 Feb 2025 10:41:14 +0100 Subject: [PATCH 08/11] [JavaSpring, kotlin-spring] attach sources when maven and interfaceOnly=true is used (#20640) * [JavaSpring] attach sources when using maven and interfaceOnly=true Closes #15659 * [kotlin-spring] attach sources when using maven and interfaceOnly=true Closes #15659 --- .../libraries/spring-boot/pom-sb3.mustache | 18 ++++++++++++++---- .../libraries/spring-boot/pom.mustache | 18 ++++++++++++++---- .../libraries/spring-cloud/pom-sb3.mustache | 14 ++++++++++++++ .../libraries/spring-cloud/pom.mustache | 14 ++++++++++++++ .../libraries/spring-boot/pom-sb3.mustache | 12 ++++++++++++ .../libraries/spring-boot/pom.mustache | 12 ++++++++++++ .../libraries/spring-cloud/pom-sb3.mustache | 12 ++++++++++++ .../libraries/spring-cloud/pom.mustache | 12 ++++++++++++ .../client/petstore/spring-cloud-auth/pom.xml | 1 + .../petstore/spring-cloud-date-time/pom.xml | 14 ++++++++++++++ .../petstore/spring-cloud-deprecated/pom.xml | 14 ++++++++++++++ .../spring-cloud-feign-without-url/pom.xml | 1 + .../client/petstore/spring-cloud-tags/pom.xml | 14 ++++++++++++++ samples/client/petstore/spring-cloud/pom.xml | 1 + .../spring-cloud-3-with-optional/pom.xml | 1 + .../client/petstore/spring-cloud-3/pom.xml | 1 + .../client/petstore/spring-cloud-async/pom.xml | 1 + .../petstore/spring-cloud-date-time/pom.xml | 14 ++++++++++++++ .../petstore/spring-cloud-http-basic/pom.xml | 14 ++++++++++++++ .../petstore/spring-cloud-oas3-fakeapi/pom.xml | 14 ++++++++++++++ .../spring-cloud-spring-pageable/pom.xml | 1 + .../client/petstore/spring-cloud/pom.xml | 14 ++++++++++++++ .../pom.xml | 15 +++++++++++++++ .../client/petstore/spring-stubs/pom.xml | 15 +++++++++++++++ .../server/petstore/spring-boot-oneof/pom.xml | 1 + .../petstore/spring-boot-springdoc/pom.xml | 1 + .../server/petstore/springboot-3/pom.xml | 1 + .../petstore/springboot-delegate/pom.xml | 1 + .../springboot-implicitHeaders/pom.xml | 1 + .../server/petstore/springboot-source/pom.xml | 1 + .../server/petstore/springboot/pom.xml | 1 + .../petstore/kotlin-spring-cloud/pom.xml | 12 ++++++++++++ .../petstore/kotlin-spring-default/pom.xml | 1 + .../petstore/kotlin-springboot-3/pom.xml | 1 + .../pom.xml | 1 + .../pom.xml | 1 + .../kotlin-springboot-delegate/pom.xml | 1 + .../kotlin-springboot-integer-enum/pom.xml | 12 ++++++++++++ .../kotlin-springboot-modelMutable/pom.xml | 1 + .../pom.xml | 1 + .../pom.xml | 1 + .../kotlin-springboot-reactive/pom.xml | 1 + .../kotlin-springboot-request-cookie/pom.xml | 12 ++++++++++++ .../kotlin-springboot-source-swagger1/pom.xml | 1 + .../kotlin-springboot-source-swagger2/pom.xml | 1 + .../kotlin-springboot-springfox/pom.xml | 1 + .../server/petstore/kotlin-springboot/pom.xml | 1 + .../pom.xml | 15 +++++++++++++++ .../petstore/spring-boot-nullable-set/pom.xml | 15 +++++++++++++++ .../pom.xml | 1 + .../petstore/springboot-beanvalidation/pom.xml | 1 + .../petstore/springboot-delegate-j8/pom.xml | 1 + .../pom.xml | 1 + .../petstore/springboot-delegate/pom.xml | 1 + .../springboot-file-delegate-optional/pom.xml | 1 + .../pom.xml | 1 + .../springboot-implicitHeaders/pom.xml | 1 + .../petstore/springboot-lombok-data/pom.xml | 1 + .../springboot-lombok-tostring/pom.xml | 1 + .../pom.xml | 1 + .../petstore/springboot-reactive/pom.xml | 1 + .../pom.xml | 1 + .../pom.xml | 1 + .../pom.xml | 1 + .../springboot-spring-pageable/pom.xml | 1 + .../springboot-spring-provide-args/pom.xml | 1 + .../petstore/springboot-useoptional/pom.xml | 1 + .../petstore/springboot-virtualan/pom.xml | 1 + samples/server/petstore/springboot/pom.xml | 1 + 69 files changed, 345 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache index 1024ea0d6088..f1b251a815da 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache @@ -57,9 +57,8 @@ src/main/java - {{^interfaceOnly}} - + {{^interfaceOnly}} org.springframework.boot spring-boot-maven-plugin @@ -75,7 +74,19 @@ {{/lombok}} - + {{/interfaceOnly}} + {{#interfaceOnly}} + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + {{/interfaceOnly}} {{#apiFirst}} org.openapitools @@ -109,7 +120,6 @@ {{/apiFirst}} - {{/interfaceOnly}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index 26e4aad21fa4..b9d84091bc9d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -50,9 +50,8 @@ {{/parentOverridden}} src/main/java - {{^interfaceOnly}} - + {{^interfaceOnly}} org.springframework.boot spring-boot-maven-plugin @@ -68,7 +67,19 @@ {{/lombok}} - + {{/interfaceOnly}} + {{#interfaceOnly}} + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + {{/interfaceOnly}} {{#apiFirst}} org.openapitools @@ -102,7 +113,6 @@ {{/apiFirst}} - {{/interfaceOnly}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb3.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb3.mustache index 65bf80bf1c0f..54c4735c89f6 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb3.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb3.mustache @@ -45,6 +45,20 @@ src/main/java + {{#interfaceOnly}} + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + {{/interfaceOnly}} {{^parentOverridden}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index 41bbf5ef1b20..c1a8d9a96e4d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -44,6 +44,20 @@ {{/parentOverridden}} src/main/java + {{#interfaceOnly}} + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + {{/interfaceOnly}} {{^parentOverridden}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom-sb3.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom-sb3.mustache index 1b8db5da1c7a..a933ddd54863 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom-sb3.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom-sb3.mustache @@ -52,6 +52,18 @@ {{/interfaceOnly}} + {{#interfaceOnly}} + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + {{/interfaceOnly}} kotlin-maven-plugin org.jetbrains.kotlin diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache index 3a385815ffdd..190b3e46ec9e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache @@ -39,6 +39,18 @@ {{/interfaceOnly}} + {{#interfaceOnly}} + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + {{/interfaceOnly}} kotlin-maven-plugin org.jetbrains.kotlin diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom-sb3.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom-sb3.mustache index cb411401236d..02b5bccf5bbf 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom-sb3.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom-sb3.mustache @@ -69,6 +69,18 @@ {{/interfaceOnly}} + {{#interfaceOnly}} + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + {{/interfaceOnly}} kotlin-maven-plugin org.jetbrains.kotlin diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom.mustache index 1fddfdbb51e5..e8d760b95207 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom.mustache @@ -49,6 +49,18 @@ {{/interfaceOnly}} + {{#interfaceOnly}} + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + {{/interfaceOnly}} kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/client/petstore/spring-cloud-auth/pom.xml b/samples/client/petstore/spring-cloud-auth/pom.xml index e9ecbf6d8a29..7bdec228001e 100644 --- a/samples/client/petstore/spring-cloud-auth/pom.xml +++ b/samples/client/petstore/spring-cloud-auth/pom.xml @@ -19,6 +19,7 @@ src/main/java + diff --git a/samples/client/petstore/spring-cloud-date-time/pom.xml b/samples/client/petstore/spring-cloud-date-time/pom.xml index ac2aa08552f1..990f6fd03372 100644 --- a/samples/client/petstore/spring-cloud-date-time/pom.xml +++ b/samples/client/petstore/spring-cloud-date-time/pom.xml @@ -20,6 +20,20 @@ src/main/java + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/client/petstore/spring-cloud-deprecated/pom.xml b/samples/client/petstore/spring-cloud-deprecated/pom.xml index 77062fc625b5..617d47fa5fd1 100644 --- a/samples/client/petstore/spring-cloud-deprecated/pom.xml +++ b/samples/client/petstore/spring-cloud-deprecated/pom.xml @@ -20,6 +20,20 @@ src/main/java + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/client/petstore/spring-cloud-feign-without-url/pom.xml b/samples/client/petstore/spring-cloud-feign-without-url/pom.xml index e77a0f03f45c..09928074378f 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/pom.xml +++ b/samples/client/petstore/spring-cloud-feign-without-url/pom.xml @@ -20,6 +20,7 @@ src/main/java + diff --git a/samples/client/petstore/spring-cloud-tags/pom.xml b/samples/client/petstore/spring-cloud-tags/pom.xml index ae4cb2017aa1..75beaa8d7dbb 100644 --- a/samples/client/petstore/spring-cloud-tags/pom.xml +++ b/samples/client/petstore/spring-cloud-tags/pom.xml @@ -20,6 +20,20 @@ src/main/java + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/client/petstore/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml index e77a0f03f45c..09928074378f 100644 --- a/samples/client/petstore/spring-cloud/pom.xml +++ b/samples/client/petstore/spring-cloud/pom.xml @@ -20,6 +20,7 @@ src/main/java + diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/pom.xml b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/pom.xml index 073730d7a477..77ce3bbb2320 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/pom.xml @@ -28,6 +28,7 @@ src/main/java + diff --git a/samples/openapi3/client/petstore/spring-cloud-3/pom.xml b/samples/openapi3/client/petstore/spring-cloud-3/pom.xml index 7d50eefeaab8..2f4e3b9ce40d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-3/pom.xml @@ -29,6 +29,7 @@ src/main/java + diff --git a/samples/openapi3/client/petstore/spring-cloud-async/pom.xml b/samples/openapi3/client/petstore/spring-cloud-async/pom.xml index 27bf283c6f44..e6d142605960 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-async/pom.xml @@ -20,6 +20,7 @@ src/main/java + diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/pom.xml b/samples/openapi3/client/petstore/spring-cloud-date-time/pom.xml index 8eb161832d0f..a309a8fb24f9 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/pom.xml @@ -20,6 +20,20 @@ src/main/java + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/pom.xml b/samples/openapi3/client/petstore/spring-cloud-http-basic/pom.xml index 6c63ac794490..b2208fab5c03 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/pom.xml @@ -20,6 +20,20 @@ src/main/java + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/pom.xml b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/pom.xml index d657a9e588fc..d09672034484 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/pom.xml @@ -20,6 +20,20 @@ src/main/java + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/pom.xml b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/pom.xml index 302f2b063322..7a16989fac3b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/pom.xml @@ -20,6 +20,7 @@ src/main/java + diff --git a/samples/openapi3/client/petstore/spring-cloud/pom.xml b/samples/openapi3/client/petstore/spring-cloud/pom.xml index d657a9e588fc..d09672034484 100644 --- a/samples/openapi3/client/petstore/spring-cloud/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud/pom.xml @@ -20,6 +20,20 @@ src/main/java + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml index 36b678341006..9fbce0513655 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml @@ -21,6 +21,21 @@ src/main/java + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/openapi3/client/petstore/spring-stubs/pom.xml b/samples/openapi3/client/petstore/spring-stubs/pom.xml index 36b678341006..9fbce0513655 100644 --- a/samples/openapi3/client/petstore/spring-stubs/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs/pom.xml @@ -21,6 +21,21 @@ src/main/java + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml b/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml index 7113913e6ca0..f492b83a9691 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml index 230983b59c85..67c48412e174 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml @@ -27,6 +27,7 @@ + diff --git a/samples/openapi3/server/petstore/springboot-3/pom.xml b/samples/openapi3/server/petstore/springboot-3/pom.xml index 54c3603cbc9d..3d20c6390a38 100644 --- a/samples/openapi3/server/petstore/springboot-3/pom.xml +++ b/samples/openapi3/server/petstore/springboot-3/pom.xml @@ -43,6 +43,7 @@ + diff --git a/samples/openapi3/server/petstore/springboot-delegate/pom.xml b/samples/openapi3/server/petstore/springboot-delegate/pom.xml index 67d552b723dc..fb60a61c9b95 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/pom.xml +++ b/samples/openapi3/server/petstore/springboot-delegate/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml index 5b071433c604..d7299a0482dc 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/openapi3/server/petstore/springboot-source/pom.xml b/samples/openapi3/server/petstore/springboot-source/pom.xml index 3f54f4adede8..53d9d81b327e 100644 --- a/samples/openapi3/server/petstore/springboot-source/pom.xml +++ b/samples/openapi3/server/petstore/springboot-source/pom.xml @@ -27,6 +27,7 @@ + diff --git a/samples/openapi3/server/petstore/springboot/pom.xml b/samples/openapi3/server/petstore/springboot/pom.xml index d60cccd3ff1f..0919bc8dbd96 100644 --- a/samples/openapi3/server/petstore/springboot/pom.xml +++ b/samples/openapi3/server/petstore/springboot/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/kotlin-spring-cloud/pom.xml b/samples/server/petstore/kotlin-spring-cloud/pom.xml index 654de03c5e77..ececa13784d9 100644 --- a/samples/server/petstore/kotlin-spring-cloud/pom.xml +++ b/samples/server/petstore/kotlin-spring-cloud/pom.xml @@ -32,6 +32,18 @@ ${project.basedir}/src/main/kotlin + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-spring-default/pom.xml b/samples/server/petstore/kotlin-spring-default/pom.xml index 8b51baf52f52..c7589ea91c55 100644 --- a/samples/server/petstore/kotlin-spring-default/pom.xml +++ b/samples/server/petstore/kotlin-spring-default/pom.xml @@ -34,6 +34,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-3/pom.xml b/samples/server/petstore/kotlin-springboot-3/pom.xml index 9d09dc29faf2..3c52a401bf8a 100644 --- a/samples/server/petstore/kotlin-springboot-3/pom.xml +++ b/samples/server/petstore/kotlin-springboot-3/pom.xml @@ -46,6 +46,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-bigdecimal-default/pom.xml b/samples/server/petstore/kotlin-springboot-bigdecimal-default/pom.xml index 8b51baf52f52..c7589ea91c55 100644 --- a/samples/server/petstore/kotlin-springboot-bigdecimal-default/pom.xml +++ b/samples/server/petstore/kotlin-springboot-bigdecimal-default/pom.xml @@ -34,6 +34,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml index 77ec69645189..b041f6c83f6e 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml @@ -47,6 +47,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-delegate/pom.xml b/samples/server/petstore/kotlin-springboot-delegate/pom.xml index 8b51baf52f52..c7589ea91c55 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/pom.xml +++ b/samples/server/petstore/kotlin-springboot-delegate/pom.xml @@ -34,6 +34,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/pom.xml b/samples/server/petstore/kotlin-springboot-integer-enum/pom.xml index 975b084d5a37..77a9c03660db 100644 --- a/samples/server/petstore/kotlin-springboot-integer-enum/pom.xml +++ b/samples/server/petstore/kotlin-springboot-integer-enum/pom.xml @@ -35,6 +35,18 @@ ${project.basedir}/src/main/kotlin ${project.basedir}/src/test/kotlin + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml b/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml index 8b51baf52f52..c7589ea91c55 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml +++ b/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml @@ -34,6 +34,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml b/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml index 8b51baf52f52..c7589ea91c55 100644 --- a/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml @@ -34,6 +34,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-reactive-without-flow/pom.xml b/samples/server/petstore/kotlin-springboot-reactive-without-flow/pom.xml index f555dc75a07d..fc671acde310 100644 --- a/samples/server/petstore/kotlin-springboot-reactive-without-flow/pom.xml +++ b/samples/server/petstore/kotlin-springboot-reactive-without-flow/pom.xml @@ -35,6 +35,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-reactive/pom.xml b/samples/server/petstore/kotlin-springboot-reactive/pom.xml index f555dc75a07d..fc671acde310 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/pom.xml +++ b/samples/server/petstore/kotlin-springboot-reactive/pom.xml @@ -35,6 +35,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/pom.xml b/samples/server/petstore/kotlin-springboot-request-cookie/pom.xml index d3dd81b25a85..fb11e4866dec 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/pom.xml +++ b/samples/server/petstore/kotlin-springboot-request-cookie/pom.xml @@ -36,6 +36,18 @@ ${project.basedir}/src/main/kotlin ${project.basedir}/src/test/kotlin + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/pom.xml b/samples/server/petstore/kotlin-springboot-source-swagger1/pom.xml index 0b4b2ed3ab8c..f64e391e05df 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/pom.xml +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/pom.xml @@ -35,6 +35,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/pom.xml b/samples/server/petstore/kotlin-springboot-source-swagger2/pom.xml index 3e48c18fac3f..4e934ad51154 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/pom.xml +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/pom.xml @@ -35,6 +35,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot-springfox/pom.xml b/samples/server/petstore/kotlin-springboot-springfox/pom.xml index df16e753a7a5..cfdc5e8c6a40 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/pom.xml +++ b/samples/server/petstore/kotlin-springboot-springfox/pom.xml @@ -35,6 +35,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/kotlin-springboot/pom.xml b/samples/server/petstore/kotlin-springboot/pom.xml index f4d469c3a090..dfd0d3a9f6b6 100644 --- a/samples/server/petstore/kotlin-springboot/pom.xml +++ b/samples/server/petstore/kotlin-springboot/pom.xml @@ -33,6 +33,7 @@ + kotlin-maven-plugin org.jetbrains.kotlin diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml index ed21f4db5509..a871967c2bb2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml @@ -21,6 +21,21 @@ src/main/java + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/server/petstore/spring-boot-nullable-set/pom.xml b/samples/server/petstore/spring-boot-nullable-set/pom.xml index f7ab953bed96..0d5996f775db 100644 --- a/samples/server/petstore/spring-boot-nullable-set/pom.xml +++ b/samples/server/petstore/spring-boot-nullable-set/pom.xml @@ -21,6 +21,21 @@ src/main/java + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index 6281f810cd38..bdf380a87060 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-beanvalidation/pom.xml b/samples/server/petstore/springboot-beanvalidation/pom.xml index f48622e7ec8d..301dfba8efd7 100644 --- a/samples/server/petstore/springboot-beanvalidation/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation/pom.xml @@ -27,6 +27,7 @@ + diff --git a/samples/server/petstore/springboot-delegate-j8/pom.xml b/samples/server/petstore/springboot-delegate-j8/pom.xml index 92bfa2cb5cbb..692bbb2b9b71 100644 --- a/samples/server/petstore/springboot-delegate-j8/pom.xml +++ b/samples/server/petstore/springboot-delegate-j8/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml index 461339353f4b..cdbb8636eeb9 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml +++ b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml index 726f5f2dae84..38d2b4da909f 100644 --- a/samples/server/petstore/springboot-delegate/pom.xml +++ b/samples/server/petstore/springboot-delegate/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-file-delegate-optional/pom.xml b/samples/server/petstore/springboot-file-delegate-optional/pom.xml index 9ac3410785c2..41c63ba68113 100644 --- a/samples/server/petstore/springboot-file-delegate-optional/pom.xml +++ b/samples/server/petstore/springboot-file-delegate-optional/pom.xml @@ -43,6 +43,7 @@ + diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml index 687700115869..5e27d9762d07 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml @@ -26,6 +26,7 @@ + diff --git a/samples/server/petstore/springboot-implicitHeaders/pom.xml b/samples/server/petstore/springboot-implicitHeaders/pom.xml index d1c4c8d6452d..954d4535a06d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-lombok-data/pom.xml b/samples/server/petstore/springboot-lombok-data/pom.xml index 16d607dab7b1..0cdbf58237db 100644 --- a/samples/server/petstore/springboot-lombok-data/pom.xml +++ b/samples/server/petstore/springboot-lombok-data/pom.xml @@ -34,6 +34,7 @@ + diff --git a/samples/server/petstore/springboot-lombok-tostring/pom.xml b/samples/server/petstore/springboot-lombok-tostring/pom.xml index 0b079a60154c..d2714a2b7939 100644 --- a/samples/server/petstore/springboot-lombok-tostring/pom.xml +++ b/samples/server/petstore/springboot-lombok-tostring/pom.xml @@ -49,6 +49,7 @@ + diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml b/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml index d445bc501aa8..fedfec8d3829 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index 586a1099ee64..c2864360a1eb 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml index 814077ac4e1a..2fe45d72699f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml index 6623444ffa31..e0fd8e70efa0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml index b518d1dee9f2..9986c18906af 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-spring-pageable/pom.xml b/samples/server/petstore/springboot-spring-pageable/pom.xml index fed9f1d12e18..585c369fb58c 100644 --- a/samples/server/petstore/springboot-spring-pageable/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-spring-provide-args/pom.xml b/samples/server/petstore/springboot-spring-provide-args/pom.xml index 4057470ce3f1..ed49ebfecf09 100644 --- a/samples/server/petstore/springboot-spring-provide-args/pom.xml +++ b/samples/server/petstore/springboot-spring-provide-args/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-useoptional/pom.xml b/samples/server/petstore/springboot-useoptional/pom.xml index f46331493248..6b7fd27c6185 100644 --- a/samples/server/petstore/springboot-useoptional/pom.xml +++ b/samples/server/petstore/springboot-useoptional/pom.xml @@ -28,6 +28,7 @@ + diff --git a/samples/server/petstore/springboot-virtualan/pom.xml b/samples/server/petstore/springboot-virtualan/pom.xml index 36bdd555a285..214efbb92284 100644 --- a/samples/server/petstore/springboot-virtualan/pom.xml +++ b/samples/server/petstore/springboot-virtualan/pom.xml @@ -29,6 +29,7 @@ + diff --git a/samples/server/petstore/springboot/pom.xml b/samples/server/petstore/springboot/pom.xml index dcce5e10d79f..187c7b784f3b 100644 --- a/samples/server/petstore/springboot/pom.xml +++ b/samples/server/petstore/springboot/pom.xml @@ -28,6 +28,7 @@ + From e7207c21073e85225653ac79d738bd19183f1556 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 12 Feb 2025 17:57:18 +0800 Subject: [PATCH 09/11] update samples (#20647) --- .../libraries/spring-boot/pom-sb3.mustache | 12 ++++++++---- .../JavaSpring/libraries/spring-boot/pom.mustache | 12 ++++++++---- .../spring-stubs-skip-default-interface/pom.xml | 1 - .../openapi3/client/petstore/spring-stubs/pom.xml | 1 - .../server/petstore/spring-boot-oneof/pom.xml | 1 - .../server/petstore/spring-boot-springdoc/pom.xml | 1 - .../openapi3/server/petstore/springboot-3/pom.xml | 1 - .../server/petstore/springboot-delegate/pom.xml | 1 - .../petstore/springboot-implicitHeaders/pom.xml | 1 - .../server/petstore/springboot-source/pom.xml | 1 - samples/openapi3/server/petstore/springboot/pom.xml | 1 - .../pom.xml | 1 - .../server/petstore/spring-boot-nullable-set/pom.xml | 1 - .../springboot-beanvalidation-no-nullable/pom.xml | 1 - .../petstore/springboot-beanvalidation/pom.xml | 1 - .../server/petstore/springboot-delegate-j8/pom.xml | 1 - .../springboot-delegate-no-response-entity/pom.xml | 1 - samples/server/petstore/springboot-delegate/pom.xml | 1 - .../springboot-file-delegate-optional/pom.xml | 1 - .../pom.xml | 1 - .../petstore/springboot-implicitHeaders/pom.xml | 1 - .../server/petstore/springboot-lombok-data/pom.xml | 1 - .../petstore/springboot-lombok-tostring/pom.xml | 1 - .../springboot-reactive-noResponseEntity/pom.xml | 1 - samples/server/petstore/springboot-reactive/pom.xml | 1 - .../pom.xml | 1 - .../pom.xml | 1 - .../springboot-spring-pageable-without-j8/pom.xml | 1 - .../petstore/springboot-spring-pageable/pom.xml | 1 - .../petstore/springboot-spring-provide-args/pom.xml | 1 - .../server/petstore/springboot-useoptional/pom.xml | 1 - samples/server/petstore/springboot-virtualan/pom.xml | 1 - samples/server/petstore/springboot/pom.xml | 1 - 33 files changed, 16 insertions(+), 39 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache index f1b251a815da..0e23de07570c 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache @@ -58,7 +58,8 @@ src/main/java - {{^interfaceOnly}} + {{^interfaceOnly}} + org.springframework.boot spring-boot-maven-plugin @@ -74,8 +75,10 @@ {{/lombok}} - {{/interfaceOnly}} - {{#interfaceOnly}} + + {{/interfaceOnly}} + {{#interfaceOnly}} + org.apache.maven.plugins maven-source-plugin @@ -86,7 +89,8 @@ - {{/interfaceOnly}} + + {{/interfaceOnly}} {{#apiFirst}} org.openapitools diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index b9d84091bc9d..2eaf236d2865 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -51,7 +51,8 @@ src/main/java - {{^interfaceOnly}} + {{^interfaceOnly}} + org.springframework.boot spring-boot-maven-plugin @@ -67,8 +68,10 @@ {{/lombok}} - {{/interfaceOnly}} - {{#interfaceOnly}} + + {{/interfaceOnly}} + {{#interfaceOnly}} + org.apache.maven.plugins maven-source-plugin @@ -79,7 +82,8 @@ - {{/interfaceOnly}} + + {{/interfaceOnly}} {{#apiFirst}} org.openapitools diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml index 9fbce0513655..0c5273b87d7a 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml @@ -22,7 +22,6 @@ src/main/java - org.apache.maven.plugins maven-source-plugin diff --git a/samples/openapi3/client/petstore/spring-stubs/pom.xml b/samples/openapi3/client/petstore/spring-stubs/pom.xml index 9fbce0513655..0c5273b87d7a 100644 --- a/samples/openapi3/client/petstore/spring-stubs/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs/pom.xml @@ -22,7 +22,6 @@ src/main/java - org.apache.maven.plugins maven-source-plugin diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml b/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml index f492b83a9691..7113913e6ca0 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml index 67c48412e174..230983b59c85 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml @@ -27,7 +27,6 @@ - diff --git a/samples/openapi3/server/petstore/springboot-3/pom.xml b/samples/openapi3/server/petstore/springboot-3/pom.xml index 3d20c6390a38..54c3603cbc9d 100644 --- a/samples/openapi3/server/petstore/springboot-3/pom.xml +++ b/samples/openapi3/server/petstore/springboot-3/pom.xml @@ -43,7 +43,6 @@ - diff --git a/samples/openapi3/server/petstore/springboot-delegate/pom.xml b/samples/openapi3/server/petstore/springboot-delegate/pom.xml index fb60a61c9b95..67d552b723dc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/pom.xml +++ b/samples/openapi3/server/petstore/springboot-delegate/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml index d7299a0482dc..5b071433c604 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/openapi3/server/petstore/springboot-source/pom.xml b/samples/openapi3/server/petstore/springboot-source/pom.xml index 53d9d81b327e..3f54f4adede8 100644 --- a/samples/openapi3/server/petstore/springboot-source/pom.xml +++ b/samples/openapi3/server/petstore/springboot-source/pom.xml @@ -27,7 +27,6 @@ - diff --git a/samples/openapi3/server/petstore/springboot/pom.xml b/samples/openapi3/server/petstore/springboot/pom.xml index 0919bc8dbd96..d60cccd3ff1f 100644 --- a/samples/openapi3/server/petstore/springboot/pom.xml +++ b/samples/openapi3/server/petstore/springboot/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml index a871967c2bb2..2e96536c4471 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/pom.xml @@ -22,7 +22,6 @@ src/main/java - org.apache.maven.plugins maven-source-plugin diff --git a/samples/server/petstore/spring-boot-nullable-set/pom.xml b/samples/server/petstore/spring-boot-nullable-set/pom.xml index 0d5996f775db..5bbc7407c1e0 100644 --- a/samples/server/petstore/spring-boot-nullable-set/pom.xml +++ b/samples/server/petstore/spring-boot-nullable-set/pom.xml @@ -22,7 +22,6 @@ src/main/java - org.apache.maven.plugins maven-source-plugin diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index bdf380a87060..6281f810cd38 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-beanvalidation/pom.xml b/samples/server/petstore/springboot-beanvalidation/pom.xml index 301dfba8efd7..f48622e7ec8d 100644 --- a/samples/server/petstore/springboot-beanvalidation/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation/pom.xml @@ -27,7 +27,6 @@ - diff --git a/samples/server/petstore/springboot-delegate-j8/pom.xml b/samples/server/petstore/springboot-delegate-j8/pom.xml index 692bbb2b9b71..92bfa2cb5cbb 100644 --- a/samples/server/petstore/springboot-delegate-j8/pom.xml +++ b/samples/server/petstore/springboot-delegate-j8/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml index cdbb8636eeb9..461339353f4b 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml +++ b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml index 38d2b4da909f..726f5f2dae84 100644 --- a/samples/server/petstore/springboot-delegate/pom.xml +++ b/samples/server/petstore/springboot-delegate/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-file-delegate-optional/pom.xml b/samples/server/petstore/springboot-file-delegate-optional/pom.xml index 41c63ba68113..9ac3410785c2 100644 --- a/samples/server/petstore/springboot-file-delegate-optional/pom.xml +++ b/samples/server/petstore/springboot-file-delegate-optional/pom.xml @@ -43,7 +43,6 @@ - diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml index 5e27d9762d07..687700115869 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml @@ -26,7 +26,6 @@ - diff --git a/samples/server/petstore/springboot-implicitHeaders/pom.xml b/samples/server/petstore/springboot-implicitHeaders/pom.xml index 954d4535a06d..d1c4c8d6452d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-lombok-data/pom.xml b/samples/server/petstore/springboot-lombok-data/pom.xml index 0cdbf58237db..16d607dab7b1 100644 --- a/samples/server/petstore/springboot-lombok-data/pom.xml +++ b/samples/server/petstore/springboot-lombok-data/pom.xml @@ -34,7 +34,6 @@ - diff --git a/samples/server/petstore/springboot-lombok-tostring/pom.xml b/samples/server/petstore/springboot-lombok-tostring/pom.xml index d2714a2b7939..0b079a60154c 100644 --- a/samples/server/petstore/springboot-lombok-tostring/pom.xml +++ b/samples/server/petstore/springboot-lombok-tostring/pom.xml @@ -49,7 +49,6 @@ - diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml b/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml index fedfec8d3829..d445bc501aa8 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index c2864360a1eb..586a1099ee64 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml index 2fe45d72699f..814077ac4e1a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml index e0fd8e70efa0..6623444ffa31 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml index 9986c18906af..b518d1dee9f2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-spring-pageable/pom.xml b/samples/server/petstore/springboot-spring-pageable/pom.xml index 585c369fb58c..fed9f1d12e18 100644 --- a/samples/server/petstore/springboot-spring-pageable/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-spring-provide-args/pom.xml b/samples/server/petstore/springboot-spring-provide-args/pom.xml index ed49ebfecf09..4057470ce3f1 100644 --- a/samples/server/petstore/springboot-spring-provide-args/pom.xml +++ b/samples/server/petstore/springboot-spring-provide-args/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-useoptional/pom.xml b/samples/server/petstore/springboot-useoptional/pom.xml index 6b7fd27c6185..f46331493248 100644 --- a/samples/server/petstore/springboot-useoptional/pom.xml +++ b/samples/server/petstore/springboot-useoptional/pom.xml @@ -28,7 +28,6 @@ - diff --git a/samples/server/petstore/springboot-virtualan/pom.xml b/samples/server/petstore/springboot-virtualan/pom.xml index 214efbb92284..36bdd555a285 100644 --- a/samples/server/petstore/springboot-virtualan/pom.xml +++ b/samples/server/petstore/springboot-virtualan/pom.xml @@ -29,7 +29,6 @@ - diff --git a/samples/server/petstore/springboot/pom.xml b/samples/server/petstore/springboot/pom.xml index 187c7b784f3b..dcce5e10d79f 100644 --- a/samples/server/petstore/springboot/pom.xml +++ b/samples/server/petstore/springboot/pom.xml @@ -28,7 +28,6 @@ - From 4161830ca909055434f73be8e3e9961bd4dca4d3 Mon Sep 17 00:00:00 2001 From: Kathrin Geilmann <16289455+kgeilmann@users.noreply.github.com> Date: Fri, 14 Feb 2025 20:59:18 +0100 Subject: [PATCH 10/11] Added new sample output directory to github workflow files --- .github/workflows/samples-spring-jdk17.yaml | 3 +++ .github/workflows/samples-spring.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/samples-spring-jdk17.yaml b/.github/workflows/samples-spring-jdk17.yaml index c418575347ff..e91db2cdfa8b 100644 --- a/.github/workflows/samples-spring-jdk17.yaml +++ b/.github/workflows/samples-spring-jdk17.yaml @@ -8,6 +8,7 @@ on: - samples/server/petstore/springboot-lombok-data - samples/server/petstore/springboot-lombok-tostring - samples/server/petstore/springboot-file-delegate-optional + - samples/server/petstore/springboot-reactive-serverSentEvents pull_request: paths: - samples/openapi3/client/petstore/spring-cloud-3-with-optional @@ -15,6 +16,7 @@ on: - samples/server/petstore/springboot-lombok-data - samples/server/petstore/springboot-lombok-tostring - samples/server/petstore/springboot-file-delegate-optional + - samples/server/petstore/springboot-reactive-serverSentEvents jobs: build: name: Build Java Spring (JDK17) @@ -30,6 +32,7 @@ jobs: - samples/server/petstore/springboot-lombok-data - samples/server/petstore/springboot-lombok-tostring - samples/server/petstore/springboot-file-delegate-optional + - samples/server/petstore/springboot-reactive-serverSentEvents steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 7b114a35ae96..b93a27e7eb22 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -52,6 +52,7 @@ jobs: - samples/server/petstore/springboot-lombok-data - samples/server/petstore/springboot-reactive - samples/server/petstore/springboot-reactive-noResponseEntity + - samples/server/petstore/springboot-reactive-serverSentEvents - samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8 - samples/server/petstore/springboot-spring-pageable-delegatePattern - samples/server/petstore/springboot-spring-pageable-without-j8 From 5b3014a1f05697d659dce90745cd827d3ca3ab41 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 17 Feb 2025 20:12:31 +0800 Subject: [PATCH 11/11] update samples --- .../.openapi-generator/FILES | 7 ------- 1 file changed, 7 deletions(-) diff --git a/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/FILES index 3e46ab1a618e..93297148e9b7 100644 --- a/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-reactive-serverSentEvents/.openapi-generator/FILES @@ -1,26 +1,19 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java src/main/java/org/openapitools/api/ApiUtil.java src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java src/main/java/org/openapitools/api/FakeApiDelegate.java src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java src/main/java/org/openapitools/api/PetApiDelegate.java src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/StoreApiDelegate.java src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java src/main/java/org/openapitools/configuration/HomeController.java