From 64f3e02ede28e72899703c0eff4e150053b1b333 Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Thu, 16 Mar 2023 12:42:11 +0100 Subject: [PATCH] docs: Update code samples in README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5b678ed..400eec9 100644 --- a/README.md +++ b/README.md @@ -85,15 +85,15 @@ fn main() { ```rust use jsonschema::{Output, BasicOutput, JSONSchema}; +use serde_json::json; fn main() { - let schema_json = serde_json::json!({ + let schema_json = json!({ "title": "string value", "type": "string" }); - let instance = serde_json::json!{"some string"}; - let schema = JSONSchema::options() - .compile(&schema_json) + let instance = json!("some string"); + let schema = JSONSchema::compile(&schema_json) .expect("A valid schema"); let output: BasicOutput = schema.apply(&instance).basic(); @@ -102,7 +102,7 @@ fn main() { assert_eq!( output_json, - serde_json::json!({ + json!({ "valid": true, "annotations": [ {