swc ast to json schema? #7728
CodeFromAnywhere
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been using https://github.com/vega/ts-json-schema-generator so I can get named parameters from functions and a json schema for every interface/type. However, I've recently moved to Bun.sh and, on top of the fact that it's always been super slow, it's also super limited now, very buggy.
I was thinking that it would be very useful to make a SWC AST --> JSON Schema parser.
But it also seems quite some work so I'm not sure I'll do it. Especially if you want to support everything.
My naive idea now is to try and understand the AST fully and generate a JSON schema from every type/interface found, including import resolutions.
Is there anyone that has any other thoughts on this? Could be helpful before I get started on this daunting task :)
Beta Was this translation helpful? Give feedback.
All reactions