SAP / open-ux-odata

Enable community collaboration to jointly promote and facilitate best in class framework and tooling capabilities when working with OData services.
Apache License 2.0
51 stars 13 forks source link

BUG - `Cannot read properties of undefined (reading 'includes')` error thrown when trying access to `UI` annotation #862

Closed 815are closed 2 months ago

815are commented 2 months ago

Steps to Reproduce

Steps to reproduce the behavior:

  1. Project ->
  2. There is following [annotation](
    <Annotations Target="LibraryService.LibraryElement">
        <Annotation Term="UI.CreateHidden">
          <Path>/AuthorizationRestriction/isNotAllowedToCreate</Path>
        </Annotation>
    ...
  3. when we try to access it like using code like:
    oDataServiceAVT.resolvePath('/LibraryElement').target.annotations.UI.CreateHidden
  4. Error is thrown from @sap-ux/annotation-converter ->https://github.com/SAP/open-ux-odata/blob/main/packages/annotation-converter/src/converter.ts#L422

From debugger: image

Expected results

Error is not thrown

Actual results

Error is thrown

Screenshots

image

image

Version/Components/Environment

Add any other context about the problem here OS:

Root Cause Analysis

Problem

{describe the problem}

Fix

{describe the fix}

Why was it missed

{Some explanation why this issue might have been missed during normal development/testing cycle}

How can we avoid this

{if we don’t want to see this type of issues anymore what we should do to prevent}

nlunets commented 2 months ago

Fixed with @sap-ux/edmx-parser@0.8.1

schreckstefan commented 2 months ago

Thanks, @nlunets. But pls. note that I had to adapt our copy of the StableIdHelper for this, evaluation of odata.concat