what is the best approach to customize base url with subfolder?

61 views
Skip to first unread message

Frank He

unread,
Mar 21, 2015, 2:16:51 AM3/21/15
to swagger-sw...@googlegroups.com
It seemed Swagger will create ajax end point by adding url to base URL.
But what is the best approach to customize base URL?
For example:
Our api-docs is here: http://www.example.com/swagger/api-docs
And our api is v0/users, so the final URL for api should be http://www.example.com/swagger/v0/users
But when I test swagger, I noticed it is this way: http://www.example.com/v0/users
the subfolder is removed, just appending URL to root.
Can anyone help to point out what is best approach to customize base URL?
Thanks

tony tam

unread,
Mar 23, 2015, 12:15:26 AM3/23/15
to swagger-sw...@googlegroups.com
Hi Frank, what framework/library are you using?  Makes a big difference in the diagnostics.

Frank He

unread,
Mar 23, 2015, 11:51:20 AM3/23/15
to swagger-sw...@googlegroups.com
I am using swagger ui,

swagger-ui

Ron Ratovsky

unread,
Mar 26, 2015, 4:23:58 PM3/26/15
to swagger-sw...@googlegroups.com
Hi Frank,

It basically depends on the basePath definition in your api declarations. You need to check it and modify it so that works properly.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------
Reply all
Reply to author
Forward
0 new messages