public JsonSchema Load() { JsonObject root = document.Root.As<JsonObject>(); JsonSchemaRepository repository = new JsonSchemaRepository(); JsonSchemaDefinitions definitions = new JsonSchemaDefinitions(repository, root); JsonSchema schema = new JsonSchema(parser.Parse(root), definitions); return schema; }
public JsonSchema Resolve(string reference) { if (reference.StartsWith("#")) { string[] parts = reference.Split('/'); JsonObject node = FindNode(parts); JsonSchemaRule rule = parser.Parse(node); JsonSchema schema = new JsonSchema(rule, this); return schema; } return repository.GetByReference(reference); }
public OmletSchemaBuilder OnResponse(HttpStatusCode status, JsonSchema schema) { onResponse[status] = schema; return this; }
public OmletSchemaBuilder OnRequest(JsonSchema schema) { onRequest = schema; return this; }
static JsonSchema() { Draft04 = GetSchema("draft-04"); }