Skip to content

Commit

Permalink
Fix core-client mismatch with AppConfig (#24366)
Browse files Browse the repository at this point in the history
  • Loading branch information
xirzec authored Jan 4, 2023
1 parent 68ca439 commit 5ced438
Showing 1 changed file with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ import {
GetKeyValuesResponse,
GetRevisionsResponse,
} from "./generated/src/models";
import {
CommonClientOptions,
deserializationPolicy,
deserializationPolicyName,
} from "@azure/core-client";
import { CommonClientOptions, InternalClientPipelineOptions } from "@azure/core-client";
import { PagedAsyncIterableIterator, PagedResult, getPagedAsyncIterator } from "@azure/core-paging";
import {
PipelinePolicy,
Expand Down Expand Up @@ -152,15 +148,24 @@ export class AppConfigurationClient {
}
}

const internalClientPipelineOptions: InternalClientPipelineOptions = {
...appConfigOptions,
loggingOptions: {
logger: logger.info,
},
deserializationOptions: {
expectedContentTypes: deserializationContentTypes,
},
};

this._syncTokens = appConfigOptions.syncTokens || new SyncTokens();
this.client = new AppConfiguration(appConfigEndpoint, apiVersion, appConfigOptions);
this.client = new AppConfiguration(
appConfigEndpoint,
apiVersion,
internalClientPipelineOptions
);
this.client.pipeline.addPolicy(authPolicy, { phase: "Sign" });
this.client.pipeline.addPolicy(syncTokenPolicy(this._syncTokens), { afterPhase: "Retry" });
this.client.pipeline.removePolicy({ name: deserializationPolicyName });
this.client.pipeline.addPolicy(
deserializationPolicy({ expectedContentTypes: deserializationContentTypes }),
{ phase: "Deserialize" }
);
}

/**
Expand Down

0 comments on commit 5ced438

Please sign in to comment.