fix(spec): validation errors formatting (#9687)

Co-authored-by: Enrico Bottacin <enrico.bottacin@gmail.com>
Co-authored-by: Vladimír Gorej <vladimir.gorej@gmail.com>
This commit is contained in:
Oliwia Rogala
2024-03-13 12:09:52 +01:00
committed by GitHub
parent 8784145185
commit 99bf8fcc19
2 changed files with 58 additions and 4 deletions

View File

@@ -496,11 +496,12 @@ export const validationErrors = (state, pathMethod) => {
paramValues.forEach( (p) => {
let errors = p.get("errors")
if ( errors && errors.count() ) {
errors.forEach( e => result.push(e))
if (errors && errors.count()) {
errors
.map((e) => (Map.isMap(e) ? `${e.get("propKey")}: ${e.get("error")}` : e))
.forEach((e) => result.push(e))
}
})
return result
}