EPMOSDU-1635-Donate-fix-for-order-error-messages

Description

What is the problem?
If the same request send several times, the response may differ.

First example:

first response

Second example:

second response

How to reproduce?

curl --location --request PATCH 'https://osdu.demo.slbn-oaap.projects.epam.com/api/storage/v2/records' \--header 'data-partition-id: osdu' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "ops": [ ]}'

Why this is happening?

After the process of an object's validation is triggered, the Jakarta Validation framework stores the error messages in a Set.
Retrieving objects from a Set could be done only in unordered manner. This is an expected and standard way of validation flow.
But the Quality Assurance engineers want some predictability.

image

How to fix it?

To bring an order to the displaying of error messages in a Response to a client a sorting feature for error messages was added.

image

Does this introduce a breaking change?

No

Edited by Vladimir Korolevskii (EPAM)

Merge request reports

Loading