-Documentation
This commit is contained in:
@@ -57,24 +57,24 @@ namespace Newtonsoft.Json.Tests.Documentation
|
|||||||
{
|
{
|
||||||
#region IsValidBasic
|
#region IsValidBasic
|
||||||
string schemaJson = @"{
|
string schemaJson = @"{
|
||||||
'description': 'A person',
|
'description': 'A person',
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'properties':
|
'properties':
|
||||||
{
|
{
|
||||||
'name': {'type':'string'},
|
'name': {'type':'string'},
|
||||||
'hobbies': {
|
'hobbies': {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
'items': {'type':'string'}
|
'items': {'type':'string'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}";
|
}";
|
||||||
|
|
||||||
JsonSchema schema = JsonSchema.Parse(schemaJson);
|
JsonSchema schema = JsonSchema.Parse(schemaJson);
|
||||||
|
|
||||||
JObject person = JObject.Parse(@"{
|
JObject person = JObject.Parse(@"{
|
||||||
'name': 'James',
|
'name': 'James',
|
||||||
'hobbies': ['.NET', 'Blogging', 'Reading', 'Xbox', 'LOLCATS']
|
'hobbies': ['.NET', 'Blogging', 'Reading', 'Xbox', 'LOLCATS']
|
||||||
}");
|
}");
|
||||||
|
|
||||||
bool valid = person.IsValid(schema);
|
bool valid = person.IsValid(schema);
|
||||||
// true
|
// true
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
JObject person = JObject.Parse(@"{
|
JObject person = JObject.Parse(@"{
|
||||||
'name': 'James',
|
'name': 'James',
|
||||||
'hobbies': ['.NET', 'Blogging', 'Reading', 'Xbox', 'LOLCATS']
|
'hobbies': ['.NET', 'Blogging', 'Reading', 'Xbox', 'LOLCATS']
|
||||||
}");
|
}");
|
||||||
|
|
||||||
bool valid = person.IsValid(schema);
|
bool valid = person.IsValid(schema);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user