fastapi-jsonrpc
fastapi-jsonrpc copied to clipboard
Allow using routers to split the code
Hi,
Fastapi offers a router functionality detailed here. It can be really useful to split the methods into many files.
It would be nice to be able to do the same things with the JSONRPC methods.
Currently, since Entrypoint inherits from fastapi's APIRouter, trying to bind another Entrypoint with the same path won't allow access to the methods from the second Entrypoint.
There should be a way to bind 2 Entrypoint with the same path to one app, allowing both of their methods to be considered.
Really great library btw, good work!
I can work on this and submit a PR, but first I wanted to know if this was relevant and if I hadn't missed an obvious way to do it.
Hi! Yea, here is no way to make it
I'm using app.include_router to add routes to Swagger from other FastAPI application, but this does not work for fastapi_jsonrpc.API object.
I hope it can be easly fixed.
And i think re-bind with same path it's bad idea. We should use include_router logic as described in fastapi link you posted above
Split across files
https://github.com/smagafurov/fastapi-jsonrpc/pull/28#issuecomment-1001257343