Post by gregm on Feb 28, 2019 8:05:42 GMT
Hi,
I've noticed that the first regular expression "[A-Za-z0-9_.:]+" in the "Oem extension object" (specified in Resource.json and Resource_v1.xml schemas) matches more or less everything including odata and Redfish properties too.
This makes it impossible to add for instance an @odata.type property because it's value is not an object but a string (URL, #Namespace.TypeName ).
Is it intentional?
I presume it's not because the "Oem extension object" contains another Regex "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_.]+$" specifically for odata and Redfish properties.
Here is the definition of the "Oem extension object" from the Resource.json
"Oem": {
"additionalProperties": true,
"description": "Oem extension object.",
"longDescription": "This object represents the Oem properties. All values for resources described by this schema shall comply to the requirements as described in the Redfish specification.",
"patternProperties": {
"[A-Za-z0-9_.:]+": {
"$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/OemObject"
},
"^([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"
]
}
},
"properties": {},
"type": "object"
},
I think the first regular expression should look like this "^[A-Za-z0-9_.:]+$" to match the beginning and the end of a string. So it won't match @odata.type and etc...
What do you think?
Thanks in advance,
Greg
I've noticed that the first regular expression "[A-Za-z0-9_.:]+" in the "Oem extension object" (specified in Resource.json and Resource_v1.xml schemas) matches more or less everything including odata and Redfish properties too.
This makes it impossible to add for instance an @odata.type property because it's value is not an object but a string (URL, #Namespace.TypeName ).
Is it intentional?
I presume it's not because the "Oem extension object" contains another Regex "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_.]+$" specifically for odata and Redfish properties.
Here is the definition of the "Oem extension object" from the Resource.json
"Oem": {
"additionalProperties": true,
"description": "Oem extension object.",
"longDescription": "This object represents the Oem properties. All values for resources described by this schema shall comply to the requirements as described in the Redfish specification.",
"patternProperties": {
"[A-Za-z0-9_.:]+": {
"$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/OemObject"
},
"^([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"
]
}
},
"properties": {},
"type": "object"
},
I think the first regular expression should look like this "^[A-Za-z0-9_.:]+$" to match the beginning and the end of a string. So it won't match @odata.type and etc...
What do you think?
Thanks in advance,
Greg