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
So, it seems that for the nested field not only that capital letter check does not work, but schema check does not work neither! I.e. we are capable to pass incomplete JSON, and that would validate as true.
The text was updated successfully, but these errors were encountered:
I have pushed a new branch '#15' including a new unit test for your case. All fields of Location are required. This is what the test is checking for and it passes. So feel free to change the test so that it will fail and I can reproduce the problem.
Regarding the Capitals there is one option in lx-valid which will be interesting for you. By default the option additionalProperties is set to true which means the data could contain fields which are not part go the schema and the validation won't fail. An example would be if your field is names location instead of Location. Then it would not use the schema for the field Location, because the validator is case sensitive. And since there is no schema for location and additionalProperties is true there will be no error. If you set additionalProperties to false, then there will be a validation error.
You can also use the option unknownProperties to control how additional data, which is not in the schema, should be handled.
In relation to: litixsoft/lx-mongodb#1 (comment)
I did further tests and I noticed:
required
or notlocation
to berequired
(here: https://github.com/litixsoft/lx-valid/blob/master/test/revalidator.spec.js#L967-L984), and I was still capable to pass just some of them (one or two of them, but not whole 3), and that would be validated astrue
. This is obviously wrong.So, it seems that for the nested field not only that capital letter check does not work, but schema check does not work neither! I.e. we are capable to pass incomplete JSON, and that would validate as
true
.The text was updated successfully, but these errors were encountered: