-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
[WIP]: Add a command to generate docs for types defined in pkg/api/v*/types.go #11253
Conversation
GCE e2e build/test passed for commit 6c32972dd8d615cbbbeb87d1d9776bb99ec746ed. |
6c32972
to
a451e43
Compare
GCE e2e build/test passed for commit a451e43ba4879cb82e667a3eb2ed49208e593821. |
#9097 shows examples output of some libraries that translates swagger-spec to markdown, which looks much nicer than swagger-ui. But currently it doesn't make markdown for models separately. |
I also took notice of swagger2markdown. And I also found that there are some UIs that support The concept is quite interesting. I believe that sooner or later we are going to either have UIs that support swagger api parsing, or swagger community will create nice tools to export to various formats (e.g. markdown) |
a451e43
to
83b8d9d
Compare
GCE e2e build/test passed for commit 83b8d9decb5e7280c65e95ec170aacaee47f01be. |
@@ -0,0 +1,34 @@ | |||
<!-- BEGIN MUNGE: UNVERSIONED_WARNING --> |
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.
your mungedocs is out of date - you'll have to re-run it :)
This is a step forward, but I dislike the exposure of our type names. Specifically, things like "PodSpec" are not actually part of the API. The only thing that is part of the API is the net structure of each of the top-level objects. This applies to client libs, too (@lavalamp). How hard would it be to in-line sub-object structures into each referring doc? Something like:
... and so on. It would make a lot of duplicated info, but it would insulate us from changes to those structs breaking links into these docs. |
83b8d9d
to
260d68b
Compare
@thockin, are you suggesting that we inline the sub-objects, and remove the separate docs for sub-objects, so that the user only see a bunch of docs for the top-level objects? I think this would be good. |
That's what I am suggesting. Docs for Pod, ReplicationController, Service, On Wed, Jul 15, 2015 at 10:44 AM, Chao Xu notifications@github.com wrote:
|
This is where Brian disagrees with me... wait for it... wait for it.... On Wed, Jul 15, 2015 at 10:57 AM, Tim Hockin thockin@google.com wrote:
|
GCE e2e build/test failed for commit 260d68b. |
I mostly agree; the names are arbitrary, not version-protected, and unimportant in user-facing docs. However the fact that structure is shared across various objects does seem relevant and useful to know. For the purpose of making a useful go client lib, however, I think these names are fixed and should not change. |
<!-- END STRIP_FOR_RELEASE --> | ||
|
||
<!-- END MUNGE: UNVERSIONED_WARNING --> | ||
###Capability### |
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.
Presumably there are constant values that would be useful to print here?
Tim's point is well taken. If you can make the change he suggests today, lets do that. But lets definitely get something in today so that other people can then begin linking to the generated docs. |
I'll disagree with Daniel for now and we can take it off-line. I agree On Wed, Jul 15, 2015 at 11:19 AM, Eric Tune notifications@github.com
|
I agree that now is better than perfect. |
@caesarxuchao you decide if you want to try to implement Tim's suggestion or not. Let us know when it is "done". |
I'll implement Tim's suggestion. I'll update the status. |
Swagger maps represented as any is known issue: #4700. |
The all-in-one doc https://docs.openshift.org/latest/rest_api/kubernetes_v1.html#v1-podspec seems pretty nice, though I'd put the operations and models into 2 separate docs. That would make it easier to link to the models from kubectl-oriented docs. |
I agree that we should de-emphasize subobject names. They are visible in the Swagger, also. Putting all the models into one doc would help, as would formatting top-level objects to be more prominent and subobjects to be less so. |
I'm trying the approach in #9097, because it's output looks more decent. But I doubt I can make it today. |
GCE e2e build/test passed for commit fcc94b1. |
please reassign when this is no longer WIP. |
Address #10966
Some known issues:
BTW, swagger-ui also suffers from this problem.
Todo:
@erictune @bgrant0607 @nikhiljindal