From 225be978c252bc0d13ee280b9cb1d2ba9272ccb5 Mon Sep 17 00:00:00 2001 From: trivernis Date: Mon, 14 Feb 2022 20:28:51 +0100 Subject: [PATCH] Fix field visibility Signed-off-by: trivernis --- .gitignore | 3 ++- Cargo.toml | 1 + src/data/datapaths.rs | 2 +- src/models/block.rs | 6 +++--- src/models/recipe.rs | 16 ++++++++-------- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 408b8a5..7a9733e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target Cargo.lock -.idea \ No newline at end of file +.idea +jtd-codegen diff --git a/Cargo.toml b/Cargo.toml index de41155..56667cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,3 +18,4 @@ serde = "1.0.133" include_dir = "0.7.2" itertools = "0.10.3" lazy_static = "1.4.0" +schemafy = "0.6.0" \ No newline at end of file diff --git a/src/data/datapaths.rs b/src/data/datapaths.rs index ee84c5b..2f40681 100644 --- a/src/data/datapaths.rs +++ b/src/data/datapaths.rs @@ -1,5 +1,5 @@ use std::collections::HashMap; - +#[allow(unused)] #[derive(Deserialize, Debug, Clone)] #[serde(rename_all(deserialize = "camelCase", serialize = "snake_case"))] pub(crate) struct Datapaths { diff --git a/src/models/block.rs b/src/models/block.rs index e94303c..c0dc07b 100644 --- a/src/models/block.rs +++ b/src/models/block.rs @@ -35,9 +35,9 @@ pub enum BoundingBox { #[derive(Deserialize, Debug, Clone)] #[serde(rename_all(deserialize = "camelCase", serialize = "snake_case"))] pub struct Variation { - metadata: u32, - display_name: String, - description: Option, + pub metadata: u32, + pub display_name: String, + pub description: Option, } #[derive(Deserialize, Debug, Clone)] diff --git a/src/models/recipe.rs b/src/models/recipe.rs index 12d5047..217516e 100644 --- a/src/models/recipe.rs +++ b/src/models/recipe.rs @@ -11,16 +11,16 @@ pub enum Recipe { #[derive(Deserialize, Debug, Clone)] #[serde(rename_all(deserialize = "camelCase", serialize = "snake_case"))] pub struct ShapedRecipe { - result: RecipeItem, - in_shape: Shape, - out_shape: Option, + pub result: RecipeItem, + pub in_shape: Shape, + pub out_shape: Option, } #[derive(Deserialize, Debug, Clone)] #[serde(rename_all(deserialize = "camelCase", serialize = "snake_case"))] pub struct ShapelessRecipe { - result: RecipeItem, - ingredients: Vec, + pub result: RecipeItem, + pub ingredients: Vec, } pub type Shape = Vec>; @@ -40,7 +40,7 @@ pub enum RecipeItem { #[derive(Deserialize, Debug, Clone)] #[serde(rename_all(deserialize = "camelCase", serialize = "snake_case"))] pub struct IDMetadataCountObject { - id: i32, - metadata: Option, - count: Option, + pub id: i32, + pub metadata: Option, + pub count: Option, }