Skip to content

Validation errors are shown as "Server communication error" #488

@denisvmedia

Description

@denisvmedia

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions