chore(server): update openapi (#2205)

This commit is contained in:
Michel Heusschen 2023-04-09 04:26:09 +02:00 committed by GitHub
parent 91e27affeb
commit 983abf5e14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 756 additions and 1458 deletions

View file

@ -11,11 +11,13 @@
part of openapi.api;
class ApiClient {
ApiClient({this.basePath = '/api', this.authentication});
ApiClient({this.basePath = '/api', this.authentication,});
final String basePath;
final Authentication? authentication;
var _client = Client();
final _defaultHeaderMap = <String, String>{};
/// Returns the current HTTP [Client] instance to use in this class.
///
@ -27,15 +29,12 @@ class ApiClient {
_client = newClient;
}
final _defaultHeaderMap = <String, String>{};
final Authentication? authentication;
Map<String, String> get defaultHeaderMap => _defaultHeaderMap;
void addDefaultHeader(String key, String value) {
_defaultHeaderMap[key] = value;
}
Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
// We don't use a Map<String, String> for queryParams.
// If collectionFormat is 'multi', a key might appear multiple times.
Future<Response> invokeAPI(
@ -47,7 +46,7 @@ class ApiClient {
Map<String, String> formParams,
String? contentType,
) async {
_updateParamsForAuth(queryParams, headerParams);
await authentication?.applyToParams(queryParams, headerParams);
headerParams.addAll(_defaultHeaderMap);
if (contentType != null) {
@ -165,16 +164,6 @@ class ApiClient {
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.')
String serialize(Object? value) => value == null ? '' : json.encode(value);
/// Update query and header parameters based on authentication settings.
void _updateParamsForAuth(
List<QueryParam> queryParams,
Map<String, String> headerParams,
) {
if (authentication != null) {
authentication!.applyToParams(queryParams, headerParams);
}
}
static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) {
try {
switch (targetType) {