question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

validateResponseFormat triggers error when calling a dataProvider custom method

See original GitHub issue

If 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:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fzaninottocommented, Sep 8, 2022

Sure, please do!

1reaction
septentrion-730ncommented, Aug 19, 2022

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found