-
Notifications
You must be signed in to change notification settings - Fork 408
Support custom JSON-schema extensions #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@bcherny, is there any way to convert a JSON object as is? I mean: let json = {
"x": 0
} convert('Foo', json); interface Foo {
x: number
} |
That is outside of jstt's responsibility, though you can probably use something like https://www.npmjs.com/package/generate-schema, and pipe its output into jstt. |
@bcherny, thanks! |
I spent a bit of time looking at how the parser works, and was curious how you might imagine a plugin system? Would this be as granular as supporting custom |
@TheLarkInn Sorry about the delayed response. If you want a plugin system that can add support for/override handling of a particular JSONSchema node type, you'd have to add support for that node type at a few layers:
A question to start with might be: does a typical plugin need to hook into all of these steps? If not, we might want to go more granular. I'd start by putting together a few use cases for JSON-Schema-to-TypeScript plugins. Then we can think through how to design the API (visitor pattern, or otherwise), and sketch out how the types would work to enforce compile time safety for plugins. |
refactor: clean up enum ref generation
No description provided.
The text was updated successfully, but these errors were encountered: