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

Report error diagnostic when trying to flattening a model with polymorphsim #1223

Merged

Conversation

archerzz
Copy link
Member

resolve #959

@microsoft-github-policy-service microsoft-github-policy-service bot added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label Jul 23, 2024
@azure-sdk
Copy link
Collaborator

azure-sdk commented Jul 23, 2024

All changed packages have been documented.

  • @azure-tools/typespec-autorest-canonical
  • @azure-tools/typespec-autorest
  • @azure-tools/typespec-client-generator-core
Show changes

@azure-tools/typespec-client-generator-core - breaking ✏️

refactor tcgc build-in types, please refer pr's description for details and migration guides

@azure-tools/typespec-client-generator-core - fix ✏️

fix the duplicate usageflags values for json and xml

@azure-tools/typespec-client-generator-core - feature ✏️

Support model format of @multipartBody

@azure-tools/typespec-client-generator-core - fix ✏️

have @clientName work for operation groups as well

@azure-tools/typespec-client-generator-core - fix ✏️

Fix @clientName conflict validation that operation defined within an interface

@azure-tools/typespec-client-generator-core - feature ✏️

Report error diagnostic when trying to flattening a model with polymorphism

@azure-tools/typespec-client-generator-core - feature ✏️

add example types support

@azure-tools/typespec-autorest - internal ✏️

create tcgc context change to async

@azure-tools/typespec-autorest-canonical - internal ✏️

adopt tcgc breaking

@azure-tools/typespec-client-generator-core - feature ✏️

add xml usage and change enumvalue arg representation in generic decorators

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@archerzz archerzz force-pushed the tcgc/forbid-polymorphism-flatten branch from 4e6dfa4 to d0c63ec Compare July 23, 2024 14:14
@archerzz archerzz marked this pull request as ready for review July 23, 2024 15:41
@timotheeguerin timotheeguerin changed the title feat(tcgc): throw error when trying to flattening a model with polymorphsim Report error diagnostic when trying to flattening a model with polymorphsim Jul 23, 2024
@archerzz archerzz changed the base branch from main to release/july-2024 July 24, 2024 06:55
@archerzz archerzz changed the base branch from release/july-2024 to main July 24, 2024 06:56
@archerzz archerzz force-pushed the tcgc/forbid-polymorphism-flatten branch from bedbb5b to f45476c Compare July 24, 2024 07:09
@archerzz archerzz changed the base branch from main to release/july-2024 July 24, 2024 07:21
@archerzz
Copy link
Member Author

I changed the merge target branch from main to release/july-2024, per suggestion.

@iscai-msft
Copy link
Contributor

@timotheeguerin should this be an error, or should it be a linter warning? It is a bad thing to generate, but I'm not sure we should completely blow up generation in this case

@timotheeguerin
Copy link
Member

I think it's fine to be an error if it's run in the validator as it would count as a validator of the for @flatten decorator. If run in the preprocessor then no. And people will not see it in the ide too

@archerzz archerzz merged commit 74b3302 into Azure:release/july-2024 Jul 25, 2024
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TCGC] propertyFlatten not apply to property of polymorphic type
5 participants