Azure / Azure/typespec-azure

`CustomPage` and `Paged` has the same friendly name

Open
#1,296 9 comments 0 reactions 0 assignees View on GitHub
feature lib:azure-core
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

The `CustomPage` model ([here](https://github.com/Azure/typespec-azure/blob/367549dd204b6fd78c7a64fcca3cfd360b0a31ed/packages/typespec-azure-core/lib/foundations.tsp#L243)) and `Paged` model ([here](https://github.com/Azure/typespec-azure/blob/367549dd204b6fd78c7a64fcca3cfd360b0a31ed/packages/typespec-azure-core/lib/models.tsp#L15)) have exactly the same `friendlyName`, this leads to models with the same name in the SDK and might lead to issues.

Taking a closer look, `Page` is identical to `CustomPage` when the second argument is empty.
Therefore how about this for a fix:
We change `Page` as an alias of `CustomPage`:
```typespec
alias Page = CustomPage;
```
which in the functionality's perspective, should not break anything.

Contributor guide

Open the contributing guide

Research direction

Start by comparing the CustomPage definition in packages/typespec-azure-core/lib/foundations.tsp and the Paged definition in packages/typespec-azure-core/lib/models.tsp, including their friendlyName values and the Page relationship. The change is done when the duplicate friendly name is removed without breaking the generated SDK model behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.