Skip to content
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

Docker Remote API: Documentation is missing and misleading #7669

Closed
ahmetb opened this issue Aug 21, 2014 · 9 comments
Closed

Docker Remote API: Documentation is missing and misleading #7669

ahmetb opened this issue Aug 21, 2014 · 9 comments

Comments

@ahmetb
Copy link
Contributor

ahmetb commented Aug 21, 2014

Many fields in the response objects that I actually get in my local calls do not exist in Remote API v1.13 documentation.

And documentation is so bad that there are no types specified.

e.g. it just says:

 "PortSpecs":null,

what is the type of this field? It is just a null in JSON response.

That doesn't make sense. Docs are very vague and it's almost impossible to write a correctly working client without reading other clients and keep testing every single corner case (e.g. you gotta reproduce a case where portspecs is not null by creating a container etc).

This is crazy and will not help things move forward very well.

@ahmetb
Copy link
Contributor Author

ahmetb commented Aug 21, 2014

Here's another example, Inspect Container's Config & ContainerConfig objects have an OnBuild field which does not appear in the API docs at all.

{...
  "OnBuild": []
...}

@ahmetb
Copy link
Contributor Author

ahmetb commented Aug 21, 2014

My suggestion: you should provide the entire object model for those types you are returning in responses.

Even a godoc.org link to those types would be super helpful in the API docs.

@ahmetb
Copy link
Contributor Author

ahmetb commented Aug 21, 2014

Another example: In the response example for the "Get the history of an image" call (v1.13) there is no such fields called Tags or Size but I get a nullable string[] by running it locally.

@ahmetb
Copy link
Contributor Author

ahmetb commented Aug 22, 2014

Another example: In the response example for "Inspect container" endpoint, quite a lot of endpoints are either do not appear at all or their type simply cannot be inferred from the example output (or my local docker inspect output for a simple container):

  • Name
  • ProcessLabel
  • Volumes
  • VolumesRW
  • MountLabel
  • HostsPath
  • HostnamePath
  • ExecDriver
  • Driver

all those fields are missing from your example output. Docs are not complete in that sense.

@cpuguy83
Copy link
Member

Thanks for looking at this!

Would be awesome if you could make a PR to update the fields you found to be missing.

Docs are in docs/sources/reference/api

@ahmetb
Copy link
Contributor Author

ahmetb commented Aug 22, 2014

@cpuguy83 it simply won't fix if I add missing fields. There will be still a lot of misleading parameter descriptions, inconsistent response types, inconsistent naming, inconsistent URL routes. To solve this, the documentation needs a full description of its response types and clear statements of what parameters can take which values and which are mutually exclusive etc. This needs an entire API and docs update. I will try to come up with a proposal soon.

@dnephin
Copy link
Member

dnephin commented Oct 4, 2014

I've noticed this problem as well. I often have to try and create containers, get them into the correct state, then make an API call to see what the API actually returns. I've also noticed that request parameters are often missing from the documentation, which is significantly harder to find.

There are a couple tools used for this type of documentation that are starting to emerge as possible standards. I think the most popular is http://swagger.io/ which uses json schemas and comes with a lot of excellent tooling. (http://apiblueprint.org/ uses markdown and is probably also worth a mention).

As a solution to this issue, I propose creating swagger schemas as the official remote API documentation.

A swagger schema (with swagger ui) gives you not only excellent documentation, the swagger ui also provides a way to interactive with the docker remote directly from the browser.

@jessfraz jessfraz added /project/doc kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Feb 26, 2015
@jessfraz
Copy link
Contributor

also see #2583

@spf13 spf13 added exp/beginner area/docs and removed /project/doc kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Mar 21, 2015
@ahmetb
Copy link
Contributor Author

ahmetb commented Dec 10, 2015

Closing this for the sake of #15188.

@ahmetb ahmetb closed this as completed Dec 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants