Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /rubelw_OSSS /tooling /generate_openapi_page.py
| # tooling/generate_openapi_page.py | |
| from pathlib import Path | |
| def main() -> None: | |
| path = Path("docs/api/rest/index.md") | |
| path.parent.mkdir(parents=True, exist_ok=True) | |
| path.write_text( | |
| """# REST API | |
| OSSS exposes a REST/JSON API described by an OpenAPI schema and served via the FastAPI app. | |
| ## Interactive API docs | |
| When OSSS is running, you can browse the live API documentation at: | |
| - FastAPI interactive docs (Swagger UI) at `/docs` | |
| - ReDoc (if enabled) at `/redoc` | |
| These routes are served directly by the FastAPI application. | |
| ## OpenAPI schema | |
| The OpenAPI schema is available at: | |
| - `/openapi.json` from the running backend | |
| - Or as a generated file in the docs build, under `api/python/openapi.json` (exported by the docs tooling) | |
| You can download this schema and use it to: | |
| - Generate client SDKs | |
| - Configure API gateways | |
| - Drive additional documentation tools | |
| ## Authentication | |
| Most endpoints are protected and require an authenticated request: | |
| - Use your configured Keycloak / identity provider to obtain an access token. | |
| - Include the token in the `Authorization: Bearer <token>` header. | |
| ## Rate limiting and usage | |
| OSSS is designed for internal school/district use. If you are exposing the API externally: | |
| - Put OSSS behind a reverse proxy (e.g., NGINX, Envoy). | |
| - Configure any rate limiting and WAF rules at the proxy layer. | |
| - Monitor usage via OSSS audit logs and your infrastructure metrics. | |
| """, | |
| encoding="utf-8", | |
| ) | |
| if __name__ == "__main__": | |
| main() | |
Xet Storage Details
- Size:
- 1.51 kB
- Xet hash:
- 192d76b82c270a30fe3906398b69c3a1d63abd0aac2131164a5d7ceb6ec16dfe
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.