Metadata-Version: 2.4
Name: fastapi-rapidoc-router
Version: 0.1.2
Summary: Simple reusable RapiDoc router for FastAPI OpenAPI specs
Keywords: fastapi,rapidoc,openapi,docs
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Framework :: FastAPI
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.100.0

# fastapi-rapidoc-router

[![PyPI version](https://img.shields.io/pypi/v/fastapi-rapidoc-router.svg)](https://pypi.org/project/fastapi-rapidoc-router/)

Simple reusable RapiDoc router for FastAPI projects.

PyPI: https://pypi.org/project/fastapi-rapidoc-router/

## Install

```bash
pip install fastapi-rapidoc-router
```

## Development Install

From local source:

```bash
pip install -e .
```

Or from a Git repository:

```bash
pip install git+https://github.com/<your-org>/<your-repo>.git
```

## Usage

```python
from fastapi import FastAPI
from rapidoc_fastapi import mount_rapidoc

app = FastAPI(docs_url=None, redoc_url=None)

@app.get("/health")
def health() -> dict[str, str]:
    return {"status": "ok"}

mount_rapidoc(app, docs_path="/docs", title="My API Docs")
```

## Router API

```python
from rapidoc_fastapi import create_rapidoc_router

router = create_rapidoc_router(
    docs_path="/docs",
    openapi_url="/openapi.json",
    title="My API Docs",
)

app.include_router(router)
```

## Notes

- `docs_path` controls where RapiDoc UI is served.
- `openapi_url` defaults to the app OpenAPI endpoint.
- This package uses the official RapiDoc script from CDN by default.
