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

Breaking change in ra-data-json-server between 2.7.0 and 2.7.3 #2965

Closed
ghost opened this issue Mar 6, 2019 · 6 comments
Closed

Breaking change in ra-data-json-server between 2.7.0 and 2.7.3 #2965

ghost opened this issue Mar 6, 2019 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 6, 2019

What you were expecting:
I am not sure if you're following Semver, but if you are - somewhere between version 2.7.0 and 2.7.3, ra-data-json-server caused a breaking change, with this commit, because it no longer sends the id_like parameter, instead it sends the resources id field to get related resources.

Also, instead of a list of ids separated by a pipe (|) character, it now sends the same parameter twice when it wants to get more than one resource item, e.g. to get category 8 and category 203 it sends http://localhost:9000/admin/categories?id=8&id=203 instead of http://localhost:9000/admin/categories?id_like=8%7C203

What happened instead:
Semver wasn't used.

Steps to reproduce:
Install the newest version 2.7.3 after being on 2.7.0.

Related code:
none

Other information:
none

Environment

  • React-admin version: 2.7.3
  • Last version that did not exhibit the issue (if applicable): 2.7.0
  • React version: 16.8.4
  • Browser: N/A
  • Stack trace (in case of a JS error): N/A
@Kmaschta
Copy link
Contributor

Kmaschta commented Mar 6, 2019

We do our best to follow semver and try not to break things between versions.

Sorry for that, and thanks for reporting the issue!

@fzaninotto
Copy link
Member

I disagree that this is a breaking change. The ra-data-json-server adapter is designed to work against jsonServer. The patch you're referring to is part of a bugfix (cf #2873) designed to make ra-data-json-server work better against jsonServer.

Now if you're using this adapter against another server, that's at your own risk, and it's not something we support.

I apologize if the update broke your app, but you made the wrong assumption about the adapter you picked up.

@ghost
Copy link
Author

ghost commented Mar 7, 2019

No problem. I wasn't waiting for a fix and I already forked it and fixed it myself. I actually just chose ra-data-json-server because it was the simplest implementation that worked well with Swagger. Thanks!

@jheiska
Copy link

jheiska commented Apr 3, 2019

I have a problem with the new parameter format, and was wondering if it's just a problem with my data provider or does anyone else experience this?
If I use a ReferenceField and there happens to be only one id referenced, the request is naturally made with a single id, resulting in a similar request to a GET_ONE. The problem is, GET_MANY is expecting an array and GET_ONE returns only a single resource, thus resulting in a data provider error.
EDIT: I use asp.net webapi and address/resource/1 and address/resource?id=1 are interpreted as similar requests.

@Kmaschta
Copy link
Contributor

Kmaschta commented Apr 4, 2019

No one will get attention to your question on a closed issue, prefer to ask it on Stack OverFlow.

@ghost
Copy link
Author

ghost commented Apr 4, 2019

@jheiska The ra-data-json-server is just one file, so it's easy to bring into your project if you want to use the previous version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants