Hi, I am using flask-restx to build an app which receives a JSON-formatted string via a POST request. Currently, the relevant piece of code in the app reads:
and still have correct Swagger documentation. I know how to do it just by calling request.get_json(), but I'd prefer to use flask-restx. I've gone through the flask-restx docs but couldn't see how to do it. Any pointers will be greatly appreciated :)
Hi, I am using
flask-restx
to build an app which receives a JSON-formatted string via a POST request. Currently, the relevant piece of code in the app reads:This correctly handles requests of the form:
and Swagger documentation is generated correctly.
However, I would like the app to respond to simpler requests like:
and still have correct Swagger documentation. I know how to do it just by calling
request.get_json()
, but I'd prefer to useflask-restx
. I've gone through theflask-restx
docs but couldn't see how to do it. Any pointers will be greatly appreciated :)