Skip to content

Commit 19620ef

Browse files
committed
improved type def resolutions and enum values
1 parent 2048e5f commit 19620ef

File tree

8 files changed

+1156
-137
lines changed

8 files changed

+1156
-137
lines changed

schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@
142142
"items": {
143143
"$ref": "#/definitions/property",
144144
"description": "Schema for array items when type is 'array'"
145+
},
146+
"values": {
147+
"type": "array",
148+
"items": {
149+
"oneOf": [
150+
{ "type": "string" },
151+
{ "type": "number" }
152+
]
153+
},
154+
"description": "Possible values when type is 'enum'"
145155
}
146156
},
147157
"required": [

src/analyze/typescript/extractors/event-extractor.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ function cleanupProperties(properties) {
530530

531531
for (const [key, value] of Object.entries(properties)) {
532532
if (value && typeof value === 'object') {
533-
// Remove __unresolved marker
533+
// Remove __unresolved marker from the value itself
534534
if (value.__unresolved) {
535535
delete value.__unresolved;
536536
}
@@ -540,9 +540,16 @@ function cleanupProperties(properties) {
540540
value.properties = cleanupProperties(value.properties);
541541
}
542542

543-
// Clean array item properties
544-
if (value.type === 'array' && value.items && value.items.properties) {
545-
value.items.properties = cleanupProperties(value.items.properties);
543+
// Clean array item properties and __unresolved markers
544+
if (value.type === 'array' && value.items) {
545+
// Remove __unresolved from items directly
546+
if (value.items.__unresolved) {
547+
delete value.items.__unresolved;
548+
}
549+
// Clean nested properties in items
550+
if (value.items.properties) {
551+
value.items.properties = cleanupProperties(value.items.properties);
552+
}
546553
}
547554

548555
cleaned[key] = value;

0 commit comments

Comments
 (0)