Redfish-Tools icon indicating copy to clipboard operation
Redfish-Tools copied to clipboard

weird error for problem in CSDL validation

Open sphuong1 opened this issue 4 years ago • 0 comments

I encountered this error:

  1) CSDL Tests
       metadata/AccountService_v1.xml
         All definitions shall include Description and LongDescription annotations:
     TypeError: Cannot read property 'Annotations' of undefined
      at typeOrBaseTypesHaveAnnotations (node_modules/redfishrepotest/csdl-syntax-test.js:1057:13)
      at typeOrBaseTypesHaveAnnotations (node_modules/redfishrepotest/csdl-syntax-test.js:1068:5)
      at definitionsHaveAnnotations (node_modules/redfishrepotest/csdl-syntax-test.js:1014:5)
      at Context.<anonymous> (node_modules/redfishrepotest/csdl-syntax-test.js:174:96)
      at processImmediate (internal/timers.js:458:21)

It took me a long time to figure out what it was. This is what I did:

<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="AccountService.v1_7_3">
    <Annotation Term="Redfish.OwningEntity" String="DMTF"/>
    <Annotation Term="OData.Description" String="This version was created to fix typos in descriptions and long descriptions."/>
     <EntityType Name="AccountService" BaseType="AccountService.v1_7_2.AccountService"/>
</Schema>

<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="AccountService.v1_8_0">
      ** snip **

      <EntityType Name="AccountService" BaseType="AccountService.v1_7_3.AccountService">
       ** snip **
      </EntityType>

      <ComplexType Name="ExternalAccountProvider" BaseType="AccountService.v1_7_3.ExternalAccountProvider">
           **snip**
      </ComplexType>

     ** snip **
</Schema>

The problem is that the ExternalAccountProvider complex type in AccountServices.v1_8_0 was referencing v 1.7.3 of Account Service schema. If you look v 1.7.3 schema did not have ExternalAccountProvider.

It would be nice if a better error message printed out stating that ExternalAccountProvider's base type in Account Services 1.8.0 was referencing a missing or incorrect base type.

sphuong1 avatar Oct 26 '20 23:10 sphuong1