|
Post by AMI_shirleyh on Feb 6, 2023 18:15:38 GMT
Hi,
There is an OEM POST Action that requires to return a JSON Response.
Is it mandatory to provide odata.type along with the response with 200 Status ?
Thanks Shirley
|
|
|
Post by mraineri on Feb 7, 2023 13:27:45 GMT
We haven't specified this today, but I don't think we walked through the OEM action response case like this. I would recommend adding it to the response, and we'll need to discuss this internally how we want to address this in the spec.
|
|
|
Post by AMI_shirleyh on Feb 8, 2023 12:08:32 GMT
Thanks a lot.
|
|
|
Post by mraineri on Feb 28, 2023 15:48:42 GMT
After discussing this with others, while @odata.type can certainly be used, it's not necessary for the client to discover the action response.
With the way actions are constructed in the "Actions" property, a client is able to use the name of the action itself to look up the schema definition for the action. This will lead the client to the response definition as well.
For example, if a client sees the action "#ContosoComputerSystem.Reset", this means the client can look for an action named "Reset" in the "ContosoComputerSystem" schema file. Once that action is found, they can use the definition to find the response payload; in CSDL, the "ReturnType" field in the action definition is used to convey this.
|
|