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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba928de33de614e4662a736a8468d4d0904aa661d6980e430a5139deba87ebd9 |
|
MD5 | 4b7e0bd4396e668e51dc05120241dce0 |
|
BLAKE2b-256 | c49ad54096ff31c5d65216302d97a9fb71c0b00c49f70a230ac50cf6a717e206 |
Close
Hashes for fastapi_restful_rsp-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbfc71212cd805adcfff3f94f763e526dc25065df4507d18dee8ef3ec3dcc07c |
|
MD5 | 79d9e9176f9071579d185de271e68013 |
|
BLAKE2b-256 | baf3d6ef36cad7e38489543658ece91895dd79692645015d8bedcd9587f3d01f |