microsoft / kiota-typescript

TypeScript libraries for Kiota-generated API clients.
https://aka.ms/kiota/docs
MIT License
34 stars 25 forks source link

Guid uri template path/query parameter values should be normalized to string #1113

Closed baywet closed 2 months ago

baywet commented 5 months ago

the std uri template library does not handle guids, and wont because it's not a standard API across languages and they don't want to bring on additional dependencies. We should normalize the value to string (no curlies) before we pass it to the uri template engine. Originally reported: https://github.com/std-uritemplate/std-uritemplate/issues/140 https://github.com/microsoft/kiota/issues/4335

Example implementation https://github.com/microsoft/kiota-abstractions-dotnet/blob/5a93d126e9ce30ae332e65f30df7b941e7d7c265/src/RequestInformation.cs#L123

illunix commented 5 months ago

Honestly I can't find file in kiota typescript in witch I should do this changes

illunix commented 5 months ago

Can you help me @baywet ?

illunix commented 5 months ago

Take a look @baywet https://github.com/microsoft/kiota-typescript/pull/1116

baywet commented 5 months ago

If we look at the dotnet implementation we can see that the URI getter calls into an additional method that's missing in typescript and which is responsible for handling enum query/path parameters as other scalar but non trivial types (guid, etc...)

This is effectively what we need to replicate int typescript

You can then add unit tests here to prevent any future regression.

Thank you for starting the pull request already!

illunix commented 5 months ago

It seems hard for me and I'm not sure if I will be able to complete this but I'll try

illunix commented 5 months ago

Also I don't understand this part with replication @baywet