Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow empty/null type path ? #2844

Closed
vinilios opened this issue Mar 9, 2015 · 3 comments
Closed

Allow empty/null type path ? #2844

vinilios opened this issue Mar 9, 2015 · 3 comments

Comments

@vinilios
Copy link
Contributor

vinilios commented Mar 9, 2015

The current default behaviour of rest adapter buildURL method appends the result of pathForType for the given type and joins it along with other params in order to construct the final resource request url. In case pathForType returns an empty or null value (this could be a case for an API which serve a resource results from the root url) the resulted url will contain an additional slash causing issues if such urls are not handled server-side.

[host, typePath, id].join("/") // result is host.com/api/v1//id for null/empty typePath

Is this a case that you would consider ember-data should deal with ? The change is trivial, i could provide a PR including the corresponding tests, but i'm not sure what kind of side-effects and/or backwards compatible issues such a change might cause.

@bmac
Copy link
Member

bmac commented Mar 26, 2015

@vinilios if you'd like to submit a pr for this feature then go for it.

vinilios added a commit to vinilios/data that referenced this issue Mar 27, 2015
handle empty values returned by pathForType in buildURL method of
the build url mixin.

refs emberjs#2844
vinilios added a commit to vinilios/data that referenced this issue Mar 27, 2015
handle empty values returned by pathForType in buildURL method of
the build url mixin.

refs emberjs#2844
vinilios added a commit to vinilios/data that referenced this issue Mar 27, 2015
handle empty values returned by pathForType in buildURL method of
the build url mixin.

refs emberjs#2844
@vinilios
Copy link
Contributor Author

do i have to branch ?

vinilios added a commit to vinilios/data that referenced this issue Mar 30, 2015
handle empty values returned by pathForType in buildURL method of
the build url mixin.

refs emberjs#2844
@bmac
Copy link
Member

bmac commented Apr 1, 2015

Closed by #2946.

@bmac bmac closed this as completed Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants