-
Notifications
You must be signed in to change notification settings - Fork 43
api spec issues #535
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
Comments
I opened oxidecomputer/dropshot#223 to address the underlying problem. And this also spawned this: OAI/OpenAPI-Specification#2833 The invalid endpoints turn out to have this by them: // TODO: this should be unpublished, but for now it's convenient for the
// console to use the generated client for this request Nevertheless, we should emit valid OpenAPI! With regard to tags: what are you generating and do you have particular suggestions for how we apply tags? I recall Jared looking at OpenAPI -> doc tools, but I'm not sure if we landed anywhere with that. Do you have a recommendation? I looked in RFD 4 and didn't see a recommendation for how we tag endpoints, but may have missed it. What I was thinking is that we should do the following:
|
Yeah that sounds good I’ve been generating docs from tags, as that’s nice for a sidebar representation. So you could assume for our API the tag is the same as the first part of the path, like projects, VMs, network etc like a way of grouping common endpoints
… On Dec 20, 2021, at 11:29 PM, Adam Leventhal ***@***.***> wrote:
I opened oxidecomputer/dropshot#223 to address the underlying problem.
And this also spawned this: OAI/OpenAPI-Specification#2833
In short: swagger-cli depends on these JSON Schema files... which aren't particularly accurate.
The invalid endpoints turn out to have this by them:
// TODO: this should be unpublished, but for now it's convenient for the
// console to use the generated client for this request
Nevertheless, we should emit valid OpenAPI!
With regard to tags: what are you generating and do you have particular suggestions for how we apply tags? I recall Jared looking at OpenAPI -> doc tools, but I'm not sure if we landed anywhere with that. Do you have a recommendation? I looked in RFD 4 and didn't see a recommendation for how we tag endpoints, but may have missed it. What I was thinking is that we should do the following:
require each endpoint to have exactly one tag
emit a document from the implementation that lists the endpoints under each tag
check in that document and have an expectorate-based test that fails if the document changes to ensure that we don't change it unintentionally and to highlight it for reviewers.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
Thanks for the tags now we can get somewhere: Some other notes:
Then other notes, and this might be a dropshot change, in #579 it is not adding the high level tags object where the tag name and description exist, this is fairly annoying since we can use this data for populating the headings of the tagged endpoints. Here is an example of the docs https://docs-five-sooty.vercel.app/ , as you can see I'm using the description for the endpoint headings where it should be the summary. Once we have the above we can have nicely generated docs :) Then likely ill annoy you to add example output for the endpoints, but we can cross that bridge later. |
for reference this is what redoc does if you just hand it the spec |
the other thing is, and idk if you even want this, but if we come up w a keyword like |
That was my intention; see above.
Please file this in dropshot. My preference would be to continue to use the Rust doc comment to populate the description and to use the first line of that as the summary by convention. We could then add a lint to, say, validate that the summary was under a certain number of characters in length.
Yes. Please file that in dropshot with a proposal for how tag metadata might be specified. |
Replace with the path to the spec....
The text was updated successfully, but these errors were encountered: