flask-restful-swagger icon indicating copy to clipboard operation
flask-restful-swagger copied to clipboard

Not working when I try to import a list of paramdict defined in different file.

Open shanushaan opened this issue 8 years ago • 0 comments

I am using the project to generate the swagger UI with the params in my url, but all the params are not visible in Swagger UI. only the param variables defined in url are visible. In docs.py I am making a list of dict of parameters as lot of params are repeated. Below is the skelton code.

docs.py param1Dict = {"name":"param1","description":"abc", "dataType":"string", "paramtype":"query","required":True,"allowMultiple":"false" } param2Dict = {"name":"param2","description":"abc", "dataType":"string", "paramtype":"query","required":False,"allowMultiple":"false" } param3Dict = {"name":"param3","description":"abc", "dataType":"integer", "paramtype":"query","required":True,"allowMultiple":"false" }

url1List =[param1Dict, param2Dict] url2List = [param3Dict] url3List= [param2Dict, .... , paramNDict]

in App,py.

from doc import url1List, url2List, url3List

class A(Resource): @swagger.operation(notes="blah", parameters=url1List) def get(param1): # " Do the task here" return response

what am I doing wrong here ?

shanushaan avatar Jun 22 '17 13:06 shanushaan