From 9406a95e16aaa5cb7522ba3f5c11606b1ffa980a Mon Sep 17 00:00:00 2001 From: Danny Browning Date: Wed, 27 Sep 2023 21:56:51 -0600 Subject: [PATCH] fix: can create for json value --- src/model_definition.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/model_definition.rs b/src/model_definition.rs index 1818528..b35047a 100644 --- a/src/model_definition.rs +++ b/src/model_definition.rs @@ -87,6 +87,14 @@ impl ModelDefinition { ) -> anyhow::Result { let schema = T::root_schema(); let schema = serde_json::to_value(&schema)?; + Self::new_for_value(name, account_relation, schema) + } + + pub fn new_for_value( + name: &str, + account_relation: ModelAccountRelation, + schema: serde_json::Value, + ) -> anyhow::Result { Ok(Self { version: "1.0", name: name.to_string(),