Closed
Description
Not sure if I should separate these issues, but I can if needed.
- Error Message & Error Path
The current structure for error response varies pretty widely dependent on the error. Is there anyway I can just get the key path that the error occurred and an error message? (like the python implementation of json-schema) If that's not possible, are there any docs on all the possible error response structures? Example:
/*schema being used*/
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "/API/V1/Login/schemas/post.json",
"type" : "object",
"properties" : {
"email" : {
"type" : "string",
"format" : "email"
},
"password" : {
"type": "string",
"minLength": 6
}
},
"required" : ["email", "password"],
"additionalProperties" : false
}
/*bad request recieved*/
{
"password": 1
}
/*library error response using all the available methods on ValidationError class*/
[
{
"pointer": [],
"keyword": "required",
"arguments": {
"missing": "email"
}
},
{
"pointer": [
"password"
],
"keyword": "type",
"arguments": {
"expected": "string",
"used": "integer"
}
}
]
/* python style implementation (what I am trying to get)
ValidationError class has two more methods (getErrorPath(), getErrorMessage()) */
[
{
"path": "email",
"message": "missing required field"
},
{
"path": "password",
"message": "type must be a `string`"
}
]
- Unlimited Errors
I see the default for$max_errors
is set to1
; how can I set max errors tounlimited
? I've tried to just not pass anything (it defaults to1
) and tried setting tonull
(it throws an error).
Metadata
Metadata
Assignees
Labels
No labels