public JsonSchemaBuilder(JsonSchemaResolver resolver) { _stack = new List<JsonSchema>(); _documentSchemas = new Dictionary<string, JsonSchema>(); _resolver = resolver; }
/// <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); }
public JsonSchemaBuilder(JsonSchemaResolver resolver) { _stack = new List <JsonSchema>(); _documentSchemas = new Dictionary <string, JsonSchema>(); _resolver = resolver; }
/// <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); }
/// <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); }
/// <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)); }
public JsonSchemaWriter(JsonWriter writer, JsonSchemaResolver resolver) { ValidationUtils.ArgumentNotNull(writer, "writer"); _writer = writer; _resolver = resolver; }