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
My API base URL is something like this https://example.com/api/v5/ and Retrofit required "/" at the end of the base URL.
Since the plugin add "/" to API @GET("/something") so it goes to @GET("/something"): https://example.com/something
BUT actually, it should go to https://example.com/api/v5/something which means the API interface should remove "/" @GET("something") . I removed "/" manually and the generated SDK working fine.
How can I resolve this rather modify the generated APIs manually?
NB:
Add trailing slash to base URL, remove leading slash from relative URL.
Just one question, do you have the "basePath" specified in your Swagger file?
Ideally we could remove the trailing slashes for Swagger files that specifies a basePath.
When generating Retrofit interfaces, we need to remove the leading
slash from the generated path. Having a leading slash will force
the path to be absolute for the host and will make URLs like:
https://petstore.swagger.io/v2/
impossible to call.
Fixes#49
@cortinico This is with regards to #46 ,
My API base URL is something like this
https://example.com/api/v5/
and Retrofit required "/" at the end of the base URL.Since the plugin add "/" to API
@GET("/something")
so it goes to@GET("/something"): https://example.com/something
BUT actually, it should go to
https://example.com/api/v5/something
which means the API interface should remove "/"@GET("something")
. I removed "/" manually and the generated SDK working fine.How can I resolve this rather modify the generated APIs manually?
NB:
square/retrofit#907 (comment)
The text was updated successfully, but these errors were encountered: