No project description provided
Project description
Wrap fastapi endpoints with RESTful API
Modern frontend frameworks encourage backend developers to follow RESTful API design. This package wraps fastapi endpoints with following structure:
{
"data": {
...
},
"code": 200,
"message": ""
}
and modify fastapi generated OpenAPI documentation to reflect the change.
Installation
pip install fastapi-restful-rsp
Usage
from fastapi import FastAPI
from fastapi_restful_rsp import restful_response
app = FastAPI()
@app.get("/foo/")
@restful_response
def foo()-> str:
return "Hello World"
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_restful_rsp-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b7bdffe83ab40942d38ad5477805e2b4899892701436ec56f03461b89bb820d |
|
MD5 | d2c1b32e978d7299f7734a0ae7460c3a |
|
BLAKE2b-256 | 650de3029bd8270fc5596bb68cbb28fc1f85dd8d15bbc5982c3c7baebaa57645 |
Close
Hashes for fastapi_restful_rsp-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a16971de75a5ccf71ef282d9edc074d7265a039c42b56bb28ab708e59f02ecd |
|
MD5 | e3c1de16bfcf3f225bfcb8787ee36ded |
|
BLAKE2b-256 | 3547ec59f4cde8335db974f4c51e7090fd79b061f7b8abbf62916c821d404226 |