-Documentation

This commit is contained in:
James Newton-King
2014-06-15 02:11:41 +12:00
parent 28cd8c497a
commit 5fbfa772b2
2 changed files with 17 additions and 17 deletions
@@ -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);