Page MenuHomePhabricator

AQS 2.0: Edit Analytics: Create OpenAPI Spec
Closed, ResolvedPublic

Description

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.

Event Timeline

Sfaci triaged this task as Medium priority.
Sfaci edited projects, added AQS2.0 (Sprint 10); removed AQS2.0.
Sfaci removed Sfaci as the assignee of this task.Jul 19 2023, 7:34 AM
Sfaci subscribed.

Change 942387 had a related patch set uploaded (by Sg912; author: Sg912):

[generated-data-platform/aqs/edit-analytics@main] api specs and docs

https://gerrit.wikimedia.org/r/942387

SGupta-WMF changed the task status from Open to In Progress.Jul 27 2023, 10:45 AM
SGupta-WMF reassigned this task from SGupta-WMF to Sfaci.
SGupta-WMF subscribed.

Thanks for the ping! Review submitted ✅

Change 942387 merged by Sg912:

[generated-data-platform/aqs/edit-analytics@main] api specs and docs

https://gerrit.wikimedia.org/r/942387