|
Post by abiramisekar on Mar 26, 2021 16:13:36 GMT
Hi, Raised an issue in GitHub (https://github.com/Julian/jsonschema/issues/793) while validating Systems/Self/SD URI, got error for AliasBootOrder Property, as per the DMTF schema, the property is of Array type, when the underlying properties are not available, we will show as AliasBootOrder : [] (empty array) in response, but we are getting error in this tool as below, Thanks, Abirami S
|
|
|
Post by mraineri on Mar 26, 2021 18:15:53 GMT
Can you confirm AliasBootOrder in the response in showing an empty array? From the console output you have shown, it looks like it's likely returning null instead.
Could you also provide the GET response for /redfish/v1/Systems/Self/SD?
|
|
|
Post by mraineri on Mar 26, 2021 19:00:40 GMT
At least from my own testing with a hacked up mockup, I've been able to use the existing JSON Schema files with the Python jsonschema module that can verify JSON payloads against a schema file. We have this tool available that uses the off-the-shelf JSON Schema validator: github.com/DMTF/Redfish-JsonSchema-ResponseValidator
This is a simplistic mockup I made specific with AliasBootOrder:
{ "@odata.type": "#ComputerSystem.v1_8_0.ComputerSystem", "Id": "1", "Name": "WebFrontEnd483", "SystemType": "Physical", "Status": { "State": "Enabled", "Health": "OK", "HealthRollup": "OK" }, "HostingRoles": [ "ApplicationServer" ], "IndicatorLED": "Off", "PowerState": "On", "Boot": { "AliasBootOrder": ***TEST POINT*** }, "@odata.id": "/redfish/v1/Systems/1" } When ***TEST POINT*** is an empty array ([]), I get the following output from the tool:
$ python3 Redfish-JsonSchema-ResponseValidator.py -l sample-mockup.json -S Redfish-JsonSchema-ResponseValidator version 1.0.1
/share/Redfish/spmf/mockups/public-rackmount1/Systems/437XR1138R2/index.json JSON schema name is ComputerSystem.v1_8_0.json
1 resources validated. 0 errors schemas returned from GET 1 schemas returned from cache 0
When ***TEST POINT*** is null, I get the following output from the tool:
$ python3 Redfish-JsonSchema-ResponseValidator.py -l sample-mockup.json -S Redfish-JsonSchema-ResponseValidator version 1.0.1
/share/Redfish/spmf/mockups/public-rackmount1/Systems/437XR1138R2/index.json JSON schema name is ComputerSystem.v1_8_0.json >>> None is not of type 'array'
1 resources validated. 1 errors. See ./validate_errs schemas returned from GET 1 schemas returned from cache 0
|
|