You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@app.doc(responses={200: 'Data Init Complete', 400: 'Invalid Key'}) def init_data(key): if key == Config.init_key: logger.info('Key is Valid') data_obj.init_data() ret = {'message': 'Data Init Complete'} return jsonify(ret) else: raise InvalidUsage('Invalid Key', 400)
In this code, I have more than one response code. 200 and 400. How do I set the example output for the 400? When I use the output decorator, it only takes the first one. Am I missing something on how to do this? is this not common?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@app.doc(responses={200: 'Data Init Complete', 400: 'Invalid Key'}) def init_data(key): if key == Config.init_key: logger.info('Key is Valid') data_obj.init_data() ret = {'message': 'Data Init Complete'} return jsonify(ret) else: raise InvalidUsage('Invalid Key', 400)
In this code, I have more than one response code. 200 and 400. How do I set the example output for the 400? When I use the output decorator, it only takes the first one. Am I missing something on how to do this? is this not common?
Beta Was this translation helpful? Give feedback.
All reactions