Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Bulk Create / Update Entities: Multiple Bean Validation violations are only shown for one of the entities #47

Closed
mariodavid opened this issue Mar 8, 2021 · 1 comment
Assignees
Milestone

Comments

@mariodavid
Copy link
Contributor

mariodavid commented Mar 8, 2021

GIven the following request:

POST {{baseUrl}}
         /entities
         /rstex11_Customer
Authorization: Bearer {{auth_token}}

[
  {
    "name": null
  },
  {
    "name": null
  }
]

Note: The name is a required field for the Customer entity.

The following response is created:

HTTP/1.1 400 

[
  {
    "message": "may not be null",
    "messageTemplate": "{javax.validation.constraints.NotNull.message}",
    "path": "name",
    "invalidValue": null
  }
]

Expected behavior:

Example:

HTTP/1.1 400 

[
  {
    "message": "may not be null",
    "messageTemplate": "{javax.validation.constraints.NotNull.message}",
    "path": ".[0].name",
    "invalidValue": null
  },
  {
    "message": "may not be null",
    "messageTemplate": "{javax.validation.constraints.NotNull.message}",
    "path": ".[1].name",
    "invalidValue": null
  }
]

NOTE: I have only tested it for creating entities, but I strongly assume that the endpoint behalves similar in the bulk update case, as the behavior seems to be related to the bean validation.

@mariodavid mariodavid changed the title Bulk Create Entities: Multiple Bean Validation violations are only shown for one of the entities Bulk Create / Update Entities: Multiple Bean Validation violations are only shown for one of the entities Mar 8, 2021
@gorbunkov gorbunkov added this to the 1.1.0 milestone Aug 10, 2021
Desire456 added a commit that referenced this issue Aug 18, 2021
@Desire456
Copy link
Contributor

After #78 resolved need to reuse the validation fragment for a bulk update too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants