Page MenuHomePhabricator

AQS 2.0: Edit Analytics: Create OpenAPI Spec
Open, Needs TriagePublic


The AQS 2.0 project is currently evaluating an OpenAPI-based toolset to create API docs:

  • Swag generates an OpenAPI specification based on a mix of code annotations and the code itself.
  • RapiDoc converts the specification into HTML.

Our goal is to create API docs that are reliable and easy to update by maintaining docs as close as possible to the code. Add your feedback about these tools to the evaluation notes on wiki.

To do

  • Add general API information: This needs to be done before documenting individual endpoints. See the docs on wiki for instructions.
  • Document edits/aggregate
  • Document edits/per-page
  • Document bytes_difference/net/aggregate
  • Document bytes_difference/net/per-page
  • Document bytes_difference/absolute/aggregate
  • Document bytes_difference/absolute/per-page
  • Document edited_pages/new
  • Document edited_pages/aggregate
  • Document edited_pages/top-by-edits
  • Document edited_pages/top-by-net-bytes-difference
  • Document edited_pages/top-by-absolute-bytes-difference

How to document an endpoint

  1. Add code annotations to document the endpoint. See the docs on wiki.
  2. Annotate the response format by adding an example and a description to each attribute. See the docs on wiki.
  3. Generate the spec using swag. See the docs on wiki.
  4. Preview the spec by loading the docs/swagger.json file into the RapiDoc demo. For more options, see the docs on wiki.