diff --git a/packages/microsoft_kiota_bundle/lib/src/default_request_adapter.dart b/packages/microsoft_kiota_bundle/lib/src/default_request_adapter.dart index dc3c217..e525b43 100644 --- a/packages/microsoft_kiota_bundle/lib/src/default_request_adapter.dart +++ b/packages/microsoft_kiota_bundle/lib/src/default_request_adapter.dart @@ -18,10 +18,10 @@ class DefaultRequestAdapter extends HttpClientRequestAdapter { /// - [TextParseNodeFactory] /// - [FormParseNodeFactory] DefaultRequestAdapter({ - required super.client, required super.authProvider, - required super.pNodeFactory, - required super.sWriterFactory, + super.pNodeFactory, + super.sWriterFactory, + super.client, }) { _setupDefaults(); } diff --git a/packages/microsoft_kiota_bundle/test/default_request_adapter_test.dart b/packages/microsoft_kiota_bundle/test/default_request_adapter_test.dart index c17ce39..6247e9f 100644 --- a/packages/microsoft_kiota_bundle/test/default_request_adapter_test.dart +++ b/packages/microsoft_kiota_bundle/test/default_request_adapter_test.dart @@ -37,10 +37,10 @@ void main() { // This should register the default serializers/deserializers final _ = DefaultRequestAdapter( - client: client, authProvider: authProvider, pNodeFactory: pNodeFactory, sWriterFactory: sWriterFactory, + client: client, ); final serializers = SerializationWriterFactoryRegistry diff --git a/packages/microsoft_kiota_http/lib/src/http_client_request_adapter.dart b/packages/microsoft_kiota_http/lib/src/http_client_request_adapter.dart index 8c442c5..b588225 100644 --- a/packages/microsoft_kiota_http/lib/src/http_client_request_adapter.dart +++ b/packages/microsoft_kiota_http/lib/src/http_client_request_adapter.dart @@ -2,14 +2,16 @@ part of '../microsoft_kiota_http.dart'; class HttpClientRequestAdapter implements RequestAdapter { HttpClientRequestAdapter({ - required http.Client client, required AuthenticationProvider authProvider, - required ParseNodeFactory pNodeFactory, - required SerializationWriterFactory sWriterFactory, - }) : _client = client, - _authProvider = authProvider, - _pNodeFactory = pNodeFactory, - _sWriterFactory = sWriterFactory; + ParseNodeFactory? pNodeFactory, + SerializationWriterFactory? sWriterFactory, + http.Client? client, + }) : _authProvider = authProvider, + _pNodeFactory = + pNodeFactory ?? ParseNodeFactoryRegistry.defaultInstance, + _sWriterFactory = sWriterFactory ?? + SerializationWriterFactoryRegistry.defaultInstance, + _client = client ?? KiotaClientFactory.createClient(); static const String _claimsKey = 'claims'; diff --git a/packages/microsoft_kiota_http/test/http_client_request_adapter_test.dart b/packages/microsoft_kiota_http/test/http_client_request_adapter_test.dart index 9f70ce5..60072a5 100644 --- a/packages/microsoft_kiota_http/test/http_client_request_adapter_test.dart +++ b/packages/microsoft_kiota_http/test/http_client_request_adapter_test.dart @@ -29,10 +29,10 @@ void main() { final contentBytes = Uint8List.fromList(stringContent.codeUnits); final adapter = HttpClientRequestAdapter( - client: client, authProvider: authProvider, pNodeFactory: pNodeFactory, sWriterFactory: sWriterFactory, + client: client, ); final info = RequestInformation(