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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb80612d57e105b213db977b2a311612c6829f028bbbf3131f7f3b5487a5c5b8 |
|
MD5 | be1670bc26a301d39fbb15d6411dd632 |
|
BLAKE2b-256 | 10f9ae1c12cbe79bf4399c867b5c39da6ee1b1fccd2351bc96efbab0d777a13a |
Close
Hashes for fastapi_restful_rsp-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07e3c34ea3f3975a2ef36d666012423f94662a5fb8fdf3dacfd2a7076c967198 |
|
MD5 | 8b0af30e7049ccc788d5e009caadbf53 |
|
BLAKE2b-256 | c23b690ee378373004521fcf062400b36d4e646d83cc115c20da283f6bd492e5 |