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
I have a custom validation function for a RequestParser argument. And I use the parser object to pass its arguments to spec. But unfortunately, it seems that the library does not support custom types input types e.g
defone_character_string(value):
"""One character string parameter validator"""ifisinstance(value, str) andlen(value) ==1:
returnvalueelse:
raiseValueError(
"The parameter '{}' should be a single character length".format(
value))
.....
fromflask_restfulimportreqparseparser=reqparse.RequestParser()
parser.add_argument(
'customInput', type=one_character_string,
help='String value expected', required=False)
I am getting the following exception
File "/usr/local/lib/python3.5/dist-packages/flask_restful_swagger_2/init.py", line 271, in get_swagger_arg_type
elif issubclass(type, basestring):
TypeError: issubclass() arg 1 must be a class
The text was updated successfully, but these errors were encountered:
I have a custom validation function for a RequestParser argument. And I use the parser object to pass its arguments to spec. But unfortunately, it seems that the library does not support custom types input types e.g
I am getting the following exception
The text was updated successfully, but these errors were encountered: