-Code reformat
This commit is contained in:
@@ -7,35 +7,35 @@ using System.Text;
|
||||
|
||||
namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
|
||||
{
|
||||
public class JsonSchemaParse
|
||||
{
|
||||
public void Example()
|
||||
public class JsonSchemaParse
|
||||
{
|
||||
#region Usage
|
||||
string schemaJson = @"{
|
||||
'description': 'A person',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'name': {'type':'string'},
|
||||
'hobbies': {
|
||||
'type': 'array',
|
||||
'items': {'type':'string'}
|
||||
}
|
||||
public void Example()
|
||||
{
|
||||
#region Usage
|
||||
string schemaJson = @"{
|
||||
'description': 'A person',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'name': {'type':'string'},
|
||||
'hobbies': {
|
||||
'type': 'array',
|
||||
'items': {'type':'string'}
|
||||
}
|
||||
}
|
||||
}";
|
||||
|
||||
JsonSchema schema = JsonSchema.Parse(schemaJson);
|
||||
|
||||
Console.WriteLine(schema.Type);
|
||||
// Object
|
||||
|
||||
foreach (var property in schema.Properties)
|
||||
{
|
||||
Console.WriteLine(property.Key + " - " + property.Value.Type);
|
||||
}
|
||||
// name - String
|
||||
// hobbies - Array
|
||||
#endregion
|
||||
}
|
||||
}";
|
||||
|
||||
JsonSchema schema = JsonSchema.Parse(schemaJson);
|
||||
|
||||
Console.WriteLine(schema.Type);
|
||||
// Object
|
||||
|
||||
foreach (var property in schema.Properties)
|
||||
{
|
||||
Console.WriteLine(property.Key + " - " + property.Value.Type);
|
||||
}
|
||||
// name - String
|
||||
// hobbies - Array
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user