-
Notifications
You must be signed in to change notification settings - Fork 342
Open
Labels
questionFurther information is requestedFurther information is requested
Description
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:
api = Api(app, authorizations=authorizations, security='bearerToken')
request_parser = api.parser()
request_parser.add_argument('input_data', location='json', required=True)
This correctly handles requests of the form:
curl -d '{"input_data": [0.0, 0.5, 1.0]}' -H "Content-Type: application/json" …
and Swagger documentation is generated correctly.
However, I would like the app to respond to simpler requests like:
curl -d '[0.0, 0.5, 1.0]' -H "Content-Type: application/json" …
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 :)
PawelLipski
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested