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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0456d1aff7a65af0514efbad53238d495f62c7ebfce26856b99c2f8eebcc8445 |
|
MD5 | ab4fbb99f7c132d0bb80fa1ae12f5198 |
|
BLAKE2b-256 | 5c6749d812a3ce42e233efbf2c2b186f92904b3815d5169695a092db095bf478 |
Close
Hashes for fastapi_restful_rsp-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 082d2c4de03a609672833d539f81124c8a0fbf7b228c8e5d2465c924aae142f2 |
|
MD5 | 0b0d58acc3b23cc65b713a844cd9ca98 |
|
BLAKE2b-256 | 52b2fae392111ba06b5d2706554e33e05aebd77d94887351743b99c95fb918f7 |