Skip to content

Add option to use service for invalid data handling #2

Description

@fesor

We already have interface ErrorResponseProvider. So it will be cool to allow use of service for this.

In case of validation errors responsibility of generating response should be:

  • Target action if `` is required as one of arguments. In that case action responsible for handling errors.
public function someAction(SomeRequest $request, ConstraintViolationList $errors) 
{
     // handle manually
}
  • Request object implements ErrorResponseProvider interface. In that case request object is responsible to provide error response.
  • Implementation of ErrorResponseProvider as a service.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions