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]: [Ask]Ambiguous-symbol "nextLink" is an ambiguous name between TypeSpec.nextLink, Azure.Core.nextLink #5048

Closed
4 tasks done
MaryGao opened this issue Nov 11, 2024 · 2 comments · Fixed by Azure/typespec-azure#1886
Assignees
Labels
breaking-change A change that might cause specs or code to break bug Something isn't working compiler:core Issues for @typespec/compiler triaged:core

Comments

@MaryGao
Copy link
Member

MaryGao commented Nov 11, 2024

Describe the bug

With below spec we received 1 errors with Ambiguous-symbol "nextLink" is an ambiguous name between TypeSpec.nextLink, Azure.Core.nextLink. I think this is because we both have nextLink decoration in TypeSpec and Azure.Core scope. And adding prefix could fix this issue. But I was wondering following questions regarding these decorators.

  • Are the duplicated decorators expecetd? Which one is preferred to use in Azure?
  • For custom paging what is the recommanded practice, typespec support vs azure core support?

playground

@pagedResult
model Bar {
  @items
  items: string[];

  @nextLink
  nextLink: url;
}

// vs

model Page<T> {
  @nextLink nextLink: url;

  @pageItems
  items: T[];
}

@list op Foo(): Page<string>;

Reproduction

NA

Checklist

@MaryGao MaryGao added the bug Something isn't working label Nov 11, 2024
@MaryGao MaryGao changed the title [Bug]: Ambiguous-symbol "nextLink" is an ambiguous name between TypeSpec.nextLink, Azure.Core.nextLink [Bug]: [Ask]Ambiguous-symbol "nextLink" is an ambiguous name between TypeSpec.nextLink, Azure.Core.nextLink Nov 11, 2024
@MaryGao
Copy link
Member Author

MaryGao commented Nov 11, 2024

Another question is if we could accept array as paged items directly for list operation? Previouly this is acceptable.

playground
Image

@markcowl markcowl added this to the [2024] December milestone Nov 13, 2024
@markcowl markcowl added the compiler:core Issues for @typespec/compiler label Nov 13, 2024
@AlitzelMendez AlitzelMendez self-assigned this Nov 18, 2024
@AlitzelMendez AlitzelMendez added the breaking-change A change that might cause specs or code to break label Dec 3, 2024
github-merge-queue bot pushed a commit to Azure/typespec-azure that referenced this issue Dec 7, 2024
issue: microsoft/typespec#5048

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
@wanlwanl wanlwanl reopened this Dec 25, 2024
@wanlwanl
Copy link
Member

@AlitzelMendez Could you take a look at Azure/azure-sdk-tools#9554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A change that might cause specs or code to break bug Something isn't working compiler:core Issues for @typespec/compiler triaged:core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants