From 1b2f3fbfb6d9fc95965b438d46075de7a628d648 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 20 Sep 2018 19:29:33 +0800 Subject: [PATCH] Fix alias to map response (#1067) * fix response reference to map * update samples * add null check for openapi --- docs/generators/aspnetcore.md | 3 ++ docs/generators/cpp-pistache-server.md | 3 ++ docs/generators/dart.md | 3 ++ docs/generators/elm.md | 5 +++ docs/generators/java.md | 7 ++- docs/generators/kotlin-spring.md | 2 +- docs/generators/spring.md | 3 ++ docs/generators/typescript-angular.md | 3 ++ .../openapitools/codegen/DefaultCodegen.java | 45 +++++++++---------- .../codegen/utils/ModelUtils.java | 35 ++++++++++++--- .../csharp/OpenAPIClient/docs/MapTest.md | 2 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 8 ++-- .../lib/OpenAPIPetstore/Model.hs | 2 +- .../lib/OpenAPIPetstore/ModelLens.hs | 2 +- .../petstore/haskell-http-client/openapi.yaml | 3 +- .../haskell-http-client/tests/Instances.hs | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../openapitools/client/model/MapTest.java | 17 ++++--- .../java/google-api-client/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../petstore/java/jersey1/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../java/jersey2-java6/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../java/jersey2-java8/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../petstore/java/jersey2/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 19 +++++--- .../petstore/java/okhttp-gson/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../java/rest-assured/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../petstore/java/resteasy/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../java/resttemplate-withXml/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 23 +++++++--- .../java/resttemplate/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../openapitools/client/model/MapTest.java | 17 ++++--- .../java/retrofit2-play24/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 18 +++++--- .../java/retrofit2-play25/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 18 +++++--- .../java/retrofit2-play26/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 18 +++++--- .../petstore/java/retrofit2/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../petstore/java/retrofit2rx/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../java/retrofit2rx2/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../petstore/java/vertx/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../petstore/java/webclient/docs/MapTest.md | 2 +- .../openapitools/client/model/MapTest.java | 17 ++++--- .../OpenAPIClient-php/docs/Model/MapTest.md | 2 +- .../OpenAPIClient-php/lib/Model/MapTest.php | 6 +-- samples/client/petstore/ruby/docs/MapTest.md | 2 +- .../ruby/lib/petstore/models/map_test.rb | 6 ++- .../OpenAPIClient-php/docs/Model/MapTest.md | 2 +- .../OpenAPIClient-php/lib/Model/MapTest.php | 6 +-- .../java/org/openapitools/model/MapTest.java | 15 ++++--- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../java/org/openapitools/model/MapTest.java | 9 ++-- .../src/main/openapi/openapi.yaml | 4 +- .../java/org/openapitools/model/MapTest.java | 9 ++-- .../jaxrs-spec/src/main/openapi/openapi.yaml | 4 +- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../petstore/php-slim/lib/Model/MapTest.php | 2 +- .../php-ze-ph/src/App/DTO/MapTest.php | 8 ++-- .../java/org/openapitools/api/FakeApi.java | 36 ++------------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../java/org/openapitools/api/FakeApi.java | 24 ---------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../openapitools/api/FakeApiController.java | 18 -------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../openapitools/api/FakeApiController.java | 18 -------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../org/openapitools/api/FakeApiDelegate.java | 24 ---------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../java/org/openapitools/api/FakeApi.java | 24 ---------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../org/openapitools/api/FakeApiDelegate.java | 18 -------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../src/main/resources/openapi.yaml | 4 +- .../java/org/openapitools/api/FakeApi.java | 24 ---------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- .../java/org/openapitools/api/FakeApi.java | 24 ---------- .../java/org/openapitools/model/MapTest.java | 19 +++++--- 95 files changed, 616 insertions(+), 509 deletions(-) diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 1307004f98..1db6c0b313 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -13,6 +13,9 @@ CONFIG OPTIONS for aspnetcore sourceFolder source folder for generated code (Default: src) + aspnetCoreVersion + ASP.NET Core version: 2.1 (default), 2.0 (deprecated) (Default: 2.1) + sortParamsByRequiredFlag Sort method arguments to place required parameters before optional parameters. (Default: true) diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index 7cc58fe304..52f9ed18c1 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -4,4 +4,7 @@ CONFIG OPTIONS for cpp-pistache-server addExternalLibs Add the Possibility to fetch and compile external Libraries needed by this Framework. (Default: true) + helpersPackage + Specify the package name to be used for the helpers (e.g. org.openapitools.server.helpers). (Default: org.openapitools.server.helpers) + Back to the [generators list](README.md) diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 8c25a60459..3e55246830 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -31,4 +31,7 @@ CONFIG OPTIONS for dart sourceFolder source folder for generated code + supportDart2 + support dart2 (Default: true) + Back to the [generators list](README.md) diff --git a/docs/generators/elm.md b/docs/generators/elm.md index 525c751bea..891a281d1e 100644 --- a/docs/generators/elm.md +++ b/docs/generators/elm.md @@ -1,4 +1,9 @@ CONFIG OPTIONS for elm + elmVersion + Elm version: 0.18, 0.19 (Default: 0.19) + 0.19 - Elm 0.19 + 0.18 - Elm 0.18 + Back to the [generators list](README.md) diff --git a/docs/generators/java.md b/docs/generators/java.md index 492b3b36d3..6892d264c7 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -117,7 +117,7 @@ CONFIG OPTIONS for java Use Play! Async HTTP client (Play WS API) (Default: false) playVersion - Version of Play! Framework (possible values "play24", "play25") + Version of Play! Framework (possible values "play24", "play25" (default), "play26") supportJava6 Whether to support Java6 with the Jersey1 library. (Default: false) @@ -134,10 +134,13 @@ CONFIG OPTIONS for java useRuntimeException Use RuntimeException instead of Exception (Default: false) + feignVersion + Version of OpenFeign: '10.x', '9.x' (default) (Default: false) + library library template (sub-template) to use (Default: okhttp-gson) jersey1 - HTTP client: Jersey client 1.19.4. JSON processing: Jackson 2.8.9. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. - feign - HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.8.9. Enable OpenFeign 10.0.1 using '-DuseFeign10=true'. + feign - HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.8.9. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x' jersey2 - HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.8.9 okhttp-gson - HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. retrofit - HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead. diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 9803e25e0d..dace2b33af 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -23,7 +23,7 @@ CONFIG OPTIONS for kotlin-spring server title name or client service name (Default: OpenAPI Kotlin Spring) basePackage - base package for generated code (Default: org.openapitools) + base package (invokerPackage) for generated code (Default: org.openapitools) serverPort configuration the port in which the sever is to run on (Default: 8080) diff --git a/docs/generators/spring.md b/docs/generators/spring.md index dd284679cd..17886ab943 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -134,6 +134,9 @@ CONFIG OPTIONS for spring responseWrapper wrap the responses in given type (Future,Callable,CompletableFuture,ListenableFuture,DeferredResult,HystrixCommand,RxObservable,RxSingle or fully qualified type) + virtualService + Generates the virtual service. For more details refer - https://github.com/elan-venture/virtualan/wiki (Default: false) + useTags use tags for creating interface and controller classnames (Default: false) diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index fcb59bebbb..e459084760 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -55,4 +55,7 @@ CONFIG OPTIONS for typescript-angular modelFileSuffix The suffix of the file of the generated model (model.ts). Default is ''. + fileNaming + Naming convention for the output files: 'camelCase', 'kebab-case'. Default is 'camelCase'. + Back to the [generators list](README.md) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 5267ee95a2..8ddbb41197 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -841,15 +841,14 @@ public class DefaultCodegen implements CodegenConfig { /** * Return the name with escaped characters. * - * @param name the name to be escaped - * @param charactersToAllow characters that are not escaped + * @param name the name to be escaped + * @param charactersToAllow characters that are not escaped * @param appdendixToReplacement String to append to replaced characters. * @return the escaped word *

* throws Runtime exception as word is not escaped properly. - * @deprecated since version 3.2.3, may be removed with the next major release (4.0) * @see org.openapitools.codegen.utils.StringUtils#escape directly instead - * + * @deprecated since version 3.2.3, may be removed with the next major release (4.0) */ @Deprecated public String escapeSpecialCharacters(String name, List charactersToAllow, String appdendixToReplacement) { @@ -1096,11 +1095,6 @@ public class DefaultCodegen implements CodegenConfig { public String toInstantiationType(Schema schema) { if (ModelUtils.isMapSchema(schema)) { Schema additionalProperties = ModelUtils.getAdditionalProperties(schema); - String type = additionalProperties.getType(); - if (null == type) { - LOGGER.error("No Type defined for Additional Property " + additionalProperties + "\n" // - + "\tIn Property: " + schema); - } String inner = getSchemaType(additionalProperties); return instantiationTypes.get("map") + ""; } else if (ModelUtils.isArraySchema(schema)) { @@ -2254,7 +2248,7 @@ public class DefaultCodegen implements CodegenConfig { } operationId = removeNonNameElementToCamelCase(operationId); - if(path.startsWith("/")) { + if (path.startsWith("/")) { op.path = path; } else { op.path = "/" + path; @@ -2295,7 +2289,10 @@ public class DefaultCodegen implements CodegenConfig { op.responses.get(op.responses.size() - 1).hasMore = false; if (methodResponse != null) { - final Schema responseSchema = ModelUtils.getSchemaFromResponse(methodResponse); + Schema responseSchema = ModelUtils.getSchemaFromResponse(methodResponse); + if (openAPI != null && openAPI.getComponents() != null) { // has models/aliases defined + responseSchema = ModelUtils.unaliasSchema(openAPI.getComponents().getSchemas(), responseSchema); + } if (responseSchema != null) { CodegenProperty cm = fromProperty("response", responseSchema); @@ -2662,12 +2659,12 @@ public class DefaultCodegen implements CodegenConfig { } Stream.of( - Pair.of("get", pi.getGet()), - Pair.of("head", pi.getHead()), - Pair.of("put", pi.getPut()), - Pair.of("post", pi.getPost()), - Pair.of("delete", pi.getDelete()), - Pair.of("patch", pi.getPatch()), + Pair.of("get", pi.getGet()), + Pair.of("head", pi.getHead()), + Pair.of("put", pi.getPut()), + Pair.of("post", pi.getPost()), + Pair.of("delete", pi.getDelete()), + Pair.of("patch", pi.getPatch()), Pair.of("options", pi.getOptions())) .filter(p -> p.getValue() != null) .forEach(p -> { @@ -2676,7 +2673,7 @@ public class DefaultCodegen implements CodegenConfig { boolean genId = op.getOperationId() == null; if (genId) { - op.setOperationId(getOrGenerateOperationId(op, c.name+"_"+expression.replaceAll("\\{\\$.*}", ""), method)); + op.setOperationId(getOrGenerateOperationId(op, c.name + "_" + expression.replaceAll("\\{\\$.*}", ""), method)); } if (op.getExtensions() == null) { @@ -3265,8 +3262,8 @@ public class DefaultCodegen implements CodegenConfig { * * @param word The word * @return The underscored version of the word - * @deprecated since version 3.2.3, may be removed with the next major release (4.0) * @see org.openapitools.codegen.utils.StringUtils#underscore + * @deprecated since version 3.2.3, may be removed with the next major release (4.0) */ @Deprecated public static String underscore(String word) { @@ -3278,8 +3275,8 @@ public class DefaultCodegen implements CodegenConfig { * * @param word The word * @return The dashized version of the word, e.g. "my-name" - * @deprecated since version 3.2.3, may be removed with the next major release (4.0) * @see org.openapitools.codegen.utils.StringUtils#dashize + * @deprecated since version 3.2.3, may be removed with the next major release (4.0) */ @SuppressWarnings("static-method") @Deprecated @@ -3492,8 +3489,8 @@ public class DefaultCodegen implements CodegenConfig { * * @param word string to be camelize * @return camelized string - * @deprecated since version 3.2.3, may be removed with the next major release (4.0) * @see org.openapitools.codegen.utils.StringUtils#camelize(String) + * @deprecated since version 3.2.3, may be removed with the next major release (4.0) */ @Deprecated public static String camelize(String word) { @@ -3506,8 +3503,8 @@ public class DefaultCodegen implements CodegenConfig { * @param word string to be camelize * @param lowercaseFirstLetter lower case for first letter if set to true * @return camelized string - * @deprecated since version 3.2.3, may be removed with the next major release (4.0) * @see org.openapitools.codegen.utils.StringUtils#camelize(String, boolean) + * @deprecated since version 3.2.3, may be removed with the next major release (4.0) */ @Deprecated public static String camelize(String word, boolean lowercaseFirstLetter) { @@ -4697,10 +4694,10 @@ public class DefaultCodegen implements CodegenConfig { * Post-process the auto-generated file, e.g. using go-fmt to format the Go code. The file type can be "model-test", * "model-doc", "model", "api", "api-test", "api-doc", "supporting-mustache", "supporting-common", * "openapi-generator-ignore", "openapi-generator-version" - * + *

* TODO: store these values in enum instead * - * @param file file to be processed + * @param file file to be processed * @param fileType file type */ public void postProcessFile(File file, String fileType) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 7d2eeb40c4..f1c0dd8afd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -308,7 +308,7 @@ public class ModelUtils { if (schema.getAdditionalProperties() instanceof Schema) { return true; } - if (schema.getAdditionalProperties() instanceof Boolean && (Boolean)schema.getAdditionalProperties()) { + if (schema.getAdditionalProperties() instanceof Boolean && (Boolean) schema.getAdditionalProperties()) { return true; } return false; @@ -638,21 +638,42 @@ public class ModelUtils { * Get the actual schema from aliases. If the provided schema is not an alias, the schema itself will be returned. * * @param allSchemas all schemas - * @param schema schema (alias or direct reference) + * @param schema schema (alias or direct reference) * @return actual schema */ public static Schema unaliasSchema(Map allSchemas, Schema schema) { + if (allSchemas == null || allSchemas.isEmpty()) { + LOGGER.warn("allSchemas cann't be null/empty in unaliasSchema. Returned 'schema'"); + return schema; + } + if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { Schema ref = allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())); if (ref == null) { LOGGER.warn("{} is not defined", schema.get$ref()); return schema; - } else if (isObjectSchema(ref)) { // model - return schema; } else if (isStringSchema(ref) && (ref.getEnum() != null && !ref.getEnum().isEmpty())) { // top-level enum class return schema; - } else if (isMapSchema(ref) || isArraySchema(ref) || isComposedSchema(ref)) { // map/array def should be created as models + } else if (isArraySchema(ref) || isComposedSchema(ref)) { // array def should be created as models + return schema; + } else if (isMapSchema(ref)) { + if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has properties + return schema; // treat it as model + else { + // treat it as a typical map + /* TODO unalias the map item if it's an alias + if (ref.getAdditionalProperties() != null) { + + Schema innerSchema = (Schema) ref.getAdditionalProperties(); + if (StringUtils.isNotEmpty(innerSchema.get$ref())) { // map item is a ref to something else + //Schema unaliasInnerSchema = unaliasSchema(allSchemas, allSchemas.get(ModelUtils.getSimpleRef(innerSchema.get$ref()))); + //ref.setAdditionalProperties(unaliasInnerSchema); + } + }*/ + return unaliasSchema(allSchemas, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); + } + } else if (isObjectSchema(ref)) { // model return schema; } else { return unaliasSchema(allSchemas, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); @@ -662,10 +683,10 @@ public class ModelUtils { } public static Schema getAdditionalProperties(Schema schema) { - if(schema.getAdditionalProperties() instanceof Schema) { + if (schema.getAdditionalProperties() instanceof Schema) { return (Schema) schema.getAdditionalProperties(); } - if(schema.getAdditionalProperties() instanceof Boolean && (Boolean)schema.getAdditionalProperties()) { + if (schema.getAdditionalProperties() instanceof Boolean && (Boolean) schema.getAdditionalProperties()) { return new ObjectSchema(); } return null; diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClient/docs/MapTest.md index ee62dbf135..2c44f95808 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/MapTest.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/MapTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] **DirectMap** | **Dictionary<string, bool?>** | | [optional] -**IndirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**IndirectMap** | **Dictionary<string, bool?>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs index 1c5bfa7019..3f44bcf22e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs @@ -63,7 +63,7 @@ namespace Org.OpenAPITools.Model /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), StringBooleanMap indirectMap = default(StringBooleanMap)) + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets IndirectMap /// [DataMember(Name="indirect_map", EmitDefaultValue=false)] - public StringBooleanMap IndirectMap { get; set; } + public Dictionary IndirectMap { get; set; } ///

/// Returns the string presentation of the object @@ -153,8 +153,8 @@ namespace Org.OpenAPITools.Model ) && ( this.IndirectMap == input.IndirectMap || - (this.IndirectMap != null && - this.IndirectMap.Equals(input.IndirectMap)) + this.IndirectMap != null && + this.IndirectMap.SequenceEqual(input.IndirectMap) ); } diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index f4a0f43dba..58bdea3d9d 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -1130,7 +1130,7 @@ data MapTest = MapTest { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" , mapTestMapOfEnumString :: !(Maybe (Map.Map String E'Inner)) -- ^ "map_of_enum_string" , mapTestDirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "direct_map" - , mapTestIndirectMap :: !(Maybe StringBooleanMap) -- ^ "indirect_map" + , mapTestIndirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "indirect_map" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON MapTest diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index 317dbe109c..b6b3e77ec3 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -543,7 +543,7 @@ mapTestDirectMapL f MapTest{..} = (\mapTestDirectMap -> MapTest { mapTestDirectM {-# INLINE mapTestDirectMapL #-} -- | 'mapTestIndirectMap' Lens -mapTestIndirectMapL :: Lens_' MapTest (Maybe StringBooleanMap) +mapTestIndirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) mapTestIndirectMapL f MapTest{..} = (\mapTestIndirectMap -> MapTest { mapTestIndirectMap, ..} ) <$> f mapTestIndirectMap {-# INLINE mapTestIndirectMapL #-} diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 688703b430..a6081e5926 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1324,7 +1324,8 @@ components: type: boolean type: object indirect_map: - $ref: '#/components/schemas/StringBooleanMap' + additionalProperties: + type: boolean type: object ArrayTest: properties: diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 6e54830ccf..d9ea47570d 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -273,7 +273,7 @@ instance Arbitrary MapTest where <$> arbitrary -- mapTestMapMapOfString :: Maybe (Map.Map String (Map.Map String Text)) <*> arbitrary -- mapTestMapOfEnumString :: Maybe (Map.Map String Text) <*> arbitrary -- mapTestDirectMap :: Maybe (Map.Map String Bool) - <*> arbitrary -- mapTestIndirectMap :: Maybe StringBooleanMap + <*> arbitrary -- mapTestIndirectMap :: Maybe (Map.Map String Bool) instance Arbitrary MixedPropertiesAndAdditionalPropertiesClass where arbitrary = diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index f67fb22c45..92128acfc7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java index f67fb22c45..92128acfc7 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/google-api-client/docs/MapTest.md b/samples/client/petstore/java/google-api-client/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/google-api-client/docs/MapTest.md +++ b/samples/client/petstore/java/google-api-client/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index f67fb22c45..92128acfc7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey1/docs/MapTest.md b/samples/client/petstore/java/jersey1/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/jersey1/docs/MapTest.md +++ b/samples/client/petstore/java/jersey1/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index 4dedd32ad7..9dcab0dc5b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey2-java6/docs/MapTest.md b/samples/client/petstore/java/jersey2-java6/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2-java6/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java index a42b294efd..2cc326e5a9 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java @@ -22,7 +22,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -74,7 +73,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -154,21 +153,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey2-java8/docs/MapTest.md b/samples/client/petstore/java/jersey2-java8/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index 8e9c0d6cb1..905b2258ed 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey2/docs/MapTest.md b/samples/client/petstore/java/jersey2/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/jersey2/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java index 4dedd32ad7..9dcab0dc5b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java index 102741c9c4..54cb45709b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; import android.os.Parcelable; import android.os.Parcel; @@ -96,7 +95,7 @@ public class MapTest implements Parcelable { public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest() { } @@ -178,21 +177,29 @@ public class MapTest implements Parcelable { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } @@ -254,7 +261,7 @@ public class MapTest implements Parcelable { mapMapOfString = (Map>)in.readValue(Map.class.getClassLoader()); mapOfEnumString = (Map)in.readValue(null); directMap = (Map)in.readValue(null); - indirectMap = (StringBooleanMap)in.readValue(StringBooleanMap.class.getClassLoader()); + indirectMap = (Map)in.readValue(null); } public int describeContents() { diff --git a/samples/client/petstore/java/okhttp-gson/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/MapTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java index 8f4186f986..bf598190bd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -94,7 +93,7 @@ public class MapTest { public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -174,21 +173,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/rest-assured/docs/MapTest.md b/samples/client/petstore/java/rest-assured/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/rest-assured/docs/MapTest.md +++ b/samples/client/petstore/java/rest-assured/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index 8f4186f986..bf598190bd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -94,7 +93,7 @@ public class MapTest { public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -174,21 +173,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/resteasy/docs/MapTest.md b/samples/client/petstore/java/resteasy/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/resteasy/docs/MapTest.md +++ b/samples/client/petstore/java/resteasy/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index f67fb22c45..92128acfc7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 4bb1ec28f8..959adc2a0a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; @@ -92,9 +91,11 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - @JacksonXmlProperty(localName = "indirect_map") - @XmlElement(name = "indirect_map") - private StringBooleanMap indirectMap = null; + // Is a container wrapped=false + // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= + // items.example= items.type=Boolean + @XmlElement(name = "inner") + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -174,21 +175,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/resttemplate/docs/MapTest.md b/samples/client/petstore/java/resttemplate/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/resttemplate/docs/MapTest.md +++ b/samples/client/petstore/java/resttemplate/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index f67fb22c45..92128acfc7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java index 8f4186f986..bf598190bd 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -94,7 +93,7 @@ public class MapTest { public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -174,21 +173,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md b/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java index aca072ecc7..861dec2d06 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -77,7 +76,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -158,22 +157,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ - @Valid @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md b/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java index aca072ecc7..861dec2d06 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -77,7 +76,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -158,22 +157,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ - @Valid @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2-play26/docs/MapTest.md b/samples/client/petstore/java/retrofit2-play26/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index aca072ecc7..861dec2d06 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -77,7 +76,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -158,22 +157,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ - @Valid @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2/docs/MapTest.md b/samples/client/petstore/java/retrofit2/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/retrofit2/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java index 8f4186f986..bf598190bd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -94,7 +93,7 @@ public class MapTest { public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -174,21 +173,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2rx/docs/MapTest.md b/samples/client/petstore/java/retrofit2rx/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java index 8f4186f986..bf598190bd 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -94,7 +93,7 @@ public class MapTest { public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -174,21 +173,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md b/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java index 8f4186f986..bf598190bd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -94,7 +93,7 @@ public class MapTest { public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -174,21 +173,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/vertx/docs/MapTest.md b/samples/client/petstore/java/vertx/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/vertx/docs/MapTest.md +++ b/samples/client/petstore/java/vertx/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index 8e9c0d6cb1..905b2258ed 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/webclient/docs/MapTest.md b/samples/client/petstore/java/webclient/docs/MapTest.md index f3b592d43f..c8387ad9af 100644 --- a/samples/client/petstore/java/webclient/docs/MapTest.md +++ b/samples/client/petstore/java/webclient/docs/MapTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] **directMap** | **Map<String, Boolean>** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index 8e9c0d6cb1..905b2258ed 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -75,7 +74,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -155,21 +154,29 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md index a6b378ac1f..e2a51f7ddc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **map_map_of_string** | [**map[string,map[string,string]]**](map.md) | | [optional] **map_of_enum_string** | **map[string,string]** | | [optional] **direct_map** | **map[string,bool]** | | [optional] -**indirect_map** | [**\OpenAPI\Client\Model\StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirect_map** | **map[string,bool]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index cd50474416..e24588a93d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -60,7 +60,7 @@ class MapTest implements ModelInterface, ArrayAccess 'map_map_of_string' => 'map[string,map[string,string]]', 'map_of_enum_string' => 'map[string,string]', 'direct_map' => 'map[string,bool]', - 'indirect_map' => '\OpenAPI\Client\Model\StringBooleanMap' + 'indirect_map' => 'map[string,bool]' ]; /** @@ -321,7 +321,7 @@ class MapTest implements ModelInterface, ArrayAccess /** * Gets indirect_map * - * @return \OpenAPI\Client\Model\StringBooleanMap|null + * @return map[string,bool]|null */ public function getIndirectMap() { @@ -331,7 +331,7 @@ class MapTest implements ModelInterface, ArrayAccess /** * Sets indirect_map * - * @param \OpenAPI\Client\Model\StringBooleanMap|null $indirect_map indirect_map + * @param map[string,bool]|null $indirect_map indirect_map * * @return $this */ diff --git a/samples/client/petstore/ruby/docs/MapTest.md b/samples/client/petstore/ruby/docs/MapTest.md index e735911888..54e16e1933 100644 --- a/samples/client/petstore/ruby/docs/MapTest.md +++ b/samples/client/petstore/ruby/docs/MapTest.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes **map_map_of_string** | **Hash<String, Hash<String, String>>** | | [optional] **map_of_enum_string** | **Hash<String, String>** | | [optional] **direct_map** | **Hash<String, BOOLEAN>** | | [optional] -**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirect_map** | **Hash<String, BOOLEAN>** | | [optional] diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 55a27ba778..94b351856e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -60,7 +60,7 @@ module Petstore :'map_map_of_string' => :'Hash>', :'map_of_enum_string' => :'Hash', :'direct_map' => :'Hash', - :'indirect_map' => :'StringBooleanMap' + :'indirect_map' => :'Hash' } end @@ -91,7 +91,9 @@ module Petstore end if attributes.has_key?(:'indirect_map') - self.indirect_map = attributes[:'indirect_map'] + if (value = attributes[:'indirect_map']).is_a?(Hash) + self.indirect_map = value + end end end diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md index a6b378ac1f..e2a51f7ddc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **map_map_of_string** | [**map[string,map[string,string]]**](map.md) | | [optional] **map_of_enum_string** | **map[string,string]** | | [optional] **direct_map** | **map[string,bool]** | | [optional] -**indirect_map** | [**\OpenAPI\Client\Model\StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirect_map** | **map[string,bool]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index cd50474416..e24588a93d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -60,7 +60,7 @@ class MapTest implements ModelInterface, ArrayAccess 'map_map_of_string' => 'map[string,map[string,string]]', 'map_of_enum_string' => 'map[string,string]', 'direct_map' => 'map[string,bool]', - 'indirect_map' => '\OpenAPI\Client\Model\StringBooleanMap' + 'indirect_map' => 'map[string,bool]' ]; /** @@ -321,7 +321,7 @@ class MapTest implements ModelInterface, ArrayAccess /** * Gets indirect_map * - * @return \OpenAPI\Client\Model\StringBooleanMap|null + * @return map[string,bool]|null */ public function getIndirectMap() { @@ -331,7 +331,7 @@ class MapTest implements ModelInterface, ArrayAccess /** * Sets indirect_map * - * @param \OpenAPI\Client\Model\StringBooleanMap|null $indirect_map indirect_map + * @param map[string,bool]|null $indirect_map indirect_map * * @return $this */ diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/MapTest.java index 2a726dc538..783e05935f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/MapTest.java @@ -3,7 +3,6 @@ package org.openapitools.model; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -62,8 +61,7 @@ public enum InnerEnum { private Map directMap = null; @ApiModelProperty(value = "") - @Valid - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; /** * Get mapMapOfString * @return mapMapOfString @@ -138,19 +136,24 @@ public enum InnerEnum { * @return indirectMap **/ @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + this.indirectMap.put(key, indirectMapItem); + return this; + } + @Override public String toString() { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java index 8492856beb..6cbf32c87e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java @@ -22,7 +22,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -73,7 +72,7 @@ public class MapTest implements Serializable { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -159,23 +158,31 @@ public class MapTest implements Serializable { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @JsonProperty("indirect_map") @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java index d0e0137e21..76b7ba5379 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -56,7 +55,7 @@ public enum InnerEnum { private @Valid Map mapOfEnumString = new HashMap(); private @Valid Map directMap = new HashMap(); - private @Valid StringBooleanMap indirectMap = null; + private @Valid Map indirectMap = new HashMap(); /** **/ @@ -111,7 +110,7 @@ public enum InnerEnum { /** **/ - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } @@ -119,10 +118,10 @@ public enum InnerEnum { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 8ce9975a0a..dbeef1c2a3 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1557,7 +1557,9 @@ components: type: boolean type: object indirect_map: - $ref: '#/components/schemas/StringBooleanMap' + additionalProperties: + type: boolean + type: object type: object Tag: example: diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java index d0e0137e21..76b7ba5379 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -56,7 +55,7 @@ public enum InnerEnum { private @Valid Map mapOfEnumString = new HashMap(); private @Valid Map directMap = new HashMap(); - private @Valid StringBooleanMap indirectMap = null; + private @Valid Map indirectMap = new HashMap(); /** **/ @@ -111,7 +110,7 @@ public enum InnerEnum { /** **/ - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } @@ -119,10 +118,10 @@ public enum InnerEnum { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 8ce9975a0a..dbeef1c2a3 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1557,7 +1557,9 @@ components: type: boolean type: object indirect_map: - $ref: '#/components/schemas/StringBooleanMap' + additionalProperties: + type: boolean + type: object type: object Tag: example: diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java index 0c4e76dd3a..549e930338 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -22,7 +22,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -72,7 +71,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -158,23 +157,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @JsonProperty("indirect_map") @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java index 0c4e76dd3a..549e930338 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java @@ -22,7 +22,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -72,7 +71,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -158,23 +157,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @JsonProperty("indirect_map") @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java index 0c4e76dd3a..549e930338 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -22,7 +22,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -72,7 +71,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -158,23 +157,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @JsonProperty("indirect_map") @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java index 0c4e76dd3a..549e930338 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java @@ -22,7 +22,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -72,7 +71,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -158,23 +157,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @JsonProperty("indirect_map") @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/php-slim/lib/Model/MapTest.php b/samples/server/petstore/php-slim/lib/Model/MapTest.php index 4adc9d60f8..d839677195 100644 --- a/samples/server/petstore/php-slim/lib/Model/MapTest.php +++ b/samples/server/petstore/php-slim/lib/Model/MapTest.php @@ -19,6 +19,6 @@ class MapTest /** @var map[string,bool] $directMap */ private $directMap; - /** @var \OpenAPIServer\Model\StringBooleanMap $indirectMap */ + /** @var map[string,bool] $indirectMap */ private $indirectMap; } diff --git a/samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php b/samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php index 0f933f96c1..cdafc69a0e 100644 --- a/samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php +++ b/samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php @@ -38,9 +38,11 @@ class MapTest public $direct_map; /** * @DTA\Data(field="indirect_map", nullable=true) - * @DTA\Strategy(name="Object", options={"type":\App\DTO\StringBooleanMap::class}) - * @DTA\Validator(name="Dictionary", options={"type":\App\DTO\StringBooleanMap::class}) - * @var \App\DTO\StringBooleanMap + * TODO check validator and strategy are correct and can handle container item type + * @DTA\Validator(name="Collection", options={"validators":{ + * {"name":"Type", "options":{"type":"bool"}} + * }}) + * @var map[string,bool] */ public $indirect_map; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index c2378aeea6..6fd5ae1631 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -52,17 +52,7 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default CompletableFuture> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); + return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -96,17 +86,7 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default CompletableFuture> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); + return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -118,17 +98,7 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default CompletableFuture> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) { - return CompletableFuture.supplyAsync(()-> { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - }, Runnable::run); + return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java index a6acaa59d1..93a2b1e7b2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index c5c3b07be8..ec1a839790 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -51,14 +51,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,14 +83,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -111,14 +95,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java index a6acaa59d1..93a2b1e7b2 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java index 70ab648075..8bbec3109c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java @@ -41,12 +41,6 @@ public class FakeApiController implements FakeApi { } public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,23 +57,11 @@ public class FakeApiController implements FakeApi { } public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java index 67a3bfdd86..9909e432f6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index 61c00424a1..0b33dcfcd4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -41,12 +41,6 @@ public class FakeApiController implements FakeApi { } public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,23 +57,11 @@ public class FakeApiController implements FakeApi { } public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java index 67a3bfdd86..9909e432f6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index 0ba0769182..9adde87bc4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -36,14 +36,6 @@ public interface FakeApiDelegate { * @see FakeApi#fakeOuterBooleanSerialize */ default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -68,14 +60,6 @@ public interface FakeApiDelegate { * @see FakeApi#fakeOuterNumberSerialize */ default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -84,14 +68,6 @@ public interface FakeApiDelegate { * @see FakeApi#fakeOuterStringSerialize */ default ResponseEntity fakeOuterStringSerialize(String body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java index a6acaa59d1..93a2b1e7b2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index 67a3bfdd86..9909e432f6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 4bd1698614..41b65ee8fd 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -53,14 +53,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -97,14 +89,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -119,14 +103,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index a6acaa59d1..93a2b1e7b2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index b7c338d094..10b7912741 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -42,12 +42,6 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - result = ApiUtil.getExampleResponse(exchange, "null"); - break; - } - } return result.then(Mono.empty()); } @@ -76,12 +70,6 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - result = ApiUtil.getExampleResponse(exchange, "null"); - break; - } - } return result.then(Mono.empty()); } @@ -93,12 +81,6 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - result = ApiUtil.getExampleResponse(exchange, "null"); - break; - } - } return result.then(Mono.empty()); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index a6acaa59d1..93a2b1e7b2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index 5765e33f9c..66e8f0dcd2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1614,7 +1614,9 @@ components: type: boolean type: object indirect_map: - $ref: '#/components/schemas/StringBooleanMap' + additionalProperties: + type: boolean + type: object type: object Tag: example: diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 3743c60bdd..7e53261295 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -51,14 +51,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,14 +83,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -111,14 +95,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index a6acaa59d1..93a2b1e7b2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 7953aaa155..d715b8fe1c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -51,14 +51,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,14 +83,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -111,14 +95,6 @@ public interface FakeApi { produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "null"); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java index a6acaa59d1..93a2b1e7b2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -62,7 +61,8 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + @Valid + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -149,24 +149,31 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ @ApiModelProperty(value = "") - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; }