flask-restful-swagger
flask-restful-swagger copied to clipboard
[Question] How can I set an example value?
I'm doing an auth service
my Register endpoint looks like:
class Register(Resource):
@swagger.operation(
notes='Register a new User',
responseClass=SwaggerUserModel.__name__,
nickname='create',
parameters=[
{
"name": "body",
"description": "This should send {"name", "password"}",
"required": True,
"allowMultiple": False,
"dataType": SwaggerUserModel.__name__,
"paramType": "body",
"exampleValue": fake_auth_register_form
}
])
def post(self):
data = parser.parse_args()
when I get the swagger ui it only shows me the body as an empty field, but I want to get a filled value to only press the button of "Try it out!" not having an empty one
I'd like to find out if we aren't meeting the spec here, did you have any luck with this?
try replace "exampleValue" to "defaultValue", it works for me.