Replies: 6 comments
-
It means there is no body |
Beta Was this translation helpful? Give feedback.
-
Does that mean we should ignore any property defined by void? Ideally the void could be used in any places like request or response body, header, query parameter or model property. Also according to the doc, it meantioned void is used for return type not input model. |
Beta Was this translation helpful? Give feedback.
-
Offline discussed this with @timotheeguerin here is the take-away:
|
Beta Was this translation helpful? Give feedback.
-
from my experiment, i believe never could only used for model property (parameter is also a model property) and means this property not exist, so it could not be used for response type. while void is a type that could be used in any place. idk if it is right for the typespec syntax meaning. |
Beta Was this translation helpful? Give feedback.
-
Yeah never as a response type would mean the operation never returns(not that it has no body) which I’m not really sure what that would mean in http. |
Beta Was this translation helpful? Give feedback.
-
In the interest of not coupling TypeSpec semantics to HTTP internals, |
Beta Was this translation helpful? Give feedback.
-
In container service fleet tsp we have following definition(tsp here).
And the second template argument in
ArmResourceActionSync
isvoid
, which means the request body is void. So finally we would get similar definition as below.https://github.com/Azure/typespec-azure/blob/079aa68184a182ad9c954213a18453785c92d598/packages/typespec-azure-resource-manager/lib/operations.tsp#L587-L606
I was wondering what the void body mean? The same question on how to express void when used as model property, header/query parameter and response body.
Beta Was this translation helpful? Give feedback.
All reactions