These are chat archives for NJsonSchema/NJsonSchema

15th
Mar 2018
Carlos Alberto Crego Sanchez
@ccrego
Mar 15 16:53
Is a there a way to get a full-detailed list of validation errors when we use object arrays?. At this moment,
the error message when one of the array items is not valid is "ArrayItemNotValid", but the validation message
does not contain the list of invalid properties for each invalid item ..
Rico Suter
@RSuter
Mar 15 16:53
the detailed validation result item will contain a child validation result or something like this
Carlos Alberto Crego Sanchez
@ccrego
Mar 15 16:59

I am doing the validation as follows:

var jsonSchema4 = JsonSchema4.FromFileAsync(path).Result;
var validationErrors = jsonSchema4.Validate(json);

However, I don't see any property in the "ValidationError" class that points to a child validation result ..
Maybe I am not using the proper overload ..
Rico Suter
@RSuter
Mar 15 17:00
i think you have to cast it to ChildValidationError
just try to debug it, then you should see it
Carlos Alberto Crego Sanchez
@ccrego
Mar 15 17:01
Mmmmm ok ¡¡¡ It makes sense
Rico Suter
@RSuter
Mar 15 17:01
hmm yes, but you're not the first one who asks this - maybe we shouldnt use inheritance for this :)
Carlos Alberto Crego Sanchez
@ccrego
Mar 15 17:04
Yes .. as you know .. composition in favour of inheritance .. :-), maybe the "Children" property should be part of ValidationError ..
Rico Suter
@RSuter
Mar 15 17:07
yes, it should just be there even if it is not used... but this way it is discoverable
oh its called Errors