-
Notifications
You must be signed in to change notification settings - Fork 237
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
how to interpret body in bodyRoot #4815
Comments
Can we have a linter rule to prevent the usage of body in bodyRoot? I wonder if there's a real case that customer has to write their typespec this way? In the above case, the Azure operation template has been changed from |
The azure specs shouldn't use @Body here it has no value and just pass start request |
@qiaozha , do you know the reason for them to declare this way? Why wouldn't it work just using
|
My guess is they want to override the body description, I can double confirm with the service team. But if service team should not use |
Playground Link
In this tsp
is the body parameter Test or an anonymous model with a property named body whose type is Test?
the openapi3 emitter result shows the former
but the type graph shows the later?
it's a real case https://github.com/Azure/azure-rest-api-specs/blob/ca4b71ab0e3bb7e4c44b44bf4d84d9c51f7b8264/specification/workloads/Workloads.SAPVirtualInstance.Management/SAPCentralServerInstance.tsp#L61, and seems quite common as azure operation template uses bodyRoot here
https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-resource-manager/lib/operations.tsp#L502
According to #2868 (comment) it feels like the former is correct?
The text was updated successfully, but these errors were encountered: