|
Post by AMI_Mani on Dec 7, 2020 17:32:32 GMT
Hi, In Attributeregistry(http://redfish.dmtf.org/schemas/v1/AttributeRegistry.v1_3_4.json), Attributetype is allowed to have integer(copied AttributeType, AttributeValue deails from schema at end of thread) How to add Hexadecimal value in Integer type for an attribute? Also Json is not supporting Hexadecimal value, so in this case do we need to use string and convert internally to integer values. In BIOS some values were hexadecimal, so user will expect same Hexadecimal value in Attribute also. Please share details related to schema or specification to handle hexadecimal values
Thanks, Mani
AttributeType: {
enum: [
"Enumeration",
"String",
"Integer",
"Boolean",
"Password",
],
enumDescriptions: {
Boolean: "A flag with a `true` or `false` value.",
Enumeration: "A list of the known possible enumerated values.",
Integer: "An integer value.",
Password: "Password values that do not appear as plain text. The value shall be null in responses.",
String: "Free-form text in their values.",
},
type: "string",
},
AttributeValue: {
additionalProperties: false,
description: "A possible value for an enumeration attribute.",
longDescription: "This type shall describe a possible enumeration attribute value.",
patternProperties: {
^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\.[a-zA-Z_][a-zA-Z0-9_]*$: {
description: "This property shall specify a valid odata or Redfish property.",
type: [
"array",
"boolean",
"integer",
"number",
"null",
"object",
"string",
],
}
},
|
|
|
Post by mraineri on Dec 8, 2020 15:13:09 GMT
In JSON, there is no such thing as a hexadecimal integer; numbers are all base-10 encoded. In cases where we've seen it important to represent a hexadecimal value, we've used a string with a pattern associated with it to enforce the fact it's a hexadecimal value. For example, "VendorId" in PCIeFunction is a string containing a hexadecimal value:
"VendorId": { "description": "The Vendor ID of this PCIe function.", "longDescription": "This property shall contain the PCI Vendor ID of the PCIe device function.", "pattern": "^0[xX](([a-fA-F]|[0-9]){2}){2}$", "readonly": true, "type": [ "string", "null" ] }
For the attribute registry, you can provide the "ValueExpression" term for an attribute to describe a pattern to enforce for your attribute (such as hexadecimal encoding).
|
|