-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add true programmatic schemas #36
Conversation
@efreila, is this what you had in mind? Let me know before EOD so I can make adjustments and deploy! :) |
With this, proper documentation may be needed as the feature usage may require a better knowledge of the constructors and methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small comments but looks great overall 🚀
…hema` depending on if basePath provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG2M!
Thanks for working on this and addressing comments/feedback so hastily 🚀
@efreila Thank you for the valuable feedback! |
I will mention you once this is deployed! |
As per #35, this re-implements the ability for a purely programmatic approach to schema generation, models and enums can be created independent of a parent schema while retaining full prior functionality.
An example has been added in
examples/programmatic-usage
, in which an API which can generate basic models is created.The core logic for this endpoint is as follows.
The README for said example is as follows.
This example creates an API at 0.0.0.0:8000 with a route in which you can send GET requests to a
/model
endpoint.It accepts the following
zod
schema.When a request is sent with the following body to
0.0.0.0:8000/model
, it will respond with the subsequent string.