You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
This is a successor of #204 After fixing it, OperationStatus appears in the context.modelsMap. However, it seems that the OperationStatus instance in context.modelsMap is NOT the same as the one returned in getLroMetadata. So codes like below won't work:
functiongetInputModelForModel(m: Model): InputModelType|undefined{if(context.modelsMap!.has(m)){// won't work because `m` is a different instance then the one in `modelsMap`.
...
}
After debugging, I think the problem is not because of there are multiple instance of the same OperationStatus. It's because of the metadata parsed by getLroMetadata() is different from what TCGC parsed.
The above is the OperationStaus parsed by getLroMetadata(). As you can see, it's name is OperationStatus.
This is what the corresponding metadata in TCGC. Its name is ResourceOperationStatus, and its sourceModel property is the same as the one parsed by getLroMetadata.
Describe the bug
This is a successor of #204 After fixing it,
OperationStatus
appears in thecontext.modelsMap
. However, it seems that theOperationStatus
instance incontext.modelsMap
is NOT the same as the one returned ingetLroMetadata
. So codes like below won't work:To Reproduce
typespec-azure/packages/typespec-client-generator-core/test/public-utils.test.ts
Line 1377 in de0ebda
OperationStatus
instances fromgetLroMetadata
andcontext.modelsMap
Expected behavior
OperationStatus
instance should be globally unique.Additional context
Not sure if it's related to how
OperationStatus
is fetched insidegetLroMetadata
. I tried to debug, and it's fromgetResourceLocationType
:typespec-azure/packages/typespec-azure-core/src/lro-helpers.ts
Line 1113 in de0ebda
The text was updated successfully, but these errors were encountered: