-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After upgrading: type error when POSTing body using a generated TS client #1464
Comments
Thanks for raising this @IkeOTL
At the moment, I believe you can use this example to create a httpclient and then pass it to the request adapter constructor.
@rkodev Any chance this is related to compression handler issues at #1442 as well? |
Hi @IkeOTL, it looks like the issue was with zlib compression that has been dropped with version 77. Kindly update your dependecies to version 77 and share if you still have the problem |
@rkodev I've updated to |
Yes, this is as a result of compression. You can disable compression if you would like to see the payload const http = KiotaClientFactory.create(undefined, [
new RetryHandler(), new RedirectHandler(), new ParametersNameDecodingHandler(), new UserAgentHandler(), new HeadersInspectionHandler()
])
const adapter = new FetchRequestAdapter(new BearerAuthenticationProvider(), undefined, undefined, http);
const client = createApiClient(adapter);
client.api.endpoint.post({
field: "testdata",
}) |
If you want to follow along or contribute to the compression discussion #1439 |
I upgraded from
to
"@microsoft/kiota-bundle": "^1.0.0-preview.72"
And now I get this error when calling a POST function on a TS client generated using dotnet tool
microsoft.openapi.kiota = 1.19.1
error:
It seems that kiota's serializer is providing a
Arraybuffer
while thevalidChunk
is expecting astring
orBuffer
. Maybe something is wrong with the compression middleware? Unfortunately I cannot figure out how to disable the compression middlewareThe text was updated successfully, but these errors were encountered: