Second+ level "metadata" inheritance issues
See original GitHub issueThere are conflicts with extending the class which extends standard UI5 class.
Example:
MyControl
extends Control
, contains test
property
OneMoreControl
extends MyControl
, contains anotherTest
property
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:
- Adding properties to
OneMoreControl
fromMyControl
, but I guess it would fail at runtime, because, if I recall correctly, metadata field is removed at runtime by UI5 framework. - Adding
@ts-expect-error
Both options seems to be bad. Any suggestions? Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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).