commit 923cf20eca35b551ae1fb4a77835f8104ea6cbed
Author: He Jie Xu <email address hidden>
Date: Wed Feb 17 16:26:19 2016 +0800
Generate better validation error message when using name regexes
There are some regexes used in the json-schema for complex string validation.
When the validation failed, json-schema lib didn't generate a useful error
info for the user, it shows the regex to the user. But regex is really
unreadable for normal user. This patch override the default FormatChecker to
support passed in custom error message. This required using custom format
checker instead of using 'pattern'.
For aggregates API, it enabled 'null' in the name input. As the 'format'
keyword works for all allowed types and name format check will only validate
string type, so this patch change the schema to use 'oneOf' keyword, then
the 'format' will only against on string type.
Reviewed: https:/ /review. openstack. org/288260 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=923cf20eca3 5b551ae1fb4a778 35f8104ea6cbed
Committed: https:/
Submitter: Jenkins
Branch: master
commit 923cf20eca35b55 1ae1fb4a77835f8 104ea6cbed
Author: He Jie Xu <email address hidden>
Date: Wed Feb 17 16:26:19 2016 +0800
Generate better validation error message when using name regexes
There are some regexes used in the json-schema for complex string validation.
When the validation failed, json-schema lib didn't generate a useful error
info for the user, it shows the regex to the user. But regex is really
unreadable for normal user. This patch override the default FormatChecker to
support passed in custom error message. This required using custom format
checker instead of using 'pattern'.
For aggregates API, it enabled 'null' in the name input. As the 'format'
keyword works for all allowed types and name format check will only validate
string type, so this patch change the schema to use 'oneOf' keyword, then
the 'format' will only against on string type.
Change-Id: Ic0e608b8a18b63 5bfcd936f57f14c 9f54e1ef8b4
Partial-Bug: #1541691