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
I tried to fix or workaround this on my own but didn't get it resolved. I would really appreciate if someone has an idea for a quick workaround or even fix. 🙏
I just found a workaround when having a deeper look into the inner workings of typescript-json-schema and at least found a viable workaround for my use case.
By passing the files array into the buildGenerator as onlyIncludeFiles-parameter I can match the cli's behaviour. 🥳
I published the workaround under a new branch in my demo repo for reference: lukas-runge/tjs-bug-demo@5f3de74
I still find this shouldn't be the default behaviour. Maybe someone more experienced can explain what's actually going on here under the hood and if it's a bug or a feature. In any case I'd say there needs to be documentation on a programmatical implementation that matches the one of the cli. 🙌
When trying to use
typescript-json-schema
programatically
I stubled across some weird behaviour that did not match thecli
output. I build a minimal example to reproduce this issue fast: https://github.com/lukas-runge/tjs-bug-demo. 🙌The cli command:
The programatic implementation of the "same" thing:
The programatically generated schema is missing one required property (
test
):I tried to fix or workaround this on my own but didn't get it resolved. I would really appreciate if someone has an idea for a quick workaround or even fix. 🙏
Looking forward to getting this resolved! 🚀
Best regards,
@lukas-runge
The text was updated successfully, but these errors were encountered: