Fields with dots in their names not receiving errors #1131
Labels
Area: Bridge
Affects some of the bridge packages
Bridge: JSON Schema
Affects the uniforms-bridge-json-schema package
Type: Bug
Bug reports and their fixes
Projects
Milestone
Problem description
The issue happens with
"uniforms": "3.8.1",
"uniforms-bridge-json-schema": "3.8.1"
Individual field errors are not passed to the fields. This causes them to not display the inline error message nor highlight it (in some cases it even displays the field as "green" indicating that everything is OK). The issue happens in
JSONSchemaBridge
with the use ofAjv
as a validator. Note: The schema validations are still performed (all invalid ones are found) and any errors are displayed by<ErrorsField />
.Technical observation
The field names (field paths, instancePath) produced by Ajv are not escaped the way uniforms do this. For example,
Ajv
will set theerror.instancePath
as"/nested.field"
. This causes problems inJSONSchemaBridge.getError
because the escaped field name andinstancePath
don't match.Reproduction
Screenshot
Example JSONSchema
Half-solution (semi-workaround)
The text was updated successfully, but these errors were encountered: