Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird error for problem in CSDL validation #315

Open
sphuong1 opened this issue Oct 26, 2020 · 0 comments
Open

weird error for problem in CSDL validation #315

sphuong1 opened this issue Oct 26, 2020 · 0 comments
Assignees

Comments

@sphuong1
Copy link

sphuong1 commented Oct 26, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants