-
-
Notifications
You must be signed in to change notification settings - Fork 302
RFC: Add to-valibot package
#1099
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…er unsupported features
|
Thanks for creating this PR! In simple words, is the general idea of this package to read a JSON or YAML file containing OpenAPI or JSON schema and convert it to a Valibot schema? If so, does it depend on Node.js to read the files? Can users also just pass an OpenAPI or JSON Schema object (without reading a file) to convert it to a Valibot schema? Does it make sense to split it into two packages |
Yes, but not limited to that. With what we have, we could allow parsing other formats too.
It's up to users how they will retrieve said files. Something such as OpenAPI Declaration file would most likely retrieved over an API call. However, at the moment current implementation depends on node to write to the file system (we could allow instead just to return generated code so users can save it however they wish)
I'm open to discussion, but don't really see benefit of that. Bundle size difference is barely noticeable, and it would only be ran on dev machine (or CI where code is built, considering types output gets .gitignored). |
|
Questionable functionalities, which can't be replicated by Typescript's types (but can be validated with custom validators/actions)
Additional concerns on https://json-schema.org/understanding-json-schema/reference/combining
|
|
Hey, I'm very sorry for my late reply, but I don't have much time right now. I recommend to continue this library as a community project for now because of time constraints on my side. Sorry for that! I am happy to help you share it on social media and connect you with other developers in our ecosystem if you are interested. Feel free to contact me again in about two months. I may have a little more time then. I also want to thank you for your recent contributions to the project! I hope to be able to give back some day! Please reach out if you are motivated to contribute even more. For example, we are looking for someone interested in investigating a possible VS Code extension implementation. |
This packages allows transforming OpenAPI Declarations (.yaml and .json) and JSON Schemas (tested and unit test covered with draft-07).
Some of JSON Schema validations (minProperties, maxProperties, isoDuration) are covered by #1100 (comment)