Closed kunal-pmj closed 5 years ago
Hi Kunal, When submitting pull requests, can you make sure to be more descriptive so it is easy for the reviewer to understand. What was the issue here and can you explain how deleting required will solve the problem?
Hi @sreeshas Apologies for not providing enough information related to the fix. Well, This is another fix to avoid the schema validation error reported in the following issue.
I will illustrate the issue and the fix with this example :
/com/vmware/vcenter/inventory/datastore?~action=find, its success response refers to following type vcenter.inventory.datastore.find_result
"vcenter.inventory.datastore.find_result": { "type": "object", "properties": { "value": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "required": false, "$ref": "#/definitions/vcenter.inventory.datastore.info" } } } } }, "required": [ "value" ] },
The validation error is reported because the "required" is present along with the $ref.
The fix was to deleted the required attribute if its sibling is $ref. This is similar to the cleanup method line#478 which deletes required field from the properties dictionary
Thanks for explaining the fix. I'm okay with the approach but i think there will lot more cases where "required" might need to be removed. So you can move this logic to cleanup method or write a new method and call it from process_output like we do for remove_com_vmware_from_dict.
Thanks for explaining the fix. I'm okay with the approach but i think there will lot more cases where "required" might need to be removed. So you can move this logic to cleanup method or write a new method and call it from process_output like we do for remove_com_vmware_from_dict.
Hi @sreeshas
I moved the fix to remove_com_vmware_from_dict.
Thanks Kunal
@kunal-pmj, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org>
to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.
@kunal-pmj, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org>
to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.
@kunal-pmj, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org>
to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.
from a property dict
Signed-off-by: Kunal Singh singhk@vmware.com