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
This is driving me nuts as well because I'm trying to wrap an API that looks like www.example.com/:organization_id/projects.json so I need to be able to set www.example.com/:organization_id as the base URL on the creation of the Client and just have things like "projects.json" as the path on the resource.
The problem is my connection url keeps getting stripped down to www.example.com when the Client gets created. 😠
There's another related issue. If your base API URL is like http://example.com/api, and your resources are like http://example.com/api/v1/things, then you can't define actions like this: GET v1/things because EndpointResolver inserts a leading slash /v1/things, which makes Faraday neglect the /api part of the API URL (described in lostisland/faraday#293).
I think this needs to be solved in this gem. A workaround is to define your base URL like this: http://example.com and define actions like this: GET /api/v1/things.
I'm working against a third-party API that barfs if the URL doesn't have a trailing slash on it. I see that this is handled by
EndpointResolver
(https://github.com/digitalocean/resource_kit/blob/master/lib/resource_kit/endpoint_resolver.rb#L30) and am wondering if it's a necessity or if a patch to leave a trailing slash if it exists it would be accepted?The text was updated successfully, but these errors were encountered: