-
Notifications
You must be signed in to change notification settings - Fork 55
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
docs: openapi specs #44
Comments
It sounds promising for specification and documentation, I'm a bit weary of using it to generate the actual code though. In your experience, if we omitted code generation, would that compromise the effectiveness of this approach? |
The code generation is only one of the possible benefits, there are parts of what the code generation does that could be just used directly such that the spec is part of the run time to avoid the dreaded documentation and the code not being in alignment. That is why I only put that under the Considerations list vs. the task list. I believe after creating the specs for the APIs and making use for the documentations is the first and most important part, then the second part could be making the spec an active part of the API implementation (like routing, validation, etc.). After the task list is complete, then take a look at other ways the specs could be leveraged. |
@mreiferson When I submit a PR to add the specs, where in the directory structure would you want them placed? Should the groups of APIs listed as deprecated (all those referred to as pre-v1) be included or would it be safe to leave those off? |
Hmmm, |
Questions based on initial nsqlookupd spec that was created.
|
No good reason, unfortunately.
Same here.
Poke around the issues surrounding nsqio/nsq#330, I remember going back and forth a bit on this.
Perhaps it's not an error if the topic is not found (e.g. they result in a topic being created)? |
Yes, seems like good practice to validate the inputs on any endpoint that expects those parameters.
I don't think errors make sense for those ops. |
moving this issue to https://github.com/nsqio/nsqio.github.io |
Provides clear documentation of each API and how to use them that is not tied to any specific vendor or technology.
There are tools that can consume the spec and generate the server component and the client component. go-swagger
Also tools for displaying the spec as html, and allows for interacting with the API if server is available.
nsqlookupd APIs as example:
https://gist.github.com/kenjones-cisco/5b36a7c54ddd548264178ca657e00bd7
To view an HTML representation of the example nsqlookupd spec provided, copy the yml file into the Swagger Editor to visually see what the documentation could look like.
Tasks:
Considerations:
References:
The text was updated successfully, but these errors were encountered: