ooni / devops

0 stars 1 forks source link

Implement consolidation of apidocs for OONI Services #26

Open hellais opened 8 months ago

hellais commented 8 months ago

Service docs are available at the direct endpoint address like this:

We should implement a service that merges together all the openapi specs into a single one that can be viewed by accessing:

hellais commented 1 month ago

One approach to doing this could be to make this be part of the docs generation process and publish them on docs.ooni.org.

It's possible to extract the openapi specifications using:

from fastapi.openapi.utils import get_openapi
from .main import app
from .__about__ import VERSION

openapi = get_openapi(title="OONI Findings", version=VERSION, routes=app.routes)
print(openapi)

And then apply some merging logic to build the composite json file which can then be served on starlight using something like: https://starlight-openapi.vercel.app/