Skip to main content

Simple reusable RapiDoc router for FastAPI OpenAPI specs

Project description

fastapi-rapidoc-router

Simple reusable RapiDoc router for FastAPI projects.

Install

pip install .

Or from a Git repository:

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

Usage

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_rapidoc_router-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_rapidoc_router-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_rapidoc_router-0.1.0.tar.gz.

File metadata

  • Download URL: fastapi_rapidoc_router-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastapi_rapidoc_router-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cba8540a4d1c92e9279a2b4b3a9d172255acba1a12e52661f17c8c6e106bbea2
MD5 cc0d69499a13d70ad63c57627928fc30
BLAKE2b-256 4f0305ab0824449f15728ee11fbad976cff8bb1796189edb95bceda97dd7cf3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_rapidoc_router-0.1.0.tar.gz:

Publisher: publish-pypi.yml on Kinjalrk2k/rapidoc-fastapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_rapidoc_router-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_rapidoc_router-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e57c0a21b35aa73604472b662f71f832cebf73a89713b390eab9aa5916e8a0ee
MD5 b9c8d6b933293e0533398e0f8caab20d
BLAKE2b-256 ce2e965aefe5b19e2b27da58a6b1940635a02f7fb9a8a2df14122501a9c016d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_rapidoc_router-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Kinjalrk2k/rapidoc-fastapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page