diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index cfcae264..3054f96f 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -12,7 +12,7 @@ license = "MIT" [dependencies] anyhow = "1.0.97" -chrono = "0.4.39" +chrono = { version = "0.4.39", features = ["serde"] } cxx = { version = "1.0", optional = true } data-encoding = "2.8.0" enum-iterator = "2.1.0" diff --git a/modeling-cmds/src/datetime.rs b/modeling-cmds/src/datetime.rs index 139e365e..f213edc9 100644 --- a/modeling-cmds/src/datetime.rs +++ b/modeling-cmds/src/datetime.rs @@ -1,5 +1,8 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + /// A wrapper for chrono types, since we need to impl Value for them. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Default)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Default, Deserialize, Serialize, JsonSchema)] pub struct DateTimeLocal { value: chrono::DateTime, } diff --git a/modeling-cmds/src/format/fbx.rs b/modeling-cmds/src/format/fbx.rs index f1411d19..e0da67d3 100644 --- a/modeling-cmds/src/format/fbx.rs +++ b/modeling-cmds/src/format/fbx.rs @@ -30,10 +30,6 @@ pub mod export { pub storage: Storage, /// Timestamp override. - /// - /// This is intended for local integration testing only; it is not provided as an option - /// in the JSON schema. - #[serde(skip)] pub created: Option, } diff --git a/modeling-cmds/src/format/step.rs b/modeling-cmds/src/format/step.rs index 1f6d61dc..9f25d973 100644 --- a/modeling-cmds/src/format/step.rs +++ b/modeling-cmds/src/format/step.rs @@ -3,6 +3,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::coord; +use crate::datetime::DateTimeLocal; /// Import models in STEP format. pub mod import { @@ -38,12 +39,9 @@ pub mod export { /// /// [KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html pub coords: coord::System, + /// Timestamp override. - /// - /// This is intended for local integration testing only; it is not provided as an option - /// in the JSON schema. - #[serde(skip)] - pub created: Option>, + pub created: Option, } impl Default for Options {