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
Sorry if this question has been answered several times, but I'm struggling to figure out which method I need to use to add "help" documentation to namespace.route path strings.
I also want to be able to customise the text in the text-field box shown on the rendered page, both for the documented path strings and a parser object
Here is my minimal code
fromflaskimportFlaskfromflask_restplusimportApi, Resource, reqparseapplication=Flask(__name__)
api=Api(app=application)
parser=reqparse.RequestParser()
parser.add_argument('content-type',
type=str,
help='my helpful text',
location='form')
name_space=api.namespace('name', description='Return a name provided by the user')
@name_space.route("<string:name>") # I WANT TO ADD HELP TEXT; PATH AND REQUIREDclassNameClass(Resource):
@api.doc(parser=parser) # WORKS BUT I WANT TO SPECIFY THE TEXT IN THE BOXdefget(self, name):
args=parser.parse_args()
return {
"My name is" : name,
"args": args# WORKS
}
# Allows app to be run in debug modeif__name__=='__main__':
application.debug=Trueapplication.run(host="127.0.0.1", port=5000)
I have annotated the sections I need help with
Many thanks
The text was updated successfully, but these errors were encountered:
Hi,
Sorry if this question has been answered several times, but I'm struggling to figure out which method I need to use to add "help" documentation to namespace.route path strings.
I also want to be able to customise the text in the text-field box shown on the rendered page, both for the documented path strings and a parser object
Here is my minimal code
I have annotated the sections I need help with
Many thanks
The text was updated successfully, but these errors were encountered: