api-platform/admin

Validation errors are shown as "Server communication error"

denisvmedia opened this issue · 6 comments

API Platform version(s) affected: 3.4.3

Description

I'm trying to submit a form that returns validation errors. The errors are properly highlighted in the form, but the main message says "Server communication error" (which is confusing).

Hydra response has proper fields set:

@context: "/api/contexts/ConstraintViolationList"
@type: "ConstraintViolationList"
hydra:title: "An error occurred"
hydra:description: "purchasePrice: A valid number is expected\ncurrentValue: A valid number is expected"

How to reproduce

Just use Hydra and submit a form with a server-side validation failure.

Possible Solution

I think, hydra:title (and maybe hydra:description) should be used instead of Server communication error message. And in general, 4xx statuses are probably not server communication errors.

Additional Context

This can be also seen on the official Admin demo:

image

@denisvmedia did you managed to solve it? We are facing the same problem.

@papppeter honestly, I don't remember now. But most likely not. Unfortunately, this project seems to be rather dead than alive.

@alanpoulain do you have maybe any suggestion here? it would be really nice to see if this package is still alive?

Or is there any other hydra data provider to react admin on github to use?

s-fog commented

Please, maybe someone fix this issue ?

s-fog commented

Merge request still not is repository :(

Thanks!