Skip to content

Commit

Permalink
support then delete $comment key when processing
Browse files Browse the repository at this point in the history
-   I could dig deeper into the code to support the $comment key properly, but it's easier to just delete it from the object (which is technically permitted by the schema spec) 😅
-   re: #2
  • Loading branch information
SignpostMarv committed Sep 15, 2024
1 parent 0ef3b7b commit 2d41c33
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/TypeDefinitionDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export class TypeDefinitionDiscovery
},
}>(this.docs.ajv, {
type: 'object',
required: ['type', '$ref', 'properties'],
required: ['$comment', 'type', '$ref', 'properties'],
additionalProperties: false,
$defs: {
$ref_base: {
Expand Down Expand Up @@ -446,6 +446,11 @@ export class TypeDefinitionDiscovery
},
},
properties: {
$comment: {
type: 'string',
// eslint-disable-next-line max-len
pattern: '^\\/Script\\/CoreUObject\\.Class\'\\/Script\\/FactoryGame\\.',
},
type: {type: 'string', const: 'object'},
$ref: {type: 'string', const: '#/$defs/NativeClass'},
unevaluatedProperties: {type: 'boolean', const: false},
Expand Down Expand Up @@ -557,6 +562,9 @@ export class TypeDefinitionDiscovery

for (const item of schema.prefixItems) {
if (native_class(item)) {
if ('$comment' in item) {
delete item.$comment;
}
result.found_classes.push(item);
} else {
result.missing_classes.push(item);
Expand Down

0 comments on commit 2d41c33

Please sign in to comment.