I can't validate a json string starting from a very simple schema. This is my object type:
public class Person
{
public string Name { get; set; }
}
public class MyPerson : Person
{
public string Surname { get; set; }
}
And this is my test:
JsonSchema schema = JsonSchema.FromType(typeof(MyPerson));
var errors = schema.Validate(@"{'Surname':'Pippo','Name':'Pluto'}");
I always get the error:
{
NotAllOf:#/
{NoAdditionalPropertiesAllowed: #/Surname}
{NoAdditionalPropertiesAllowed: #/Name}
}
Can someone help me? How should the json string be composed? Thanks in advance