|
Post by AMI_Mani on Dec 8, 2022 17:28:51 GMT
Hi, We have below details in Section 7.9 POST (create) redfish specification
Services should return the HTTP 400 Bad Request status code for requests containing properties with the
value null .
As per schema we can have null value for some attributes and sending null value for that attribute in Post request won't be a problem. I would like to know whether any specific purpose of returning HTTP 400 Bad Request status code for requests containing properties with the
value null . Is it ok to ignore the null value attribute and proceed with other attributes to complete post request? Since specification mentioned as should return, it is recommended only and not mandatory to return HTTP 400 Bad Request status code for requests containing properties with the value null .
Thanks, Mani
|
|
|
Post by mraineri on Dec 8, 2022 19:25:57 GMT
No, the schema showing that null is allowed is to show that it's allowed in response payloads. This is to allow for cases when the service is unable to return the data to the client, perhaps due to an internal error or some sort of temporary block.
Unless you can speak to one, there are no use cases (that I know of) where a client would directly specify null for a property in a new resource. This is why we have that clause in the spec.
|
|
|
Post by AMI_Mani on Dec 9, 2022 3:56:13 GMT
Thanks for the reply. Can we ignore null property in post request and proceed further for post operation?
Thanks, Mani
|
|
|
Post by mraineri on Dec 9, 2022 18:56:00 GMT
Since it's a "should" and not a "shall", you're certainly free to do that.
|
|