Page MenuHomePhabricator

AQS 2.0: Unique Devices: 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 /:project/:access-site/:granularity/:start/:end
  • Review

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

Change 862252 had a related patch set uploaded (by Atieno; author: WQuarshie):

[generated-data-platform/aqs/device_analytics@main] T317721:Open spec api

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

Test status: QA PASS

This looks good. Clearly defines the schema, the definitions with the data types and response type

Change 862252 merged by BPirkle:

[generated-data-platform/aqs/device_analytics@main] T317721:Open spec api

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

Change 866630 had a related patch set uploaded (by Alex Paskulin; author: Alex Paskulin):

[generated-data-platform/aqs/device_analytics@main] docs: Add endpoint docs

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

Change 866630 merged by BPirkle:

[generated-data-platform/aqs/device_analytics@main] docs: Add endpoint docs

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