How to specify json data input in docs for request? #7620
Replies: 5 comments
-
Shouldn't this
be this
I don't think you need |
Beta Was this translation helpful? Give feedback.
-
Then the await request.json() won't work since request is just Input and not a starlette.requests.Request |
Beta Was this translation helpful? Give feedback.
-
@Shane-Neeley
fastapi will take care of deserializing the body into |
Beta Was this translation helpful? Give feedback.
-
That did the trick. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help here everyone! 🍰 Thanks @Shane-Neeley for reporting back and closing the issue 👍 |
Beta Was this translation helpful? Give feedback.
-
Question
How can I make my Input parameters show up in the swagger docs for a JSON request? I make requests like this ...
curl 'http://127.0.0.1:5000/predict' -H "Content-Type: application/json" --data '{"data": ["string1", "string2"]}'
Swagger docs without input parameters
I would like this to show the input schema so the user knows they're supposed to POST with
{"data": [list of strings])
Beta Was this translation helpful? Give feedback.
All reactions