You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to generate a JSON schema for a TypeScript type that uses indexed access references from another file, ts-json-schema-generator does not produce the expected output. Instead, it returns a schema with an empty not object.
Flattening the type references (i.e., defining the type directly in intermediary.ts without referencing api.d.ts) does produce the expected schema. However, this is not a sustainable solution for larger projects with interrelated types.
The text was updated successfully, but these errors were encountered:
Description
When attempting to generate a JSON schema for a TypeScript type that uses indexed access references from another file,
ts-json-schema-generator
does not produce the expected output. Instead, it returns a schema with an emptynot
object.Reproducible Example
intermediary.ts
api.d.ts
Command Used:
Expected Output:
A valid JSON schema representing the MetadateDto type.
Actual Output:
Workaround
Flattening the type references (i.e., defining the type directly in intermediary.ts without referencing api.d.ts) does produce the expected schema. However, this is not a sustainable solution for larger projects with interrelated types.
The text was updated successfully, but these errors were encountered: