diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml
index 5375c61f6b55..23f7ace53e97 100644
--- a/.github/workflows/samples-jdk17.yaml
+++ b/.github/workflows/samples-jdk17.yaml
@@ -14,6 +14,7 @@ on:
- samples/client/petstore/java/microprofile-rest-client-outer-enum/**
# servers
- samples/openapi3/server/petstore/springboot-3/**
+ - samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
- samples/server/petstore/springboot-x-implements-skip/**
- samples/server/petstore/java-camel/**
- samples/server/petstore/java-helidon-server/v3/mp/**
@@ -32,6 +33,7 @@ on:
- samples/client/petstore/java/microprofile-rest-client-outer-enum/**
# servers
- samples/openapi3/server/petstore/springboot-3/**
+ - samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
- samples/server/petstore/springboot-x-implements-skip/**
- samples/server/petstore/java-camel/**
- samples/server/petstore/java-helidon-server/v3/mp/**
@@ -56,6 +58,7 @@ jobs:
- samples/client/petstore/java/microprofile-rest-client-outer-enum
# servers
- samples/openapi3/server/petstore/springboot-3
+ - samples/openapi3/server/petstore/springboot-3-include-http-request-context
- samples/server/petstore/springboot-x-implements-skip
- samples/server/petstore/java-camel/
- samples/server/petstore/java-helidon-server/v3/mp/
diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml
index 7f0a903ace3d..51b9dc70196e 100644
--- a/.github/workflows/samples-spring.yaml
+++ b/.github/workflows/samples-spring.yaml
@@ -44,6 +44,7 @@ jobs:
- samples/server/petstore/spring-boot-nullable-set
- samples/server/petstore/spring-boot-defaultInterface-unhandledExcp
- samples/server/petstore/springboot
+ - samples/server/petstore/springboot-include-http-request-context
- samples/server/petstore/springboot-beanvalidation
- samples/server/petstore/springboot-builtin-validation
- samples/server/petstore/springboot-delegate
diff --git a/bin/configs/spring-boot-3-include-http-request-context.yaml b/bin/configs/spring-boot-3-include-http-request-context.yaml
new file mode 100644
index 000000000000..c4afe938134a
--- /dev/null
+++ b/bin/configs/spring-boot-3-include-http-request-context.yaml
@@ -0,0 +1,16 @@
+generatorName: spring
+outputDir: samples/openapi3/server/petstore/springboot-3-include-http-request-context
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaSpring
+additionalProperties:
+ groupId: org.openapitools.openapi3
+ documentationProvider: springdoc
+ artifactId: springboot
+ snapshotVersion: "true"
+ useSpringBoot3: true
+ useBeanValidation: true
+ withXml: true
+ hideGenerationTimestamp: "true"
+ generateConstructorWithAllArgs: true
+ generateBuilders: true
+ includeHttpRequestContext: "true"
diff --git a/bin/configs/spring-boot-include-http-request-context.yaml b/bin/configs/spring-boot-include-http-request-context.yaml
new file mode 100644
index 000000000000..00701dce3193
--- /dev/null
+++ b/bin/configs/spring-boot-include-http-request-context.yaml
@@ -0,0 +1,12 @@
+generatorName: spring
+outputDir: samples/server/petstore/springboot-include-http-request-context
+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:
+ documentationProvider: springfox
+ artifactId: springboot
+ snapshotVersion: "true"
+ hideGenerationTimestamp: "true"
+ camelCaseDollarSign: "true"
+ modelNameSuffix: 'Dto'
+ includeHttpRequestContext: "true"
diff --git a/bin/configs/spring-boot-reactive-noResponseEntity.yaml b/bin/configs/spring-boot-reactive-noResponseEntity.yaml
index 746184ef2aba..1e7ec4815201 100644
--- a/bin/configs/spring-boot-reactive-noResponseEntity.yaml
+++ b/bin/configs/spring-boot-reactive-noResponseEntity.yaml
@@ -10,3 +10,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
delegatePattern: "true"
useResponseEntity: "false"
+ includeHttpRequestContext: "false"
diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md
index 0651cc84e31d..7aa537f8c7ba 100644
--- a/docs/generators/java-camel.md
+++ b/docs/generators/java-camel.md
@@ -68,6 +68,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
+|includeHttpRequestContext|Whether to include HttpServletRequest (blocking) or ServerWebExchange (reactive) as additional parameter in generated methods. Defaults to 'true' for reactive and 'false' for blocking.| |true (reactive) / false (blocking)|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true** The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. **false** The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. |false|
diff --git a/docs/generators/spring.md b/docs/generators/spring.md
index 854118300bda..dfcc8e74791b 100644
--- a/docs/generators/spring.md
+++ b/docs/generators/spring.md
@@ -61,6 +61,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
+|includeHttpRequestContext|Whether to include HttpServletRequest (blocking) or ServerWebExchange (reactive) as additional parameter in generated methods. Defaults to 'true' for reactive and 'false' for blocking.| |true (reactive) / false (blocking)|
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|**true** The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. **false** The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. |false|
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 2c3c584e931a..8d18068ec0e4 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
@@ -25,6 +25,7 @@
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.tags.Tag;
+import io.swagger.v3.parser.util.SchemaTypeUtil;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
@@ -93,6 +94,7 @@ public class SpringCodegen extends AbstractJavaCodegen
public static final String GENERATE_GENERIC_RESPONSE_ENTITY = "generateGenericResponseEntity";
public static final String USE_ENUM_CASE_INSENSITIVE = "useEnumCaseInsensitive";
public static final String USE_SPRING_BOOT3 = "useSpringBoot3";
+ public static final String INCLUDE_HTTP_REQUEST_CONTEXT = "includeHttpRequestContext";
public static final String REQUEST_MAPPING_OPTION = "requestMappingMode";
public static final String USE_REQUEST_MAPPING_ON_CONTROLLER = "useRequestMappingOnController";
public static final String USE_REQUEST_MAPPING_ON_INTERFACE = "useRequestMappingOnInterface";
@@ -154,6 +156,12 @@ public enum RequestMappingMode {
@Setter protected boolean useEnumCaseInsensitive = false;
@Getter @Setter
protected boolean useSpringBoot3 = false;
+ @Getter @Setter
+ private Boolean includeHttpRequestContext = null;
+ @Getter
+ private final boolean defaultIncludeHttpRequestContextForReactive = true;
+ @Getter
+ private final boolean defaultIncludeHttpRequestContextForBlocking = false;
protected boolean generatedConstructorWithRequiredArgs = true;
@Getter @Setter
protected RequestMappingMode requestMappingMode = RequestMappingMode.controller;
@@ -281,6 +289,9 @@ public SpringCodegen() {
cliOptions.add(CliOption.newBoolean(USE_SPRING_BOOT3,
"Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.",
useSpringBoot3));
+ cliOptions.add(new CliOption(INCLUDE_HTTP_REQUEST_CONTEXT,
+ "Whether to include HttpServletRequest (blocking) or ServerWebExchange (reactive) as additional parameter in generated methods. Defaults to 'true' for reactive and 'false' for blocking.",
+ SchemaTypeUtil.BOOLEAN_TYPE).defaultValue("true (reactive) / false (blocking)"));
cliOptions.add(CliOption.newBoolean(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS,
"Whether to generate constructors with required args for models",
generatedConstructorWithRequiredArgs));
@@ -432,6 +443,22 @@ public void processOpts() {
convertPropertyToBooleanAndWriteBack(REACTIVE, this::setReactive);
convertPropertyToBooleanAndWriteBack(SSE, this::setSse);
}
+ if (additionalProperties.containsKey(INCLUDE_HTTP_REQUEST_CONTEXT)) {
+ convertPropertyToBooleanAndWriteBack(INCLUDE_HTTP_REQUEST_CONTEXT, this::setIncludeHttpRequestContext);
+ }
+ //set default value for includeHttpRequestContext based on reactive/blocking
+ if (includeHttpRequestContext == null) {
+ if (this.reactive) {
+ //default to true for reactive
+ this.setIncludeHttpRequestContext(this.isDefaultIncludeHttpRequestContextForReactive());
+ LOGGER.info("Defaulting {} to '{}' for reactive", INCLUDE_HTTP_REQUEST_CONTEXT, this.isDefaultIncludeHttpRequestContextForReactive());
+ } else {
+ //default to false for blocking
+ this.setIncludeHttpRequestContext(this.isDefaultIncludeHttpRequestContextForBlocking());
+ LOGGER.info("Defaulting {} to '{}' for blocking", INCLUDE_HTTP_REQUEST_CONTEXT, this.isDefaultIncludeHttpRequestContextForBlocking());
+ }
+ additionalProperties.put(INCLUDE_HTTP_REQUEST_CONTEXT, this.getIncludeHttpRequestContext());
+ }
convertPropertyToStringAndWriteBack(RESPONSE_WRAPPER, this::setResponseWrapper);
convertPropertyToBooleanAndWriteBack(USE_TAGS, this::setUseTags);
@@ -1031,7 +1058,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
// add org.springframework.format.annotation.DateTimeFormat when needed
codegenOperation.allParams.stream().filter(p -> p.isDate || p.isDateTime).findFirst()
.ifPresent(p -> codegenOperation.imports.add("DateTimeFormat"));
-
// add org.springframework.data.domain.Pageable import when needed
if (codegenOperation.vendorExtensions.containsKey("x-spring-paginated")) {
codegenOperation.imports.add("Pageable");
@@ -1057,13 +1083,12 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
addSpringNullableImportForOperation(codegenOperation);
- if (reactive) {
- if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
- codegenOperation.imports.add("ApiIgnore");
- }
- if (sse) {
- var MEDIA_EVENT_STREAM = "text/event-stream";
- // inspecting used streaming media types
+ if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider()) && includeHttpRequestContext != null && includeHttpRequestContext) {
+ codegenOperation.imports.add("ApiIgnore");
+ }
+ if (reactive && sse) {
+ var MEDIA_EVENT_STREAM = "text/event-stream";
+ // inspecting used streaming media types
/*
expected definition:
content:
@@ -1075,36 +1100,35 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
type: or
$ref:
*/
- Map> schemaTypes = operation.getResponses().entrySet().stream()
- .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))
- .map(MediaType::getSchema)
- .collect(Collectors.toList()).stream()
- .collect(Collectors.groupingBy(Schema::getType));
- if (schemaTypes.containsKey("array")) {
- // we have a match with SSE pattern
- // double check potential conflicting, multiple specs
- if (schemaTypes.keySet().size() > 1) {
- throw new RuntimeException("only 1 response media type supported, when SSE is detected");
- }
- // double check schema format
- List eventTypes = schemaTypes.get("array");
- if (eventTypes.stream().anyMatch(schema -> !"event-stream".equalsIgnoreCase(schema.getFormat()))) {
- throw new RuntimeException("schema format 'event-stream' is required, when SSE is detected");
- }
- // double check item types
- Set itemTypes = eventTypes.stream()
- .map(schema -> schema.getItems().getType() != null
- ? schema.getItems().getType()
- : schema.getItems().get$ref())
- .collect(Collectors.toSet());
- if (itemTypes.size() > 1) {
- throw new RuntimeException("only single item type is supported, when SSE is detected");
- }
- codegenOperation.vendorExtensions.put("x-sse", true);
- } // Not an SSE compliant definition
- }
+ Map> schemaTypes = operation.getResponses().entrySet().stream()
+ .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))
+ .map(MediaType::getSchema)
+ .collect(Collectors.toList()).stream()
+ .collect(Collectors.groupingBy(Schema::getType));
+ if (schemaTypes.containsKey("array")) {
+ // we have a match with SSE pattern
+ // double check potential conflicting, multiple specs
+ if (schemaTypes.keySet().size() > 1) {
+ throw new RuntimeException("only 1 response media type supported, when SSE is detected");
+ }
+ // double check schema format
+ List eventTypes = schemaTypes.get("array");
+ if (eventTypes.stream().anyMatch(schema -> !"event-stream".equalsIgnoreCase(schema.getFormat()))) {
+ throw new RuntimeException("schema format 'event-stream' is required, when SSE is detected");
+ }
+ // double check item types
+ Set itemTypes = eventTypes.stream()
+ .map(schema -> schema.getItems().getType() != null
+ ? schema.getItems().getType()
+ : schema.getItems().get$ref())
+ .collect(Collectors.toSet());
+ if (itemTypes.size() > 1) {
+ throw new RuntimeException("only single item type is supported, when SSE is detected");
+ }
+ codegenOperation.vendorExtensions.put("x-sse", true);
+ } // Not an SSE compliant definition
}
return codegenOperation;
}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
index 7f396c340415..ec78a0a0584c 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
@@ -58,8 +58,15 @@ import org.springframework.web.context.request.NativeWebRequest;
{{/isDelegate}}
{{/jdk8-default-interface}}
import org.springframework.web.multipart.MultipartFile;
+{{#includeHttpRequestContext}}
{{#reactive}}
import org.springframework.web.server.ServerWebExchange;
+{{/reactive}}
+{{^reactive}}
+import {{javaxPackage}}.servlet.http.HttpServletRequest;
+{{/reactive}}
+{{/includeHttpRequestContext}}
+{{#reactive}}
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import org.springframework.http.codec.multipart.Part;
@@ -270,24 +277,24 @@ public interface {{classname}} {
{{/vendorExtensions.x-sse}}
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}(
{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
- {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
- {{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}},
- {{/hasParams}}{{^hasParams}}{{#reactive}},{{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}{{#springDocDocumentationProvider}}@ParameterObject {{/springDocDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}{{#vendorExtensions.x-spring-provide-args}}{{#hasParams}},
- {{/hasParams}}{{^hasParams}}{{#reactive}},{{/reactive}}{{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} {{{.}}}{{^hasParams}}{{^-last}}{{^reactive}},{{/reactive}}
+ {{/-last}}{{/allParams}}{{#includeHttpRequestContext}}{{#hasParams}},
+ {{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final {{#reactive}}ServerWebExchange exchange{{/reactive}}{{^reactive}}HttpServletRequest servletRequest{{/reactive}}{{/includeHttpRequestContext}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}},
+ {{/hasParams}}{{^hasParams}}{{#includeHttpRequestContext}},{{/includeHttpRequestContext}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}{{#springDocDocumentationProvider}}@ParameterObject{{/springDocDocumentationProvider}} final Pageable pageable{{/vendorExtensions.x-spring-paginated}}{{#vendorExtensions.x-spring-provide-args}}{{#hasParams}},
+ {{/hasParams}}{{^hasParams}}{{#includeHttpRequestContext}},{{/includeHttpRequestContext}}{{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} {{{.}}}{{^hasParams}}{{^-last}}{{^reactive}},{{/reactive}}
{{/-last}}{{/hasParams}}{{/vendorExtensions.x-spring-provide-args}}
){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
{{#delegate-method}}
- {{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}pageable{{/vendorExtensions.x-spring-paginated}});
+ {{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#includeHttpRequestContext}}{{#hasParams}}, {{/hasParams}}{{#reactive}}exchange{{/reactive}}{{^reactive}}servletRequest{{/reactive}}{{/includeHttpRequestContext}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}pageable{{/vendorExtensions.x-spring-paginated}});
}
// Override this method
- {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} {
+ {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#includeHttpRequestContext}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final {{#reactive}}ServerWebExchange exchange{{/reactive}}{{^reactive}}HttpServletRequest servletRequest{{/reactive}}{{/includeHttpRequestContext}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} {
{{/delegate-method}}
{{^isDelegate}}
{{>methodBody}}{{! prevent indent}}
{{/isDelegate}}
{{#isDelegate}}
- {{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}pageable{{/vendorExtensions.x-spring-paginated}});
+ {{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#includeHttpRequestContext}}{{#hasParams}}, {{/hasParams}}{{#reactive}}exchange{{/reactive}}{{^reactive}}servletRequest{{/reactive}}{{/includeHttpRequestContext}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}pageable{{/vendorExtensions.x-spring-paginated}});
{{/isDelegate}}
}{{/jdk8-default-interface}}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache
index 44d989952b7b..12ed158dedb5 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache
@@ -9,8 +9,15 @@ import org.springframework.http.ResponseEntity;
{{/useResponseEntity}}
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
+{{#includeHttpRequestContext}}
{{#reactive}}
import org.springframework.web.server.ServerWebExchange;
+{{/reactive}}
+{{^reactive}}
+import {{javaxPackage}}.servlet.http.HttpServletRequest;
+{{/reactive}}
+{{/includeHttpRequestContext}}
+{{#reactive}}
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import org.springframework.http.codec.multipart.Part;
@@ -71,8 +78,8 @@ public interface {{classname}}Delegate {
@Deprecated
{{/isDeprecated}}
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}{{#isFormParam}}MultipartFile{{/isFormParam}}{{^isFormParam}}{{>optionalDataType}}{{/isFormParam}}{{#isArray}}>{{/isArray}}{{/reactive}}{{/isFile}} {{paramName}}{{^-last}},
- {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
- {{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
+ {{/-last}}{{/allParams}}{{#includeHttpRequestContext}}{{#hasParams}},
+ {{/hasParams}}{{#reactive}}ServerWebExchange exchange{{/reactive}}{{^reactive}}HttpServletRequest servletRequest{{/reactive}}{{/includeHttpRequestContext}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#includeHttpRequestContext}}, {{/includeHttpRequestContext}}{{/hasParams}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
{{>methodBody}}{{! prevent indent}}
}{{/jdk8-default-interface}}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache
index 57045774d386..0d0a2c2272ba 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache
@@ -35,7 +35,7 @@ return CompletableFuture.supplyAsync(()-> {
{{#reactive}}
{{^vendorExtensions.x-sse}}
Mono result = Mono.empty();
- {{#examples}}
+{{#includeHttpRequestContext}} {{#examples}}
{{#-first}}
exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}});
for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) {
@@ -48,14 +48,14 @@ Mono result = Mono.empty();
{{#-last}}
}
{{/-last}}
- {{/examples}}
-{{^examples}}
+ {{/examples}}{{/includeHttpRequestContext}}
+{{^examples}}{{#includeHttpRequestContext}}
exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}});
-{{/examples}}
+{{/includeHttpRequestContext}}{{/examples}}
return result{{#allParams}}{{#isBodyParam}}{{^isArray}}{{#paramName}}.then({{.}}){{/paramName}}{{/isArray}}{{#isArray}}{{#paramName}}.thenMany({{.}}){{/paramName}}{{/isArray}}{{/isBodyParam}}{{/allParams}}{{#isArray}}{{#useResponseEntity}}.then(Mono.empty()){{/useResponseEntity}}{{^useResponseEntity}}.thenMany(Flux.empty()){{/useResponseEntity}}{{/isArray}}{{^isArray}}.then(Mono.empty()){{/isArray}};
{{/vendorExtensions.x-sse}}
{{#vendorExtensions.x-sse}}
-exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}});
+{{#includeHttpRequestContext}}exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}});{{/includeHttpRequestContext}}
return Flux.empty();
{{/vendorExtensions.x-sse}}
{{/reactive}}
\ No newline at end of file
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 ac819033d71e..9d8d795be537 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
@@ -734,6 +734,157 @@ public void testMultipartBoot() throws IOException {
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"statusArray\"", "required", "false"));
}
+ @Test
+ public void testSpringBoot3ReactiveDefaultsToIncludeHttpRequestContextTrue() throws IOException {
+ final SpringCodegen codegen = new SpringCodegen();
+ codegen.setReactive(true);
+ codegen.setLibrary("spring-boot");
+ codegen.setUseSpringBoot3(true);
+
+ final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .assertMethod("createUser", "Mono", "ServerWebExchange")
+ .assertParameter("exchange").hasType("ServerWebExchange")
+ .assertParameterAnnotations()
+ .containsWithNameAndAttributes("Parameter", ImmutableMap.of("hidden", "true"))
+ .doesNotContainWithName("ApiIgnore");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoImports("jakarta.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest")
+ .hasImports("org.springframework.web.server.ServerWebExchange");
+ }
+
+ @Test
+ public void testSpringBootReactiveDefaultsToIncludeHttpRequestContextTrue() throws IOException {
+ final SpringCodegen codegen = new SpringCodegen();
+ codegen.setReactive(true);
+ codegen.setLibrary("spring-boot");
+ codegen.setUseSpringBoot3(false);
+ codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
+
+ final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .assertMethod("createUser", "Mono", "ServerWebExchange")
+ .assertParameter("exchange").hasType("ServerWebExchange")
+ .assertParameterAnnotations()
+ .containsWithName("ApiIgnore")
+ .doesNotContainWithName("Parameter");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoImports("jakarta.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest")
+ .hasImports("org.springframework.web.server.ServerWebExchange", "springfox.documentation.annotations.ApiIgnore");
+ }
+
+
+ @Test
+ public void testSpringBoot3ReactiveIncludeHttpRequestContextFalse() throws IOException {
+ final SpringCodegen codegen = new SpringCodegen();
+ codegen.setReactive(true);
+ codegen.setLibrary("spring-boot");
+ codegen.setUseSpringBoot3(true);
+ codegen.additionalProperties().put(INCLUDE_HTTP_REQUEST_CONTEXT, "false");
+
+ final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .assertMethod("createUser", "Mono");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoMethod("createUser", "Mono", "ServerWebExchange");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoImports("jakarta.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest", "org.springframework.web.server.ServerWebExchange");
+ }
+
+ @Test
+ public void testSpringBootReactiveIncludeHttpRequestContextFalse() throws IOException {
+ final SpringCodegen codegen = new SpringCodegen();
+ codegen.setReactive(true);
+ codegen.setLibrary("spring-boot");
+ codegen.setUseSpringBoot3(false);
+ codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
+ codegen.additionalProperties().put(INCLUDE_HTTP_REQUEST_CONTEXT, "false");
+
+ final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .assertMethod("createUser", "Mono");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoMethod("createUser", "Mono", "ServerWebExchange");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoImports("jakarta.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest", "org.springframework.web.server.ServerWebExchange", "springfox.documentation.annotations.ApiIgnore");
+ }
+
+ @Test
+ public void testSpringBoot3BlockingDefaultsToIncludeHttpRequestContextFalse() throws IOException {
+ final SpringCodegen codegen = new SpringCodegen();
+ codegen.setReactive(false);
+ codegen.setLibrary("spring-boot");
+ codegen.setUseSpringBoot3(true);
+
+ final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .assertMethod("createUser", "User");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoImports("jakarta.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest", "org.springframework.web.server.ServerWebExchange");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoMethod("createUser", "User", "HttpServletRequest");
+ }
+
+
+ @Test
+ public void testSpringBoot3BlockingIncludeHttpRequestContextTrue() throws IOException {
+ final SpringCodegen codegen = new SpringCodegen();
+ codegen.setReactive(false);
+ codegen.setLibrary("spring-boot");
+ codegen.setUseSpringBoot3(true);
+ codegen.additionalProperties().put(INCLUDE_HTTP_REQUEST_CONTEXT, "true");
+
+ final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoMethod("createUser", "User");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasImports("jakarta.servlet.http.HttpServletRequest")
+ .hasNoImports("javax.servlet.http.HttpServletRequest", "org.springframework.web.server.ServerWebExchange");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .assertMethod("createUser", "User", "HttpServletRequest")
+ .assertParameter("servletRequest").hasType("HttpServletRequest")
+ .assertParameterAnnotations()
+ .containsWithNameAndAttributes("Parameter", ImmutableMap.of("hidden", "true"))
+ .doesNotContainWithName("ApiIgnore");
+ }
+
+
+ @Test
+ public void testSpringBootBlockingIncludeHttpRequestContextTrue() throws IOException {
+ final SpringCodegen codegen = new SpringCodegen();
+ codegen.setReactive(false);
+ codegen.setLibrary("spring-boot");
+ codegen.setUseSpringBoot3(false);
+ codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
+ codegen.additionalProperties().put(INCLUDE_HTTP_REQUEST_CONTEXT, "true");
+
+ final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasNoMethod("createUser", "User");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .hasImports("javax.servlet.http.HttpServletRequest", "springfox.documentation.annotations.ApiIgnore")
+ .hasNoImports("jakarta.servlet.http.HttpServletRequest", "org.springframework.web.server.ServerWebExchange");
+
+ JavaFileAssert.assertThat(files.get("UserApi.java"))
+ .assertMethod("createUser", "User", "HttpServletRequest")
+ .assertParameter("servletRequest").hasType("HttpServletRequest")
+ .assertParameterAnnotations()
+ .containsWithName("ApiIgnore")
+ .doesNotContainWithName("Parameter");
+ }
+
+
@Test
public void testReactiveMultipartBoot() throws IOException {
final SpringCodegen codegen = new SpringCodegen();
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/.openapi-generator-ignore
new file mode 100644
index 000000000000..7484ee590a38
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/.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/openapi3/server/petstore/springboot-3-include-http-request-context/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/.openapi-generator/FILES
new file mode 100644
index 000000000000..b15e2c45d45d
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/.openapi-generator/FILES
@@ -0,0 +1,19 @@
+README.md
+pom.xml
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
+src/main/java/org/openapitools/RFC3339DateFormat.java
+src/main/java/org/openapitools/api/ApiUtil.java
+src/main/java/org/openapitools/api/PetApi.java
+src/main/java/org/openapitools/api/StoreApi.java
+src/main/java/org/openapitools/api/UserApi.java
+src/main/java/org/openapitools/configuration/HomeController.java
+src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
+src/main/java/org/openapitools/model/Category.java
+src/main/java/org/openapitools/model/ModelApiResponse.java
+src/main/java/org/openapitools/model/Order.java
+src/main/java/org/openapitools/model/Pet.java
+src/main/java/org/openapitools/model/Tag.java
+src/main/java/org/openapitools/model/User.java
+src/main/resources/application.properties
+src/main/resources/openapi.yaml
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/.openapi-generator/VERSION
new file mode 100644
index 000000000000..193a12d6e891
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.20.0-SNAPSHOT
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/README.md b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/README.md
new file mode 100644
index 000000000000..5cd22b6081a2
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/README.md
@@ -0,0 +1,21 @@
+# 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 [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:8080/v3/api-docs/
+
+Start your server as a simple java application
+
+You can view the api documentation in swagger-ui by pointing to
+http://localhost:8080/swagger-ui.html
+
+Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/pom.xml b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/pom.xml
new file mode 100644
index 000000000000..69154939209c
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/pom.xml
@@ -0,0 +1,106 @@
+
+ 4.0.0
+ org.openapitools.openapi3
+ springboot
+ jar
+ springboot
+ 1.0.0-SNAPSHOT
+
+ 17
+ ${java.version}
+ ${java.version}
+ UTF-8
+ 2.6.0
+ 5.17.14
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.1.3
+
+
+
+
+
+ repository.spring.milestone
+ Spring Milestone Repository
+ https://repo.spring.io/milestone
+
+
+
+
+ spring-milestones
+ https://repo.spring.io/milestone
+
+
+
+
+ src/main/java
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.data
+ spring-data-commons
+
+
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ ${springdoc.version}
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+
+ jakarta.xml.bind
+ jakarta.xml.bind-api
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-xml
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+ org.openapitools
+ jackson-databind-nullable
+ 0.2.9
+
+
+
+ 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/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..97252a8a9402
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/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/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/RFC3339DateFormat.java
new file mode 100644
index 000000000000..bcd3936d8b34
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/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/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/ApiUtil.java
new file mode 100644
index 000000000000..44bf770ccc47
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/ApiUtil.java
@@ -0,0 +1,21 @@
+package org.openapitools.api;
+
+import org.springframework.web.context.request.NativeWebRequest;
+
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+public class ApiUtil {
+ public static void setExampleResponse(NativeWebRequest req, String contentType, String example) {
+ try {
+ HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class);
+ if (res != null) {
+ res.setCharacterEncoding("UTF-8");
+ res.addHeader("Content-Type", contentType);
+ res.getWriter().print(example);
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java
new file mode 100644
index 000000000000..927bcd60175f
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java
@@ -0,0 +1,449 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.api;
+
+import org.openapitools.model.ModelApiResponse;
+import org.springframework.lang.Nullable;
+import org.openapitools.model.Pet;
+import io.swagger.v3.oas.annotations.ExternalDocumentation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.ExampleObject;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import jakarta.servlet.http.HttpServletRequest;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import jakarta.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+@Validated
+@Tag(name = "pet", description = "Everything about your Pets")
+public interface PetApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_ADD_PET = "/pet";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "addPet",
+ summary = "Add a new pet to the store",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))
+ }),
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = PetApi.PATH_ADD_PET,
+ produces = { "application/xml", "application/json" },
+ consumes = { "application/json", "application/xml" }
+ )
+ default ResponseEntity addPet(
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_DELETE_PET = "/pet/{petId}";
+ /**
+ * DELETE /pet/{petId} : Deletes a pet
+ *
+ *
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ * @return Invalid pet value (status code 400)
+ */
+ @Operation(
+ operationId = "deletePet",
+ summary = "Deletes a pet",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid pet value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.DELETE,
+ value = PetApi.PATH_DELETE_PET
+ )
+ default ResponseEntity deletePet(
+ @NotNull @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
+ @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) @Nullable String apiKey,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus";
+ /**
+ * GET /pet/findByStatus : Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ *
+ * @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)
+ */
+ @Operation(
+ operationId = "findPetsByStatus",
+ summary = "Finds Pets by status",
+ description = "Multiple status values can be provided with comma separated strings",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))),
+ @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class)))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid status value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = PetApi.PATH_FIND_PETS_BY_STATUS,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity> findPetsByStatus(
+ @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags";
+ /**
+ * GET /pet/findByTags : Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ *
+ * @param tags Tags to filter by (required)
+ * @return successful operation (status code 200)
+ * or Invalid tag value (status code 400)
+ * @deprecated
+ */
+ @Deprecated
+ @Operation(
+ operationId = "findPetsByTags",
+ summary = "Finds Pets by tags",
+ description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
+ deprecated = true,
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))),
+ @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class)))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid tag value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = PetApi.PATH_FIND_PETS_BY_TAGS,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity> findPetsByTags(
+ @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_GET_PET_BY_ID = "/pet/{petId}";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "getPetById",
+ summary = "Find pet by ID",
+ description = "Returns a single pet",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Pet not found")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = PetApi.PATH_GET_PET_BY_ID,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity getPetById(
+ @NotNull @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPDATE_PET = "/pet";
+ /**
+ * 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)
+ * API documentation for the updatePet operation
+ * @see Update an existing pet Documentation
+ */
+ @Operation(
+ operationId = "updatePet",
+ summary = "Update an existing pet",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Pet not found"),
+ @ApiResponse(responseCode = "405", description = "Validation exception")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ },
+ externalDocs = @ExternalDocumentation(description = "API documentation for the updatePet operation", url = "http://petstore.swagger.io/v2/doc/updatePet")
+ )
+ @RequestMapping(
+ method = RequestMethod.PUT,
+ value = PetApi.PATH_UPDATE_PET,
+ produces = { "application/xml", "application/json" },
+ consumes = { "application/json", "application/xml" }
+ )
+ default ResponseEntity updatePet(
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 doggie aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "updatePetWithForm",
+ summary = "Updates a pet in the store with form data",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = PetApi.PATH_UPDATE_PET_WITH_FORM,
+ consumes = { "application/x-www-form-urlencoded" }
+ )
+ default ResponseEntity updatePetWithForm(
+ @NotNull @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
+ @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
+ @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "uploadFile",
+ summary = "uploads an image",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = PetApi.PATH_UPLOAD_FILE,
+ produces = { "application/json" },
+ consumes = { "multipart/form-data" }
+ )
+ default ResponseEntity uploadFile(
+ @NotNull @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
+ @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
+ @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApiController.java
new file mode 100644
index 000000000000..c6d5a1006a1f
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApiController.java
@@ -0,0 +1,48 @@
+package org.openapitools.api;
+
+import org.openapitools.model.ModelApiResponse;
+import org.springframework.lang.Nullable;
+import org.openapitools.model.Pet;
+
+
+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 org.springframework.web.context.request.NativeWebRequest;
+
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import jakarta.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class PetApiController implements PetApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public PetApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java
new file mode 100644
index 000000000000..674f7edc8617
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java
@@ -0,0 +1,215 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.api;
+
+import java.util.Map;
+import org.openapitools.model.Order;
+import io.swagger.v3.oas.annotations.ExternalDocumentation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.ExampleObject;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import jakarta.servlet.http.HttpServletRequest;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import jakarta.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+@Validated
+@Tag(name = "store", description = "Access to Petstore orders")
+public interface StoreApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_DELETE_ORDER = "/store/order/{orderId}";
+ /**
+ * DELETE /store/order/{orderId} : Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ *
+ * @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)
+ */
+ @Operation(
+ operationId = "deleteOrder",
+ summary = "Delete purchase order by ID",
+ description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
+ tags = { "store" },
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.DELETE,
+ value = StoreApi.PATH_DELETE_ORDER
+ )
+ default ResponseEntity deleteOrder(
+ @NotNull @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_GET_INVENTORY = "/store/inventory";
+ /**
+ * GET /store/inventory : Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ *
+ * @return successful operation (status code 200)
+ */
+ @Operation(
+ operationId = "getInventory",
+ summary = "Returns pet inventories by status",
+ description = "Returns a map of status codes to quantities",
+ tags = { "store" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = StoreApi.PATH_GET_INVENTORY,
+ produces = { "application/json" }
+ )
+ default ResponseEntity> getInventory(
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_GET_ORDER_BY_ID = "/store/order/{orderId}";
+ /**
+ * GET /store/order/{orderId} : Find purchase order by ID
+ * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
+ *
+ * @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)
+ */
+ @Operation(
+ operationId = "getOrderById",
+ summary = "Find purchase order by ID",
+ description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
+ tags = { "store" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = StoreApi.PATH_GET_ORDER_BY_ID,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity getOrderById(
+ @NotNull @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_PLACE_ORDER = "/store/order";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "placeOrder",
+ summary = "Place an order for a pet",
+ description = "",
+ tags = { "store" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid Order")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = StoreApi.PATH_PLACE_ORDER,
+ produces = { "application/xml", "application/json" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity placeOrder(
+ @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApiController.java
new file mode 100644
index 000000000000..1b0f90b47a64
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApiController.java
@@ -0,0 +1,47 @@
+package org.openapitools.api;
+
+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 org.springframework.web.context.request.NativeWebRequest;
+
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import jakarta.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class StoreApiController implements StoreApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public StoreApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java
new file mode 100644
index 000000000000..3a60241f24a8
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java
@@ -0,0 +1,342 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.api;
+
+import java.time.OffsetDateTime;
+import org.openapitools.model.User;
+import io.swagger.v3.oas.annotations.ExternalDocumentation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.ExampleObject;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import jakarta.servlet.http.HttpServletRequest;
+
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import jakarta.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+@Validated
+@Tag(name = "user", description = "Operations about user")
+public interface UserApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_CREATE_USER = "/user";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "createUser",
+ summary = "Create user",
+ description = "This can only be done by the logged in user.",
+ tags = { "user" },
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = UserApi.PATH_CREATE_USER,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity createUser(
+ @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray";
+ /**
+ * POST /user/createWithArray : Creates list of users with given input array
+ *
+ *
+ * @param user List of user object (required)
+ * @return successful operation (status code 200)
+ */
+ @Operation(
+ operationId = "createUsersWithArrayInput",
+ summary = "Creates list of users with given input array",
+ description = "",
+ tags = { "user" },
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity createUsersWithArrayInput(
+ @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList";
+ /**
+ * POST /user/createWithList : Creates list of users with given input array
+ *
+ *
+ * @param user List of user object (required)
+ * @return successful operation (status code 200)
+ */
+ @Operation(
+ operationId = "createUsersWithListInput",
+ summary = "Creates list of users with given input array",
+ description = "",
+ tags = { "user" },
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity createUsersWithListInput(
+ @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_DELETE_USER = "/user/{username}";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "deleteUser",
+ summary = "Delete user",
+ description = "This can only be done by the logged in user.",
+ tags = { "user" },
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.DELETE,
+ value = UserApi.PATH_DELETE_USER
+ )
+ default ResponseEntity deleteUser(
+ @NotNull @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_GET_USER_BY_NAME = "/user/{username}";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "getUserByName",
+ summary = "Get user by user name",
+ description = "",
+ tags = { "user" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = UserApi.PATH_GET_USER_BY_NAME,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity getUserByName(
+ @NotNull @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_LOGIN_USER = "/user/login";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "loginUser",
+ summary = "Logs user into the system",
+ description = "",
+ tags = { "user" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username/password supplied")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = UserApi.PATH_LOGIN_USER,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity loginUser(
+ @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username,
+ @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_LOGOUT_USER = "/user/logout";
+ /**
+ * GET /user/logout : Logs out current logged in user session
+ *
+ *
+ * @return successful operation (status code 200)
+ */
+ @Operation(
+ operationId = "logoutUser",
+ summary = "Logs out current logged in user session",
+ description = "",
+ tags = { "user" },
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = UserApi.PATH_LOGOUT_USER
+ )
+ default ResponseEntity logoutUser(
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPDATE_USER = "/user/{username}";
+ /**
+ * 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)
+ */
+ @Operation(
+ operationId = "updateUser",
+ summary = "Updated user",
+ description = "This can only be done by the logged in user.",
+ tags = { "user" },
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid user supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.PUT,
+ value = UserApi.PATH_UPDATE_USER,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity updateUser(
+ @NotNull @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
+ @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user,
+ @Parameter(hidden = true) final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApiController.java
new file mode 100644
index 000000000000..e9678d548047
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApiController.java
@@ -0,0 +1,47 @@
+package org.openapitools.api;
+
+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 org.springframework.web.context.request.NativeWebRequest;
+
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import jakarta.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class UserApiController implements UserApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public UserApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java
new file mode 100644
index 000000000000..9aa29284ab5f
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java
@@ -0,0 +1,20 @@
+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;
+
+/**
+ * Home redirection to OpenAPI api documentation
+ */
+@Controller
+public class HomeController {
+
+ @RequestMapping("/")
+ public String index() {
+ return "redirect:swagger-ui.html";
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
new file mode 100644
index 000000000000..2ea502c445ae
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
@@ -0,0 +1,43 @@
+package org.openapitools.configuration;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.info.Contact;
+import io.swagger.v3.oas.models.info.License;
+import io.swagger.v3.oas.models.Components;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+
+@Configuration
+public class SpringDocConfiguration {
+
+ @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo")
+ OpenAPI apiInfo() {
+ return new OpenAPI()
+ .info(
+ new Info()
+ .title("OpenAPI Petstore")
+ .description("This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.")
+ .license(
+ new License()
+ .name("Apache-2.0")
+ .url("https://www.apache.org/licenses/LICENSE-2.0.html")
+ )
+ .version("1.0.0")
+ )
+ .components(
+ new Components()
+ .addSecuritySchemes("petstore_auth", new SecurityScheme()
+ .type(SecurityScheme.Type.OAUTH2)
+ )
+ .addSecuritySchemes("api_key", new SecurityScheme()
+ .type(SecurityScheme.Type.APIKEY)
+ .in(SecurityScheme.In.HEADER)
+ .name("api_key")
+ )
+ )
+ ;
+ }
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Category.java
new file mode 100644
index 000000000000..d04f7291c31a
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Category.java
@@ -0,0 +1,196 @@
+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 org.springframework.lang.Nullable;
+import org.openapitools.jackson.nullable.JsonNullable;
+import java.time.OffsetDateTime;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import jakarta.xml.bind.annotation.*;
+
+import java.util.*;
+import jakarta.annotation.Generated;
+
+/**
+ * A category for a pet
+ */
+
+@Schema(name = "Category", description = "A category for a pet")
+@JacksonXmlRootElement(localName = "Category")
+@XmlRootElement(name = "Category")
+@XmlAccessorType(XmlAccessType.FIELD)
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class Category {
+
+ private @Nullable Long id;
+
+ private @Nullable String name;
+
+ public Category() {
+ super();
+ }
+
+ /**
+ * Constructor with all args parameters
+ */
+ public Category(@Nullable Long id, @Nullable String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public Category id(@Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("id")
+ @JacksonXmlProperty(localName = "id")
+ @XmlElement(name = "id")
+ public @Nullable Long getId() {
+ return id;
+ }
+
+ public void setId(@Nullable Long id) {
+ this.id = id;
+ }
+
+ public Category name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("name")
+ @JacksonXmlProperty(localName = "name")
+ @XmlElement(name = "name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ public static class Builder {
+
+ private Category instance;
+
+ public Builder() {
+ this(new Category());
+ }
+
+ protected Builder(Category instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Category value) {
+ this.instance.setId(value.id);
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public Category.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Category.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ /**
+ * returns a built Category instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Category build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Category.Builder builder() {
+ return new Category.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Category.Builder toBuilder() {
+ Category.Builder builder = new Category.Builder();
+ return builder.copyOf(this);
+ }
+
+}
+
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/ModelApiResponse.java
new file mode 100644
index 000000000000..43de7668f7ed
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/ModelApiResponse.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.JsonTypeName;
+import org.springframework.lang.Nullable;
+import org.openapitools.jackson.nullable.JsonNullable;
+import java.time.OffsetDateTime;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import jakarta.xml.bind.annotation.*;
+
+import java.util.*;
+import jakarta.annotation.Generated;
+
+/**
+ * Describes the result of uploading an image resource
+ */
+
+@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource")
+@JsonTypeName("ApiResponse")
+@JacksonXmlRootElement(localName = "ModelApiResponse")
+@XmlRootElement(name = "ModelApiResponse")
+@XmlAccessorType(XmlAccessType.FIELD)
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ModelApiResponse {
+
+ private @Nullable Integer code;
+
+ private @Nullable String type;
+
+ private @Nullable String message;
+
+ public ModelApiResponse() {
+ super();
+ }
+
+ /**
+ * Constructor with all args parameters
+ */
+ public ModelApiResponse(@Nullable Integer code, @Nullable String type, @Nullable String message) {
+ this.code = code;
+ this.type = type;
+ this.message = message;
+ }
+
+ public ModelApiResponse code(@Nullable Integer code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get code
+ * @return code
+ */
+
+ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("code")
+ @JacksonXmlProperty(localName = "code")
+ @XmlElement(name = "code")
+ public @Nullable Integer getCode() {
+ return code;
+ }
+
+ public void setCode(@Nullable Integer code) {
+ this.code = code;
+ }
+
+ public ModelApiResponse type(@Nullable String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get type
+ * @return type
+ */
+
+ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("type")
+ @JacksonXmlProperty(localName = "type")
+ @XmlElement(name = "type")
+ public @Nullable String getType() {
+ return type;
+ }
+
+ public void setType(@Nullable String type) {
+ this.type = type;
+ }
+
+ public ModelApiResponse message(@Nullable String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Get message
+ * @return message
+ */
+
+ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("message")
+ @JacksonXmlProperty(localName = "message")
+ @XmlElement(name = "message")
+ public @Nullable String getMessage() {
+ return message;
+ }
+
+ public void setMessage(@Nullable 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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ public static class Builder {
+
+ private ModelApiResponse instance;
+
+ public Builder() {
+ this(new ModelApiResponse());
+ }
+
+ protected Builder(ModelApiResponse instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ModelApiResponse value) {
+ this.instance.setCode(value.code);
+ this.instance.setType(value.type);
+ this.instance.setMessage(value.message);
+ return this;
+ }
+
+ public ModelApiResponse.Builder code(Integer code) {
+ this.instance.code(code);
+ return this;
+ }
+
+ public ModelApiResponse.Builder type(String type) {
+ this.instance.type(type);
+ return this;
+ }
+
+ public ModelApiResponse.Builder message(String message) {
+ this.instance.message(message);
+ return this;
+ }
+
+ /**
+ * returns a built ModelApiResponse instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ModelApiResponse build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ModelApiResponse.Builder builder() {
+ return new ModelApiResponse.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelApiResponse.Builder toBuilder() {
+ ModelApiResponse.Builder builder = new ModelApiResponse.Builder();
+ return builder.copyOf(this);
+ }
+
+}
+
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Order.java
new file mode 100644
index 000000000000..99edf945cf4e
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Order.java
@@ -0,0 +1,369 @@
+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 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 jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import jakarta.xml.bind.annotation.*;
+
+import java.util.*;
+import jakarta.annotation.Generated;
+
+/**
+ * An order for a pets from the pet store
+ */
+
+@Schema(name = "Order", description = "An order for a pets from the pet store")
+@JacksonXmlRootElement(localName = "Order")
+@XmlRootElement(name = "Order")
+@XmlAccessorType(XmlAccessType.FIELD)
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.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 final 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() {
+ super();
+ }
+
+ /**
+ * Constructor with all args parameters
+ */
+ public Order(@Nullable Long id, @Nullable Long petId, @Nullable Integer quantity, @Nullable OffsetDateTime shipDate, @Nullable StatusEnum status, Boolean complete) {
+ this.id = id;
+ this.petId = petId;
+ this.quantity = quantity;
+ this.shipDate = shipDate;
+ this.status = status;
+ this.complete = complete;
+ }
+
+ public Order id(@Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("id")
+ @JacksonXmlProperty(localName = "id")
+ @XmlElement(name = "id")
+ public @Nullable Long getId() {
+ return id;
+ }
+
+ public void setId(@Nullable Long id) {
+ this.id = id;
+ }
+
+ public Order petId(@Nullable Long petId) {
+ this.petId = petId;
+ return this;
+ }
+
+ /**
+ * Get petId
+ * @return petId
+ */
+
+ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("petId")
+ @JacksonXmlProperty(localName = "petId")
+ @XmlElement(name = "petId")
+ public @Nullable Long getPetId() {
+ return petId;
+ }
+
+ public void setPetId(@Nullable Long petId) {
+ this.petId = petId;
+ }
+
+ public Order quantity(@Nullable Integer quantity) {
+ this.quantity = quantity;
+ return this;
+ }
+
+ /**
+ * Get quantity
+ * @return quantity
+ */
+
+ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("quantity")
+ @JacksonXmlProperty(localName = "quantity")
+ @XmlElement(name = "quantity")
+ public @Nullable Integer getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(@Nullable Integer quantity) {
+ this.quantity = quantity;
+ }
+
+ public Order shipDate(@Nullable OffsetDateTime shipDate) {
+ this.shipDate = shipDate;
+ return this;
+ }
+
+ /**
+ * Get shipDate
+ * @return shipDate
+ */
+ @Valid
+ @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("shipDate")
+ @JacksonXmlProperty(localName = "shipDate")
+ @XmlElement(name = "shipDate")
+ public @Nullable OffsetDateTime getShipDate() {
+ return shipDate;
+ }
+
+ public void setShipDate(@Nullable OffsetDateTime shipDate) {
+ this.shipDate = shipDate;
+ }
+
+ public Order status(@Nullable StatusEnum status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Order Status
+ * @return status
+ */
+
+ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("status")
+ @JacksonXmlProperty(localName = "status")
+ @XmlElement(name = "status")
+ public @Nullable StatusEnum getStatus() {
+ return status;
+ }
+
+ public void setStatus(@Nullable StatusEnum status) {
+ this.status = status;
+ }
+
+ public Order complete(Boolean complete) {
+ this.complete = complete;
+ return this;
+ }
+
+ /**
+ * Get complete
+ * @return complete
+ */
+
+ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("complete")
+ @JacksonXmlProperty(localName = "complete")
+ @XmlElement(name = "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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ public static class Builder {
+
+ private Order instance;
+
+ public Builder() {
+ this(new Order());
+ }
+
+ protected Builder(Order instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Order value) {
+ this.instance.setId(value.id);
+ this.instance.setPetId(value.petId);
+ this.instance.setQuantity(value.quantity);
+ this.instance.setShipDate(value.shipDate);
+ this.instance.setStatus(value.status);
+ this.instance.setComplete(value.complete);
+ return this;
+ }
+
+ public Order.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Order.Builder petId(Long petId) {
+ this.instance.petId(petId);
+ return this;
+ }
+
+ public Order.Builder quantity(Integer quantity) {
+ this.instance.quantity(quantity);
+ return this;
+ }
+
+ public Order.Builder shipDate(OffsetDateTime shipDate) {
+ this.instance.shipDate(shipDate);
+ return this;
+ }
+
+ public Order.Builder status(StatusEnum status) {
+ this.instance.status(status);
+ return this;
+ }
+
+ public Order.Builder complete(Boolean complete) {
+ this.instance.complete(complete);
+ return this;
+ }
+
+ /**
+ * returns a built Order instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Order build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Order.Builder builder() {
+ return new Order.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Order.Builder toBuilder() {
+ Order.Builder builder = new Order.Builder();
+ return builder.copyOf(this);
+ }
+
+}
+
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java
new file mode 100644
index 000000000000..74e9e908de70
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java
@@ -0,0 +1,409 @@
+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 java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+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 jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import jakarta.xml.bind.annotation.*;
+
+import java.util.*;
+import jakarta.annotation.Generated;
+
+/**
+ * A pet for sale in the pet store
+ */
+
+@Schema(name = "Pet", description = "A pet for sale in the pet store")
+@JacksonXmlRootElement(localName = "Pet")
+@XmlRootElement(name = "Pet")
+@XmlAccessorType(XmlAccessType.FIELD)
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class Pet {
+
+ private @Nullable Long id;
+
+ private @Nullable Category category;
+
+ private String name;
+
+ @Valid
+ private List photoUrls = new ArrayList<>();
+
+ @Valid
+ private List<@Valid Tag> tags = new ArrayList<>();
+
+ /**
+ * pet status in the store
+ */
+ public enum StatusEnum {
+ AVAILABLE("available"),
+
+ PENDING("pending"),
+
+ SOLD("sold");
+
+ private final 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, List photoUrls) {
+ this.name = name;
+ this.photoUrls = photoUrls;
+ }
+
+ /**
+ * Constructor with all args parameters
+ */
+ public Pet(@Nullable Long id, @Nullable Category category, String name, List photoUrls, List<@Valid Tag> tags, @Nullable StatusEnum status) {
+ this.id = id;
+ this.category = category;
+ this.name = name;
+ this.photoUrls = photoUrls;
+ this.tags = tags;
+ this.status = status;
+ }
+
+ public Pet id(@Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("id")
+ @JacksonXmlProperty(localName = "id")
+ @XmlElement(name = "id")
+ public @Nullable Long getId() {
+ return id;
+ }
+
+ public void setId(@Nullable Long id) {
+ this.id = id;
+ }
+
+ public Pet category(@Nullable Category category) {
+ this.category = category;
+ return this;
+ }
+
+ /**
+ * Get category
+ * @return category
+ */
+ @Valid
+ @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("category")
+ @JacksonXmlProperty(localName = "Category")
+ @XmlElement(name = "Category")
+ public @Nullable Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(@Nullable Category category) {
+ this.category = category;
+ }
+
+ public Pet name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+ @NotNull
+ @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("name")
+ @JacksonXmlProperty(localName = "name")
+ @XmlElement(name = "name")
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Pet photoUrls(List photoUrls) {
+ this.photoUrls = photoUrls;
+ return this;
+ }
+
+ public Pet addPhotoUrlsItem(String photoUrlsItem) {
+ if (this.photoUrls == null) {
+ this.photoUrls = new ArrayList<>();
+ }
+ this.photoUrls.add(photoUrlsItem);
+ return this;
+ }
+
+ /**
+ * Get photoUrls
+ * @return photoUrls
+ */
+ @NotNull
+ @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("photoUrls")
+ @JacksonXmlProperty(localName = "photoUrl")
+ @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true)
+ @XmlElement(name = "photoUrl")
+ @XmlElementWrapper(name = "photoUrl")
+ public List getPhotoUrls() {
+ return photoUrls;
+ }
+
+ public void setPhotoUrls(List 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
+ @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("tags")
+ @JacksonXmlProperty(localName = "Tag")
+ @JacksonXmlElementWrapper(localName = "tag", useWrapping = true)
+ @XmlElement(name = "Tag")
+ @XmlElementWrapper(name = "tag")
+ public List<@Valid Tag> getTags() {
+ return tags;
+ }
+
+ public void setTags(List<@Valid Tag> tags) {
+ this.tags = tags;
+ }
+
+ public Pet status(@Nullable StatusEnum status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * pet status in the store
+ * @return status
+ * @deprecated
+ */
+
+ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("status")
+ @JacksonXmlProperty(localName = "status")
+ @XmlElement(name = "status")
+ @Deprecated
+ public @Nullable StatusEnum getStatus() {
+ return status;
+ }
+
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public void setStatus(@Nullable 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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ public static class Builder {
+
+ private Pet instance;
+
+ public Builder() {
+ this(new Pet());
+ }
+
+ protected Builder(Pet instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Pet value) {
+ this.instance.setId(value.id);
+ this.instance.setCategory(value.category);
+ this.instance.setName(value.name);
+ this.instance.setPhotoUrls(value.photoUrls);
+ this.instance.setTags(value.tags);
+ this.instance.setStatus(value.status);
+ return this;
+ }
+
+ public Pet.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Pet.Builder category(Category category) {
+ this.instance.category(category);
+ return this;
+ }
+
+ public Pet.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public Pet.Builder photoUrls(List photoUrls) {
+ this.instance.photoUrls(photoUrls);
+ return this;
+ }
+
+ public Pet.Builder tags(List tags) {
+ this.instance.tags(tags);
+ return this;
+ }
+
+ @Deprecated
+ public Pet.Builder status(StatusEnum status) {
+ this.instance.status(status);
+ return this;
+ }
+
+ /**
+ * returns a built Pet instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Pet build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Pet.Builder builder() {
+ return new Pet.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Pet.Builder toBuilder() {
+ Pet.Builder builder = new Pet.Builder();
+ return builder.copyOf(this);
+ }
+
+}
+
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Tag.java
new file mode 100644
index 000000000000..32e9c3cd638c
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Tag.java
@@ -0,0 +1,196 @@
+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 org.springframework.lang.Nullable;
+import org.openapitools.jackson.nullable.JsonNullable;
+import java.time.OffsetDateTime;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import jakarta.xml.bind.annotation.*;
+
+import java.util.*;
+import jakarta.annotation.Generated;
+
+/**
+ * A tag for a pet
+ */
+
+@Schema(name = "Tag", description = "A tag for a pet")
+@JacksonXmlRootElement(localName = "Tag")
+@XmlRootElement(name = "Tag")
+@XmlAccessorType(XmlAccessType.FIELD)
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class Tag {
+
+ private @Nullable Long id;
+
+ private @Nullable String name;
+
+ public Tag() {
+ super();
+ }
+
+ /**
+ * Constructor with all args parameters
+ */
+ public Tag(@Nullable Long id, @Nullable String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public Tag id(@Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("id")
+ @JacksonXmlProperty(localName = "id")
+ @XmlElement(name = "id")
+ public @Nullable Long getId() {
+ return id;
+ }
+
+ public void setId(@Nullable Long id) {
+ this.id = id;
+ }
+
+ public Tag name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("name")
+ @JacksonXmlProperty(localName = "name")
+ @XmlElement(name = "name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ public static class Builder {
+
+ private Tag instance;
+
+ public Builder() {
+ this(new Tag());
+ }
+
+ protected Builder(Tag instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Tag value) {
+ this.instance.setId(value.id);
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public Tag.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Tag.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ /**
+ * returns a built Tag instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Tag build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Tag.Builder builder() {
+ return new Tag.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Tag.Builder toBuilder() {
+ Tag.Builder builder = new Tag.Builder();
+ return builder.copyOf(this);
+ }
+
+}
+
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/User.java
new file mode 100644
index 000000000000..627d226c2772
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/User.java
@@ -0,0 +1,394 @@
+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 org.springframework.lang.Nullable;
+import org.openapitools.jackson.nullable.JsonNullable;
+import java.time.OffsetDateTime;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.*;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import jakarta.xml.bind.annotation.*;
+
+import java.util.*;
+import jakarta.annotation.Generated;
+
+/**
+ * A User who is purchasing from the pet store
+ */
+
+@Schema(name = "User", description = "A User who is purchasing from the pet store")
+@JacksonXmlRootElement(localName = "User")
+@XmlRootElement(name = "User")
+@XmlAccessorType(XmlAccessType.FIELD)
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.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() {
+ super();
+ }
+
+ /**
+ * Constructor with all args parameters
+ */
+ public User(@Nullable Long id, @Nullable String username, @Nullable String firstName, @Nullable String lastName, @Nullable String email, @Nullable String password, @Nullable String phone, @Nullable Integer userStatus) {
+ this.id = id;
+ this.username = username;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.email = email;
+ this.password = password;
+ this.phone = phone;
+ this.userStatus = userStatus;
+ }
+
+ public User id(@Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("id")
+ @JacksonXmlProperty(localName = "id")
+ @XmlElement(name = "id")
+ public @Nullable Long getId() {
+ return id;
+ }
+
+ public void setId(@Nullable Long id) {
+ this.id = id;
+ }
+
+ public User username(@Nullable String username) {
+ this.username = username;
+ return this;
+ }
+
+ /**
+ * Get username
+ * @return username
+ */
+
+ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("username")
+ @JacksonXmlProperty(localName = "username")
+ @XmlElement(name = "username")
+ public @Nullable String getUsername() {
+ return username;
+ }
+
+ public void setUsername(@Nullable String username) {
+ this.username = username;
+ }
+
+ public User firstName(@Nullable String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ /**
+ * Get firstName
+ * @return firstName
+ */
+
+ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("firstName")
+ @JacksonXmlProperty(localName = "firstName")
+ @XmlElement(name = "firstName")
+ public @Nullable String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(@Nullable String firstName) {
+ this.firstName = firstName;
+ }
+
+ public User lastName(@Nullable String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ /**
+ * Get lastName
+ * @return lastName
+ */
+
+ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("lastName")
+ @JacksonXmlProperty(localName = "lastName")
+ @XmlElement(name = "lastName")
+ public @Nullable String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(@Nullable String lastName) {
+ this.lastName = lastName;
+ }
+
+ public User email(@Nullable String email) {
+ this.email = email;
+ return this;
+ }
+
+ /**
+ * Get email
+ * @return email
+ */
+
+ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("email")
+ @JacksonXmlProperty(localName = "email")
+ @XmlElement(name = "email")
+ public @Nullable String getEmail() {
+ return email;
+ }
+
+ public void setEmail(@Nullable String email) {
+ this.email = email;
+ }
+
+ public User password(@Nullable String password) {
+ this.password = password;
+ return this;
+ }
+
+ /**
+ * Get password
+ * @return password
+ */
+
+ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("password")
+ @JacksonXmlProperty(localName = "password")
+ @XmlElement(name = "password")
+ public @Nullable String getPassword() {
+ return password;
+ }
+
+ public void setPassword(@Nullable String password) {
+ this.password = password;
+ }
+
+ public User phone(@Nullable String phone) {
+ this.phone = phone;
+ return this;
+ }
+
+ /**
+ * Get phone
+ * @return phone
+ */
+
+ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("phone")
+ @JacksonXmlProperty(localName = "phone")
+ @XmlElement(name = "phone")
+ public @Nullable String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(@Nullable String phone) {
+ this.phone = phone;
+ }
+
+ public User userStatus(@Nullable Integer userStatus) {
+ this.userStatus = userStatus;
+ return this;
+ }
+
+ /**
+ * User Status
+ * @return userStatus
+ */
+
+ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("userStatus")
+ @JacksonXmlProperty(localName = "userStatus")
+ @XmlElement(name = "userStatus")
+ public @Nullable Integer getUserStatus() {
+ return userStatus;
+ }
+
+ public void setUserStatus(@Nullable 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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+ public static class Builder {
+
+ private User instance;
+
+ public Builder() {
+ this(new User());
+ }
+
+ protected Builder(User instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(User value) {
+ this.instance.setId(value.id);
+ this.instance.setUsername(value.username);
+ this.instance.setFirstName(value.firstName);
+ this.instance.setLastName(value.lastName);
+ this.instance.setEmail(value.email);
+ this.instance.setPassword(value.password);
+ this.instance.setPhone(value.phone);
+ this.instance.setUserStatus(value.userStatus);
+ return this;
+ }
+
+ public User.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public User.Builder username(String username) {
+ this.instance.username(username);
+ return this;
+ }
+
+ public User.Builder firstName(String firstName) {
+ this.instance.firstName(firstName);
+ return this;
+ }
+
+ public User.Builder lastName(String lastName) {
+ this.instance.lastName(lastName);
+ return this;
+ }
+
+ public User.Builder email(String email) {
+ this.instance.email(email);
+ return this;
+ }
+
+ public User.Builder password(String password) {
+ this.instance.password(password);
+ return this;
+ }
+
+ public User.Builder phone(String phone) {
+ this.instance.phone(phone);
+ return this;
+ }
+
+ public User.Builder userStatus(Integer userStatus) {
+ this.instance.userStatus(userStatus);
+ return this;
+ }
+
+ /**
+ * returns a built User instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public User build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static User.Builder builder() {
+ return new User.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public User.Builder toBuilder() {
+ User.Builder builder = new User.Builder();
+ return builder.copyOf(this);
+ }
+
+}
+
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/resources/application.properties b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/resources/application.properties
new file mode 100644
index 000000000000..7e90813e59b2
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/resources/application.properties
@@ -0,0 +1,3 @@
+server.port=8080
+spring.jackson.date-format=org.openapitools.RFC3339DateFormat
+spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/resources/openapi.yaml
new file mode 100644
index 000000000000..31074771d9fb
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/resources/openapi.yaml
@@ -0,0 +1,909 @@
+openapi: 3.0.0
+info:
+ description: "This is a sample server Petstore server. For this sample, you can\
+ \ use the api key `special-key` to test the authorization filters."
+ license:
+ name: Apache-2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+ title: OpenAPI Petstore
+ version: 1.0.0
+externalDocs:
+ description: Find out more about Swagger
+ url: http://swagger.io
+servers:
+- url: http://petstore.swagger.io/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":
+ content:
+ application/xml:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ 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
+ - application/xml
+ x-tags:
+ - tag: pet
+ put:
+ description: ""
+ externalDocs:
+ description: API documentation for the updatePet operation
+ url: http://petstore.swagger.io/v2/doc/updatePet
+ operationId: updatePet
+ requestBody:
+ $ref: "#/components/requestBodies/Pet"
+ 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
+ "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
+ - application/xml
+ x-tags:
+ - tag: pet
+ /pet/findByStatus:
+ get:
+ description: Multiple status values can be provided with comma separated strings
+ operationId: findPetsByStatus
+ parameters:
+ - deprecated: true
+ 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:
+ - 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
+ 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 tag value
+ security:
+ - petstore_auth:
+ - 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:
+ "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/{orderId}:
+ 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: orderId
+ 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: orderId
+ 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
+ security:
+ - api_key: []
+ 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
+ security:
+ - api_key: []
+ 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
+ security:
+ - api_key: []
+ 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:
+ pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
+ 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:
+ Set-Cookie:
+ description: Cookie authentication key for use with the `api_key` apiKey
+ authentication.
+ explode: false
+ schema:
+ example: AUTH_KEY=abcde12345; Path=/; HttpOnly
+ type: string
+ style: simple
+ 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
+ security:
+ - api_key: []
+ 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
+ security:
+ - api_key: []
+ 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
+ security:
+ - api_key: []
+ summary: Updated user
+ tags:
+ - user
+ x-content-type: application/json
+ x-accepts:
+ - application/json
+ x-tags:
+ - tag: user
+components:
+ requestBodies:
+ UserArray:
+ content:
+ application/json:
+ schema:
+ items:
+ $ref: "#/components/schemas/User"
+ type: array
+ description: List of user object
+ 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:
+ description: An order for a pets from the pet store
+ 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
+ title: Pet Order
+ type: object
+ xml:
+ name: Order
+ Category:
+ description: A category for a pet
+ example:
+ name: name
+ id: 6
+ properties:
+ id:
+ format: int64
+ type: integer
+ name:
+ pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
+ type: string
+ title: Pet category
+ type: object
+ xml:
+ name: Category
+ User:
+ description: A User who is purchasing from the pet store
+ example:
+ firstName: firstName
+ lastName: lastName
+ password: password
+ userStatus: 6
+ phone: phone
+ id: 0
+ email: email
+ username: username
+ properties:
+ id:
+ format: int64
+ type: integer
+ 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
+ title: a User
+ type: object
+ xml:
+ name: User
+ Tag:
+ description: A tag for a pet
+ example:
+ name: name
+ id: 1
+ properties:
+ id:
+ format: int64
+ type: integer
+ name:
+ type: string
+ title: Pet Tag
+ type: object
+ xml:
+ name: Tag
+ Pet:
+ description: A pet for sale in the pet store
+ example:
+ photoUrls:
+ - photoUrls
+ - photoUrls
+ name: doggie
+ id: 0
+ category:
+ name: name
+ id: 6
+ tags:
+ - name: name
+ id: 1
+ - name: name
+ id: 1
+ status: available
+ properties:
+ id:
+ format: int64
+ type: integer
+ category:
+ $ref: "#/components/schemas/Category"
+ name:
+ example: doggie
+ type: string
+ photoUrls:
+ items:
+ type: string
+ type: array
+ 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
+ title: a Pet
+ type: object
+ xml:
+ name: Pet
+ ApiResponse:
+ description: Describes the result of uploading an image resource
+ example:
+ code: 0
+ type: type
+ message: message
+ properties:
+ code:
+ format: int32
+ type: integer
+ type:
+ type: string
+ message:
+ type: string
+ title: An uploaded response
+ 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
+ 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
diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/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-include-http-request-context/.openapi-generator-ignore b/samples/server/petstore/springboot-include-http-request-context/.openapi-generator-ignore
new file mode 100644
index 000000000000..7484ee590a38
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/.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-include-http-request-context/.openapi-generator/FILES b/samples/server/petstore/springboot-include-http-request-context/.openapi-generator/FILES
new file mode 100644
index 000000000000..bee80ebd189f
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/.openapi-generator/FILES
@@ -0,0 +1,68 @@
+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/ApiUtil.java
+src/main/java/org/openapitools/api/FakeApi.java
+src/main/java/org/openapitools/api/FakeClassnameTestApi.java
+src/main/java/org/openapitools/api/PetApi.java
+src/main/java/org/openapitools/api/StoreApi.java
+src/main/java/org/openapitools/api/UserApi.java
+src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java
+src/main/java/org/openapitools/configuration/HomeController.java
+src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java
+src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java
+src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java
+src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java
+src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java
+src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java
+src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java
+src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java
+src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java
+src/main/java/org/openapitools/model/AnimalDto.java
+src/main/java/org/openapitools/model/ApiResponseDto.java
+src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java
+src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java
+src/main/java/org/openapitools/model/ArrayTestDto.java
+src/main/java/org/openapitools/model/BigCatDto.java
+src/main/java/org/openapitools/model/CapitalizationDto.java
+src/main/java/org/openapitools/model/CatDto.java
+src/main/java/org/openapitools/model/CategoryDto.java
+src/main/java/org/openapitools/model/ChildWithNullableDto.java
+src/main/java/org/openapitools/model/ClassModelDto.java
+src/main/java/org/openapitools/model/ClientDto.java
+src/main/java/org/openapitools/model/ContainerDefaultValueDto.java
+src/main/java/org/openapitools/model/DogDto.java
+src/main/java/org/openapitools/model/EnumArraysDto.java
+src/main/java/org/openapitools/model/EnumClassDto.java
+src/main/java/org/openapitools/model/EnumTestDto.java
+src/main/java/org/openapitools/model/FileDto.java
+src/main/java/org/openapitools/model/FileSchemaTestClassDto.java
+src/main/java/org/openapitools/model/FormatTestDto.java
+src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java
+src/main/java/org/openapitools/model/ListDto.java
+src/main/java/org/openapitools/model/MapTestDto.java
+src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java
+src/main/java/org/openapitools/model/Model200ResponseDto.java
+src/main/java/org/openapitools/model/NameDto.java
+src/main/java/org/openapitools/model/NullableMapPropertyDto.java
+src/main/java/org/openapitools/model/NumberOnlyDto.java
+src/main/java/org/openapitools/model/OrderDto.java
+src/main/java/org/openapitools/model/OuterCompositeDto.java
+src/main/java/org/openapitools/model/OuterEnumDto.java
+src/main/java/org/openapitools/model/ParentWithNullableDto.java
+src/main/java/org/openapitools/model/PetDto.java
+src/main/java/org/openapitools/model/ReadOnlyFirstDto.java
+src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java
+src/main/java/org/openapitools/model/ReturnDto.java
+src/main/java/org/openapitools/model/SpecialModelNameDto.java
+src/main/java/org/openapitools/model/TagDto.java
+src/main/java/org/openapitools/model/TypeHolderDefaultDto.java
+src/main/java/org/openapitools/model/TypeHolderExampleDto.java
+src/main/java/org/openapitools/model/UserDto.java
+src/main/java/org/openapitools/model/XmlItemDto.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-include-http-request-context/.openapi-generator/VERSION b/samples/server/petstore/springboot-include-http-request-context/.openapi-generator/VERSION
new file mode 100644
index 000000000000..193a12d6e891
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.20.0-SNAPSHOT
diff --git a/samples/server/petstore/springboot-include-http-request-context/README.md b/samples/server/petstore/springboot-include-http-request-context/README.md
new file mode 100644
index 000000000000..6721bbc28ca4
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/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-include-http-request-context/pom.xml b/samples/server/petstore/springboot-include-http-request-context/pom.xml
new file mode 100644
index 000000000000..8b028d261c8a
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/pom.xml
@@ -0,0 +1,91 @@
+
+ 4.0.0
+ org.openapitools
+ springboot
+ jar
+ springboot
+ 1.0.0-SNAPSHOT
+
+ 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-web
+
+
+ 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.8
+
+
+
+ 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-include-http-request-context/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..97252a8a9402
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/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-include-http-request-context/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/RFC3339DateFormat.java
new file mode 100644
index 000000000000..bcd3936d8b34
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/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-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java
new file mode 100644
index 000000000000..db76da0e9b92
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java
@@ -0,0 +1,77 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.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.ClientDto;
+import io.swagger.annotations.*;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletRequest;
+
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+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.20.0-SNAPSHOT")
+@Validated
+@Api(value = "$another-fake?", description = "the $another-fake? API")
+public interface AnotherFakeApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy";
+ /**
+ * PATCH /another-fake/dummy : To test special tags
+ * To test special tags and operation ID starting with number
+ *
+ * @param clientDto 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 = ClientDto.class
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class)
+ })
+ @RequestMapping(
+ method = RequestMethod.PATCH,
+ value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS,
+ produces = { "application/json" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity call123testSpecialTags(
+ @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"client\" : \"client\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApiController.java
new file mode 100644
index 000000000000..da05b5e3d440
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApiController.java
@@ -0,0 +1,46 @@
+package org.openapitools.api;
+
+import org.openapitools.model.ClientDto;
+
+
+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 org.springframework.web.context.request.NativeWebRequest;
+
+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.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class AnotherFakeApiController implements AnotherFakeApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public AnotherFakeApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/ApiUtil.java
new file mode 100644
index 000000000000..c03486e4081d
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/ApiUtil.java
@@ -0,0 +1,21 @@
+package org.openapitools.api;
+
+import org.springframework.web.context.request.NativeWebRequest;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+public class ApiUtil {
+ public static void setExampleResponse(NativeWebRequest req, String contentType, String example) {
+ try {
+ HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class);
+ if (res != null) {
+ res.setCharacterEncoding("UTF-8");
+ res.addHeader("Content-Type", contentType);
+ res.getWriter().print(example);
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java
new file mode 100644
index 000000000000..4c3e8907224c
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java
@@ -0,0 +1,736 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.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.ApiResponseDto;
+import java.math.BigDecimal;
+import org.openapitools.model.ChildWithNullableDto;
+import org.openapitools.model.ClientDto;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.openapitools.model.FileSchemaTestClassDto;
+import java.time.LocalDate;
+import java.util.Map;
+import org.springframework.lang.Nullable;
+import java.time.OffsetDateTime;
+import org.openapitools.model.OuterCompositeDto;
+import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto;
+import org.openapitools.model.UserDto;
+import org.openapitools.model.XmlItemDto;
+import io.swagger.annotations.*;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletRequest;
+
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+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.20.0-SNAPSHOT")
+@Validated
+@Api(value = "fake", description = "the fake API")
+public interface FakeApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_CREATE_XML_ITEM = "/fake/create_xml_item";
+ /**
+ * POST /fake/create_xml_item : creates an XmlItem
+ * this route creates an XmlItem
+ *
+ * @param xmlItemDto 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 = FakeApi.PATH_CREATE_XML_ITEM,
+ consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }
+ )
+ default ResponseEntity createXmlItem(
+ @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItemDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean";
+ /**
+ * 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 = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE,
+ produces = { "*/*" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity fakeOuterBooleanSerialize(
+ @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite";
+ /**
+ * POST /fake/outer/composite
+ * Test serialization of object with outer number type
+ *
+ * @param outerCompositeDto 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 = OuterCompositeDto.class
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "Output composite", response = OuterCompositeDto.class)
+ })
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE,
+ produces = { "*/*" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity fakeOuterCompositeSerialize(
+ @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
+ String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }";
+ ApiUtil.setExampleResponse(request, "*/*", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number";
+ /**
+ * 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 = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE,
+ produces = { "*/*" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity fakeOuterNumberSerialize(
+ @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string";
+ /**
+ * 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 = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE,
+ produces = { "*/*" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity fakeOuterStringSerialize(
+ @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_RESPONSE_OBJECT_DIFFERENT_NAMES = "/fake/{petId}/response-object-different-names";
+ /**
+ * 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 = ResponseObjectWithDifferentFieldNamesDto.class
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNamesDto.class)
+ })
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES,
+ produces = { "application/json" }
+ )
+ default ResponseEntity responseObjectDifferentNames(
+ @NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema";
+ /**
+ * PUT /fake/body-with-file-schema
+ * For this test, the body for this request much reference a schema named `File`.
+ *
+ * @param fileSchemaTestClassDto (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 = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity testBodyWithFileSchema(
+ @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params";
+ /**
+ * PUT /fake/body-with-query-params
+ *
+ * @param query (required)
+ * @param userDto (required)
+ * @return Success (status code 200)
+ */
+ @ApiOperation(
+ tags = { "fake" },
+ value = "",
+ nickname = "testBodyWithQueryParams",
+ notes = ""
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "Success")
+ })
+ @RequestMapping(
+ method = RequestMethod.PUT,
+ value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity testBodyWithQueryParams(
+ @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,
+ @ApiParam(value = "", required = true) @Valid @RequestBody UserDto userDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_CLIENT_MODEL = "/fake";
+ /**
+ * PATCH /fake : To test \"client\" model
+ * To test \"client\" model
+ *
+ * @param clientDto 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 = ClientDto.class
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class)
+ })
+ @RequestMapping(
+ method = RequestMethod.PATCH,
+ value = FakeApi.PATH_TEST_CLIENT_MODEL,
+ produces = { "application/json" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity testClientModel(
+ @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"client\" : \"client\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_ENDPOINT_PARAMETERS = "/fake";
+ /**
+ * 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 = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS,
+ consumes = { "application/x-www-form-urlencoded" }
+ )
+ default ResponseEntity testEndpointParameters(
+ @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number,
+ @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double,
+ @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,
+ @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte,
+ @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer,
+ @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32,
+ @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64,
+ @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestParam(value = "float", required = false) Float _float,
+ @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestParam(value = "string", required = false) String string,
+ @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary,
+ @ApiParam(value = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
+ @ApiParam(value = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
+ @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestParam(value = "password", required = false) String password,
+ @ApiParam(value = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_ENUM_PARAMETERS = "/fake";
+ /**
+ * 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 = FakeApi.PATH_TEST_ENUM_PARAMETERS,
+ consumes = { "application/x-www-form-urlencoded" }
+ )
+ default ResponseEntity testEnumParameters(
+ @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) @Nullable 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) @Nullable 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) @Nullable Integer enumQueryInteger,
+ @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable 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 @RequestParam(value = "enum_form_string", required = false) String enumFormString,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_GROUP_PARAMETERS = "/fake";
+ /**
+ * 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 = FakeApi.PATH_TEST_GROUP_PARAMETERS
+ )
+ default ResponseEntity 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) @Nullable Integer stringGroup,
+ @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) @Nullable Boolean booleanGroup,
+ @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) @Nullable Long int64Group,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties";
+ /**
+ * 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 = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity testInlineAdditionalProperties(
+ @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData";
+ /**
+ * 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 = FakeApi.PATH_TEST_JSON_FORM_DATA,
+ consumes = { "application/x-www-form-urlencoded" }
+ )
+ default ResponseEntity testJsonFormData(
+ @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param,
+ @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_NULLABLE = "/fake/nullable";
+ /**
+ * POST /fake/nullable : test nullable parent property
+ *
+ *
+ * @param childWithNullableDto 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 = FakeApi.PATH_TEST_NULLABLE,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity testNullable(
+ @ApiParam(value = "request body", required = true) @Valid @RequestBody ChildWithNullableDto childWithNullableDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters";
+ /**
+ * 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 = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT
+ )
+ default ResponseEntity 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 HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_TEST_WITH_RESULT_EXAMPLE = "/fake/response-with-example";
+ /**
+ * GET /fake/response-with-example
+ * This endpoint defines an example value for its response schema.
+ *
+ * @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 = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE,
+ produces = { "application/json" }
+ )
+ default ResponseEntity testWithResultExample(
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "42";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile";
+ /**
+ * 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 = ApiResponseDto.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 = ApiResponseDto.class)
+ })
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE,
+ produces = { "application/json" },
+ consumes = { "multipart/form-data" }
+ )
+ default ResponseEntity uploadFileWithRequiredFile(
+ @NotNull @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) MultipartFile requiredFile,
+ @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApiController.java
new file mode 100644
index 000000000000..bc52ebc8e490
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApiController.java
@@ -0,0 +1,59 @@
+package org.openapitools.api;
+
+import org.openapitools.model.ApiResponseDto;
+import java.math.BigDecimal;
+import org.openapitools.model.ChildWithNullableDto;
+import org.openapitools.model.ClientDto;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.openapitools.model.FileSchemaTestClassDto;
+import java.time.LocalDate;
+import java.util.Map;
+import org.springframework.lang.Nullable;
+import java.time.OffsetDateTime;
+import org.openapitools.model.OuterCompositeDto;
+import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto;
+import org.openapitools.model.UserDto;
+import org.openapitools.model.XmlItemDto;
+
+
+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 org.springframework.web.context.request.NativeWebRequest;
+
+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.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class FakeApiController implements FakeApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public FakeApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java
new file mode 100644
index 000000000000..db99c10c3423
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java
@@ -0,0 +1,80 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.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.ClientDto;
+import io.swagger.annotations.*;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletRequest;
+
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+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.20.0-SNAPSHOT")
+@Validated
+@Api(value = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API")
+public interface FakeClassnameTestApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_TEST_CLASSNAME = "/fake_classname_test";
+ /**
+ * PATCH /fake_classname_test : To test class name in snake case
+ * To test class name in snake case
+ *
+ * @param clientDto 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 = ClientDto.class,
+ authorizations = {
+ @Authorization(value = "api_key_query")
+ }
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class)
+ })
+ @RequestMapping(
+ method = RequestMethod.PATCH,
+ value = FakeClassnameTestApi.PATH_TEST_CLASSNAME,
+ produces = { "application/json" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity testClassname(
+ @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"client\" : \"client\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java
new file mode 100644
index 000000000000..68835b4b9f8f
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java
@@ -0,0 +1,46 @@
+package org.openapitools.api;
+
+import org.openapitools.model.ClientDto;
+
+
+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 org.springframework.web.context.request.NativeWebRequest;
+
+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.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class FakeClassnameTestApiController implements FakeClassnameTestApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public FakeClassnameTestApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java
new file mode 100644
index 000000000000..b6d5150dbfd5
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java
@@ -0,0 +1,418 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.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.ApiResponseDto;
+import org.springframework.lang.Nullable;
+import org.openapitools.model.PetDto;
+import java.util.Set;
+import io.swagger.annotations.*;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletRequest;
+
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+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.20.0-SNAPSHOT")
+@Validated
+@Api(value = "pet", description = "Everything about your Pets")
+public interface PetApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_ADD_PET = "/pet";
+ /**
+ * POST /pet : Add a new pet to the store
+ *
+ *
+ * @param petDto 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 = PetApi.PATH_ADD_PET,
+ consumes = { "application/json", "application/xml" }
+ )
+ default ResponseEntity addPet(
+ @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_DELETE_PET = "/pet/{petId}";
+ /**
+ * 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 = PetApi.PATH_DELETE_PET
+ )
+ default ResponseEntity deletePet(
+ @NotNull @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
+ @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus";
+ /**
+ * GET /pet/findByStatus : Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ *
+ * @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 = PetDto.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 = PetDto.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid status value")
+ })
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = PetApi.PATH_FIND_PETS_BY_STATUS,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity> 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 HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" } ]";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags";
+ /**
+ * GET /pet/findByTags : Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ *
+ * @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 = PetDto.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 = PetDto.class, responseContainer = "Set"),
+ @ApiResponse(code = 400, message = "Invalid tag value")
+ })
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = PetApi.PATH_FIND_PETS_BY_TAGS,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity> findPetsByTags(
+ @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" } ]";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_GET_PET_BY_ID = "/pet/{petId}";
+ /**
+ * 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 = PetDto.class,
+ authorizations = {
+ @Authorization(value = "api_key")
+ }
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "successful operation", response = PetDto.class),
+ @ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @ApiResponse(code = 404, message = "Pet not found")
+ })
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = PetApi.PATH_GET_PET_BY_ID,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity getPetById(
+ @NotNull @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPDATE_PET = "/pet";
+ /**
+ * PUT /pet : Update an existing pet
+ *
+ *
+ * @param petDto 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 = PetApi.PATH_UPDATE_PET,
+ consumes = { "application/json", "application/xml" }
+ )
+ default ResponseEntity updatePet(
+ @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}";
+ /**
+ * 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 = PetApi.PATH_UPDATE_PET_WITH_FORM,
+ consumes = { "application/x-www-form-urlencoded" }
+ )
+ default ResponseEntity updatePetWithForm(
+ @NotNull @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
+ @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
+ @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage";
+ /**
+ * 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 = ApiResponseDto.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 = ApiResponseDto.class)
+ })
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = PetApi.PATH_UPLOAD_FILE,
+ produces = { "application/json" },
+ consumes = { "multipart/form-data" }
+ )
+ default ResponseEntity uploadFile(
+ @NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
+ @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
+ @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApiController.java
new file mode 100644
index 000000000000..27650fb63af7
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApiController.java
@@ -0,0 +1,49 @@
+package org.openapitools.api;
+
+import org.openapitools.model.ApiResponseDto;
+import org.springframework.lang.Nullable;
+import org.openapitools.model.PetDto;
+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 org.springframework.web.context.request.NativeWebRequest;
+
+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.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class PetApiController implements PetApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public PetApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java
new file mode 100644
index 000000000000..33b5ffaadd5f
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java
@@ -0,0 +1,201 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.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.OrderDto;
+import io.swagger.annotations.*;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletRequest;
+
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+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.20.0-SNAPSHOT")
+@Validated
+@Api(value = "store", description = "Access to Petstore orders")
+public interface StoreApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_DELETE_ORDER = "/store/order/{order_id}";
+ /**
+ * DELETE /store/order/{order_id} : Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ *
+ * @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 = StoreApi.PATH_DELETE_ORDER
+ )
+ default ResponseEntity deleteOrder(
+ @NotNull @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_GET_INVENTORY = "/store/inventory";
+ /**
+ * 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 = StoreApi.PATH_GET_INVENTORY,
+ produces = { "application/json" }
+ )
+ default ResponseEntity> getInventory(
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}";
+ /**
+ * GET /store/order/{order_id} : Find purchase order by ID
+ * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
+ *
+ * @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 = OrderDto.class
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "successful operation", response = OrderDto.class),
+ @ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @ApiResponse(code = 404, message = "Order not found")
+ })
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = StoreApi.PATH_GET_ORDER_BY_ID,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity getOrderById(
+ @NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_PLACE_ORDER = "/store/order";
+ /**
+ * POST /store/order : Place an order for a pet
+ *
+ *
+ * @param orderDto 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 = OrderDto.class
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "successful operation", response = OrderDto.class),
+ @ApiResponse(code = 400, message = "Invalid Order")
+ })
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = StoreApi.PATH_PLACE_ORDER,
+ produces = { "application/xml", "application/json" },
+ consumes = { "application/json" }
+ )
+ default ResponseEntity placeOrder(
+ @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApiController.java
new file mode 100644
index 000000000000..14845d6df819
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApiController.java
@@ -0,0 +1,47 @@
+package org.openapitools.api;
+
+import java.util.Map;
+import org.openapitools.model.OrderDto;
+
+
+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 org.springframework.web.context.request.NativeWebRequest;
+
+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.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class StoreApiController implements StoreApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public StoreApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java
new file mode 100644
index 000000000000..5d5fe0e8c5e4
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java
@@ -0,0 +1,310 @@
+/*
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.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.UserDto;
+import io.swagger.annotations.*;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletRequest;
+
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+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.20.0-SNAPSHOT")
+@Validated
+@Api(value = "user", description = "Operations about user")
+public interface UserApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ String PATH_CREATE_USER = "/user";
+ /**
+ * POST /user : Create user
+ * This can only be done by the logged in user.
+ *
+ * @param userDto 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 = UserApi.PATH_CREATE_USER,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity createUser(
+ @ApiParam(value = "Created user object", required = true) @Valid @RequestBody UserDto userDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray";
+ /**
+ * POST /user/createWithArray : Creates list of users with given input array
+ *
+ *
+ * @param userDto 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 = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity createUsersWithArrayInput(
+ @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList";
+ /**
+ * POST /user/createWithList : Creates list of users with given input array
+ *
+ *
+ * @param userDto 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 = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity createUsersWithListInput(
+ @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_DELETE_USER = "/user/{username}";
+ /**
+ * 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 = UserApi.PATH_DELETE_USER
+ )
+ default ResponseEntity deleteUser(
+ @NotNull @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_GET_USER_BY_NAME = "/user/{username}";
+ /**
+ * 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 = UserDto.class
+ )
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "successful operation", response = UserDto.class),
+ @ApiResponse(code = 400, message = "Invalid username supplied"),
+ @ApiResponse(code = 404, message = "User not found")
+ })
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = UserApi.PATH_GET_USER_BY_NAME,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity getUserByName(
+ @NotNull @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ 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\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_LOGIN_USER = "/user/login";
+ /**
+ * 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 = UserApi.PATH_LOGIN_USER,
+ produces = { "application/xml", "application/json" }
+ )
+ default ResponseEntity 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 HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_LOGOUT_USER = "/user/logout";
+ /**
+ * 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 = UserApi.PATH_LOGOUT_USER
+ )
+ default ResponseEntity logoutUser(
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ String PATH_UPDATE_USER = "/user/{username}";
+ /**
+ * 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 userDto 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 = UserApi.PATH_UPDATE_USER,
+ consumes = { "application/json" }
+ )
+ default ResponseEntity updateUser(
+ @NotNull @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
+ @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody UserDto userDto,
+ @ApiIgnore final HttpServletRequest servletRequest
+ ) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApiController.java
new file mode 100644
index 000000000000..28e6350ea157
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApiController.java
@@ -0,0 +1,47 @@
+package org.openapitools.api;
+
+import java.time.OffsetDateTime;
+import org.openapitools.model.UserDto;
+
+
+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 org.springframework.web.context.request.NativeWebRequest;
+
+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.20.0-SNAPSHOT")
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class UserApiController implements UserApi {
+
+ private final NativeWebRequest request;
+
+ @Autowired
+ public UserApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java
new file mode 100644
index 000000000000..9e72f2634517
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java
@@ -0,0 +1,39 @@
+package org.openapitools.configuration;
+
+import org.openapitools.model.EnumClassDto;
+import org.openapitools.model.OuterEnumDto;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.convert.converter.Converter;
+
+/**
+ * This class provides Spring Converter beans for the enum models in the OpenAPI specification.
+ *
+ * By default, Spring only converts primitive types to enums using Enum::valueOf, which can prevent
+ * correct conversion if the OpenAPI specification is using an `enumPropertyNaming` other than
+ * `original` or the specification has an integer enum.
+ */
+@Configuration(value = "org.openapitools.configuration.enumConverterConfiguration")
+public class EnumConverterConfiguration {
+
+ @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter")
+ Converter enumClassConverter() {
+ return new Converter() {
+ @Override
+ public EnumClassDto convert(String source) {
+ return EnumClassDto.fromValue(source);
+ }
+ };
+ }
+ @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter")
+ Converter outerEnumConverter() {
+ return new Converter() {
+ @Override
+ public OuterEnumDto convert(String source) {
+ return OuterEnumDto.fromValue(source);
+ }
+ };
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java
new file mode 100644
index 000000000000..e390f86f5b73
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java
@@ -0,0 +1,28 @@
+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;
+
+/**
+ * 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";
+ }
+
+ @RequestMapping("/")
+ public String index() {
+ return "redirect:swagger-ui.html";
+ }
+
+}
\ No newline at end of file
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java
new file mode 100644
index 000000000000..f56492cdd3b4
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java
@@ -0,0 +1,71 @@
+package org.openapitools.configuration;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import org.springframework.web.util.UriComponentsBuilder;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.paths.Paths;
+import springfox.documentation.spring.web.paths.RelativePathProvider;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import javax.annotation.Generated;
+import javax.servlet.ServletContext;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+@Configuration
+@EnableSwagger2
+public class SpringFoxConfiguration {
+
+ ApiInfo apiInfo() {
+ return new ApiInfoBuilder()
+ .title("OpenAPI Petstore")
+ .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("Apache-2.0")
+ .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html")
+ .termsOfServiceUrl("")
+ .version("1.0.0")
+ .contact(new Contact("","", ""))
+ .build();
+ }
+
+ @Bean
+ public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .select()
+ .apis(RequestHandlerSelectors.basePackage("org.openapitools.api"))
+ .build()
+ .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath))
+ .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
+ .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class)
+ .apiInfo(apiInfo());
+ }
+
+ class BasePathAwareRelativePathProvider extends RelativePathProvider {
+ private String basePath;
+
+ public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) {
+ super(servletContext);
+ this.basePath = basePath;
+ }
+
+ @Override
+ protected String applicationPath() {
+ return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString());
+ }
+
+ @Override
+ public String getOperationPath(String operationPath) {
+ UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/");
+ return Paths.removeAdjacentForwardSlashes(
+ uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString());
+ }
+ }
+
+}
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java
new file mode 100644
index 000000000000..b35e388d9543
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java
@@ -0,0 +1,131 @@
+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;
+
+import java.util.Map;
+import java.util.HashMap;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+/**
+ * AdditionalPropertiesAnyTypeDto
+ */
+
+@JsonTypeName("AdditionalPropertiesAnyType")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AdditionalPropertiesAnyTypeDto {
+
+ private @Nullable String name;
+
+ public AdditionalPropertiesAnyTypeDto name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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 AdditionalPropertiesAnyTypeDto 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;
+ }
+ AdditionalPropertiesAnyTypeDto additionalPropertiesAnyType = (AdditionalPropertiesAnyTypeDto) 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 AdditionalPropertiesAnyTypeDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java
new file mode 100644
index 000000000000..a1ef0f509fd1
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java
@@ -0,0 +1,132 @@
+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.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;
+/**
+ * AdditionalPropertiesArrayDto
+ */
+
+@JsonTypeName("AdditionalPropertiesArray")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AdditionalPropertiesArrayDto {
+
+ private @Nullable String name;
+
+ public AdditionalPropertiesArrayDto name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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 AdditionalPropertiesArrayDto 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;
+ }
+ AdditionalPropertiesArrayDto additionalPropertiesArray = (AdditionalPropertiesArrayDto) 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 AdditionalPropertiesArrayDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java
new file mode 100644
index 000000000000..b760cffc137a
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java
@@ -0,0 +1,131 @@
+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;
+
+import java.util.Map;
+import java.util.HashMap;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+/**
+ * AdditionalPropertiesBooleanDto
+ */
+
+@JsonTypeName("AdditionalPropertiesBoolean")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AdditionalPropertiesBooleanDto {
+
+ private @Nullable String name;
+
+ public AdditionalPropertiesBooleanDto name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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 AdditionalPropertiesBooleanDto 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;
+ }
+ AdditionalPropertiesBooleanDto additionalPropertiesBoolean = (AdditionalPropertiesBooleanDto) 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 AdditionalPropertiesBooleanDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java
new file mode 100644
index 000000000000..d1d85f409958
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java
@@ -0,0 +1,417 @@
+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.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;
+
+/**
+ * AdditionalPropertiesClassDto
+ */
+
+@JsonTypeName("AdditionalPropertiesClass")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AdditionalPropertiesClassDto {
+
+ @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 AdditionalPropertiesClassDto mapString(Map mapString) {
+ this.mapString = mapString;
+ return this;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto mapNumber(Map mapNumber) {
+ this.mapNumber = mapNumber;
+ return this;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto mapInteger(Map mapInteger) {
+ this.mapInteger = mapInteger;
+ return this;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto mapBoolean(Map mapBoolean) {
+ this.mapBoolean = mapBoolean;
+ return this;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto mapArrayInteger(Map> mapArrayInteger) {
+ this.mapArrayInteger = mapArrayInteger;
+ return this;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto mapArrayAnytype(Map> mapArrayAnytype) {
+ this.mapArrayAnytype = mapArrayAnytype;
+ return this;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto mapMapString(Map> mapMapString) {
+ this.mapMapString = mapMapString;
+ return this;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto mapMapAnytype(Map> mapMapAnytype) {
+ this.mapMapAnytype = mapMapAnytype;
+ return this;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto anytype1(@Nullable Object anytype1) {
+ this.anytype1 = anytype1;
+ return this;
+ }
+
+ /**
+ * Get anytype1
+ * @return anytype1
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("anytype_1")
+ public @Nullable Object getAnytype1() {
+ return anytype1;
+ }
+
+ public void setAnytype1(@Nullable Object anytype1) {
+ this.anytype1 = anytype1;
+ }
+
+ public AdditionalPropertiesClassDto 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 AdditionalPropertiesClassDto anytype3(@Nullable Object anytype3) {
+ this.anytype3 = anytype3;
+ return this;
+ }
+
+ /**
+ * Get anytype3
+ * @return anytype3
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("anytype_3")
+ public @Nullable Object getAnytype3() {
+ return anytype3;
+ }
+
+ public void setAnytype3(@Nullable Object anytype3) {
+ this.anytype3 = anytype3;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AdditionalPropertiesClassDto additionalPropertiesClass = (AdditionalPropertiesClassDto) 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 AdditionalPropertiesClassDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java
new file mode 100644
index 000000000000..2a85908567f0
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java
@@ -0,0 +1,131 @@
+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;
+
+import java.util.Map;
+import java.util.HashMap;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+/**
+ * AdditionalPropertiesIntegerDto
+ */
+
+@JsonTypeName("AdditionalPropertiesInteger")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AdditionalPropertiesIntegerDto {
+
+ private @Nullable String name;
+
+ public AdditionalPropertiesIntegerDto name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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 AdditionalPropertiesIntegerDto 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;
+ }
+ AdditionalPropertiesIntegerDto additionalPropertiesInteger = (AdditionalPropertiesIntegerDto) 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 AdditionalPropertiesIntegerDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java
new file mode 100644
index 000000000000..181a7b20805d
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java
@@ -0,0 +1,132 @@
+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 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;
+/**
+ * AdditionalPropertiesNumberDto
+ */
+
+@JsonTypeName("AdditionalPropertiesNumber")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AdditionalPropertiesNumberDto {
+
+ private @Nullable String name;
+
+ public AdditionalPropertiesNumberDto name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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 AdditionalPropertiesNumberDto 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;
+ }
+ AdditionalPropertiesNumberDto additionalPropertiesNumber = (AdditionalPropertiesNumberDto) 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 AdditionalPropertiesNumberDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java
new file mode 100644
index 000000000000..ff4bfcbfed6f
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java
@@ -0,0 +1,132 @@
+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.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;
+/**
+ * AdditionalPropertiesObjectDto
+ */
+
+@JsonTypeName("AdditionalPropertiesObject")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AdditionalPropertiesObjectDto {
+
+ private @Nullable String name;
+
+ public AdditionalPropertiesObjectDto name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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 AdditionalPropertiesObjectDto 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;
+ }
+ AdditionalPropertiesObjectDto additionalPropertiesObject = (AdditionalPropertiesObjectDto) 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 AdditionalPropertiesObjectDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java
new file mode 100644
index 000000000000..425f1864f24f
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java
@@ -0,0 +1,131 @@
+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;
+
+import java.util.Map;
+import java.util.HashMap;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+/**
+ * AdditionalPropertiesStringDto
+ */
+
+@JsonTypeName("AdditionalPropertiesString")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AdditionalPropertiesStringDto {
+
+ private @Nullable String name;
+
+ public AdditionalPropertiesStringDto name(@Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("name")
+ public @Nullable String getName() {
+ return name;
+ }
+
+ public void setName(@Nullable 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 AdditionalPropertiesStringDto 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;
+ }
+ AdditionalPropertiesStringDto additionalPropertiesString = (AdditionalPropertiesStringDto) 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 AdditionalPropertiesStringDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java
new file mode 100644
index 000000000000..b645733ac918
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java
@@ -0,0 +1,135 @@
+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.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;
+
+/**
+ * AnimalDto
+ */
+
+@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 = BigCatDto.class, name = "BigCat"),
+ @JsonSubTypes.Type(value = CatDto.class, name = "Cat"),
+ @JsonSubTypes.Type(value = DogDto.class, name = "Dog")
+})
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class AnimalDto {
+
+ private String className;
+
+ private String color = "red";
+
+ public AnimalDto() {
+ super();
+ }
+
+ /**
+ * Constructor with only required parameters
+ */
+ public AnimalDto(String className) {
+ this.className = className;
+ }
+
+ public AnimalDto 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 AnimalDto 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;
+ }
+ AnimalDto animal = (AnimalDto) 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 AnimalDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ApiResponseDto.java
new file mode 100644
index 000000000000..cd376e162fa9
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ApiResponseDto.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;
+
+/**
+ * ApiResponseDto
+ */
+
+@JsonTypeName("ApiResponse")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ApiResponseDto {
+
+ private @Nullable Integer code;
+
+ private @Nullable String type;
+
+ private @Nullable String message;
+
+ public ApiResponseDto code(@Nullable Integer code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get code
+ * @return code
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("code")
+ public @Nullable Integer getCode() {
+ return code;
+ }
+
+ public void setCode(@Nullable Integer code) {
+ this.code = code;
+ }
+
+ public ApiResponseDto type(@Nullable String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get type
+ * @return type
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("type")
+ public @Nullable String getType() {
+ return type;
+ }
+
+ public void setType(@Nullable String type) {
+ this.type = type;
+ }
+
+ public ApiResponseDto message(@Nullable String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Get message
+ * @return message
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("message")
+ public @Nullable String getMessage() {
+ return message;
+ }
+
+ public void setMessage(@Nullable String message) {
+ this.message = message;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ApiResponseDto _apiResponse = (ApiResponseDto) 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 ApiResponseDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java
new file mode 100644
index 000000000000..ca83464735b5
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java
@@ -0,0 +1,100 @@
+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.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;
+
+/**
+ * ArrayOfArrayOfNumberOnlyDto
+ */
+
+@JsonTypeName("ArrayOfArrayOfNumberOnly")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ArrayOfArrayOfNumberOnlyDto {
+
+ @Valid
+ private List> arrayArrayNumber = new ArrayList<>();
+
+ public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) {
+ this.arrayArrayNumber = arrayArrayNumber;
+ return this;
+ }
+
+ public ArrayOfArrayOfNumberOnlyDto 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;
+ }
+ ArrayOfArrayOfNumberOnlyDto arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnlyDto) 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 ArrayOfArrayOfNumberOnlyDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java
new file mode 100644
index 000000000000..0a18e0ad1dfb
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java
@@ -0,0 +1,100 @@
+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.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;
+
+/**
+ * ArrayOfNumberOnlyDto
+ */
+
+@JsonTypeName("ArrayOfNumberOnly")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ArrayOfNumberOnlyDto {
+
+ @Valid
+ private List arrayNumber = new ArrayList<>();
+
+ public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) {
+ this.arrayNumber = arrayNumber;
+ return this;
+ }
+
+ public ArrayOfNumberOnlyDto 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;
+ }
+ ArrayOfNumberOnlyDto arrayOfNumberOnly = (ArrayOfNumberOnlyDto) 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 ArrayOfNumberOnlyDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayTestDto.java
new file mode 100644
index 000000000000..c3c94874b9b9
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayTestDto.java
@@ -0,0 +1,166 @@
+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.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.openapitools.model.ReadOnlyFirstDto;
+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;
+
+/**
+ * ArrayTestDto
+ */
+
+@JsonTypeName("ArrayTest")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ArrayTestDto {
+
+ @Valid
+ private List arrayOfString = new ArrayList<>();
+
+ @Valid
+ private List> arrayArrayOfInteger = new ArrayList<>();
+
+ @Valid
+ private List> arrayArrayOfModel = new ArrayList<>();
+
+ public ArrayTestDto arrayOfString(List arrayOfString) {
+ this.arrayOfString = arrayOfString;
+ return this;
+ }
+
+ public ArrayTestDto 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 ArrayTestDto arrayArrayOfInteger(List> arrayArrayOfInteger) {
+ this.arrayArrayOfInteger = arrayArrayOfInteger;
+ return this;
+ }
+
+ public ArrayTestDto 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 ArrayTestDto arrayArrayOfModel(List> arrayArrayOfModel) {
+ this.arrayArrayOfModel = arrayArrayOfModel;
+ return this;
+ }
+
+ public ArrayTestDto addArrayArrayOfModelItem(List<@Valid ReadOnlyFirstDto> 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;
+ }
+ ArrayTestDto arrayTest = (ArrayTestDto) 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 ArrayTestDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/BigCatDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/BigCatDto.java
new file mode 100644
index 000000000000..11dd31831a92
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/BigCatDto.java
@@ -0,0 +1,160 @@
+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.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.CatDto;
+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;
+
+/**
+ * BigCatDto
+ */
+
+
+@JsonTypeName("BigCat")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class BigCatDto extends CatDto {
+
+ /**
+ * Gets or Sets kind
+ */
+ public enum KindEnum {
+ LIONS("lions"),
+
+ TIGERS("tigers"),
+
+ LEOPARDS("leopards"),
+
+ JAGUARS("jaguars");
+
+ private final 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 BigCatDto() {
+ super();
+ }
+
+ /**
+ * Constructor with only required parameters
+ */
+ public BigCatDto(String className) {
+ super(className);
+ }
+
+ public BigCatDto kind(@Nullable KindEnum kind) {
+ this.kind = kind;
+ return this;
+ }
+
+ /**
+ * Get kind
+ * @return kind
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("kind")
+ public @Nullable KindEnum getKind() {
+ return kind;
+ }
+
+ public void setKind(@Nullable KindEnum kind) {
+ this.kind = kind;
+ }
+
+
+ public BigCatDto declawed(Boolean declawed) {
+ super.declawed(declawed);
+ return this;
+ }
+
+ public BigCatDto className(String className) {
+ super.className(className);
+ return this;
+ }
+
+ public BigCatDto 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;
+ }
+ BigCatDto bigCat = (BigCatDto) 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 BigCatDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CapitalizationDto.java
new file mode 100644
index 000000000000..2f7a20d51ab4
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CapitalizationDto.java
@@ -0,0 +1,207 @@
+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;
+
+/**
+ * CapitalizationDto
+ */
+
+@JsonTypeName("Capitalization")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class CapitalizationDto {
+
+ 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 CapitalizationDto smallCamel(@Nullable String smallCamel) {
+ this.smallCamel = smallCamel;
+ return this;
+ }
+
+ /**
+ * Get smallCamel
+ * @return smallCamel
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("smallCamel")
+ public @Nullable String getSmallCamel() {
+ return smallCamel;
+ }
+
+ public void setSmallCamel(@Nullable String smallCamel) {
+ this.smallCamel = smallCamel;
+ }
+
+ public CapitalizationDto capitalCamel(@Nullable String capitalCamel) {
+ this.capitalCamel = capitalCamel;
+ return this;
+ }
+
+ /**
+ * Get capitalCamel
+ * @return capitalCamel
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("CapitalCamel")
+ public @Nullable String getCapitalCamel() {
+ return capitalCamel;
+ }
+
+ public void setCapitalCamel(@Nullable String capitalCamel) {
+ this.capitalCamel = capitalCamel;
+ }
+
+ public CapitalizationDto smallSnake(@Nullable String smallSnake) {
+ this.smallSnake = smallSnake;
+ return this;
+ }
+
+ /**
+ * Get smallSnake
+ * @return smallSnake
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("small_Snake")
+ public @Nullable String getSmallSnake() {
+ return smallSnake;
+ }
+
+ public void setSmallSnake(@Nullable String smallSnake) {
+ this.smallSnake = smallSnake;
+ }
+
+ public CapitalizationDto capitalSnake(@Nullable String capitalSnake) {
+ this.capitalSnake = capitalSnake;
+ return this;
+ }
+
+ /**
+ * Get capitalSnake
+ * @return capitalSnake
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("Capital_Snake")
+ public @Nullable String getCapitalSnake() {
+ return capitalSnake;
+ }
+
+ public void setCapitalSnake(@Nullable String capitalSnake) {
+ this.capitalSnake = capitalSnake;
+ }
+
+ public CapitalizationDto scAETHFlowPoints(@Nullable String scAETHFlowPoints) {
+ this.scAETHFlowPoints = scAETHFlowPoints;
+ return this;
+ }
+
+ /**
+ * Get scAETHFlowPoints
+ * @return scAETHFlowPoints
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("SCA_ETH_Flow_Points")
+ public @Nullable String getScAETHFlowPoints() {
+ return scAETHFlowPoints;
+ }
+
+ public void setScAETHFlowPoints(@Nullable String scAETHFlowPoints) {
+ this.scAETHFlowPoints = scAETHFlowPoints;
+ }
+
+ public CapitalizationDto ATT_NAME(@Nullable 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 @Nullable String getATTNAME() {
+ return ATT_NAME;
+ }
+
+ public void setATTNAME(@Nullable 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;
+ }
+ CapitalizationDto capitalization = (CapitalizationDto) 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 CapitalizationDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CatDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CatDto.java
new file mode 100644
index 000000000000..9ee441ad0fa6
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CatDto.java
@@ -0,0 +1,122 @@
+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.JsonTypeName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.AnimalDto;
+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;
+
+/**
+ * CatDto
+ */
+
+@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 = BigCatDto.class, name = "BigCat")
+})
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class CatDto extends AnimalDto {
+
+ private @Nullable Boolean declawed;
+
+ public CatDto() {
+ super();
+ }
+
+ /**
+ * Constructor with only required parameters
+ */
+ public CatDto(String className) {
+ super(className);
+ }
+
+ public CatDto declawed(@Nullable Boolean declawed) {
+ this.declawed = declawed;
+ return this;
+ }
+
+ /**
+ * Get declawed
+ * @return declawed
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("declawed")
+ public @Nullable Boolean getDeclawed() {
+ return declawed;
+ }
+
+ public void setDeclawed(@Nullable Boolean declawed) {
+ this.declawed = declawed;
+ }
+
+
+ public CatDto className(String className) {
+ super.className(className);
+ return this;
+ }
+
+ public CatDto 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;
+ }
+ CatDto cat = (CatDto) 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 CatDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java
new file mode 100644
index 000000000000..a96abfd855ed
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.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 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;
+
+/**
+ * CategoryDto
+ */
+
+@JsonTypeName("Category")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class CategoryDto {
+
+ private @Nullable Long id;
+
+ private String name = "default-name";
+
+ public CategoryDto() {
+ super();
+ }
+
+ /**
+ * Constructor with only required parameters
+ */
+ public CategoryDto(String name) {
+ this.name = name;
+ }
+
+ public CategoryDto id(@Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("id")
+ public @Nullable Long getId() {
+ return id;
+ }
+
+ public void setId(@Nullable Long id) {
+ this.id = id;
+ }
+
+ public CategoryDto 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;
+ }
+ CategoryDto category = (CategoryDto) 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 CategoryDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ChildWithNullableDto.java
new file mode 100644
index 000000000000..c26b8eddf14d
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ChildWithNullableDto.java
@@ -0,0 +1,118 @@
+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.JsonTypeName;
+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.ParentWithNullableDto;
+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;
+
+/**
+ * ChildWithNullableDto
+ */
+
+
+@JsonTypeName("ChildWithNullable")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ChildWithNullableDto extends ParentWithNullableDto {
+
+ private @Nullable String otherProperty;
+
+ public ChildWithNullableDto otherProperty(@Nullable String otherProperty) {
+ this.otherProperty = otherProperty;
+ return this;
+ }
+
+ /**
+ * Get otherProperty
+ * @return otherProperty
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("otherProperty")
+ public @Nullable String getOtherProperty() {
+ return otherProperty;
+ }
+
+ public void setOtherProperty(@Nullable String otherProperty) {
+ this.otherProperty = otherProperty;
+ }
+
+
+ public ChildWithNullableDto type(TypeEnum type) {
+ super.type(type);
+ return this;
+ }
+
+ public ChildWithNullableDto 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;
+ }
+ ChildWithNullableDto childWithNullable = (ChildWithNullableDto) 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 ChildWithNullableDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClassModelDto.java
new file mode 100644
index 000000000000..e7905f5dc3a9
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClassModelDto.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 model with \"_class\" property
+ */
+
+@ApiModel(description = "Model for testing model with \"_class\" property")
+@JsonTypeName("ClassModel")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ClassModelDto {
+
+ private @Nullable String propertyClass;
+
+ public ClassModelDto propertyClass(@Nullable String propertyClass) {
+ this.propertyClass = propertyClass;
+ return this;
+ }
+
+ /**
+ * Get propertyClass
+ * @return propertyClass
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("_class")
+ public @Nullable String getPropertyClass() {
+ return propertyClass;
+ }
+
+ public void setPropertyClass(@Nullable String propertyClass) {
+ this.propertyClass = propertyClass;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ClassModelDto classModel = (ClassModelDto) 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 ClassModelDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClientDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClientDto.java
new file mode 100644
index 000000000000..9570af694744
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClientDto.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;
+
+/**
+ * ClientDto
+ */
+
+@JsonTypeName("Client")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ClientDto {
+
+ private @Nullable String client;
+
+ public ClientDto client(@Nullable String client) {
+ this.client = client;
+ return this;
+ }
+
+ /**
+ * Get client
+ * @return client
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("client")
+ public @Nullable String getClient() {
+ return client;
+ }
+
+ public void setClient(@Nullable String client) {
+ this.client = client;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ClientDto client = (ClientDto) 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 ClientDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java
new file mode 100644
index 000000000000..f414c04e048d
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java
@@ -0,0 +1,223 @@
+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.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;
+
+/**
+ * ContainerDefaultValueDto
+ */
+
+@JsonTypeName("ContainerDefaultValue")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ContainerDefaultValueDto {
+
+ @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 ContainerDefaultValueDto() {
+ super();
+ }
+
+ /**
+ * Constructor with only required parameters
+ */
+ public ContainerDefaultValueDto(List nullableRequiredArray, List requiredArray) {
+ this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray);
+ this.requiredArray = requiredArray;
+ }
+
+ public ContainerDefaultValueDto nullableArray(List nullableArray) {
+ this.nullableArray = JsonNullable.of(nullableArray);
+ return this;
+ }
+
+ public ContainerDefaultValueDto 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 ContainerDefaultValueDto nullableRequiredArray(List nullableRequiredArray) {
+ this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray);
+ return this;
+ }
+
+ public ContainerDefaultValueDto 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 ContainerDefaultValueDto requiredArray(List requiredArray) {
+ this.requiredArray = requiredArray;
+ return this;
+ }
+
+ public ContainerDefaultValueDto 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 ContainerDefaultValueDto nullableArrayWithDefault(List nullableArrayWithDefault) {
+ this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault);
+ return this;
+ }
+
+ public ContainerDefaultValueDto 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;
+ }
+ ContainerDefaultValueDto containerDefaultValue = (ContainerDefaultValueDto) 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 ContainerDefaultValueDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/DogDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/DogDto.java
new file mode 100644
index 000000000000..5314555cdcba
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/DogDto.java
@@ -0,0 +1,115 @@
+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.JsonTypeName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.AnimalDto;
+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;
+
+/**
+ * DogDto
+ */
+
+
+@JsonTypeName("Dog")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class DogDto extends AnimalDto {
+
+ private @Nullable String breed;
+
+ public DogDto() {
+ super();
+ }
+
+ /**
+ * Constructor with only required parameters
+ */
+ public DogDto(String className) {
+ super(className);
+ }
+
+ public DogDto breed(@Nullable String breed) {
+ this.breed = breed;
+ return this;
+ }
+
+ /**
+ * Get breed
+ * @return breed
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("breed")
+ public @Nullable String getBreed() {
+ return breed;
+ }
+
+ public void setBreed(@Nullable String breed) {
+ this.breed = breed;
+ }
+
+
+ public DogDto className(String className) {
+ super.className(className);
+ return this;
+ }
+
+ public DogDto 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;
+ }
+ DogDto dog = (DogDto) 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 DogDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumArraysDto.java
new file mode 100644
index 000000000000..b0514fbe6a45
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumArraysDto.java
@@ -0,0 +1,194 @@
+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 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;
+
+/**
+ * EnumArraysDto
+ */
+
+@JsonTypeName("EnumArrays")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class EnumArraysDto {
+
+ /**
+ * Gets or Sets justSymbol
+ */
+ public enum JustSymbolEnum {
+ GREATER_THAN_OR_EQUAL_TO(">="),
+
+ DOLLAR("$");
+
+ private final 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 final 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 EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) {
+ this.justSymbol = justSymbol;
+ return this;
+ }
+
+ /**
+ * Get justSymbol
+ * @return justSymbol
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("just_symbol")
+ public @Nullable JustSymbolEnum getJustSymbol() {
+ return justSymbol;
+ }
+
+ public void setJustSymbol(@Nullable JustSymbolEnum justSymbol) {
+ this.justSymbol = justSymbol;
+ }
+
+ public EnumArraysDto arrayEnum(List arrayEnum) {
+ this.arrayEnum = arrayEnum;
+ return this;
+ }
+
+ public EnumArraysDto 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;
+ }
+ EnumArraysDto enumArrays = (EnumArraysDto) 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 EnumArraysDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumClassDto.java
new file mode 100644
index 000000000000..7deb2abb92bd
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumClassDto.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.20.0-SNAPSHOT")
+public enum EnumClassDto {
+
+ _ABC("_abc"),
+
+ _EFG("-efg"),
+
+ _XYZ_("(xyz)");
+
+ private final String value;
+
+ EnumClassDto(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static EnumClassDto fromValue(String value) {
+ for (EnumClassDto b : EnumClassDto.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java
new file mode 100644
index 000000000000..5406afc6760f
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.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.OuterEnumDto;
+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;
+
+/**
+ * EnumTestDto
+ */
+
+@JsonTypeName("Enum_Test")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class EnumTestDto {
+
+ /**
+ * Gets or Sets enumString
+ */
+ public enum EnumStringEnum {
+ UPPER("UPPER"),
+
+ LOWER("lower"),
+
+ EMPTY("");
+
+ private final 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 final 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 final 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 final 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 OuterEnumDto outerEnum;
+
+ public EnumTestDto() {
+ super();
+ }
+
+ /**
+ * Constructor with only required parameters
+ */
+ public EnumTestDto(EnumStringRequiredEnum enumStringRequired) {
+ this.enumStringRequired = enumStringRequired;
+ }
+
+ public EnumTestDto enumString(@Nullable EnumStringEnum enumString) {
+ this.enumString = enumString;
+ return this;
+ }
+
+ /**
+ * Get enumString
+ * @return enumString
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("enum_string")
+ public @Nullable EnumStringEnum getEnumString() {
+ return enumString;
+ }
+
+ public void setEnumString(@Nullable EnumStringEnum enumString) {
+ this.enumString = enumString;
+ }
+
+ public EnumTestDto 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 EnumTestDto enumInteger(@Nullable EnumIntegerEnum enumInteger) {
+ this.enumInteger = enumInteger;
+ return this;
+ }
+
+ /**
+ * Get enumInteger
+ * @return enumInteger
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("enum_integer")
+ public @Nullable EnumIntegerEnum getEnumInteger() {
+ return enumInteger;
+ }
+
+ public void setEnumInteger(@Nullable EnumIntegerEnum enumInteger) {
+ this.enumInteger = enumInteger;
+ }
+
+ public EnumTestDto enumNumber(@Nullable EnumNumberEnum enumNumber) {
+ this.enumNumber = enumNumber;
+ return this;
+ }
+
+ /**
+ * Get enumNumber
+ * @return enumNumber
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("enum_number")
+ public @Nullable EnumNumberEnum getEnumNumber() {
+ return enumNumber;
+ }
+
+ public void setEnumNumber(@Nullable EnumNumberEnum enumNumber) {
+ this.enumNumber = enumNumber;
+ }
+
+ public EnumTestDto outerEnum(@Nullable OuterEnumDto outerEnum) {
+ this.outerEnum = outerEnum;
+ return this;
+ }
+
+ /**
+ * Get outerEnum
+ * @return outerEnum
+ */
+ @Valid
+ @ApiModelProperty(value = "")
+ @JsonProperty("outerEnum")
+ public @Nullable OuterEnumDto getOuterEnum() {
+ return outerEnum;
+ }
+
+ public void setOuterEnum(@Nullable OuterEnumDto outerEnum) {
+ this.outerEnum = outerEnum;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ EnumTestDto enumTest = (EnumTestDto) 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 EnumTestDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileDto.java
new file mode 100644
index 000000000000..68982c42dc12
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileDto.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;
+
+/**
+ * Must be named `File` for test.
+ */
+
+@ApiModel(description = "Must be named `File` for test.")
+@JsonTypeName("File")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class FileDto {
+
+ private @Nullable String sourceURI;
+
+ public FileDto sourceURI(@Nullable String sourceURI) {
+ this.sourceURI = sourceURI;
+ return this;
+ }
+
+ /**
+ * Test capitalization
+ * @return sourceURI
+ */
+
+ @ApiModelProperty(value = "Test capitalization")
+ @JsonProperty("sourceURI")
+ public @Nullable String getSourceURI() {
+ return sourceURI;
+ }
+
+ public void setSourceURI(@Nullable String sourceURI) {
+ this.sourceURI = sourceURI;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FileDto file = (FileDto) 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 FileDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java
new file mode 100644
index 000000000000..4a7ca33c3f49
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java
@@ -0,0 +1,124 @@
+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.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.openapitools.model.FileDto;
+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;
+
+/**
+ * FileSchemaTestClassDto
+ */
+
+@JsonTypeName("FileSchemaTestClass")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class FileSchemaTestClassDto {
+
+ private @Nullable FileDto file;
+
+ @Valid
+ private List<@Valid FileDto> files = new ArrayList<>();
+
+ public FileSchemaTestClassDto file(@Nullable FileDto file) {
+ this.file = file;
+ return this;
+ }
+
+ /**
+ * Get file
+ * @return file
+ */
+ @Valid
+ @ApiModelProperty(value = "")
+ @JsonProperty("file")
+ public @Nullable FileDto getFile() {
+ return file;
+ }
+
+ public void setFile(@Nullable FileDto file) {
+ this.file = file;
+ }
+
+ public FileSchemaTestClassDto files(List<@Valid FileDto> files) {
+ this.files = files;
+ return this;
+ }
+
+ public FileSchemaTestClassDto addFilesItem(FileDto 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 FileDto> getFiles() {
+ return files;
+ }
+
+ public void setFiles(List<@Valid FileDto> files) {
+ this.files = files;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FileSchemaTestClassDto fileSchemaTestClass = (FileSchemaTestClassDto) 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 FileSchemaTestClassDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java
new file mode 100644
index 000000000000..dee42ce7c8a1
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.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;
+
+/**
+ * FormatTestDto
+ */
+
+@JsonTypeName("format_test")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class FormatTestDto {
+
+ 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 FormatTestDto() {
+ super();
+ }
+
+ /**
+ * Constructor with only required parameters
+ */
+ public FormatTestDto(BigDecimal number, byte[] _byte, LocalDate date, String password) {
+ this.number = number;
+ this._byte = _byte;
+ this.date = date;
+ this.password = password;
+ }
+
+ public FormatTestDto integer(@Nullable Integer integer) {
+ this.integer = integer;
+ return this;
+ }
+
+ /**
+ * Get integer
+ * minimum: 10
+ * maximum: 100
+ * @return integer
+ */
+ @Min(value = 10) @Max(value = 100)
+ @ApiModelProperty(value = "")
+ @JsonProperty("integer")
+ public @Nullable Integer getInteger() {
+ return integer;
+ }
+
+ public void setInteger(@Nullable Integer integer) {
+ this.integer = integer;
+ }
+
+ public FormatTestDto int32(@Nullable Integer int32) {
+ this.int32 = int32;
+ return this;
+ }
+
+ /**
+ * Get int32
+ * minimum: 20
+ * maximum: 200
+ * @return int32
+ */
+ @Min(value = 20) @Max(value = 200)
+ @ApiModelProperty(value = "")
+ @JsonProperty("int32")
+ public @Nullable Integer getInt32() {
+ return int32;
+ }
+
+ public void setInt32(@Nullable Integer int32) {
+ this.int32 = int32;
+ }
+
+ public FormatTestDto int64(@Nullable Long int64) {
+ this.int64 = int64;
+ return this;
+ }
+
+ /**
+ * Get int64
+ * @return int64
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("int64")
+ public @Nullable Long getInt64() {
+ return int64;
+ }
+
+ public void setInt64(@Nullable Long int64) {
+ this.int64 = int64;
+ }
+
+ public FormatTestDto number(BigDecimal number) {
+ this.number = number;
+ return this;
+ }
+
+ /**
+ * Get number
+ * minimum: 32.1
+ * maximum: 543.2
+ * @return number
+ */
+ @NotNull @Valid @DecimalMin(value = "32.1") @DecimalMax(value = "543.2")
+ @ApiModelProperty(required = true, value = "")
+ @JsonProperty("number")
+ public BigDecimal getNumber() {
+ return number;
+ }
+
+ public void setNumber(BigDecimal number) {
+ this.number = number;
+ }
+
+ public FormatTestDto _float(@Nullable Float _float) {
+ this._float = _float;
+ return this;
+ }
+
+ /**
+ * Get _float
+ * minimum: 54.3
+ * maximum: 987.6
+ * @return _float
+ */
+ @DecimalMin(value = "54.3") @DecimalMax(value = "987.6")
+ @ApiModelProperty(value = "")
+ @JsonProperty("float")
+ public @Nullable Float getFloat() {
+ return _float;
+ }
+
+ public void setFloat(@Nullable Float _float) {
+ this._float = _float;
+ }
+
+ public FormatTestDto _double(@Nullable Double _double) {
+ this._double = _double;
+ return this;
+ }
+
+ /**
+ * Get _double
+ * minimum: 67.8
+ * maximum: 123.4
+ * @return _double
+ */
+ @DecimalMin(value = "67.8") @DecimalMax(value = "123.4")
+ @ApiModelProperty(value = "")
+ @JsonProperty("double")
+ public @Nullable Double getDouble() {
+ return _double;
+ }
+
+ public void setDouble(@Nullable Double _double) {
+ this._double = _double;
+ }
+
+ public FormatTestDto string(@Nullable String string) {
+ this.string = string;
+ return this;
+ }
+
+ /**
+ * Get string
+ * @return string
+ */
+ @Pattern(regexp = "/[a-z]/i")
+ @ApiModelProperty(value = "")
+ @JsonProperty("string")
+ public @Nullable String getString() {
+ return string;
+ }
+
+ public void setString(@Nullable String string) {
+ this.string = string;
+ }
+
+ public FormatTestDto _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 FormatTestDto binary(@Nullable org.springframework.core.io.Resource binary) {
+ this.binary = binary;
+ return this;
+ }
+
+ /**
+ * Get binary
+ * @return binary
+ */
+ @Valid
+ @ApiModelProperty(value = "")
+ @JsonProperty("binary")
+ public @Nullable org.springframework.core.io.Resource getBinary() {
+ return binary;
+ }
+
+ public void setBinary(@Nullable org.springframework.core.io.Resource binary) {
+ this.binary = binary;
+ }
+
+ public FormatTestDto 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 FormatTestDto dateTime(@Nullable OffsetDateTime dateTime) {
+ this.dateTime = dateTime;
+ return this;
+ }
+
+ /**
+ * Get dateTime
+ * @return dateTime
+ */
+ @Valid
+ @ApiModelProperty(value = "")
+ @JsonProperty("dateTime")
+ public @Nullable OffsetDateTime getDateTime() {
+ return dateTime;
+ }
+
+ public void setDateTime(@Nullable OffsetDateTime dateTime) {
+ this.dateTime = dateTime;
+ }
+
+ public FormatTestDto uuid(@Nullable UUID uuid) {
+ this.uuid = uuid;
+ return this;
+ }
+
+ /**
+ * Get uuid
+ * @return uuid
+ */
+ @Valid
+ @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "")
+ @JsonProperty("uuid")
+ public @Nullable UUID getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(@Nullable UUID uuid) {
+ this.uuid = uuid;
+ }
+
+ public FormatTestDto 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 FormatTestDto bigDecimal(@Nullable BigDecimal bigDecimal) {
+ this.bigDecimal = bigDecimal;
+ return this;
+ }
+
+ /**
+ * Get bigDecimal
+ * @return bigDecimal
+ */
+ @Valid
+ @ApiModelProperty(value = "")
+ @JsonProperty("BigDecimal")
+ public @Nullable BigDecimal getBigDecimal() {
+ return bigDecimal;
+ }
+
+ public void setBigDecimal(@Nullable BigDecimal bigDecimal) {
+ this.bigDecimal = bigDecimal;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FormatTestDto formatTest = (FormatTestDto) 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 FormatTestDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java
new file mode 100644
index 000000000000..22352d6763d8
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.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;
+
+/**
+ * HasOnlyReadOnlyDto
+ */
+
+@JsonTypeName("hasOnlyReadOnly")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class HasOnlyReadOnlyDto {
+
+ private @Nullable String bar;
+
+ private @Nullable String foo;
+
+ public HasOnlyReadOnlyDto bar(@Nullable String bar) {
+ this.bar = bar;
+ return this;
+ }
+
+ /**
+ * Get bar
+ * @return bar
+ */
+
+ @ApiModelProperty(readOnly = true, value = "")
+ @JsonProperty("bar")
+ public @Nullable String getBar() {
+ return bar;
+ }
+
+ public void setBar(@Nullable String bar) {
+ this.bar = bar;
+ }
+
+ public HasOnlyReadOnlyDto foo(@Nullable String foo) {
+ this.foo = foo;
+ return this;
+ }
+
+ /**
+ * Get foo
+ * @return foo
+ */
+
+ @ApiModelProperty(readOnly = true, value = "")
+ @JsonProperty("foo")
+ public @Nullable String getFoo() {
+ return foo;
+ }
+
+ public void setFoo(@Nullable String foo) {
+ this.foo = foo;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ HasOnlyReadOnlyDto hasOnlyReadOnly = (HasOnlyReadOnlyDto) 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 HasOnlyReadOnlyDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ListDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ListDto.java
new file mode 100644
index 000000000000..a54c9a8ffde4
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ListDto.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;
+
+/**
+ * ListDto
+ */
+
+@JsonTypeName("List")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class ListDto {
+
+ private @Nullable String _123List;
+
+ public ListDto _123List(@Nullable String _123List) {
+ this._123List = _123List;
+ return this;
+ }
+
+ /**
+ * Get _123List
+ * @return _123List
+ */
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("123-list")
+ public @Nullable String get123List() {
+ return _123List;
+ }
+
+ public void set123List(@Nullable String _123List) {
+ this._123List = _123List;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ListDto _list = (ListDto) 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 ListDto {\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(@Nullable Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MapTestDto.java
new file mode 100644
index 000000000000..78b4edea7585
--- /dev/null
+++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MapTestDto.java
@@ -0,0 +1,233 @@
+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 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;
+
+/**
+ * MapTestDto
+ */
+
+@JsonTypeName("MapTest")
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
+public class MapTestDto {
+
+ @Valid
+ private Map> mapMapOfString = new HashMap<>();
+
+ /**
+ * Gets or Sets inner
+ */
+ public enum InnerEnum {
+ UPPER("UPPER"),
+
+ LOWER("lower");
+
+ private final 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 MapTestDto mapMapOfString(Map> mapMapOfString) {
+ this.mapMapOfString = mapMapOfString;
+ return this;
+ }
+
+ public MapTestDto putMapMapOfStringItem(String key, Map