Skip to content
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

Guid param in API path throws in TS client on GET #4902

Closed
IkeOTL opened this issue Jun 28, 2024 · 4 comments · Fixed by microsoft/kiota-typescript#1253
Closed

Guid param in API path throws in TS client on GET #4902

IkeOTL opened this issue Jun 28, 2024 · 4 comments · Fixed by microsoft/kiota-typescript#1253
Labels
fixed type:bug A broken experience TypeScript Pull requests that update Javascript code

Comments

@IkeOTL
Copy link

IkeOTL commented Jun 28, 2024

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

TypeScript

Describe the bug

I have a TypeScript client generated from a Swagger,json that was generated by Swashbuckle. In this client there is an endpoint where there is a path param that is of type Guid. In the generated TS client I'm submitting a GET to this endpoint like so:
let g = uploadRes.guid!;
const dl = await audioClient.audio.download.byGuid(g).get();

note: uploadRes is response from another endpoint that produces a Guid in the same client

This throws Error: Illegal class passed as substitution, found function

Work when I do this:
const dl = await audioClient.audio.download.byGuid(g.toString() as any).get();

Expected behavior

Endpoint works when Guid is used since thats the type the Kiota generated client is using.

How to reproduce

Execute (from a Kiota generated TS client) an endpoint where there is a path param of swagger schema type: string / format: uuid. ex: /Audio/download/{guid}

Open API description file

swagger.json

Kiota Version

1.14.0+fc4b39c65d89f7bfc8c7f1813c197e95e206da09

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

Instead of using the Guid class directly do this guid.toString() as any

Configuration

No response

Debug output

Click to expand log ```
</details>


### Other information

_No response_
@IkeOTL IkeOTL added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jun 28, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Jun 28, 2024
@msgraph-bot msgraph-bot bot added the TypeScript Pull requests that update Javascript code label Jun 28, 2024
@IkeOTL
Copy link
Author

IkeOTL commented Jun 28, 2024

Oh might be resolved in microsoft/kiota-typescript#1116

edit: actually that seems to be query param focused, will it apply to path params?

@andrueastman
Copy link
Member

Thanks for raising this @IkeOTL

Any chance you can confirm the version of the abstractions packages you are using? I believe this was resolved with microsoft/kiota-typescript#1226 for both path and query params.

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jun 28, 2024
@IkeOTL
Copy link
Author

IkeOTL commented Jun 28, 2024

@andrueastman I'm on version 1.0.0-preview.56 of @microsoft/kiota-abstractions

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jun 28, 2024
@andrueastman
Copy link
Member

Apologies, @IkeOTL,

Looks like the changes for microsoft/kiota-typescript#1226 are unreleased. Authored microsoft/kiota-typescript#1253 to create a new release.

@andrueastman andrueastman moved this from Needs Triage 🔍 to In Progress 🚧 in Kiota Jul 1, 2024
@github-project-automation github-project-automation bot moved this from In Progress 🚧 to Done ✔️ in Kiota Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed type:bug A broken experience TypeScript Pull requests that update Javascript code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants