You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 21, 2023. It is now read-only.
public final class ErrorCodes {
public static final String PROPERTY_SHOULD_NOT_BE_EMPTY = "PROPERTY_SHOULD_NOT_BE_EMPTY";
public static final String PROPERTY_IS_NOT_EMAIL = "PROPERTY_IS_NOT_EMAIL";
}
If I test this with the 4 fields of UserCreationParameters empty, I only get 1 item in the errors array:
I checked in SpringValidationWebErrorHandler and there are 4 errors in the BindingResult. However, since they map to the same key and they are put in a Set only 1 remains.
It is possible to support re-use of error codes to avoid having a lot of nearly the same translations of the error codes to error messages? I wrote a custom HttpErrorAttributesAdapter to add the name of the property in the resulting JSON so I can have the same error codes.