Open jhendrixMSFT opened 2 months ago
it is by design. with current tcgc logic, all azure core model will be filtered in sdkPackage.models
if filter-out-core-models
set to true. but the property type used in FailedLockToken
will still refer to that model. @iscai-msft i'm thinking of not do any filtering for tcgc output, leave them to emitter is more flexiable.
yeah i'm starting to agree that filtering out core models might be more effort than it's worth. Let me bring this up during discussions on wednesday since this will require emitters to modify their own logic
We have discussed this issue in DPG sync ups. We all agree that languages' emitter should already deal with the core model's in emitter's logic, so it is safe to remove the filtering logic in TCGC. @jhendrixMSFT , I'm wondering if Go has filtering logic for core models? The most common scenario is the ErrorResponse
model. With current TCGC logic, sdkPackage.models
will not contain that model, but after change, it will.
When you say ErrorResponse
model that sounds different from Azure.Core.Foundations.Error
. While we can treat these the same, shouldn't services be using Azure.Core.Foundations.Error
instead of defining their own error models (at least when the expectation is for a core error to be returned)?
Sorry, I do mean Azure.Core.Foundations.Error
. It will be in sdkPackage.models
if we do not filtering core models, and Go needs to ignore generating then.
Yep we can filter these out (I think we already do).
Describe the bug
Model
FailedLockToken
contains fielderror
of typeAzure.Core.Foundations.Error
but it's missing in the array of model types. As a result, the type isn't emitted during codegen.Reproduction
Build https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/Azure.Messaging.EventGrid with tcgc version
0.44.3
Checklist