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

Issues with multiple end points with similar names

Open soulscreme opened this issue 10 years ago • 3 comments

I have upgraded from 0.12 to 0.15 and am seeing some breakage. I have multiple endpoints with similar paths as such:

#fanfeed endpoints
api.add_resource(feeditems.GetFanFeed, '/api/feeditems/<string:showId>/<string:catname>/<string:modified>')
api.add_resource(feeditems.PostFeedItem, '/api/feeditems')
api.add_resource(feeditems.UpdateFeedItem, '/api/feeditems', '/api/feeditems/<string:uuid>')
api.add_resource(feeditems.DeleteFeedItem, '/api/feeditems/<string:showid>/<string:uuid>')

When processing the second add to the API I get the following exception:

ValueError: This endpoint (/api/feeditems/help) is already set to the class SwaggerResource.

Is there a simple way to resolve this? I moved to 0.15 from 0.12 due to come issued with using the "Try it out!" button with posts containing both a JSON request body and query parameters arising from swagger-ui itself.. Might 0.14 or 0.13 be a better option to avoid both issues?

soulscreme avatar Nov 06 '14 17:11 soulscreme

I had a similar problem but it was a result of me calling add_resource more than once. Stepping through with pdb helped me to get it sorted out. I didn't dig through the change lists but it seems possible that only registering each endpoint one time was added recently

BrettHolton avatar Dec 17 '14 16:12 BrettHolton

Hi, I have the same issue like soulscreme. Does anyone has an idea on how to fix the issue please? Thankks and regards

allaok avatar Jul 08 '15 15:07 allaok

Hi, I have fixed this issue in https://github.com/rantav/flask-restful-swagger/pull/92 .

flexme avatar Mar 02 '16 04:03 flexme