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

[Bug]: RequestParameter do not allow to link to non-body parameter #1880

Open
4 tasks done
lmazuel opened this issue Nov 18, 2024 · 0 comments
Open
4 tasks done

[Bug]: RequestParameter do not allow to link to non-body parameter #1880

lmazuel opened this issue Nov 18, 2024 · 0 comments
Labels
bug Something isn't working lib:azure-core Issues for @azure-tools/typespec-azure-core library
Milestone

Comments

@lmazuel
Copy link
Member

lmazuel commented Nov 18, 2024

Describe the bug

This TypeSpec:

interface Foo {
  #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is a test."
  @route("{nextLink}")
  @get nextPage is Azure.Core.Foundations.Operation<
    { @query foo?: string, nextLink: string },
    Azure.Core.Page<MyResource>
  >;

  @nextPageOperation(Foo.nextPage, 
      { 
          nextLink: ResponseProperty<"nextLink">,
          foo: RequestParameter<"foo">
      })
  list is Azure.Core.ResourceList<MyResource,
  {
      parameters: {
        @query foo?: string
      };
    }>;
}

End up with an error Request parameter 'foo' not found on request body model

Discussed with @markcowl that we should be able to link non-body parameter as well

Reproduction

See above

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@lmazuel lmazuel added the bug Something isn't working label Nov 18, 2024
@markcowl markcowl added the lib:azure-core Issues for @azure-tools/typespec-azure-core library label Nov 18, 2024
@markcowl markcowl added this to the Backlog milestone Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib:azure-core Issues for @azure-tools/typespec-azure-core library
Projects
None yet
Development

No branches or pull requests

2 participants