From 57126a1900bb1b477b7eba252025c13aedf9faa2 Mon Sep 17 00:00:00 2001 From: NANASHI0X74 Date: Fri, 29 Jan 2021 03:58:07 +0100 Subject: [PATCH] Add getters for private default Headers and authentications (#8509) * add getters for default headermap and auths * regenerate samples, make shebangs portable * Revert making shebangs portable This reverts commit ec60f603598abf0f57dfdb6ca55b4d5c1ee25edf. Co-authored-by: nanashi0x74 --- .../src/main/resources/dart2/api_client.mustache | 6 ++++++ .../petstore/dart2/petstore_client_lib/lib/api_client.dart | 6 ++++++ .../petstore/dart2/petstore_client_lib/lib/api_client.dart | 6 ++++++ .../dart2/petstore_client_lib_fake/lib/api_client.dart | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/dart2/api_client.mustache b/modules/openapi-generator/src/main/resources/dart2/api_client.mustache index e6e6b07771..09edf0a827 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_client.mustache @@ -49,6 +49,12 @@ class ApiClient { _defaultHeaderMap[key] = value; } + Map get defaultHeaderMap => _defaultHeaderMap; + /// returns an unmodifiable view of the authentications, since none should be added + /// nor deleted + Map get authentications => + Map.unmodififiable(_authentications); + dynamic deserialize(String json, String targetType, {bool growable}) { // Remove all spaces. Necessary for reg expressions as well. targetType = targetType.replaceAll(' ', ''); diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/api_client.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/api_client.dart index 79394cc833..e9fe382f91 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/api_client.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/api_client.dart @@ -42,6 +42,12 @@ class ApiClient { _defaultHeaderMap[key] = value; } + Map get defaultHeaderMap => _defaultHeaderMap; + /// returns an unmodifiable view of the authentications, since none should be added + /// nor deleted + Map get authentications => + Map.unmodififiable(_authentications); + dynamic deserialize(String json, String targetType, {bool growable}) { // Remove all spaces. Necessary for reg expressions as well. targetType = targetType.replaceAll(' ', ''); diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_client.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_client.dart index 79394cc833..e9fe382f91 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_client.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/api_client.dart @@ -42,6 +42,12 @@ class ApiClient { _defaultHeaderMap[key] = value; } + Map get defaultHeaderMap => _defaultHeaderMap; + /// returns an unmodifiable view of the authentications, since none should be added + /// nor deleted + Map get authentications => + Map.unmodififiable(_authentications); + dynamic deserialize(String json, String targetType, {bool growable}) { // Remove all spaces. Necessary for reg expressions as well. targetType = targetType.replaceAll(' ', ''); diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart index 22d45db938..ef90645965 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart @@ -45,6 +45,12 @@ class ApiClient { _defaultHeaderMap[key] = value; } + Map get defaultHeaderMap => _defaultHeaderMap; + /// returns an unmodifiable view of the authentications, since none should be added + /// nor deleted + Map get authentications => + Map.unmodififiable(_authentications); + dynamic deserialize(String json, String targetType, {bool growable}) { // Remove all spaces. Necessary for reg expressions as well. targetType = targetType.replaceAll(' ', '');