YousefED / typescript-json-schema

Generate json-schema from your Typescript sources
BSD 3-Clause "New" or "Revised" License
3.17k stars 323 forks source link

Handling Unsupported Types in Schema Generation #609

Closed zwa73 closed 4 months ago

zwa73 commented 4 months ago

I encountered an issue while generating a schema. I received the following error:

TypeError: Unsupported type: import("src/UtilInterfaces").PartialOption<B, D>  at JsonSchemaGenerator.getDefinitionForRootType

There are some types that are inevitably unsupported, but they might just be some types that I don't need. Currently, I can generate normally by directly removing var error = new TypeError("Unsupported type: " + propertyTypeString);, but this seems odd.

Is there a way to directly ignore such errors? The ignoreError:true option doesn't seem to have any effect on these errors. Any help would be appreciated.

zwa73 commented 4 months ago

Well, I searched for ast to export only the types in the include file and solved the problem