Validate JSON against JSON Schema C#
I think that you just need to add ‘additionalProperties’: false to your schema. This will stop unknown properties being provided. So now your results will be:- True, False, False test code…. void Main() { var schema = JsonSchema.Parse( @”{ ‘type’: ‘object’, ‘properties’: { ‘name’: {‘type’:’string’}, ‘hobbies’: {‘type’: ‘array’} }, ‘additionalProperties’: false }”); IsValid(JObject.Parse( @”{ ‘name’: … Read more