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

Spreading record in operation parameter cause issue in resolving path parameters #3051

Closed
timotheeguerin opened this issue Mar 25, 2024 · 2 comments · Fixed by #3190
Closed
Assignees
Labels
bug Something isn't working triaged:core
Milestone

Comments

@timotheeguerin
Copy link
Member

timotheeguerin commented Mar 25, 2024

import "@typespec/http";

using TypeSpec.Http;

@route("/foos/{fooId}")
op test(
  @path fooId: string,

  // comment below to fix
  ...Record<string>,
): void;

Playground Link

@qiaozha
Copy link
Member

qiaozha commented Mar 26, 2024

I wonder if the above typespec means we have an operation that have a body parameter which is a dictionary of string or it means we have additional arguments that takes string? Is it possible that there might be a scenario, service wants to have a open dictionary as query parameter?

@query // this is not allowed now.
scalar bar extends string;

@route("/foos/{fooId}")
op test(
  @path fooId: string,
  ...Record<bar>,
): void;

@timotheeguerin
Copy link
Member Author

Yeah this particular case means the input takes many parameters that all go in the body but we do have a separate issue on dictionary for queries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged:core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants