@@ -1277,6 +1277,9 @@ function createAPIJSON4Symbol(symbol, omitDefaults) {
12771277 if ( aggr . altTypes ) {
12781278 curr . altTypes = aggr . altTypes . slice ( ) ;
12791279 }
1280+ if ( aggr . defaultClass ) {
1281+ attrib ( "defaultClass" , aggr . defaultClass ) ;
1282+ }
12801283 attrib ( "cardinality" , aggr . cardinality , '0..n' ) ;
12811284 attrib ( "visibility" , aggr . visibility , 'public' ) ;
12821285 if ( aggr . stakeholders ) {
@@ -1934,9 +1937,8 @@ function createAPIJSON4Symbol(symbol, omitDefaults) {
19341937 return obj [ 0 ] ;
19351938}
19361939
1937- function postProcessAPIJSON ( api ) {
1940+ function addExportInfo ( symbols ) {
19381941 const modules = { } ;
1939- const symbols = api . symbols ;
19401942
19411943 // collect modules and the symbols that refer to them
19421944 for ( let i = 0 ; i < symbols . length ; i ++ ) {
@@ -2058,6 +2060,13 @@ function postProcessAPIJSON(api) {
20582060 for ( const n in modules ) {
20592061 guessExports ( n , modules [ n ] ) ;
20602062 }
2063+ }
2064+
2065+ function postProcessAPIJSON ( api ) {
2066+
2067+ const symbols = api . symbols ;
2068+
2069+ addExportInfo ( symbols ) ;
20612070
20622071 function findSymbol ( name ) {
20632072 if ( name == null || name === '' ) {
@@ -2086,6 +2095,28 @@ function postProcessAPIJSON(api) {
20862095 return ( m && m [ 1 ] ) || "" ;
20872096 }
20882097
2098+ // create a 2-level map of symbol names, first keyed by the exporting module and then by export name
2099+ const modules = Object . create ( null ) ;
2100+ for ( const symbol of Object . values ( externalSymbols ) ) {
2101+ if ( symbol . module && symbol . export !== undefined ) {
2102+ modules [ symbol . module ] ??= Object . create ( null ) ;
2103+ modules [ symbol . module ] [ symbol . export ] = symbol . name ;
2104+ }
2105+ }
2106+ for ( const symbol of symbols ) {
2107+ if ( symbol . module && symbol . export !== undefined ) {
2108+ modules [ symbol . module ] ??= Object . create ( null ) ;
2109+ modules [ symbol . module ] [ symbol . export ] = symbol . name ;
2110+ }
2111+ }
2112+
2113+ function findSymbolByModule ( module , exportName ) {
2114+ if ( module === "unknown" ) {
2115+ return "unknown" ;
2116+ }
2117+ return modules [ module ] ?. [ exportName ] ?? "unknown" ;
2118+ }
2119+
20892120 symbols . forEach ( ( symbol ) => {
20902121 // add note for enums which are not exposed by their name
20912122 if ( symbol . kind === "enum" && symbol . export ) {
@@ -2154,6 +2185,16 @@ function postProcessAPIJSON(api) {
21542185 }
21552186 }
21562187 }
2188+ /*
2189+ * Up to here, the defaultClass only contains a module name. Replace it with the corresponding API (type) name.
2190+ */
2191+ if ( Array . isArray ( symbol [ "ui5-metadata" ] . aggregations ) ) {
2192+ for ( const aggr of symbol [ "ui5-metadata" ] . aggregations ) {
2193+ if ( aggr . defaultClass != null ) {
2194+ aggr . defaultClass = findSymbolByModule ( aggr . defaultClass , "" ) ;
2195+ }
2196+ }
2197+ }
21572198 } ) ;
21582199
21592200}
0 commit comments