flask-restx icon indicating copy to clipboard operation
flask-restx copied to clipboard

Added support for empty JSON arguments

Open axc450 opened this issue 2 years ago • 0 comments

Adds support for empty JSON body inputs in the generated Swagger documentation:

image

The code is essentially just ignoring any arguments with a None name, so if it is the sole argument you can have an empty input:

empty_json_parser = RequestParser()
empty_json_parser.add_argument(None, location="json")

If there is a better way to do this or it is already supported, please let me know!

axc450 avatar Feb 17 '23 15:02 axc450