mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Create dict for the fields in the error response.
This commit is contained in:
@@ -15,6 +15,8 @@ def build_error_message(errors, schema):
|
||||
for e in errors:
|
||||
field = "'{}' {}".format(e.path[0], e.schema.get('validationMessage')) if e.schema.get(
|
||||
'validationMessage') else e.message
|
||||
s = field.split("'")
|
||||
field = {s[1]: s[2].strip()}
|
||||
fields.append(field)
|
||||
message = {
|
||||
"code": "1001",
|
||||
|
||||
Reference in New Issue
Block a user