Closed blakehilliard closed 1 year ago
The schema is logical, but the tool is acting particular about type casting to a higher version.
<EntityType Name="ManagerNetworkProtocol" BaseType="ManagerNetworkProtocol.v1_1_1.ManagerNetworkProtocol">
<Property Name="NTP" Type="ManagerNetworkProtocol.v1_2_0.NTPProtocol" Nullable="false">
<Annotation Term="OData.Description" String="The settings for this manager's NTP protocol support."/>
<Annotation Term="OData.LongDescription" String="This object shall contain the NTP protocol settings for the manager."/>
</Property>
.........
</EntityType>
<ComplexType Name="NTPProtocol" BaseType="ManagerNetworkProtocol.v1_0_0.Protocol">
<Annotation Term="OData.AdditionalProperties" Bool="false"/>
<Property Name="NTPServers" Type="Collection(Edm.String)">
<Annotation Term="OData.Permissions" EnumMember="OData.Permission/ReadWrite"/>
<Annotation Term="OData.Description" String="Indicates to which NTP servers this manager is subscribed."/>
<Annotation Term="OData.LongDescription" String="This property shall contain all the NTP servers for which this manager is using to obtain time."/>
</Property>
</ComplexType>
In catalog.py, the following code only casts if our namespace is the lowest or undefined, or specified by '@odata.type':
if my_ns in [my_ns_unversioned, my_ns_unversioned + '.v1_0_0', '.'.join([my_ns_unversioned, min_version])] or my_odata_type:
Since the Property in particular NTP
's typechain starts at v1_2_0
, but the actual lowest version is v1_0_0.Protocol
, the tool falsely assumes it should not be cast.
The tool should maybe just cast if there's any higher type that's valid within sub_obj.parent.Type
(which would be ManagerNetworkProtocol.v1_9_1
), but I'm unsure if that's accomplished by simply removing this line. This should probably be given a series of corner cases, or if there's any fallback in Redfish schema, or some precedent in odata to define this behavior since @odata.type is assumed... @mraineri , @jautor
The tool gives me this error, but "NetworkSuppliedServers" is in the schema. Notice that it says "1_2_0" as the schema version, even though the one in odata.type is 1_9_1. It seems to be validating against a very old version of ManagerNetworkProtocol for some reason?
This is likely the same root cause as https://github.com/DMTF/Redfish/issues/5311