You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I want to use you jsonrpc implementation for its numerous benefits, but when I try to combine it with some functions that return JSON strings I cannot seem to get the response configuration right.
When I run it with json return type I get an error, when I try to use a class implementing BaseModel and containing the json element, then it runs the server but responses error the server out.
If you want to see the code, its basically:
which I would be fine removing the json return type, but the value it responds with to the client should absolutely be this json string. I feel that I am missing something, being a beginner at fastapi and your library as well. The code in question can be found here.
The text was updated successfully, but these errors were encountered:
Check how fast API solves this problem. If you want to annotate you return's type you should use def foo() -> dict: (dict = json). So just return a dict from your view and the lib will do its job.
Hint:
It's better to return plain dict from your service function proof_from(), and then return dict from api view.
So I want to use you jsonrpc implementation for its numerous benefits, but when I try to combine it with some functions that return JSON strings I cannot seem to get the response configuration right.
When I run it with json return type I get an error, when I try to use a class implementing BaseModel and containing the json element, then it runs the server but responses error the server out.
If you want to see the code, its basically:
which I would be fine removing the json return type, but the value it responds with to the client should absolutely be this json string. I feel that I am missing something, being a beginner at fastapi and your library as well. The code in question can be found here.
The text was updated successfully, but these errors were encountered: