-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ErrorMessage with Array of strings #70
Comments
Does any one have solution? |
Bump |
I'm having the same issues with getting the 'errorMessage' when it's a pattern in an array... banks: {
type: "array",
items: {
type: "object",
additionalProperties: false,
properties: {
bsbNumber: {
type: "string",
pattern: "^[0-9]{3}-[0-9]{3}$"
}
},
errorMessage: {
properties: {
bsbNumber: "BSB number must be in the format 000-000."
}
}
}
} the actual error does not contain the keyword "errorMessage", only the keyword "pattern" as bellow {
"instancePath": "/banks/0/bsbNumber",
"schemaPath": "#/properties/banks/items/properties/bsbNumber/pattern",
"keyword": "pattern",
"params": {
"pattern": "^[0-9]{3}-[0-9]{3}$"
},
"message": "must match pattern \"^[0-9]{3}-[0-9]{3}$\"",
"schema": "^[0-9]{3}-[0-9]{3}$",
"parentSchema": {
"type": "string",
"pattern": "^[0-9]{3}-[0-9]{3}$"
},
"data": ""
} |
It seems to be that you need to put the pattern-related error message paired with the key "pattern", not "type".
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey everybody,
I have some issues when i'm trying to put errorMessage with an array, for example, this is my schema :
When the pattern doesn't match, I don't receive errorMessage keyword, but instead :
I would like to receive my
INVALID_MEDIA_PICTURES_ITEMS
. I have the feeling errorMessage only works withtype: object
Am I missing something here ?
The text was updated successfully, but these errors were encountered: