|
Post by AMI_shirleyh on May 4, 2021 17:39:17 GMT
Large Integers are represented in exponential form with the JSON Parser we use.
For example: Property "abc" : 10000000000000 is displayed as "abc" : 1e+14 and is considered by DMTF Validator as float and hence FAIL.
Can you comment on this ?
Thanks
Shirley
|
|
|
Post by jautor on May 4, 2021 18:45:48 GMT
What property/schema is causing this? If we have a property defined (in JSON schema) as "integer", then it cannot use the exponent form - as that is the "float" format. If that property is exceeding the 64-bit int values, we want to know about it...
Jeff
|
|
|
Post by mraineri on May 4, 2021 18:49:59 GMT
|
|
|
Post by AMI_shirleyh on May 6, 2021 5:54:47 GMT
I got this from google when I posted the following question: Is it possible to display Maximum 64-bit integer value in JSON ? [ Got this ] "For example, a 64-bit integer cannot be represented in JSON (since JavaScript and JSON support integers up to 2^53). Therefore, a 64-bit integer must be represented as a string in JSON requests/responses."
Trying to represent "Attributes" sent from BIOS Settings in the following URI:- https://{{ip}}/redfish/v1/Systems/Self/Bios
They have the data in Hex and converting to decimal and sending it as Integer Datatype.
Example : "PCIS016": 1.2476874751235e+15 inside the Attributes Object in BIOS.
|
|
|
Post by jautor on May 8, 2021 18:26:21 GMT
The 53-bit integer limitation is an old library limit and shouldn't be an issue with modern libraries and interpreters.
But regardless, a set of register values or other normally hex-encoded data should be rendered in Redfish as a string, using a prepended "0x" for clarity. See the various Processor identification properties in the Processor schema for examples of this. There's no value in converting registers to decimal for display to a user - when it's the binary/hex values that are known (from documentation or specification), and they represent a bitmap for some purpose.
Jeff
|
|