Post by ginugeorge on Feb 7, 2023 12:10:18 GMT
Consider I am performing a PATCH operation on the Ethernet Interface Instance eth0 with the below request body :
https://{{ip}}/redfish/v1/Managers/Self/EthernetInterfaces/eth0
If you see the above request body, we see that the Address attribute doesnt have a valid value associated with it and so we need to return 400 Bad Request with the appropriate error response body.
Please let us know which of the below mentioned response bodies are correct ?
Error Response Body Format 1 :
Here in the "Message" attribute, the property Address is represented as a RFC6901-defined JSON pointer representation, similar to what we have under the "RelatedProperties" attribute.
Error Response Body Format 2 :
Here in the "Message" attribute, the property Address is represented normally, unlike the "RelatedProperties" attribute, which is represented as a RFC6901-defined JSON pointer representation.
https://{{ip}}/redfish/v1/Managers/Self/EthernetInterfaces/eth0
{
"IPv6StaticAddresses": [
{
"Address": true,
"Oem": {
"Ami": {
"@odata.type": "#AMIIPV6.v1_0_0.AMIIPV6",
"StaticIPAddressIndex": 1
}
},
"PrefixLength": 64
}
]
}
If you see the above request body, we see that the Address attribute doesnt have a valid value associated with it and so we need to return 400 Bad Request with the appropriate error response body.
Please let us know which of the below mentioned response bodies are correct ?
Error Response Body Format 1 :
Here in the "Message" attribute, the property Address is represented as a RFC6901-defined JSON pointer representation, similar to what we have under the "RelatedProperties" attribute.
{
"error": {
"@message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_8.Message",
"Message": "The value 'true' for the property /IPv6StaticAddresses/0/Address is of a different type than the property can accept.",
"MessageArgs": [
"true",
"/IPv6StaticAddresses/0/Address"
],
"MessageId": "Base.1.12.PropertyValueTypeError",
"RelatedProperties": [
"/IPv6StaticAddresses/0/Address"
],
"Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed.",
"Severity": "Warning"
}
],
"code": "Base.1.12.PropertyValueTypeError",
"message": "The value 'true' for the property /IPv6StaticAddresses/0/Address is of a different type than the property can accept."
}
}
Error Response Body Format 2 :
Here in the "Message" attribute, the property Address is represented normally, unlike the "RelatedProperties" attribute, which is represented as a RFC6901-defined JSON pointer representation.
{
"error": {
"@message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_8.Message",
"Message": "The value 'true' for the property Address is of a different type than the property can accept.",
"MessageArgs": [
"true",
"Address"
],
"MessageId": "Base.1.12.PropertyValueTypeError",
"RelatedProperties": [
"/IPv6StaticAddresses/0/Address"
],
"Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed.",
"Severity": "Warning"
}
],
"code": "Base.1.12.PropertyValueTypeError",
"message": "The value 'true' for the property Address is of a different type than the property can accept."
}
}