-
Notifications
You must be signed in to change notification settings - Fork 44
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
Type changed for envelopeResult
from getLroMetadata
#311
Comments
@tadelesh I think this is by design, the finalEnvelopeResult (which matches the finalResult) is the value that should be used by emitters. The operations in the attached specs are a bit strange, as the interface template instantiates them without using TResource, which might be a factor in why the odd result, but the finalResult/finalEnvelopeResult/finalPath should be definitive, regardless. |
Let me explain more clearly. The main problem here is for the following TypeSpec, when we call
|
@timotheeguerin do you think it is a bug for |
This should be handled by the fix here: #1416 Closing as duplicate |
…RO (#1887) Remove this workaround since #311 is closed. Fixes #1752 Fixes #1530 This PR adds three new usage flags: `LroInitial`, `LroPolling`, `LroFinalEnvelope`. These new usage flags are previously represented by `Output`, now the `Output` flag no longer contain the semantics of these usages. Therefore, if a model's usage is only `LroInitial`, this means it is only used as the initial response of an LRO. if a model has both `LroInitial` and `Output`, this means it is used as the initial response of an LRO, and it also used as a normal output in other places. The final result will not have above new usages unless it participates as those roles as well. It will have output usage.
…RO (Azure#1887) Remove this workaround since Azure#311 is closed. Fixes Azure#1752 Fixes Azure#1530 This PR adds three new usage flags: `LroInitial`, `LroPolling`, `LroFinalEnvelope`. These new usage flags are previously represented by `Output`, now the `Output` flag no longer contain the semantics of these usages. Therefore, if a model's usage is only `LroInitial`, this means it is only used as the initial response of an LRO. if a model has both `LroInitial` and `Output`, this means it is used as the initial response of an LRO, and it also used as a normal output in other places. The final result will not have above new usages unless it participates as those roles as well. It will have output usage.
…RO (#1887) Remove this workaround since #311 is closed. Fixes #1752 Fixes #1530 This PR adds three new usage flags: `LroInitial`, `LroPolling`, `LroFinalEnvelope`. These new usage flags are previously represented by `Output`, now the `Output` flag no longer contain the semantics of these usages. Therefore, if a model's usage is only `LroInitial`, this means it is only used as the initial response of an LRO. if a model has both `LroInitial` and `Output`, this means it is used as the initial response of an LRO, and it also used as a normal output in other places. The final result will not have above new usages unless it participates as those roles as well. It will have output usage.
When calling
getLroMetadata
forcreateOrUpdate
for the template resource, I gotlogicResult
with right TypeSpec typeProduct
, butenvelopResult
with a wrong calculated TypeSpec typeProxyResource
as follow screenshot.After some investigation, I found the type is changed after calling
getEffectiveModelType
here. Since the resource model has a path parameter, so it will enter the logic of finding a naming model which is same to the resource model without this path parameter (filter logic). When it has no exactly same model, it will also find a model that is same with it with the same filter logic, then the final result will fall to the original model. But after the complicated process, the type has totally changed and the naming info lost, it make the emitter hard to distinguish if it is the same resource model. Either fix thegetEffectiveModelType
logic for templated model or change the logic ofgetLroMetadata
coudl resolve it. I don't know whether it should be opened as a core compiler problem or agetLroMetadata
problem, If wrong place, I could move it.The text was updated successfully, but these errors were encountered: