DMTF/Redfish-Service-Validator

About new payload annotations key errors

vincent-tang1 opened this issue · 9 comments

In redfish spec 1.16.0, introducing three new payload annotation support, including

  • @redfish.WriteableProperties
  • @redfish.AllowableValues
  • @redfish.AllowablePattern

After applied its into our redfish service, for SerialInterface example

"@odata.type": "#SerialInterface.v1_1_0.SerialInterface",

"@odata.context": "/redfish/v1/$metadata#SerialInterface.SerialInterface",

"@odata.id": "/redfish/v1/Managers/0/SerialInterfaces/1",

"@odata.etag": "05518a449fc991cc0da8",

"@Redfish.WriteableProperties": [

    "InterfaceEnabled",

    "BitRate",

    "Parity",

    "DataBits",

    "StopBits",

    "FlowControl"

],

"Id": "1",

"Name": "COM1",

"Description": "Management for Serial Interface",

"InterfaceEnabled": true,

"BitRate": "115200",

"BitRate@Redfish.AllowableNumbers": [

    "9600",

    "19200",

    "38400",

    "57600",

    "115200"

],

"Parity": "None",

"Parity@Redfish.AllowableValues": [

    "None",

    "Even",

    "Odd"

],

"DataBits": "8",

"DataBits@Redfish.AllowableNumbers": [

    "5:8"

],

"StopBits": "1",

"StopBits@Redfish.AllowableNumbers": [

    "1:2"

],

"FlowControl": "Hardware",

"FlowControl@Redfish.AllowableValues": [

    "None",

    "Hardware",

    "Software"

]

And then, using latest Redfish Service Validator tool v2.2.7 to verify will be failure, for SerialInterface example, appear below error

ConformanceHtmlLog_SerialInterface

Not sure if this is because latest Redfish Validator v2.2.7 tool have not supported these new annotation check yet ?

I was hoping the tool would dynamically pick up on new annotations, but that doesn't seem to be the case. We'll need to make an update to fix this.

Well, good news and bad news...

The good news is the tool does dynamically pull terms from RedfishExtentions; there is a bug in that it crashes rather than shows a meaningful error. I can certainly make a fix for that.

The bad news is we did not update the file RedfishExtensions_v1.xml to include these new annotations added last summer... We updated them in the spec, JSON Schema, and OpenAPI YAML, but not CSDL... So, even with the above fix to the tool, we'll still need a new publication of RedfishExtensions_v1.xml to get things fully squared away...

Just as a quick overview.

Around line 1016

type_obj = sub_obj.Type.catalog.getSchemaInCatalog(fullItem).terms[getType(fullItem)]

Directly checks that Schema "Redfish" and list of Terms. There's a more comprehensive function getProperties that ought to be written for RedfishType that finds Terms instead, and the schema grabbed from the catalog needs to be it's highest version (using getHighestType).

Just as a quick overview.

Around line 1016

type_obj = sub_obj.Type.catalog.getSchemaInCatalog(fullItem).terms[getType(fullItem)]

Directly checks that Schema "Redfish" and list of Terms. There's a more comprehensive function getProperties that ought to be written for RedfishType that finds Terms instead, and the schema grabbed from the catalog needs to be it's highest version (using getHighestType).

We may not need it to be super comprehensive; we never provide versioning of the RedfishExtensions_v1.xml file like we do for other schemas (if we add a new term, it will be in the RedfishExtensions.v1_0_0 namespace). I've added a simple exception check in my local branch around that code if a term isn't found, and that seems to be sufficient.

Thanks for the reply,
Not sure if the #548 patch was intended to fix the annotation error to warning
After verified from trunk code, and the result is still with same error compared with first comment.

We haven't merged the changes yet (that should take place this afternoon). But after discussing it with others, we may want to flag errors for unrecognized annotations; the change will at least make the error intelligible rather than showing a vague "Exception" error message. Unfortunately that means you'll need to wait until a new version of DSP8010 is available with the fix in RedfixExtensions_v1.xml, but it should be much easier to ignore a more specific error about an unrecognized annotation.

We haven't merged the changes yet (that should take place this afternoon). But after discussing it with others, we may want to flag errors for unrecognized annotations; the change will at least make the error intelligible rather than showing a vague "Exception" error message. Unfortunately that means you'll need to wait until a new version of DSP8010 is available with the fix in RedfixExtensions_v1.xml, but it should be much easier to ignore a more specific error about an unrecognized annotation.

Thank the info, this error messages became more specific and easier to understand. Furthermore, not sure if you have any schedule for releasing this new version of DSP8010 with the fix in RedfixExtensions_v1.xml?

@vincent0526 unfortunately DMTF does not disclose future publication dates, but if you work for a member company, please reach out to your contact and they should be able to provide more info.

jautor commented

@vincent0526 if you're just trying to get past those errors, you can edit your local copy of RedfishExtensions_v1.xml to add the missing annotations. Since those names and definitions are already public in the JSON schema version of the extensions, some quick cut/paste and you can replicate the fix yourself as a stop-gap.

But if you need truly "official" files, then as mraineri said, we're not able to provide future publications dates.