question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Second+ level "metadata" inheritance issues

See original GitHub issue

There are conflicts with extending the class which extends standard UI5 class. Example: MyControl extends Control, contains test property OneMoreControl extends MyControl, contains anotherTest property image

OneMoreControl gets error: Class static side 'typeof OneMoreControl' incorrectly extends base class static side 'typeof MyControl'.\n The types of 'metadata.properties' are incompatible between these types.\n Property 'test' is missing in type '{ anotherTest: string; }' but required in type '{ test: { type: string; }; }'.

There are two ways of dealing with it:

  1. Adding properties to OneMoreControl from MyControl, but I guess it would fail at runtime, because, if I recall correctly, metadata field is removed at runtime by UI5 framework.
  2. Adding @ts-expect-error

Both options seems to be bad. Any suggestions? Thanks!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
akudevcommented, Dec 20, 2022

Ok, with https://github.com/SAP/openui5/commit/8f935aa5d277291bbb985db5aebb76546637873e the type definitions for the “metadata” objects have landed. They can already be seen at and around https://openui5nightly.hana.ondemand.com/api/sap.ui.core.Element.MetadataOptions. They will be released with version 1.110 of the type definitions and once this happened (~mid January) I will adapt the TS control dev examples/tutorials to use them - and close this issue.

1reaction
akudevcommented, Nov 29, 2022

FYI: we have enriched the JSDoc processing to enable specifying inheritance in @typedef. So we are going to express the above types directly in the UI5 source code and have them generated to d.ts (and displayed as types on their own in the documentation).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Decorated class inheritance issue - rbuckton/reflect-metadata
When multiple instances extends from the same base class that has decorated properties. Children decorators 'pollutes' parent metadata.
Read more >
sharepoint online folder inheritance - Microsoft Community Hub
Hello,. You can customize the views per metadata, but metadata is inherited from the upper level (Document library). Hope this resolve your issue....
Read more >
Inheritance of attributes and metadata in maps - OASIS Open
Some of the attributes and metadata in a map can be inherited based on the structures in the map.
Read more >
Inheritance Paths - platformadmin.com
In any given metadata repository the vast majority of metadata objects will not have any direct access controls applied to them. Almost all ......
Read more >
Do Not Inherit Metadata Title, Description, Keywords
Brendon, So you are saying your first level pages are set to not inherit but when you add another page below one of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found