swagger-api / swagger-play

Apache License 2.0
330 stars 181 forks source link

Fixed to avoid changing Endpoint API if basePath exists in the middle or as part #165

Closed ram-ds closed 6 years ago

ram-ds commented 6 years ago

Issue - When setting the basePath (for example to /api) and if you had a Endpoint API that contains the string of basePath in the middle or part of the path (examples: /documentapi or /doc/api/{id}) generated swagger json is creating these example api's as (/document; /doc//{id})

Changes - modified to replace the basePath if it exists in the beginning of the Endpoint API only and not modify the EndPoint path. Modified test code to verify the behavior when basePath exists as part of Endpoint API and as part of the string.

ram-ds commented 6 years ago

@fehguy Hi Tony, wondering if I can get a review on this PR?

fehguy commented 6 years ago

Hey @ram-ds I'm sorry but I no longer have commit rights on this project. What you did makes sense to me from glancing at it, FWIW

ram-ds commented 6 years ago

@fehguy Thanks for your reivew.