Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
Document all APIs with swagger
In order to replace / automate the API documentation on https://www.aptly.info/doc/api document API calls with swagger.
About 40 APIs currently only have stubs and need to be documented:
Run swagger
See Swagger doc: http://localhost:3142/docs
Note: as the dev server has live reload, changes to the code will be recompiled, then the page can be reloaded.
Examples
GET Request: https://github.com/aptly-dev/aptly/blob/improve/documentation/api/mirror.go#L220 (returning object)
GET Request: https://github.com/aptly-dev/aptly/blob/improve/documentation/api/mirror.go#L34 (returning a list)
POST Request: https://github.com/aptly-dev/aptly/blob/improve/documentation/api/mirror.go#L54 (with json body params)
Object: https://github.com/aptly-dev/aptly/blob/improve/documentation/deb/remote.go#L36 (used in response)
Header:https://github.com/aptly-dev/aptly/blob/improve/documentation/api/api.go#L47 (long description with bullet list)
Document aptly.conf
Found that aptly uses
github.com/DisposaBoy/JsonConfigReader
already, tunrs our it supports comments in json,so we can have a inline documented config file.
Checklist