Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement consolidation of apidocs for OONI Services #26

Open
hellais opened this issue Mar 15, 2024 · 1 comment
Open

Implement consolidation of apidocs for OONI Services #26

hellais opened this issue Mar 15, 2024 · 1 comment
Assignees
Labels
enhancement improving existing code or new feature good first issue Good for newcomers priority/low

Comments

@hellais
Copy link
Member

hellais commented Mar 15, 2024

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 hellais added enhancement improving existing code or new feature good first issue Good for newcomers priority/low labels Mar 15, 2024
@hellais
Copy link
Member Author

hellais commented Oct 14, 2024

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improving existing code or new feature good first issue Good for newcomers priority/low
Projects
None yet
Development

No branches or pull requests

2 participants