Skip to content

Prepare docs and Swagger definition for automatically generated API docs#28506

Merged
thaJeztah merged 5 commits intomoby:masterfrom
bfirsh:prepare-api-docs-for-swagger-docs
Nov 22, 2016
Merged

Prepare docs and Swagger definition for automatically generated API docs#28506
thaJeztah merged 5 commits intomoby:masterfrom
bfirsh:prepare-api-docs-for-swagger-docs

Conversation

@bfirsh
Copy link
Contributor

@bfirsh bfirsh commented Nov 16, 2016

- What I did

This is some preparation for automatically generating API documentation from a Swagger definition. See #22931.

It is the Engine half of this documentation pull request. This pull request should be merged before the documentation pull request.

It consists of a bunch of things:

  • Removed the API reference for the latest API version. This is now all in api/swagger.yaml, which the documentation is automatically generated from.
  • Removed all the other API documentation from this repository. The old versions barely ever change, and all the other stuff is not tied to any code change, so they should probably just live in docker/docker.github.io.
  • Renamed "Remote API" to "Engine API". See Proposal: Rename "Docker Remote API" to "Docker Engine API" #28319 for details.
  • Update api/swagger.yaml with some more documentation and some recent API changes.

- A picture of a cute animal (not mandatory but encouraged)

robot-cat

/cc @dnephin @johndmulhausen

@johndmulhausen
Copy link
Contributor

So excited about this, thanks @bfirsh. Slowly, we are killing all these hand-rolled markdown files and I couldn't be happier. To be getting such nice-looking API docs is just an added bonus!

cc @mstanleyjones

@thaJeztah
Copy link
Member

Is there an easy way to generate these docs for preview / reviewing pull requests?

@bfirsh
Copy link
Contributor Author

bfirsh commented Nov 17, 2016

@thaJeztah I think the easiest way is to copy swagger.yaml into the right place in the documentation repo and run the documentation locally.

That could be documented somewhere I suppose. Perhaps a "API documentation" section in the contributing docs?

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor requests for changes to OperationID.

Thanks for adding all the missing endpoints.

LGTM

api/swagger.yaml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this PluginPush ? I've been normalizing everything to be singular.

api/swagger.yaml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServiceLogs

api/swagger.yaml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SecretList

api/swagger.yaml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SecretCreate

@bfirsh bfirsh force-pushed the prepare-api-docs-for-swagger-docs branch from de31a0e to c794bfe Compare November 18, 2016 13:45
@bfirsh
Copy link
Contributor Author

bfirsh commented Nov 18, 2016

If we want this included in 1.13, then these changes need cherry-picking to the 1.13 branch. I see no reason why not to include it – it's purely a documentation change.

Following an offline discussion with @thaJeztah, I'm also going to add some docs about how to write and test the API docs.

@thaJeztah thaJeztah added this to the 1.13.0 milestone Nov 18, 2016
@thaJeztah
Copy link
Member

Adding to the milestone, but /cc @vieux

@bfirsh bfirsh force-pushed the prepare-api-docs-for-swagger-docs branch from c794bfe to b728b24 Compare November 18, 2016 18:44
@bfirsh
Copy link
Contributor Author

bfirsh commented Nov 18, 2016

Copy link
Contributor

@mdlinville mdlinville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so cool!! Thank you so much, @bfirsh !

@bfirsh bfirsh force-pushed the prepare-api-docs-for-swagger-docs branch 4 times, most recently from ef307d0 to 1b1c71b Compare November 21, 2016 15:37
See: docker/docs#606

Also:
- Add missing redirects to API reference pages
- Remove v1.25 and 1.26, because they are being replaced with
  swagger generated docs.
- Remove all other docs which aren't reference material, because
  this can live in docker/docker.github.io

Signed-off-by: Ben Firshman <[email protected]>
Implementation of moby#28319

Signed-off-by: Ben Firshman <[email protected]>
- Tidied up copy
- API version is now mandatory
- Links to previous API versions

Signed-off-by: Ben Firshman <[email protected]>
Up to and including 673c5ee

Signed-off-by: Ben Firshman <[email protected]>
@bfirsh bfirsh force-pushed the prepare-api-docs-for-swagger-docs branch from 1b1c71b to 00873a9 Compare November 22, 2016 12:49
@bfirsh bfirsh force-pushed the prepare-api-docs-for-swagger-docs branch from 00873a9 to 79a9ee0 Compare November 22, 2016 14:06
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

api/README.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace v1.25 with something like <API_VERSION> so we don't have to update this file every release? (we've already updated master to v1.26)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, good point. I'll just remove the version number actually, because /engine/api/ redirects to /engine/api/v1.25/!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlaventure Done!

@bfirsh bfirsh force-pushed the prepare-api-docs-for-swagger-docs branch from 79a9ee0 to 109c54c Compare November 22, 2016 16:47
@vieux
Copy link
Contributor

vieux commented Nov 22, 2016

LGTM

@thaJeztah
Copy link
Member

There we go!

@thaJeztah thaJeztah merged commit 3135024 into moby:master Nov 22, 2016
@vieux
Copy link
Contributor

vieux commented Nov 23, 2016

@bfirsh can you create a PR against the 1.13.x branch directly ? this one is tricky to cherry-pick since it's 5 commits and the version changed in master

@vieux
Copy link
Contributor

vieux commented Nov 23, 2016

@bfirsh nevermind I got it

@bfirsh
Copy link
Contributor Author

bfirsh commented Nov 23, 2016

@vieux Nice, thank you! Appreciate that, because I realise it was non-trivial...

@vieux
Copy link
Contributor

vieux commented Nov 30, 2016

@bfirsh
Copy link
Contributor Author

bfirsh commented Nov 30, 2016

@vieux They will exist once docker/docs#606 exists. :)

Well, 1.26 won't, but the 1.13 branch doesn't have that broken link.

@bfirsh bfirsh deleted the prepare-api-docs-for-swagger-docs branch November 30, 2016 11:42
dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
…r-docs

Prepare docs and Swagger definition for automatically generated API docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants