Skip to content

Commit

Permalink
Merge pull request #80 from microsoft/fix/http-request-adapter-parame…
Browse files Browse the repository at this point in the history
…ters

fix: parameters ordering and requirement for request adapters
  • Loading branch information
baywet authored Jan 17, 2025
2 parents fc6b6ff + c920c0a commit b1a41b5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b1a41b5

Please sign in to comment.