Closed joguiMultimedia closed 7 years ago
Hi! You wrote
"NOMRUE": { "type": "string", "title": "Rue", "Required": true }
but "required" has to be in lowercase. This should fix your problem.... Cheers!
As simple as that! Thanks it works. But, what about the $ref example? UPDATE: No validation error is thrown when none of the fields are filled but one is thrown when only one of them is filled (s1 OR s2). Is this the intent?
That is a good question @joguiMultimedia!
Yes, it is the expected behavior. Nested required properties trigger a validation error when:
It might be a little confusing at first, but it has sense. Think about an object that is not required, but some of its properties are. It is legal not informing it, but if informed the property has to be informed too.
Cheers
It does make sense indeed. The confusion in my mind was that the object does not really exist (in terms of instanciation) even though the form's fields are displayed. Thanks for fast and accurate reply!
Hi, and first thank you for your great work.
I am using a simple schema with properties referencing other properties defined in a separate schema through a $ref like this:
The issue is when validating the generated form the individual nested "adress" properties are not validated even though they are marked as "required" and leaved empty. Did I miss something?
Notes: