validateResponseFormat triggers error when calling a dataProvider custom method
See original GitHub issueIf you implement a data provider with a custom method, then call that method as documented here then validateResponseFormat()
throws an error if the returned object doesn’t contain a ‘data’ key
The response to 'action' must be like { data: ... }, but the received response does not have a 'data' key. The dataProvider is probably wrong for 'action'.
I think if it’s a custom method, there should not be any validation of the returned object (how could react-admin know?)
Otherwise, maybe the type of DataProvider
should be typed better than [key: string]: any
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
react-admin: ERROR: The dataProvider threw an error. It ...
The dataProvider threw an error. It should return a rejected Promise instead. This is the getList function of my custom dataprovider:
Read more >React-admin - Using Data Providers - Marmelab
Here is how this Data Provider maps react-admin calls to API calls: ... Check the Calling Custom Methods documentation for more details.
Read more >7 Using Data Providers to Retrieve Data - Oracle Help Center
When you select Custom, the Provider Class field is enabled because you must supply the class name of the custom adapter that you...
Read more >react-admin - bytemeta
Data Provider Image Upload Example - Undefined from params.data · validateResponseFormat triggers error when calling a dataProvider custom method.
Read more >How to Change a Test Name When Using TestNG DataProvider
One of the great features of TestNG is DataProvider. TestNG DataProvider provides a way to run one test with different data with multiplying ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sure, please do!
Thanks for your pertinent report.
IMHO,
validateResponseFormat()
should be perfectly un-opinionated about custom methods and we should harmonize the documentation and types accordingly. Change would not introduce breaking changes as it lower data requirements.Feedback on this topic will be very gladly welcomed!