【文件属性】:
文件名称:fastapi-jsonrpc:基于fastapi的JSON-RPC服务器
文件大小:206KB
文件格式:ZIP
更新时间:2021-05-25 18:27:26
swagger openapi json-rpc json-rpc-server asgi
描述
基于fastapi的JSON-RPC服务器:
动机
自动生成的JSON-RPC的OpenAPI和Swagger (感谢fastapi)!!!
安装
pip install fastapi-jsonrpc
文献资料
阅读FastAPI文档,并在下面查看用法示例
简单用法示例
pip install uvicorn
example1.py
import fastapi_jsonrpc as jsonrpc
from pydantic import BaseModel
from fastapi import Body
app = jsonrpc . API ()
api_v1 = jsonrpc . Entrypoint ( '/api/v1/jsonrpc' )
class MyError ( jsonrpc . BaseError ):
CODE = 5000
M
【文件预览】:
fastapi-jsonrpc-master
----README.rst(7KB)
----poetry.lock(53KB)
----example1.py(642B)
----fastapi_jsonrpc()
--------__init__.py(41KB)
----images()
--------fastapi-jsonrpc.png(166KB)
----README.src.rst(1KB)
----example2.py(4KB)
----setup.py(1KB)
----tests()
--------test_dependencies.py(2KB)
--------test_sub_response.py(2KB)
--------test_jsonrpc_request_id.py(975B)
--------test_middlewares_exc_exit.py(4KB)
--------test_middlewares.py(13KB)
--------test_shared_model.py(25KB)
--------test_http_exception.py(3KB)
--------test_jsonrpc_method.py(1KB)
--------test_openapi.py(21KB)
--------test_http_auth.py(3KB)
--------conftest.py(2KB)
--------test_dependencies_yield.py(2KB)
--------test_middlewares_exc_enter.py(3KB)
--------test_http_auth_shared_deps.py(2KB)
--------test_params.py(22KB)
--------test_openapi_dependencies.py(26KB)
--------test_jsonrpc.py(8KB)
----.gitignore(2KB)
----pyproject.toml(911B)