DMTF / YANG-to-Redfish-Converter

This tool converts a YANG model file to the corresponding Redfish schema, specified in OData CSDL, in accordance with the YANG-to-CSDL Mapping Specification.
Other
4 stars 5 forks source link

Travis complains for <Annotation> elements #42

Closed jcleung5549 closed 5 years ago

jcleung5549 commented 5 years ago

Travis complains when an element is within another element.

   metadata/NetworkDevice_v1.xml
      ✗ is valid syntax
      Error: http://redfish.dmtf.org/schemas/v1/openconfig_acl_v1.xml: Unknown element name Annotation
      at Annotation.defaultElementParse (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\ParserCommon.js:87:11)
      at parseEntity (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\ParserCommon.js:26:11)
      at Annotation.initEntity (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\ParserCommon.js:14:5)
      at new Annotation (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\Annotation.js:19:3)
      at Property.defaultElementParse (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\ParserCommon.js:84:28)
      at parseEntity (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\ParserCommon.js:26:11)
      at Property.initEntity (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\ParserCommon.js:14:5)
      at new Property (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\Property.js:22:3)
      at EntityType.defaultElementParse (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\ParserCommon.js:84:28)
      at parseEntity (C:\Users\jcleung\Documents\github external\branch-networktf\Redfish\node_modules\CSDLParser\lib\ParserCommon.js:26:11)
jcleung5549 commented 5 years ago

We ran into the same problem with the element translation, in May 2018.

mraineri commented 5 years ago

@jcleung5549 I don't think this is an issue with the tool; I think CSDLParser needs to be updated to allow <Annotation> within <Annotation>.

tomasg2012 commented 5 years ago

While annotations within annotation is still the case, it might no longer be the case when generating the new style of "PropertyValue" or "Property" tags inside of annotation. However, Description tags that have Odata.Description and LongDescription would still create Annotations

ex:

<Record>
    <Annotation Term="RedfishYang.revision" String="2018-04-24">
        <Annotation Term="OData.Description" String="Clarified order of ACL evaluation."/>
        <Annotation Term="OData.LongDescription" String="Clarified order of ACL evaluation."/>
        <PropertyValue Property="reference" String="1.0.1"/>
    </Annotation>
</Record>

Should embedded description records just be referred to by their YANG tag?

mraineri commented 5 years ago

Since we have expectations for how certain annotations are used in Redfish, I think we'd still want to use the existing OData.Description and OData.LongDescription annotations. It would give us better mapping alignment between YANG and Redfish.

mraineri commented 5 years ago

Newer version of CSDLParser has been pushed to allow for Annotations in Annotations and the Travis package list in the branch has been updated to use the newer version.

mraineri commented 5 years ago

Would like to keep this open until we positively confirm this is resolved.

jcleung5549 commented 5 years ago

No longer seeing with YANG-2019. Waiting for a clean Travis run, before closing this issue.

jcleung5549 commented 5 years ago

Travis is not longer generating this error.