Skip to content
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

Feature Request: json-schema generation #109

Closed
jsbrain opened this issue Sep 25, 2022 · 1 comment
Closed

Feature Request: json-schema generation #109

jsbrain opened this issue Sep 25, 2022 · 1 comment

Comments

@jsbrain
Copy link

jsbrain commented Sep 25, 2022

Ever thought about pairing it with typebox to generate the types?

This would result in not only getting the types, but also a json-schema which could be used for all sorts of input and output validation, basically "for free".

The only project I've seen so far doing it is prisma-typebox-generator which only covers some of the required generation and also is dependent on prisma but I think having a project like sql-ts that works for multiple DBs and also generating json schemas for the models and input/query models as well would be incredibly powerful and useful.

I'm eager to hear your opinion 🙌

@rmp135
Copy link
Owner

rmp135 commented Dec 21, 2022

It's not something I've actively looked into and probably won't pursue it.

It should be possible to take the output of toObject and parse it in a way to generate the typebox types.

If someone does make a tool that combines these libraries I'll gladly link it in the readme.

@rmp135 rmp135 closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants