コード例 #1
0
 public JsonSchemaBuilder(JsonSchemaResolver resolver)
 {
     _stack = new List<JsonSchema>();
     _documentSchemas = new Dictionary<string, JsonSchema>();
     _resolver = resolver;
 }
コード例 #2
0
ファイル: JsonSchema.cs プロジェクト: sat1582/CODEFramework
 /// <summary>
 /// Writes this schema to a <see cref="JsonWriter"/> using the specified <see cref="JsonSchemaResolver"/>.
 /// </summary>
 /// <param name="writer">A <see cref="JsonWriter"/> into which this method will write.</param>
 /// <param name="resolver">The resolver used.</param>
 public void WriteTo(JsonWriter writer, JsonSchemaResolver resolver)
 {
     ValidationUtils.ArgumentNotNull(writer, "writer");
     ValidationUtils.ArgumentNotNull(resolver, "resolver");
     var schemaWriter = new JsonSchemaWriter(writer, resolver);
     schemaWriter.WriteSchema(this);
 }
コード例 #3
0
 public JsonSchemaBuilder(JsonSchemaResolver resolver)
 {
     _stack           = new List <JsonSchema>();
     _documentSchemas = new Dictionary <string, JsonSchema>();
     _resolver        = resolver;
 }
コード例 #4
0
ファイル: JsonSchema.cs プロジェクト: sat1582/CODEFramework
 /// <summary>
 /// Parses the specified json.
 /// </summary>
 /// <param name="json">The json.</param>
 /// <param name="resolver">The resolver.</param>
 /// <returns>A <see cref="JsonSchema"/> populated from the string that contains JSON.</returns>
 public static JsonSchema Parse(string json, JsonSchemaResolver resolver)
 {
     ValidationUtils.ArgumentNotNull(json, "json");
     using (JsonReader reader = new JsonTextReader(new StringReader(json)))
         return Read(reader, resolver);
 }
コード例 #5
0
ファイル: JsonSchema.cs プロジェクト: sat1582/CODEFramework
 /// <summary>
 /// Reads a <see cref="JsonSchema"/> from the specified <see cref="JsonReader"/>.
 /// </summary>
 /// <param name="reader">The <see cref="JsonReader"/> containing the JSON Schema to read.</param>
 /// <param name="resolver">The <see cref="JsonSchemaResolver"/> to use when resolving schema references.</param>
 /// <returns>The <see cref="JsonSchema"/> object representing the JSON Schema.</returns>
 public static JsonSchema Read(JsonReader reader, JsonSchemaResolver resolver)
 {
     ValidationUtils.ArgumentNotNull(reader, "reader");
     ValidationUtils.ArgumentNotNull(resolver, "resolver");
     var builder = new JsonSchemaBuilder(resolver);
     return builder.Read(reader);
 }
コード例 #6
0
 /// <summary>
 /// Parses the specified json.
 /// </summary>
 /// <param name="json">The json.</param>
 /// <param name="resolver">The resolver.</param>
 /// <returns>A <see cref="JsonSchema"/> populated from the string that contains JSON.</returns>
 public static JsonSchema Parse(string json, JsonSchemaResolver resolver)
 {
     ValidationUtils.ArgumentNotNull(json, "json");
     using (JsonReader reader = new JsonTextReader(new StringReader(json)))
         return(Read(reader, resolver));
 }
コード例 #7
0
 public JsonSchemaWriter(JsonWriter writer, JsonSchemaResolver resolver)
 {
     ValidationUtils.ArgumentNotNull(writer, "writer");
     _writer   = writer;
     _resolver = resolver;
 }
コード例 #8
0
 public JsonSchemaWriter(JsonWriter writer, JsonSchemaResolver resolver)
 {
     ValidationUtils.ArgumentNotNull(writer, "writer");
     _writer = writer;
     _resolver = resolver;
 }