Skip to content

Commit

Permalink
fix: can create for json value
Browse files Browse the repository at this point in the history
  • Loading branch information
dbcfd committed Sep 28, 2023
1 parent a06ab1c commit 9406a95
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/model_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ impl ModelDefinition {
) -> anyhow::Result<Self> {
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<Self> {
Ok(Self {
version: "1.0",
name: name.to_string(),
Expand Down

0 comments on commit 9406a95

Please sign in to comment.