Extend OpenAPI schema to collect HTTPExceptions.
Project description
FastAPI Responses
This package is not stable. Do not use in production!
The goal of this package is to have your responses up-to-date according to your exceptions.
Installation
pip install fastapi-responses
Usage
from fastapi import FastAPI, HTTPException
from fastapi_responses import custom_openapi
app = FastAPI()
app.openapi = custom_openapi
@app.get("/{item_id}")
def get_item(item_id: int):
if item_id == 0:
raise HTTPException(status_code=404, detail="Item not found.")
return "Item exists!"
license
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fastapi_responses-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87eb4f7389910ec010a11cc1634acdad10987f58867a3ec59959da420b347cc |
|
MD5 | d1c5db55272a002c5ca4b30e003bdb41 |
|
BLAKE2b-256 | da73c71b419dbe5cb9d41f6f84141ae03bc940db909d4d233efd67c6df972e94 |