Page MenuHomePhabricator

AQS 2.0: Editor 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 editors/aggregate
  • Document editors/top-by-edits
  • Document editors/top-by-net-bytes-difference
  • Document editors/top-by-absolute-bytes-difference
  • Document registered_users/new
  • Adding OpenAPI spec endpoint

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 changed the task status from Open to In Progress.Jun 20 2023, 8:03 AM
Sfaci changed the task status from In Progress to Open.
Sfaci triaged this task as Medium priority.
Sfaci edited projects, added AQS2.0 (Sprint 10); removed AQS2.0.

Change 930760 had a related patch set uploaded (by Santiago Faci; author: Santiago Faci):

[generated-data-platform/aqs/editor-analytics@main] all endpoints implemented

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

Change 930760 merged by Santiago Faci:

[generated-data-platform/aqs/editor-analytics@main] all endpoints implemented

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

After the last merge (that includes endpoints + unit tests + integration tests + doc + spec endpoint) some refactoring about common Druid code must be done. Moving to "Next Up" to keep working on that.

SGupta-WMF changed the task status from Open to In Progress.Jul 21 2023, 11:56 AM
SGupta-WMF removed subscribers: FGoodwin, codebug, Atieno.
apaskulin subscribed.