-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
OpenAPI generator #42
Labels
feature request
Request for new feature implementation
Comments
I had a few ideas to make this feature:
|
Closed
I'd love to help you with this if you have't already started. |
Hello @njr8392 ! Thank you very much for your help ! I haven't started this feature yet. Don't hesitate to contact me (via email, telegram or discord) if you have any question or if you need guidance. |
appreciate it!I agree that reading the routes/validation requirements would do the bulk of the job or using godoc to parse comments. How would you ideally like this implemented? Should i assume that the user will declare routes in a routes.go file? Maybe read all files to look for route declaration/validation and parse that info and put into a document format? Is your goal solely to produce automatically generated documentationfor the api the user creates?Thanks, NickSent from my Verizon, Samsung Galaxy smartphone
-------- Original message --------From: SystemGlitch <notifications@github.com> Date: 10/22/20 2:56 AM (GMT-05:00) To: System-Glitch/goyave <goyave@noreply.github.com> Cc: Nicholas Rodgers <nrodgers88@gmail.com>, Mention <mention@noreply.github.com> Subject: Re: [System-Glitch/goyave] OpenAPI generator (#42)
Hello @njr8392 ! Thank you very much for your help ! Don't hesitate to contact me (via email, telegram or discord) if you have any question or if you need guidance.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
Awesome, thanks for the clarity. I'll start this and will let you if I have any questions or issuesSent from my Verizon, Samsung Galaxy smartphone
-------- Original message --------From: SystemGlitch <notifications@github.com> Date: 10/22/20 2:32 PM (GMT-05:00) To: System-Glitch/goyave <goyave@noreply.github.com> Cc: Nicholas Rodgers <nrodgers88@gmail.com>, Mention <mention@noreply.github.com> Subject: Re: [System-Glitch/goyave] OpenAPI generator (#42)
If possible, that would make more sense to me if this was a separate project. I don't want applications in production to waste memory usage holding information needed for the OpenAPI spec generation. Ideally, this is something that we could use in the future CLI app. If it is not possible to get the data you need from outside, we can add an accessor to the Router struct which will copy the route slice.
Routes should always be defined in a http/route/route.go file so use this as default, but make it so it is possible to optionally give a path to the file.
Prefer the go/ast package over godoc. Using godoc would be quite hacky.
I would like to get as much information as possible automatically, but I also want the developer to be able to override and/or complete it. I think Beego's approach with annotations is quite neat. You can take inspiration from it.
The goal is to turn a Router struct into an OpenAPI specification.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
|
After some reasearch, it looks like kin-openapi is the most fitting library we could use. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Proposal
Develop a module able to generate OpenAPI specification for Goyave applications by reading the main route registrer and validation rule sets.
This feature could be included in the CLI Utility ( #39 )
Possible drawbacks
None
.Additional information
This issue is a feature proposal and is meant to be discussed.
It is also a good candidate if you want to contribute to the project.
This should probably be developed as a side-project.
The text was updated successfully, but these errors were encountered: