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

Do not carry over friendly name with model is or op is #3793

Merged

Conversation

timotheeguerin
Copy link
Member

fix #2276 As the design for a dedicated @instanceName was not approved due to the concern that we should maybe have a more generic @name decorator that handle template I am just fixing this very anyoing carry over that requires using @friendlyName in all derived models when it is used upstream.

This is technically a breaking change as if you used to have

@friendlyName("Abc{T}", T)
model Foo<T> {}

model Bar is Foo<string>

it would have created a model called Abcstring instead of Bar

@timotheeguerin timotheeguerin added the breaking-change A change that might cause specs or code to break label Jul 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the compiler:core Issues for @typespec/compiler label Jul 9, 2024
@azure-sdk
Copy link
Collaborator

azure-sdk commented Jul 9, 2024

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - breaking ✏️

Do not carry over @friendlyName with model is or op is,> ,> tsp,> @friendlyName("Abc{T}", T),> model Foo<T> {},> ,> model Bar is Foo<string>;,> ,> // This can be changed to,> model Abcstring is Foo<string>;,>

@azure-sdk
Copy link
Collaborator

You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/3793/

Check the website changes at https://tspwebsitepr.z22.web.core.windows.net/prs/3793/

Copy link
Contributor

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to see a PR against typespec-next to verify the scope and make any needed fixes.

@timotheeguerin
Copy link
Member Author

I think we need to see a PR against typespec-next to verify the scope and make any needed fixes.

PR checking the changes Azure/azure-rest-api-specs#29827

There is only 2 spec impacted(and some others which could now remove the workaround this previously required).

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@timotheeguerin timotheeguerin added this pull request to the merge queue Jul 16, 2024
Merged via the queue into microsoft:main with commit 4af9030 Jul 16, 2024
22 checks passed
@timotheeguerin timotheeguerin deleted the friendly-name-no-carry-over branch July 16, 2024 18:21
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 compiler:core Issues for @typespec/compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

model is of a model with @friendlyName use the friendlyName instead of the model name
3 participants