You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is my first issue here 😁 . I've came across of what I believe it is a bug on the JSONSchemaBridge. To be more precise, a bug on the pathToName method.
As we can see on this piece of code on the last line, it performs a slice(1). This slice makes this method return a wrong string if you have a property that contains whitespace on the top level of your schema.
A property with whitespace is represented as "['My Property']" and a common property is ".myProperty".
Version: any (since the creation of this file)
An example of a schema that doesn't work correctly:
The someValue property will not be validated correctly because pathToName will return "'My Property']" instead of "My Property" (I'm not sure if this should be the correct return, but it is what my tests suggest).
The text was updated successfully, but these errors were encountered:
Hi @ljmotta, thanks for the report! It looks like you are using the old format of ajv errors. Since v7 the default one is jsonPointers: true (to enable the old style in v7 use jsPropertySyntax: true). Here's a playground presenting this problem. Anyway, I agree we have to fix that.
@radekmie Thanks for addressing this issue so quickly! Yes I'm using an old format of ajv. My setup is ajv v6 (and ajv errors v1 due to compatibility) beucase my schema is draft4.
Hi, this is my first issue here 😁 . I've came across of what I believe it is a bug on the JSONSchemaBridge. To be more precise, a bug on the
pathToName
method.uniforms/packages/uniforms-bridge-json-schema/src/JSONSchemaBridge.ts
Lines 57 to 66 in 66e40d8
As we can see on this piece of code on the last line, it performs a
slice(1)
. This slice makes this method return a wrong string if you have a property that contains whitespace on the top level of your schema.A property with whitespace is represented as
"['My Property']"
and a common property is".myProperty"
.Version: any (since the creation of this file)
An example of a schema that doesn't work correctly:
The
someValue
property will not be validated correctly becausepathToName
will return"'My Property']"
instead of"My Property"
(I'm not sure if this should be the correct return, but it is what my tests suggest).The text was updated successfully, but these errors were encountered: