diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index e05ed048..45b89393 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -15,7 +15,8 @@ all-features = true [features] clap = ["dep:clap"] default = [] -derive-jsonschema-on-enums = [] +derive-jsonschema-on-enums = ["json-schema"] +json-schema = ["dep:schemars"] tabled = ["dep:tabled"] ts-rs = ["dep:ts-rs", "kcl-api?/ts-rs", "kittycad-point/ts-rs"] slog = ["dep:slog"] @@ -51,7 +52,7 @@ parse-display = "0.11.0" parse-display-derive = "0.11.0" pyo3 = { version = "0.29.2", optional = true } pyo3-stub-gen = { version = "0.23.0", optional = true, default-features = false, features = ["either", "numpy", "ordered-float"] } -schemars = { version = "0.8.22", features = ["bigdecimal04", "chrono", "url", "uuid1"] } +schemars = { version = "0.8.22", features = ["bigdecimal04", "chrono", "url", "uuid1"], optional = true } serde = { version = "1.0.219", features = ["derive"] } serde_bytes = "0.11.19" serde_json = { version = "1.0.150", optional = true } diff --git a/modeling-cmds/src/base64.rs b/modeling-cmds/src/base64.rs index 20c0d3c4..836c6556 100644 --- a/modeling-cmds/src/base64.rs +++ b/modeling-cmds/src/base64.rs @@ -127,6 +127,7 @@ impl Serialize for Base64Data { } } +#[cfg(feature = "json-schema")] impl schemars::JsonSchema for Base64Data { fn schema_name() -> String { "Base64Data".to_string() diff --git a/modeling-cmds/src/coord.rs b/modeling-cmds/src/coord.rs index 7f807bf9..0021b49a 100644 --- a/modeling-cmds/src/coord.rs +++ b/modeling-cmds/src/coord.rs @@ -1,5 +1,4 @@ use parse_display::{Display, FromStr}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /// Co-ordinate axis specifier. @@ -7,7 +6,8 @@ use serde::{Deserialize, Serialize}; /// See [cglearn.eu] for background reading. /// /// [cglearn.eu]: https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1 -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] @@ -26,7 +26,8 @@ pub enum Axis { } /// Specifies the sign of a co-ordinate axis. -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] @@ -56,7 +57,8 @@ impl std::ops::Mul for Direction { } /// An [`Axis`] paired with a [`Direction`]. -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[display("({axis}, {direction})")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -81,7 +83,8 @@ pub struct AxisDirectionPair { /// See [cglearn.eu] for background reading. /// /// [cglearn.eu](https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1) -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[display("forward: {forward}, up: {up}")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 699b5bfd..e89dcbe4 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -1,5 +1,4 @@ use kittycad_modeling_cmds_macros::define_modeling_cmd_enum; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; pub use self::each_cmd::*; @@ -13,7 +12,6 @@ define_modeling_cmd_enum! { use crate::{self as kittycad_modeling_cmds}; use kittycad_modeling_cmds_macros::{ModelingCmdVariant}; use parse_display_derive::{Display, FromStr}; - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use uuid::Uuid; use crate::shared::CameraViewState; @@ -57,8 +55,9 @@ define_modeling_cmd_enum! { /// Evaluates the position of a path in one shot (engine utility for kcl executor) #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -73,9 +72,10 @@ define_modeling_cmd_enum! { /// Start a new path. #[derive( - Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + Debug, Clone, Default, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -90,8 +90,9 @@ define_modeling_cmd_enum! { /// to (1, 1, 0) with this command uses local coordinates. So, it would move the pen to /// (1, 1, 50) in global coordinates. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -106,8 +107,9 @@ define_modeling_cmd_enum! { /// Extend a path by adding a new segment which starts at the path's "pen". /// If no "pen" location has been set before (via `MovePen`), then the pen is at the origin. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -125,8 +127,9 @@ define_modeling_cmd_enum! { /// Command for extruding a solid 2d. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -182,8 +185,9 @@ define_modeling_cmd_enum! { /// Command for extruding a solid 2d to a reference geometry. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -222,8 +226,9 @@ define_modeling_cmd_enum! { /// Command for twist extruding a solid 2d. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -259,8 +264,9 @@ define_modeling_cmd_enum! { /// Extrude the object along a path. #[derive( - Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder + Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -309,8 +315,9 @@ define_modeling_cmd_enum! { /// Command for revolving a solid 2d. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -342,8 +349,9 @@ define_modeling_cmd_enum! { /// Command for shelling a solid3d face #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -368,8 +376,9 @@ define_modeling_cmd_enum! { /// BooleanImprint, EntityDeleteChildren, Solid3dFlipFace /// If successful, the new body type will become "Solid". #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -381,8 +390,9 @@ define_modeling_cmd_enum! { /// Command for joining multiple Surfaces (non-manifold) to a Solid. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -397,15 +407,16 @@ define_modeling_cmd_enum! { /// Command for creating a blend between the edge of two given surfaces #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SurfaceBlend { /// The two surfaces that the blend will span between - #[schemars(length(min = 2, max = 2))] + #[cfg_attr(feature = "json-schema", schemars(length(min = 2, max = 2)))] pub surfaces: Vec, /// The type of blend to use. #[serde(default)] @@ -415,8 +426,9 @@ define_modeling_cmd_enum! { /// What is the UUID of this body's n-th edge? #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -431,8 +443,9 @@ define_modeling_cmd_enum! { /// What is the UUID of this body's n-th face? #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -447,8 +460,9 @@ define_modeling_cmd_enum! { /// Retrieves the body type. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -460,8 +474,9 @@ define_modeling_cmd_enum! { /// Command for revolving a solid 2d about a brep edge #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -494,8 +509,9 @@ define_modeling_cmd_enum! { /// Command for lofting sections to create a solid #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -524,8 +540,9 @@ define_modeling_cmd_enum! { /// Closes a path, converting it to a 2D solid. #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -536,7 +553,8 @@ define_modeling_cmd_enum! { } /// Camera drag started. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -549,7 +567,8 @@ define_modeling_cmd_enum! { } /// Camera drag continued. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -567,7 +586,8 @@ define_modeling_cmd_enum! { } /// Camera drag ended - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -580,7 +600,8 @@ define_modeling_cmd_enum! { } /// Gets the default camera's camera settings - #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -588,7 +609,8 @@ define_modeling_cmd_enum! { pub struct DefaultCameraGetSettings {} /// Gets the default camera's view state - #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -596,7 +618,8 @@ define_modeling_cmd_enum! { pub struct DefaultCameraGetView {} /// Sets the default camera's view state - #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -607,7 +630,8 @@ define_modeling_cmd_enum! { } /// Change what the default camera is looking at. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -627,7 +651,8 @@ define_modeling_cmd_enum! { } /// Change what the default camera is looking at. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -653,7 +678,8 @@ define_modeling_cmd_enum! { } /// Adjust zoom of the default camera. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -666,7 +692,8 @@ define_modeling_cmd_enum! { } /// Export a sketch to a file. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -681,7 +708,8 @@ define_modeling_cmd_enum! { /// Export the scene to a file. /// /// The response is a MsgPack-encoded message in a WebSocket binary frame. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -697,7 +725,8 @@ define_modeling_cmd_enum! { /// Export the scene to a file. /// /// The response is a MsgPack-encoded message in a WebSocket binary frame. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -711,7 +740,8 @@ define_modeling_cmd_enum! { } /// What is this entity's parent? - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -722,7 +752,8 @@ define_modeling_cmd_enum! { } /// How many children does the entity have? - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -733,7 +764,8 @@ define_modeling_cmd_enum! { } /// What is the UUID of this entity's n-th child? - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -746,7 +778,8 @@ define_modeling_cmd_enum! { } /// What is this entity's child index within its parent - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -757,7 +790,8 @@ define_modeling_cmd_enum! { } /// What is this edge or face entity's primitive index within its parent body's edges or faces array respectively - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -769,7 +803,8 @@ define_modeling_cmd_enum! { /// Attempts to delete children entity from an entity. /// Note that this API may change the body type of certain entities from Solid to Surface. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -782,7 +817,8 @@ define_modeling_cmd_enum! { } /// What are all UUIDs of this entity's children? - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -793,7 +829,8 @@ define_modeling_cmd_enum! { } /// What are all UUIDs of all the paths sketched on top of this entity? - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -804,7 +841,8 @@ define_modeling_cmd_enum! { } /// What is the distance between these two entities? - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -819,7 +857,8 @@ define_modeling_cmd_enum! { } /// What is the length of this edge? - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -831,7 +870,8 @@ define_modeling_cmd_enum! { /// Create a pattern using this entity by specifying the transform for each desired repetition. /// Transformations are performed in the following order (first applied to last applied): scale, rotate, translate. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -843,7 +883,8 @@ define_modeling_cmd_enum! { /// Create a pattern using this entity by specifying the transform for each desired repetition. /// Transformations are performed in the following order (first applied to last applied): scale, rotate, translate. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -866,7 +907,8 @@ define_modeling_cmd_enum! { } /// Create a linear pattern using this entity. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -883,7 +925,8 @@ define_modeling_cmd_enum! { pub spacing: LengthUnit, } /// Create a circular pattern using this entity. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -906,7 +949,8 @@ define_modeling_cmd_enum! { } /// Create a helix using the input cylinder and other specified parameters. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -927,7 +971,8 @@ define_modeling_cmd_enum! { } /// Create a helix using the specified parameters. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -952,7 +997,8 @@ define_modeling_cmd_enum! { } /// Create a helix using the specified parameters. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -981,7 +1027,8 @@ define_modeling_cmd_enum! { } /// Mirror the input entities over the specified axis, edge, or plane. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -996,7 +1043,8 @@ define_modeling_cmd_enum! { /// Mirror the input entities over the specified axis. /// Deprecated; please use `EntityMirrorAcross` - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1013,8 +1061,9 @@ define_modeling_cmd_enum! { /// Mirror the input entities over the specified edge. /// Deprecated; please use `EntityMirrorAcross` #[derive( - Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder + Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1034,7 +1083,8 @@ define_modeling_cmd_enum! { /// Modifies the selection by simulating a "mouse click" at the given x,y window coordinate /// Returns ID of whatever was selected. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1049,7 +1099,8 @@ define_modeling_cmd_enum! { /// Query the type of entity that was selected. E.g. if a face is selected the face id is /// returned, if an edge/vertex is selected then the face ids that uniquely define the edge/vertex are /// returned (typically two). - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1064,7 +1115,8 @@ define_modeling_cmd_enum! { /// Query the type of entity given its id. E.g. if a face is selected the face id is /// returned, if an edge/vertex is selected then the face ids that uniquely define the edge/vertex are /// returned (typically two). - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1075,7 +1127,8 @@ define_modeling_cmd_enum! { } /// Adds one or more entities (by UUID) to the selection. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1086,7 +1139,8 @@ define_modeling_cmd_enum! { } /// Removes one or more entities (by UUID) from the selection. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1097,7 +1151,8 @@ define_modeling_cmd_enum! { } /// Removes all of the Objects in the scene - #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1105,7 +1160,8 @@ define_modeling_cmd_enum! { pub struct SceneClearAll {} /// Replaces current selection with these entities (by UUID). - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1117,7 +1173,8 @@ define_modeling_cmd_enum! { /// Changes the current highlighted entity to whichever one is at the given window coordinate. /// If there's no entity at this location, clears the highlight. - #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1133,7 +1190,8 @@ define_modeling_cmd_enum! { } /// Changes the current highlighted entity to these entities. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1144,7 +1202,8 @@ define_modeling_cmd_enum! { } /// Create a new annotation - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1159,7 +1218,8 @@ define_modeling_cmd_enum! { } /// Update an annotation - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1173,7 +1233,8 @@ define_modeling_cmd_enum! { } /// Changes visibility of scene-wide edge lines on brep solids - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1184,7 +1245,8 @@ define_modeling_cmd_enum! { } /// Hide or show an object - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1197,7 +1259,8 @@ define_modeling_cmd_enum! { } /// Bring an object to the front of the scene - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1208,7 +1271,8 @@ define_modeling_cmd_enum! { } /// Set the material properties of an object - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1230,7 +1294,8 @@ define_modeling_cmd_enum! { } /// Set the name of an object - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1244,7 +1309,8 @@ define_modeling_cmd_enum! { } /// What type of entity is this? - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1255,7 +1321,8 @@ define_modeling_cmd_enum! { } /// Gets all faces which use the given edge. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1268,7 +1335,8 @@ define_modeling_cmd_enum! { } /// Flips (reverses) a brep that is "inside-out". - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1280,7 +1348,8 @@ define_modeling_cmd_enum! { /// Flips (reverses) a face. If the solid3d body type is "Solid", /// then body type will become non-manifold ("Surface"). - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1293,7 +1362,8 @@ define_modeling_cmd_enum! { } /// Add a hole to a Solid2d object before extruding it. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1306,7 +1376,8 @@ define_modeling_cmd_enum! { } /// Gets all edges which are opposite the given edge, across all possible faces. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1321,7 +1392,8 @@ define_modeling_cmd_enum! { } /// Gets the edge opposite the given edge, along the given face. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1336,7 +1408,8 @@ define_modeling_cmd_enum! { } /// Gets the next adjacent edge for the given edge, along the given face. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1351,7 +1424,8 @@ define_modeling_cmd_enum! { } /// Gets the previous adjacent edge for the given edge, along the given face. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1366,7 +1440,8 @@ define_modeling_cmd_enum! { } /// Gets the shared edge between these two faces if it exists - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1379,7 +1454,8 @@ define_modeling_cmd_enum! { } /// Fillets the given edge with the specified radius. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1431,7 +1507,8 @@ define_modeling_cmd_enum! { } /// Cut the list of edge references with the given cut parameters - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1477,7 +1554,8 @@ define_modeling_cmd_enum! { } /// Cut the list of given edges with the given cut parameters. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1523,7 +1601,8 @@ define_modeling_cmd_enum! { } /// Determines whether a brep face is planar and returns its surface-local planar axes if so - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1534,7 +1613,8 @@ define_modeling_cmd_enum! { } /// Determines a position on a brep face evaluated by parameters u,v - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1548,7 +1628,8 @@ define_modeling_cmd_enum! { } ///Obtains the surface "center of mass" - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1559,7 +1640,8 @@ define_modeling_cmd_enum! { } /// Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1573,7 +1655,8 @@ define_modeling_cmd_enum! { } /// Send object to front or back. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1585,7 +1668,8 @@ define_modeling_cmd_enum! { pub front: bool, } /// Set opacity of the entity. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1600,7 +1684,8 @@ define_modeling_cmd_enum! { } /// Fade entity in or out. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1617,7 +1702,8 @@ define_modeling_cmd_enum! { } /// Make a new plane - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1640,7 +1726,8 @@ define_modeling_cmd_enum! { } /// Set the color of a plane. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1653,7 +1740,8 @@ define_modeling_cmd_enum! { } /// Set the current tool. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1664,7 +1752,8 @@ define_modeling_cmd_enum! { } /// Send a mouse move event - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1681,7 +1770,8 @@ define_modeling_cmd_enum! { /// Send a mouse click event /// Updates modified/selected entities. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1694,7 +1784,8 @@ define_modeling_cmd_enum! { /// Disable sketch mode. /// If you are sketching on a face, be sure to not disable sketch mode until you have extruded. /// Otherwise, your object will not be fused with the face. - #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1702,7 +1793,8 @@ define_modeling_cmd_enum! { pub struct SketchModeDisable {} /// Get the plane for sketch mode. - #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1710,7 +1802,8 @@ define_modeling_cmd_enum! { pub struct GetSketchModePlane {} /// Get the plane for sketch mode. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1725,7 +1818,8 @@ define_modeling_cmd_enum! { } /// Sketch on some entity (e.g. a plane, a face). - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1746,7 +1840,8 @@ define_modeling_cmd_enum! { } /// Set the background color of the scene. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1757,7 +1852,8 @@ define_modeling_cmd_enum! { } /// Set the properties of the tool lines for the scene. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1768,7 +1864,8 @@ define_modeling_cmd_enum! { } /// Set the default system properties used when a specific property isn't set. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1795,7 +1892,8 @@ define_modeling_cmd_enum! { } /// Get type of the given curve. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1806,7 +1904,8 @@ define_modeling_cmd_enum! { } /// Get control points of the given curve. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1817,7 +1916,8 @@ define_modeling_cmd_enum! { } /// Project an entity on to a plane. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1837,7 +1937,8 @@ define_modeling_cmd_enum! { } /// Project a list of points on to a plane. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1853,7 +1954,8 @@ define_modeling_cmd_enum! { } /// Enum containing the variety of image formats snapshots may be exported to. - #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)] + #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, FromStr, Display)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] @@ -1869,7 +1971,8 @@ define_modeling_cmd_enum! { } /// Take a snapshot of the current view. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1880,7 +1983,8 @@ define_modeling_cmd_enum! { } /// Add a gizmo showing the axes. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1894,7 +1998,8 @@ define_modeling_cmd_enum! { } /// Query the given path. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1905,7 +2010,8 @@ define_modeling_cmd_enum! { } /// Obtain curve ids for vertex ids - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1919,7 +2025,8 @@ define_modeling_cmd_enum! { } /// Obtain curve id by index - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1933,7 +2040,8 @@ define_modeling_cmd_enum! { } /// Obtain vertex ids for a path - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1944,7 +2052,8 @@ define_modeling_cmd_enum! { } /// Obtain the sketch target id (if the path was drawn in sketchmode) for a path - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1955,7 +2064,8 @@ define_modeling_cmd_enum! { } /// Start dragging the mouse. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1966,7 +2076,8 @@ define_modeling_cmd_enum! { } /// Continue dragging the mouse. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1982,7 +2093,8 @@ define_modeling_cmd_enum! { } /// Stop dragging the mouse. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1993,7 +2105,8 @@ define_modeling_cmd_enum! { } /// Remove scene objects. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2005,7 +2118,8 @@ define_modeling_cmd_enum! { /// Utility method. Performs both a ray cast and projection to plane-local coordinates. /// Returns the plane coordinates for the given window coordinates. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2018,7 +2132,8 @@ define_modeling_cmd_enum! { } /// Find the start and end of a curve. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2029,7 +2144,8 @@ define_modeling_cmd_enum! { } /// Reconfigure the stream. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2053,7 +2169,8 @@ define_modeling_cmd_enum! { /// Note: These imports are non-editable. In the future we may expose a proprietary-to-KCL function /// to resolve this. The main intention today is to use imports as design references. /// - #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2070,7 +2187,8 @@ define_modeling_cmd_enum! { /// Any previously executed commands will not be affected or have their units changed. /// They will remain in the units they were originally executed in. /// If not set, engine units default to mm. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2081,7 +2199,8 @@ define_modeling_cmd_enum! { } /// Get the mass of entities in the scene or the default scene. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2100,7 +2219,8 @@ define_modeling_cmd_enum! { } /// Get the density of entities in the scene or the default scene. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2119,7 +2239,8 @@ define_modeling_cmd_enum! { } /// Get the volume of entities in the scene or the default scene. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2134,7 +2255,8 @@ define_modeling_cmd_enum! { } /// Get the center of mass of entities in the scene or the default scene. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2149,7 +2271,8 @@ define_modeling_cmd_enum! { } /// Get the surface area of entities in the scene or the default scene. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2166,7 +2289,8 @@ define_modeling_cmd_enum! { /// Get mass, density, volume, center of mass, surface area, and bounding box together. /// Equivalent to querying each property separately for the same entities, while allowing /// the engine to share the intermediate geometry used by the calculations. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2200,9 +2324,10 @@ define_modeling_cmd_enum! { /// Focus the default camera upon an object in the scene. #[derive( - Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2213,9 +2338,10 @@ define_modeling_cmd_enum! { } /// When you select some entity with the current tool, what should happen to the entity? #[derive( - Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2227,9 +2353,10 @@ define_modeling_cmd_enum! { /// What kind of entities can be selected? #[derive( - Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2242,9 +2369,10 @@ define_modeling_cmd_enum! { /// Get the ids of a given entity type. #[derive( - Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2259,15 +2387,16 @@ define_modeling_cmd_enum! { /// exceed 1000. If multiple filters are provided, this take will apply to each filter /// individually. If there are fewer than `take` items of the provided filter type then the /// returned list's length will be the smaller value. - #[schemars(range(min = 1, max = 1000))] + #[cfg_attr(feature = "json-schema", schemars(range(min = 1, max = 1000)))] pub take: u32, } /// Use orthographic projection. #[derive( - Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Default, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2276,9 +2405,10 @@ define_modeling_cmd_enum! { /// Use perspective projection. #[derive( - Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2291,8 +2421,9 @@ define_modeling_cmd_enum! { ///Updates the camera to center to the center of the current selection ///(or the origin if nothing is selected) #[derive( - Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder + Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2307,8 +2438,9 @@ define_modeling_cmd_enum! { ///Updates the camera to center to the center of the current scene's bounds #[derive( - Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder + Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2322,7 +2454,8 @@ define_modeling_cmd_enum! { } /// Fit the view to the specified object(s). - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2346,7 +2479,8 @@ define_modeling_cmd_enum! { } /// Looks along the normal of the specified face (if it is planar!), and fits the view to it. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2368,7 +2502,8 @@ define_modeling_cmd_enum! { } /// Fit the view to the scene with an isometric view. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2384,7 +2519,8 @@ define_modeling_cmd_enum! { } /// Get a concise description of all of an extrusion's faces. - #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)] + #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2398,7 +2534,8 @@ define_modeling_cmd_enum! { } /// Get a concise description of all of solids edges. - #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)] + #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2413,7 +2550,8 @@ define_modeling_cmd_enum! { /// Clear the selection - #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)] + #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2422,7 +2560,8 @@ define_modeling_cmd_enum! { /// Set the selection to exactly these entities (replaces previous selection). /// Empty array clears the selection. - #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)] + #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2433,7 +2572,8 @@ define_modeling_cmd_enum! { } /// Find all IDs of selected entities - #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)] + #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2442,9 +2582,10 @@ define_modeling_cmd_enum! { /// Get the number of objects in the scene #[derive( - Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Default, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2453,9 +2594,10 @@ define_modeling_cmd_enum! { ///Set the transform of an object. #[derive( - Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Deserialize, PartialEq, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2485,9 +2627,10 @@ define_modeling_cmd_enum! { /// * When exporting to STEP, if the above behavior is observed, will merged the faces. /// #[derive( - Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Deserialize, PartialEq, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2512,9 +2655,10 @@ define_modeling_cmd_enum! { /// Create a new solid from intersecting several other solids. /// In other words, the part of the input solids where they all overlap will be the output solid. #[derive( - Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Deserialize, PartialEq, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2556,9 +2700,10 @@ define_modeling_cmd_enum! { /// that doesn't WILL NOT signal a non-overlap warning. /// #[derive( - Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Deserialize, PartialEq, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2583,9 +2728,10 @@ define_modeling_cmd_enum! { /// Create a new non-manifold body by intersecting all the input bodies, cutting and splitting all the faces at the intersection boundaries. #[derive( - Clone, Debug, Deserialize, PartialEq, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Deserialize, PartialEq, Serialize, ModelingCmdVariant, Builder )] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2617,7 +2763,8 @@ define_modeling_cmd_enum! { /// Make a new path by offsetting an object by a given distance. /// The new path's ID will be the ID of this command. - #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)] + #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2636,7 +2783,8 @@ define_modeling_cmd_enum! { } /// Add a hole to a closed path by offsetting it a uniform distance inward. - #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)] + #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2649,7 +2797,8 @@ define_modeling_cmd_enum! { } /// Align the grid with a plane or a planar face. - #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, Builder)] + #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2663,7 +2812,8 @@ define_modeling_cmd_enum! { } /// Set the scale of the grid lines in the video feed. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2677,7 +2827,8 @@ define_modeling_cmd_enum! { /// Set the grid lines to auto scale. The grid will get larger the further you zoom out, /// and smaller the more you zoom in. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2687,7 +2838,8 @@ define_modeling_cmd_enum! { /// Render transparent surfaces more accurately, but this might make rendering slower. /// Because it can interfere with runtime performance, it defaults to false. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2701,7 +2853,8 @@ define_modeling_cmd_enum! { /// Create a region bounded by the intersection of various paths. /// The region should have an ID taken from the ID of the /// 'CreateRegion' modeling command. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2733,7 +2886,8 @@ define_modeling_cmd_enum! { /// Enable or disable graphics. /// Warning: enabling graphics slows down the engine. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2745,7 +2899,8 @@ define_modeling_cmd_enum! { /// Create a planar surface bounded by the connection of various paths and curves. /// 'CreatePlanarSurface' modeling command. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2760,7 +2915,8 @@ define_modeling_cmd_enum! { } /// Finds a suitable set of arguments that can be passed to CreateRegion to resolve this very region. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2773,7 +2929,8 @@ define_modeling_cmd_enum! { /// Create a region with a query point. /// The region should have an ID taken from the ID of the /// 'CreateRegionFromQueryPoint' modeling command. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2792,7 +2949,8 @@ define_modeling_cmd_enum! { } /// Finds a suitable point inside the region for calling such that CreateRegionFromQueryPoint will generate an identical region. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2804,7 +2962,8 @@ define_modeling_cmd_enum! { /// The user clicked on a point in the window, /// returns the region the user clicked on, if any. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2815,7 +2974,8 @@ define_modeling_cmd_enum! { } /// Get the smallest box that could contain the given parts. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2832,7 +2992,8 @@ define_modeling_cmd_enum! { } ///Offset a surface by a given distance. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2852,7 +3013,8 @@ define_modeling_cmd_enum! { /// reduced detail, to make execution faster. /// Call EndExecution to restore high quality /// once you're done sending commands. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2866,7 +3028,8 @@ define_modeling_cmd_enum! { /// Tell the engine you're finished execution, /// and it should resume rendering at high resolution. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder, Default)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder, Default)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2875,7 +3038,8 @@ define_modeling_cmd_enum! { } /// Returns the closest edge to this point. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2891,7 +3055,8 @@ define_modeling_cmd_enum! { } /// Gets debug information about a sketch - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2902,7 +3067,8 @@ define_modeling_cmd_enum! { } /// Sets the KCL Version used by the engine. - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2947,7 +3113,8 @@ impl ModelingCmd { } /// File to import into the current scene. -#[derive(Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq, bon::Builder)] +#[derive(Clone, Serialize, Deserialize, Eq, PartialEq, bon::Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] diff --git a/modeling-cmds/src/exec_kcl.rs b/modeling-cmds/src/exec_kcl.rs index 24426af8..98e2c8f3 100644 --- a/modeling-cmds/src/exec_kcl.rs +++ b/modeling-cmds/src/exec_kcl.rs @@ -4,13 +4,13 @@ use indexmap::IndexMap; use kcl_api::ArtifactGraph; use kcl_api::{kcl_value_view::KclValueView, DefaultPlanes}; use kcl_error::{CompilationIssue, KclError}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::shared::safe_filepath::SafeFilepath; /// A KCL project that can be executed. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Default, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -32,7 +32,8 @@ impl KclProject { } /// Region-creation algorithm version. -#[derive(Clone, PartialEq, Serialize, Deserialize, JsonSchema, Default, Builder)] +#[derive(Clone, PartialEq, Serialize, Deserialize, Default, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -64,7 +65,8 @@ impl KclFile { } } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] @@ -85,7 +87,8 @@ pub struct ExecKclProjectOk { pub default_planes: Option>, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] diff --git a/modeling-cmds/src/format/dxf.rs b/modeling-cmds/src/format/dxf.rs index f557ebb7..22c4677b 100644 --- a/modeling-cmds/src/format/dxf.rs +++ b/modeling-cmds/src/format/dxf.rs @@ -1,11 +1,11 @@ /// Export sketches in DXF format. pub mod export { use bon::Builder; - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /// Export storage. - #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, JsonSchema, PartialEq, Serialize)] + #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "DxfStorage", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -28,7 +28,8 @@ pub mod export { } /// Options for exporting DXF format. - #[derive(Clone, Debug, Default, Deserialize, Eq, Hash, JsonSchema, PartialEq, Serialize, Builder)] + #[derive(Clone, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "DxfExportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] diff --git a/modeling-cmds/src/format/fbx.rs b/modeling-cmds/src/format/fbx.rs index a3a1011f..ef0a53e6 100644 --- a/modeling-cmds/src/format/fbx.rs +++ b/modeling-cmds/src/format/fbx.rs @@ -1,13 +1,13 @@ use bon::Builder; use parse_display::{Display, FromStr}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /// Import models in FBX format. pub mod import { use super::*; /// Options for importing FBX. - #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "FbxImportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -37,7 +37,8 @@ pub mod export { use super::*; /// Options for exporting FBX. - #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "FbxExportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -68,9 +69,8 @@ pub mod export { } /// Describes the storage format of an FBX file. - #[derive( - Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr, - )] + #[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[display(style = "snake_case")] #[serde(rename = "FbxStorage", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] diff --git a/modeling-cmds/src/format/gltf.rs b/modeling-cmds/src/format/gltf.rs index 2bd6dffa..b0260605 100644 --- a/modeling-cmds/src/format/gltf.rs +++ b/modeling-cmds/src/format/gltf.rs @@ -1,6 +1,5 @@ use bon::Builder; use parse_display::{Display, FromStr}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /// Import models in KittyCAD's GLTF format. @@ -8,7 +7,8 @@ pub mod import { use super::*; /// Options for importing glTF 2.0. - #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "GltfImportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -37,7 +37,8 @@ pub mod import { pub mod export { use super::*; /// Options for exporting glTF 2.0. - #[derive(Default, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Default, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "GltfExportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -73,9 +74,8 @@ pub mod export { } /// Describes the storage format of a glTF 2.0 scene. - #[derive( - Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr, - )] + #[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[display(style = "snake_case")] #[serde(rename = "GltfStorage", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] @@ -110,9 +110,8 @@ pub mod export { } /// Describes the presentation style of the glTF JSON. - #[derive( - Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr, - )] + #[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[display(style = "snake_case")] #[serde(rename = "GltfPresentation", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] diff --git a/modeling-cmds/src/format/mod.rs b/modeling-cmds/src/format/mod.rs index db3d575c..a3d29bc0 100644 --- a/modeling-cmds/src/format/mod.rs +++ b/modeling-cmds/src/format/mod.rs @@ -1,5 +1,4 @@ use bon::Builder; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::shared::{FileExportFormat, FileExportFormat2d, FileImportFormat}; @@ -23,7 +22,8 @@ pub mod step; pub mod stl; /// Output 2D format specifier. -#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(tag = "type", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -39,7 +39,8 @@ pub enum OutputFormat2d { pub type OutputFormat = OutputFormat3d; /// Output 3D format specifier. -#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(tag = "type", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -68,7 +69,8 @@ pub enum OutputFormat3d { pub type InputFormat = InputFormat3d; /// Input format specifier. -#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(tag = "type", rename_all = "snake_case")] #[cfg_attr( feature = "python", @@ -132,7 +134,8 @@ impl InputFormat3d { } /// Data item selection. -#[derive(Clone, Debug, Default, Eq, Hash, PartialEq, JsonSchema, Deserialize, Serialize)] +#[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case", tag = "type")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -390,12 +393,12 @@ macro_rules! proprietary_brep_formats { /// Import functionality pub mod import { use bon::Builder; - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::coord; #[doc = std::concat!("Options for importing ", $format_description, ".")] - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(default, rename = $spec_name)] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] diff --git a/modeling-cmds/src/format/obj.rs b/modeling-cmds/src/format/obj.rs index 1629a149..21c9bf0a 100644 --- a/modeling-cmds/src/format/obj.rs +++ b/modeling-cmds/src/format/obj.rs @@ -1,5 +1,4 @@ use bon::Builder; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{coord, units::UnitLength}; @@ -9,7 +8,8 @@ pub mod import { use super::*; /// Options for importing OBJ. - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "ObjImportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -65,7 +65,8 @@ pub mod export { use super::*; /// Options for exporting OBJ. - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "ObjExportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] diff --git a/modeling-cmds/src/format/ply.rs b/modeling-cmds/src/format/ply.rs index 41d53682..e3d7ff0b 100644 --- a/modeling-cmds/src/format/ply.rs +++ b/modeling-cmds/src/format/ply.rs @@ -1,6 +1,5 @@ use bon::Builder; use parse_display::{Display, FromStr}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{coord, format::Selection, units::UnitLength}; @@ -10,7 +9,8 @@ pub mod import { use super::*; /// Options for importing PLY. - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "PlyImportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -67,7 +67,8 @@ pub mod export { use super::*; /// Options for exporting PLY. - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "PlyExportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -125,7 +126,8 @@ pub mod export { } /// The storage for the output PLY file. - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr, Default)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr, Default)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[display(style = "snake_case")] #[serde(rename = "PlyStorage", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] diff --git a/modeling-cmds/src/format/step.rs b/modeling-cmds/src/format/step.rs index c0804c14..9d441159 100644 --- a/modeling-cmds/src/format/step.rs +++ b/modeling-cmds/src/format/step.rs @@ -1,12 +1,12 @@ use bon::Builder; use parse_display::{Display, FromStr}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::coord; /// After importing, how should this model's data be represented? -#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "StepImportTargetRepresentation", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -31,7 +31,8 @@ pub mod import { use super::*; /// Options for importing STEP format. - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(default, rename = "StepImportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -90,9 +91,8 @@ pub mod export { use crate::units::UnitLength; /// Describes the presentation style of the EXPRESS exchange format. - #[derive( - Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr, - )] + #[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, FromStr)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[display(style = "snake_case")] #[serde(rename = "StepPresentation", rename_all = "snake_case")] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -116,7 +116,8 @@ pub mod export { } /// Options for exporting STEP format. - #[derive(Clone, Debug, Deserialize, Eq, Hash, JsonSchema, PartialEq, Serialize, Builder)] + #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(default, rename = "StepExportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] diff --git a/modeling-cmds/src/format/stl.rs b/modeling-cmds/src/format/stl.rs index 2e03b949..3cd3a870 100644 --- a/modeling-cmds/src/format/stl.rs +++ b/modeling-cmds/src/format/stl.rs @@ -1,6 +1,5 @@ use bon::Builder; use parse_display::{Display, FromStr}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{coord, format::Selection, units::UnitLength}; @@ -10,7 +9,8 @@ pub mod import { use super::*; /// Options for importing STL. - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "StlImportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -66,7 +66,8 @@ pub mod export { use super::*; /// Options for exporting STL. - #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename = "StlExportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -124,9 +125,8 @@ pub mod export { } /// Export storage. - #[derive( - Clone, Copy, Debug, Default, Deserialize, Display, Eq, FromStr, Hash, JsonSchema, PartialEq, Serialize, - )] + #[derive(Clone, Copy, Debug, Default, Deserialize, Display, Eq, FromStr, Hash, PartialEq, Serialize)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[display(style = "snake_case")] #[serde(rename = "StlStorage", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] diff --git a/modeling-cmds/src/id.rs b/modeling-cmds/src/id.rs index d54b070b..0de2f3b1 100644 --- a/modeling-cmds/src/id.rs +++ b/modeling-cmds/src/id.rs @@ -1,11 +1,11 @@ use std::{fmt, str::FromStr}; -use schemars::JsonSchema; use serde::{de, de::Visitor, Deserialize, Deserializer, Serialize}; use uuid::Uuid; /// All commands have unique IDs. These should be randomly generated. -#[derive(Debug, Clone, Copy, Hash, Ord, PartialOrd, Eq, PartialEq, JsonSchema, Serialize)] +#[derive(Debug, Clone, Copy, Hash, Ord, PartialOrd, Eq, PartialEq, Serialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(test, derive(Default))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] diff --git a/modeling-cmds/src/kcl_version.rs b/modeling-cmds/src/kcl_version.rs index d0ed9b3f..3783c366 100644 --- a/modeling-cmds/src/kcl_version.rs +++ b/modeling-cmds/src/kcl_version.rs @@ -1,11 +1,11 @@ use std::str::FromStr; -use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; /// Which KCL versions does Zoo support? -#[derive(Debug, Clone, Copy, Default, Deserialize, Serialize, PartialEq, Eq, Ord, PartialOrd, JsonSchema)] +#[derive(Debug, Clone, Copy, Default, Deserialize, Serialize, PartialEq, Eq, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export))] diff --git a/modeling-cmds/src/length_unit.rs b/modeling-cmds/src/length_unit.rs index 30b5a762..0f1495c1 100644 --- a/modeling-cmds/src/length_unit.rs +++ b/modeling-cmds/src/length_unit.rs @@ -121,6 +121,7 @@ impl PointExt for Point4d { } } +#[cfg(feature = "json-schema")] impl schemars::JsonSchema for LengthUnit { fn schema_name() -> String { "LengthUnit".to_string() diff --git a/modeling-cmds/src/lib.rs b/modeling-cmds/src/lib.rs index f7f878d3..2e15fd26 100644 --- a/modeling-cmds/src/lib.rs +++ b/modeling-cmds/src/lib.rs @@ -1,4 +1,9 @@ //! KittyCAD's Modeling API lets you design 3D models. +//! +//! Enable `json-schema` for JSON Schema implementations. Enable +//! `derive-jsonschema-on-enums` for command and response enum schemas as well; +//! it also enables `json-schema`. +//! //! # Beware //! This project does not use semver. We are using 0.1.x for everything. If you use this crate, commit your Cargo.lock to avoid being broken when we publish a new version. //! Why? Because we use this primarily for KittyCAD server and clients, where we are on top of all changes. diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index a2e2d0f3..aceacf6e 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -15,7 +15,6 @@ define_ok_modeling_cmd_response_enum! { /// Output from Modeling API commands. pub mod output { use kittycad_modeling_cmds_macros::ModelingCmdOutput; - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use bon::Builder; use uuid::Uuid; @@ -39,7 +38,8 @@ define_ok_modeling_cmd_response_enum! { use super::bool_true; /// The response of the `EngineUtilEvaluatePath` endpoint - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EngineUtilEvaluatePath { /// The evaluated path curve position @@ -47,25 +47,29 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `StartPath` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct StartPath { } /// The response from the `MovePathPen` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct MovePathPen { } /// The response from the `ExtendPath` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ExtendPath { } /// The response from the `Extrude` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Extrude { /// Any new bodies created by the request. @@ -77,7 +81,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `ExtrudeToReference` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ExtrudeToReference { /// Any new bodies created by the request. @@ -89,7 +94,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `TwistExtrude` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct TwistExtrude { /// Any new bodies created by the request. @@ -101,7 +107,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Sweep` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Sweep { /// Any new bodies created by the request. @@ -113,7 +120,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Revolve` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Revolve { /// Any new bodies created by the request. @@ -125,30 +133,35 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3dShellFace` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dShellFace { } /// The response from the `Solid3dJoin` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dJoin { } /// The response from the `Solid3dMultiJoin` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dMultiJoin { } /// The response from the `SurfaceBlend` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct SurfaceBlend { } /// The response from the `Solid3dGetEdgeUuid` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetEdgeUuid { /// The UUID of the edge. @@ -156,7 +169,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3dGetFaceUuid` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetFaceUuid { /// The UUID of the face. @@ -164,7 +178,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3dGetBodyType` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetBodyType { /// The body type @@ -172,7 +187,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `RevolveAboutEdge` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct RevolveAboutEdge { /// Any new bodies created by the request. @@ -184,289 +200,337 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `CameraDragStart` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CameraDragStart { } /// The response from the `DefaultCameraLookAt` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraLookAt { } /// The response from the `DefaultCameraPerspectiveSettings` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraPerspectiveSettings { } /// The response from the `SelectAdd` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SelectAdd { } /// The response from the `SelectRemove` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SelectRemove { } /// The response from the `SceneClearAll` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SceneClearAll { } /// The response from the `SelectReplace` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SelectReplace { } /// The response from the `HighlightSetEntities` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct HighlightSetEntities { } /// The response from the `NewAnnotation` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct NewAnnotation { } /// The response from the `UpdateAnnotation` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct UpdateAnnotation { } /// The response from the `EdgeLinesVisible` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EdgeLinesVisible { } /// The response from the `ObjectVisible` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ObjectVisible { } /// The response from the `ObjectBringToFront` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ObjectBringToFront { } /// The response from the `ObjectSetMaterialParamsPbr` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ObjectSetMaterialParamsPbr { } /// The response from the `ObjectSetName` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ObjectSetName { } /// The response from the `Solid2dAddHole` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid2dAddHole { } /// The response from the `Solid3dFilletEdge` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dFilletEdge { } /// The response from the `Solid3dCutEdgeReferences` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct Solid3dCutEdgeReferences { } /// The response from the `Solid3dCutEdges` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dCutEdges { } /// The response from the `SendObject` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SendObject { } /// The response from the `EntitySetOpacity` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntitySetOpacity { } /// The response from the `EntityFade` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityFade { } /// The response from the `MakePlane` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct MakePlane { } /// The response from the `PlaneSetColor` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PlaneSetColor { } /// The response from the `SetTool` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetTool { } /// The response from the `MouseMove` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct MouseMove { } /// The response from the `SketchModeDisable` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SketchModeDisable { } /// The response from the `CurveSetConstraint` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CurveSetConstraint { } /// The response from the `EnableSketchMode` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EnableSketchMode { } /// The response from the `SetBackgroundColor` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetBackgroundColor { } /// The response from the `SetCurrentToolProperties` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetCurrentToolProperties { } /// The response from the `SetDefaultSystemProperties` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetDefaultSystemProperties { } /// The response from the `MakeAxesGizmo` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct MakeAxesGizmo { } /// The response from the `HandleMouseDragStart` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct HandleMouseDragStart { } /// The response from the `HandleMouseDragMove` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct HandleMouseDragMove { } /// The response from the `HandleMouseDragEnd` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct HandleMouseDragEnd { } /// The response from the `RemoveSceneObjects` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct RemoveSceneObjects { } /// The response from the `ReconfigureStream` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ReconfigureStream { } /// The response from the `SetSceneUnits` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetSceneUnits { } /// The response from the `SetSelectionType` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetSelectionType { } /// The response from the `SetSelectionFilter` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetSelectionFilter { } /// The response from the `DefaultCameraSetOrthographic` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraSetOrthographic { } /// The response from the `DefaultCameraSetPerspective` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraSetPerspective { } /// The response from the `DefaultCameraCenterToSelection` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraCenterToSelection { } /// The response from the `DefaultCameraCenterToScene` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraCenterToScene { } /// The response from the `SelectClear` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SelectClear { } /// The response from the `SelectEntity` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SelectEntity { } /// The response from the `Export2d` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Export2d { /// The files that were exported. @@ -474,7 +538,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Export3d` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Export3d { /// The files that were exported. @@ -482,7 +547,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Export` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Export { /// The files that were exported. @@ -490,7 +556,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `SelectWithPoint` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SelectWithPoint { /// The UUID of the entity that was selected. @@ -498,7 +565,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `QueryEntityTypeWithPoint` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct QueryEntityTypeWithPoint { /// How to reference the selected entity using face ids. @@ -508,14 +576,16 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `QueryEntityType` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct QueryEntityType { /// How to reference the provided entity using face ids. pub reference: EntityReference, } /// The response from the `HighlightSetEntity` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct HighlightSetEntity { /// The UUID of the entity that was highlighted. @@ -525,21 +595,24 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityGetChildUuid` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityGetChildUuid { /// The UUID of the child entity. pub entity_id: Uuid, } /// The response from the `EntityGetIndex` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityGetIndex { /// The child index of the entity. pub entity_index: u32, } /// The response from the `EntityGetPrimitiveIndex` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityGetPrimitiveIndex { /// The primitive index of the entity. @@ -549,26 +622,30 @@ define_ok_modeling_cmd_response_enum! { pub entity_type: EntityType, } /// The response from the `EntityDeleteChildren` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityDeleteChildren { } /// The response from the `EntityGetNumChildren` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityGetNumChildren { /// The number of children the entity has. pub num: u32, } /// The response from the `EntityGetParentId` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityGetParentId { /// The UUID of the parent entity. pub entity_id: Uuid, } /// The response from the `EntityGetAllChildUuids` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityGetAllChildUuids { /// The UUIDs of the child entities. @@ -576,7 +653,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityGetSketchPaths` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityGetSketchPaths { /// The UUIDs of the sketch paths. @@ -584,7 +662,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Loft` command. - #[derive(Debug, Serialize, Deserialize, JsonSchema, PartialEq, ModelingCmdOutput, Clone)] + #[derive(Debug, Serialize, Deserialize, PartialEq, ModelingCmdOutput, Clone)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Loft { ///The UUID of the newly created solid loft. @@ -592,7 +671,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `ClosePath` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ClosePath { /// The UUID of the lone face of the resulting solid2D. @@ -602,7 +682,8 @@ define_ok_modeling_cmd_response_enum! { /// The response from the `CameraDragMove` command. /// Note this is an "unreliable" channel message, so this data may need more data like a "sequence" // to work properly - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CameraDragMove { /// Camera settings @@ -610,7 +691,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `CameraDragEnd` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CameraDragEnd { /// Camera settings @@ -618,7 +700,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `DefaultCameraGetSettings` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraGetSettings { /// Camera settings @@ -626,7 +709,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `DefaultCameraGetView` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraGetView { /// Camera view state @@ -634,12 +718,14 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `DefaultCameraSetView` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraSetView {} /// The response from the `DefaultCameraZoom` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraZoom { /// Camera settings @@ -647,7 +733,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `ZoomToFit` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ZoomToFit { /// Camera settings @@ -655,7 +742,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `OrientToFace` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct OrientToFace { /// Camera settings @@ -663,7 +751,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `ViewIsometric` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ViewIsometric { /// Camera settings @@ -671,7 +760,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `GetNumObjects` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct GetNumObjects { /// The number of objects in the scene. @@ -679,7 +769,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `MakeOffsetPath` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct MakeOffsetPath { /// If the offset path splits into multiple paths, this will contain the UUIDs of the @@ -690,12 +781,14 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `SetObjectTransform` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetObjectTransform {} /// The response from the `AddHoleFromOffset` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct AddHoleFromOffset { /// If the offset path splits into multiple paths, this will contain the UUIDs of the @@ -706,12 +799,14 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `DefaultCameraFocusOn` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct DefaultCameraFocusOn { } /// The response from the `SelectGet` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SelectGet { /// The UUIDs of the selected entities. @@ -720,7 +815,8 @@ define_ok_modeling_cmd_response_enum! { /// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces) /// This includes the opposite and adjacent faces and edges. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetAdjacencyInfo { /// Details of each edge. @@ -728,7 +824,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3dGetAllEdgeFaces` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetAllEdgeFaces { /// The UUIDs of the faces. @@ -736,19 +833,22 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3dFlip` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dFlip { } /// The response from the `Solid3dFlipFace` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dFlipFace { } /// The response from the `Solid3dGetAllOppositeEdges` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetAllOppositeEdges { /// The UUIDs of the edges. @@ -756,7 +856,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3dGetOppositeEdge` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetOppositeEdge { /// The UUID of the edge. @@ -764,7 +865,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3dGetNextAdjacentEdge` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetNextAdjacentEdge { /// The UUID of the edge. @@ -772,7 +874,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3dGetPrevAdjacentEdge` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetPrevAdjacentEdge { /// The UUID of the edge. @@ -780,7 +883,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `Solid3DGetCommonEdge` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetCommonEdge { /// The UUID of the common edge, if any. @@ -788,7 +892,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `GetEntityType` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct GetEntityType { /// The type of the entity. @@ -796,7 +901,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `SceneGetEntityIds` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SceneGetEntityIds { /// The ids of the requested entities. @@ -804,7 +910,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `CurveGetControlPoints` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CurveGetControlPoints { /// Control points in the curve. @@ -812,7 +919,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `ProjectEntityToPlane` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ProjectEntityToPlane { /// Projected points. @@ -820,7 +928,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `ProjectPointsToPlane` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ProjectPointsToPlane { /// Projected points. @@ -828,7 +937,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `CurveGetType` command. - #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, Eq, PartialEq, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CurveGetType { /// Curve type @@ -836,7 +946,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `MouseClick` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct MouseClick { /// Entities that are modified. @@ -846,7 +957,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `TakeSnapshot` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct TakeSnapshot { /// Contents of the image. @@ -854,7 +966,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `PathGetInfo` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PathGetInfo { /// All segments in the path, in the order they were added. @@ -862,7 +975,8 @@ define_ok_modeling_cmd_response_enum! { } /// Info about a path segment - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PathSegmentInfo { /// Which command created this path? @@ -876,7 +990,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `PathGetCurveUuidsForVertices` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PathGetCurveUuidsForVertices { /// The UUIDs of the curve entities. @@ -884,7 +999,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `PathGetCurveUuid` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PathGetCurveUuid { /// The UUID of the curve entity. @@ -892,7 +1008,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `PathGetVertexUuids` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PathGetVertexUuids { /// The UUIDs of the vertex entities. @@ -900,7 +1017,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `PathGetSketchTargetUuid` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PathGetSketchTargetUuid { /// The UUID of the sketch target. @@ -908,7 +1026,8 @@ define_ok_modeling_cmd_response_enum! { } /// Endpoints of a curve - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CurveGetEndPoints { /// Start @@ -918,7 +1037,8 @@ define_ok_modeling_cmd_response_enum! { } /// Surface-local planar axes (if available) - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct FaceIsPlanar { /// plane's origin @@ -935,7 +1055,8 @@ define_ok_modeling_cmd_response_enum! { } /// The 3D position on the surface that was evaluated - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct FaceGetPosition { /// The 3D position on the surface that was evaluated @@ -943,7 +1064,8 @@ define_ok_modeling_cmd_response_enum! { } /// The 3D center of mass on the surface - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct FaceGetCenter { /// The 3D position on the surface center of mass @@ -951,7 +1073,8 @@ define_ok_modeling_cmd_response_enum! { } /// The gradient (dFdu, dFdv) + normal vector on a brep face - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct FaceGetGradient { /// dFdu @@ -965,7 +1088,8 @@ define_ok_modeling_cmd_response_enum! { } /// Corresponding coordinates of given window coordinates, intersected on given plane. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PlaneIntersectAndProject { /// Corresponding coordinates of given window coordinates, intersected on given plane. @@ -973,7 +1097,8 @@ define_ok_modeling_cmd_response_enum! { } /// Data from importing the files - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput, Builder)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ImportFiles { /// ID of the imported 3D models within the scene. @@ -981,7 +1106,8 @@ define_ok_modeling_cmd_response_enum! { } /// Data from importing the files - #[derive(Debug, Eq, PartialEq, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Eq, PartialEq, Serialize, Deserialize, Clone, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ImportedGeometry { /// ID of the imported 3D models within the scene. @@ -991,7 +1117,8 @@ define_ok_modeling_cmd_response_enum! { } /// The mass response. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Mass { @@ -1002,7 +1129,8 @@ define_ok_modeling_cmd_response_enum! { } /// The volume response. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Volume { @@ -1013,7 +1141,8 @@ define_ok_modeling_cmd_response_enum! { } /// The density response. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Density { @@ -1024,7 +1153,8 @@ define_ok_modeling_cmd_response_enum! { } /// The surface area response. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SurfaceArea { @@ -1035,7 +1165,8 @@ define_ok_modeling_cmd_response_enum! { } /// The center of mass response. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CenterOfMass { @@ -1046,7 +1177,8 @@ define_ok_modeling_cmd_response_enum! { } /// The physical properties response, containing the same data as the individual property responses. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct PhysicalProperties { /// The mass and its output unit. @@ -1064,7 +1196,8 @@ define_ok_modeling_cmd_response_enum! { } /// The plane for sketch mode. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct GetSketchModePlane { /// The origin. @@ -1078,7 +1211,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntitiesGetDistance` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityGetDistance { /// The minimum distance between the input entities. @@ -1088,7 +1222,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EdgeGetLength` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EdgeGetLength { /// The length of the edge. @@ -1096,7 +1231,8 @@ define_ok_modeling_cmd_response_enum! { } /// Faces and edges id info (most used in identifying geometry in patterned and mirrored objects). - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct FaceEdgeInfo { /// The UUID of the object. @@ -1108,7 +1244,8 @@ define_ok_modeling_cmd_response_enum! { } /// A list of faces for a specific edge. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EdgeInfo { /// The UUID of the id. @@ -1118,7 +1255,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityClone` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityClone { /// The Face and Edge Ids of the cloned entity. @@ -1127,7 +1265,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityLinearPatternTransform` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityLinearPatternTransform { /// The Face, edge, and entity ids of the patterned entities. @@ -1136,7 +1275,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityLinearPattern` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityLinearPattern { /// The Face, edge, and entity ids of the patterned entities. @@ -1145,7 +1285,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityCircularPattern` command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput, Default)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput, Default)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityCircularPattern { /// The Face, edge, and entity ids of the patterned entities. @@ -1154,7 +1295,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityMirror` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityMirror { /// The Face, edge, and entity ids of the patterned entities. @@ -1163,7 +1305,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityMirrorAcross` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityMirrorAcross { /// The Face, edge, and entity ids of the patterned entities. @@ -1172,7 +1315,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityMirrorAcrossEdge` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityMirrorAcrossEdge { /// The Face, edge, and entity ids of the patterned entities. @@ -1181,25 +1325,29 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the `EntityMakeHelix` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityMakeHelix { } /// The response from the `EntityMakeHelixFromParams` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityMakeHelixFromParams { } /// The response from the `EntityMakeHelixFromEdge` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EntityMakeHelixFromEdge { } /// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces) - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct Solid3dGetExtrusionFaceInfo { /// Details of each face. @@ -1207,7 +1355,8 @@ define_ok_modeling_cmd_response_enum! { } /// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces) - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ExtrusionFaceInfo { /// Path component (curve) UUID. @@ -1222,7 +1371,8 @@ define_ok_modeling_cmd_response_enum! { } /// Struct to contain the edge information of a wall of an extrude/rotate/loft/sweep. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ComplementaryEdges { /// The opposite edge has no common vertices with the original edge. A wall may not @@ -1235,7 +1385,8 @@ define_ok_modeling_cmd_response_enum! { /// Edge info struct (useful for maintaining mappings between edges and faces and /// adjacent/opposite edges). - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct AdjacencyInfo { /// Original edge id and face info. @@ -1253,12 +1404,14 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'SetGridReferencePlane'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetGridReferencePlane {} /// The response from the 'BooleanUnion'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct BooleanUnion { /// If the operation produced just one solid, then its ID will be the @@ -1273,7 +1426,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'BooleanIntersection'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct BooleanIntersection { /// If the operation produced just one solid, then its ID will be the @@ -1288,7 +1442,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'BooleanSubtract'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct BooleanSubtract { /// If the operation produced just one solid, then its ID will be the @@ -1303,7 +1458,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'BooleanImprint'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct BooleanImprint { /// If the operation produced just one body, then its ID will be the @@ -1318,17 +1474,20 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'SetGridScale'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetGridScale {} /// The response from the 'SetGridScale'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetGridAutoScale {} /// The response from the 'SetOrderIndependentTransparency'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetOrderIndependentTransparency { /// Is it now enabled, or disabled? @@ -1338,7 +1497,8 @@ define_ok_modeling_cmd_response_enum! { /// The response from the 'CreateRegion'. /// The region should have an ID taken from the ID of the /// 'CreateRegion' modeling command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CreateRegion { /// a mapping from the curves within this region to the source component segment curves they were split from @@ -1346,13 +1506,15 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'ToggleGraphics'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ToggleGraphics{ } /// The response from the 'CreatePlanarSurface'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CreatePlanarSurface { /// the list of the ids of the surfaces that were created from the planar surface command @@ -1360,7 +1522,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'RegionGetResolvableIntersectionInfo'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct RegionGetResolvableIntersectionInfo { /// The UUID of the walking curve that borders the queried region @@ -1378,7 +1541,8 @@ define_ok_modeling_cmd_response_enum! { /// The response from the 'CreateRegionFromQueryPoint'. /// The region should have an ID taken from the ID of the /// 'CreateRegionFromQueryPoint' modeling command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CreateRegionFromQueryPoint { /// a mapping from the curves within this region to the source component segment curves they were split from @@ -1386,7 +1550,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from 'RegionGetQueryPoint' modeling command. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct RegionGetQueryPoint { ///A point that is inside of the queried region, in the same coordinate frame as the sketch itself @@ -1395,7 +1560,8 @@ define_ok_modeling_cmd_response_enum! { /// The response from the 'SelectRegionFromPoint'. /// If there are multiple ways to construct this region, this chooses arbitrarily. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SelectRegionFromPoint { /// The region the user clicked on. @@ -1405,7 +1571,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'BoundingBox'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct BoundingBox { /// Center of the box. @@ -1415,24 +1582,28 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'OffsetSurface'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct OffsetSurface { } /// The response from the 'BeginExecution'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput, Builder, Default)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput, Builder, Default)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct BeginExecution { } /// The response from the 'EndExecution'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput, Builder, Default)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput, Builder, Default)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct EndExecution { } /// The response from the 'ClosestEdge'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct ClosestEdge { /// The ID of the edge closest to the point given in the request. @@ -1441,7 +1612,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'SketchGetInfo'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput, Builder)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SketchGetInfo { /// All curves in this sketch. @@ -1453,7 +1625,8 @@ define_ok_modeling_cmd_response_enum! { } /// The response from the 'SetKclVersion'. - #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput, Builder)] + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, ModelingCmdOutput, Builder)] + #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct SetKclVersion { } diff --git a/modeling-cmds/src/session.rs b/modeling-cmds/src/session.rs index 15637e1a..27062c56 100644 --- a/modeling-cmds/src/session.rs +++ b/modeling-cmds/src/session.rs @@ -1,10 +1,10 @@ -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{shared::PostEffectType, KclVersion}; /// Params for starting the engine. -#[derive(Debug, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(default)] pub struct EngineParams { /// Width of the video feed. Must be a multiple of 4. diff --git a/modeling-cmds/src/shared.rs b/modeling-cmds/src/shared.rs index 4db11c9c..b20aa0c8 100644 --- a/modeling-cmds/src/shared.rs +++ b/modeling-cmds/src/shared.rs @@ -2,6 +2,7 @@ use bon::Builder; use enum_iterator::Sequence; pub use kittycad_point::{Point2d, Point3d, Point4d, Quaternion}; use parse_display_derive::{Display, FromStr}; +#[cfg(feature = "json-schema")] use schemars::{schema::SchemaObject, JsonSchema}; use serde::{Deserialize, Serialize}; use uuid::Uuid; @@ -19,8 +20,9 @@ use crate::{ pub mod safe_filepath; /// Default tolerance values for modeling operations. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -31,7 +33,8 @@ pub struct Tolerance { } /// An edge can be referenced by its uuid or by the faces that uniquely define it. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -66,7 +69,8 @@ pub struct EdgeSpecifier { /// - **Segment**: `parent_id` is the **Path** UUID; `primitive_index` is the curve index within that path. /// /// Other [`EntityReference`] variants may omit this field or leave it unset when not applicable. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -80,7 +84,8 @@ pub struct PrimitiveTopologyFallback { } /// An edge/vertex can be defined by the faces that it is connected to. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(tag = "type", rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -173,7 +178,8 @@ pub enum EntityReference { } /// What kind of cut to do -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -187,7 +193,8 @@ pub enum CutType { } /// What to use as a direction when one is needed (e.g. for an extrusion). -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -206,7 +213,8 @@ pub enum DirectionType { } /// What to reflect mirrored geometry across -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -241,7 +249,8 @@ pub enum MirrorAcross { } /// What kind of cut to perform when cutting an edge. -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -275,7 +284,8 @@ pub enum CutTypeV2 { } /// A rotation defined by an axis, origin of rotation, and an angle. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -304,7 +314,8 @@ impl Default for Rotation { } /// Ways to transform each solid being replicated in a repeating pattern. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -344,7 +355,8 @@ impl Default for Transform { } /// Options for annotations -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -379,7 +391,8 @@ pub struct AnnotationOptions { } /// Options for annotation text -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -393,7 +406,8 @@ pub struct AnnotationLineEndOptions { } /// Options for annotation text -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -411,7 +425,8 @@ pub struct AnnotationTextOptions { } /// Parameters for defining a specific MBD Leader Position within an Entity -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -429,7 +444,8 @@ pub enum AnnotationMbdLeaderPosition { } /// Parameters for defining an MBD Geometric control frame -#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -454,7 +470,8 @@ pub struct AnnotationMbdControlFrame { } /// Parameters for defining an MBD basic dimension -#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -472,7 +489,8 @@ pub struct AnnotationMbdBasicDimension { } /// Parameters for defining an MBD Basic Dimension Annotation state which is measured between two positions in 3D -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -539,7 +557,8 @@ pub struct AnnotationBasicDimension { } /// Parameters for defining an MBD Feature Control Annotation state -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -603,7 +622,8 @@ pub struct AnnotationFeatureControl { } /// Parameters for defining an MBD Feature Tag Annotation state -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -660,7 +680,8 @@ pub struct AnnotationFeatureTag { /// The type of distance /// Distances can vary depending on /// the objects used as input. -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case", tag = "type")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -677,7 +698,8 @@ pub enum DistanceType { } /// The type of origin -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case", tag = "type")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -697,7 +719,8 @@ pub enum OriginType { } /// An RGBA color -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -722,9 +745,8 @@ impl Color { /// Horizontal Text alignment #[allow(missing_docs)] -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -738,9 +760,8 @@ pub enum AnnotationTextAlignmentX { /// Vertical Text alignment #[allow(missing_docs)] -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -754,9 +775,8 @@ pub enum AnnotationTextAlignmentY { /// Annotation line end type #[allow(missing_docs)] -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -769,9 +789,8 @@ pub enum AnnotationLineEnd { } /// The type of annotation -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -785,9 +804,8 @@ pub enum AnnotationType { } /// MBD standard -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -802,21 +820,9 @@ pub enum MbdStandard { /// MBD symbol type #[allow(missing_docs)] #[derive( - Default, - Display, - FromStr, - Copy, - Eq, - PartialEq, - Debug, - JsonSchema, - Deserialize, - Serialize, - Sequence, - Clone, - Ord, - PartialOrd, + Default, Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -891,9 +897,8 @@ pub enum MbdSymbol { } /// The type of camera drag interaction. -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -912,7 +917,8 @@ pub enum CameraDragInteractionType { /// A segment of a path. /// Paths are composed of many segments. -#[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, PartialEq)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case", tag = "type")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1027,7 +1033,8 @@ pub enum PathSegment { } /// An angle, with a specific unit. -#[derive(Clone, Copy, PartialEq, Debug, JsonSchema, Deserialize, Serialize)] +#[derive(Clone, Copy, PartialEq, Debug, Deserialize, Serialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1130,9 +1137,8 @@ impl std::ops::AddAssign for Angle { } /// The type of scene selection change -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1149,9 +1155,8 @@ pub enum SceneSelectionType { /// The type of scene's active tool #[allow(missing_docs)] -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1170,21 +1175,9 @@ pub enum SceneToolType { /// The path component constraint bounds type #[allow(missing_docs)] #[derive( - Display, - FromStr, - Copy, - Eq, - PartialEq, - Debug, - JsonSchema, - Deserialize, - Serialize, - Sequence, - Clone, - Ord, - PartialOrd, - Default, + Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, Default, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1200,21 +1193,9 @@ pub enum PathComponentConstraintBound { /// The path component constraint type #[allow(missing_docs)] #[derive( - Display, - FromStr, - Copy, - Eq, - PartialEq, - Debug, - JsonSchema, - Deserialize, - Serialize, - Sequence, - Clone, - Ord, - PartialOrd, - Default, + Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, Default, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1232,9 +1213,8 @@ pub enum PathComponentConstraintType { /// The path component command type (within a Path) #[allow(missing_docs)] -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1250,9 +1230,8 @@ pub enum PathCommand { /// The type of entity #[allow(missing_docs)] -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1277,9 +1256,8 @@ pub enum EntityType { /// The type of Curve (embedded within path) #[allow(missing_docs)] -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1292,7 +1270,8 @@ pub enum CurveType { } /// A file to be exported to the client. -#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone, PartialEq, Builder)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr( feature = "python", pyo3::pyclass(from_py_object), @@ -1322,9 +1301,8 @@ impl ExportFile { } /// The valid types of output file formats. -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, Ord, PartialOrd, Sequence, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Clone, Ord, PartialOrd, Sequence)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[display(style = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] @@ -1370,9 +1348,8 @@ pub enum FileExportFormat { } /// The valid types of 2D output file formats. -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, Ord, PartialOrd, Sequence, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Clone, Ord, PartialOrd, Sequence)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[display(style = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] @@ -1385,9 +1362,8 @@ pub enum FileExportFormat2d { } /// The valid types of source file formats. -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, Ord, PartialOrd, Sequence, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Clone, Ord, PartialOrd, Sequence)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[display(style = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] @@ -1426,7 +1402,8 @@ pub enum FileImportFormat { } /// The type of error sent by the KittyCAD graphics engine. -#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, Ord, PartialOrd)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1451,7 +1428,8 @@ impl From for http::StatusCode { } /// What kind of blend to do -#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1463,7 +1441,8 @@ pub enum BlendType { } /// Body type determining if the operation will create a manifold (solid) body or a non-manifold collection of surfaces. -#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1479,7 +1458,8 @@ pub enum BodyType { /// Extrusion method determining if the extrusion will be part of the existing object or an /// entirely new object. -#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1496,7 +1476,8 @@ pub enum ExtrudeMethod { } /// Type of reference geometry to extrude to. -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1530,7 +1511,8 @@ pub enum ExtrudeReference { } /// IDs for the extruded faces. -#[derive(Debug, PartialEq, Serialize, Deserialize, JsonSchema, Clone, Builder)] +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1548,7 +1530,8 @@ pub struct ExtrudedFaceInfo { } /// IDs for a side face, extruded from the path of some sketch/2D shape. -#[derive(Debug, PartialEq, Serialize, Deserialize, JsonSchema, Clone, Builder)] +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1561,7 +1544,8 @@ pub struct SideFace { } /// Camera settings including position, center, fov etc -#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone, PartialEq, Builder)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1591,7 +1575,8 @@ pub struct CameraSettings { #[allow(missing_docs)] #[repr(u8)] -#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1605,7 +1590,8 @@ pub enum WorldCoordinateSystem { #[allow(missing_docs)] #[repr(C)] -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1679,7 +1665,8 @@ impl From for crate::output::ViewIsometric { } /// Defines a perspective view. -#[derive(Copy, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, PartialOrd, Default, Builder)] +#[derive(Copy, PartialEq, Debug, Deserialize, Serialize, Clone, PartialOrd, Default, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1696,21 +1683,9 @@ pub struct PerspectiveCameraParameters { /// A type of camera movement applied after certain camera operations #[derive( - Default, - Display, - FromStr, - Copy, - Eq, - PartialEq, - Debug, - JsonSchema, - Deserialize, - Serialize, - Sequence, - Clone, - Ord, - PartialOrd, + Default, Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1725,9 +1700,8 @@ pub enum CameraMovement { } /// The global axes. -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1743,9 +1717,8 @@ pub enum GlobalAxis { } /// Possible types of faces which can be extruded from a 3D solid. -#[derive( - Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, -)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1766,21 +1739,9 @@ pub enum ExtrusionFaceCapType { /// Post effect type #[allow(missing_docs)] #[derive( - Display, - FromStr, - Copy, - Eq, - PartialEq, - Debug, - JsonSchema, - Deserialize, - Serialize, - Sequence, - Clone, - Ord, - PartialOrd, - Default, + Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, Default, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "lowercase")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -1901,8 +1862,9 @@ mod tests { } /// How a property of an object should be transformed. -#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, JsonSchema, Builder)] -#[schemars(rename = "TransformByFor{T}")] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "json-schema", schemars(rename = "TransformByFor{T}"))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1931,7 +1893,8 @@ impl TransformBy { /// Container that holds a translate, rotate and scale. /// Defaults to no change, everything stays the same (i.e. the identity function). -#[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, Default, Builder)] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Default, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -1967,6 +1930,7 @@ pub enum Opposite { Other(T), } +#[cfg(feature = "json-schema")] impl JsonSchema for Opposite { fn schema_name() -> String { format!("OppositeFor{}", T::schema_name()) @@ -1987,7 +1951,8 @@ impl JsonSchema for Opposite { /// What strategy (algorithm) should be used for cutting? /// Defaults to Automatic. -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -2006,7 +1971,8 @@ pub enum CutStrategy { } /// What is the given geometry relative to? -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -2021,7 +1987,8 @@ pub enum RelativeTo { } /// The region a user clicked on. -#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Builder)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] @@ -2054,7 +2021,8 @@ impl Default for SelectedRegion { } /// An edge id and an upper and lower percentage bound of the edge. -#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2071,19 +2039,20 @@ pub struct FractionOfEdge { /// If lower_bound is larger than upper_bound, the edge is effectively "flipped". #[serde(default)] #[builder(default)] - #[schemars(range(min = 0, max = 1))] + #[cfg_attr(feature = "json-schema", schemars(range(min = 0, max = 1)))] pub lower_bound: f32, /// A value between [0.0, 1.0] (default 1.0) that is a percentage along the edge. This bound /// will control how much of the edge is used during the blend. /// If lower_bound is larger than upper_bound, the edge is effectively "flipped". #[serde(default = "one")] #[builder(default = one())] - #[schemars(range(min = 0, max = 1))] + #[cfg_attr(feature = "json-schema", schemars(range(min = 0, max = 1)))] pub upper_bound: f32, } /// An object id, that corresponds to a surface body, and a list of edges of the surface. -#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2096,7 +2065,8 @@ pub struct SurfaceEdgeReference { } /// List of bodies that were created by an operation. -#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, Default)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2114,7 +2084,8 @@ impl BodiesCreated { } /// List of bodies that were updated by an operation. -#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, Default)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2132,7 +2103,8 @@ impl BodiesUpdated { } /// Details of a body that was created. -#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2145,7 +2117,8 @@ pub struct BodyCreated { } /// Details of a body that was updated. -#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2158,7 +2131,8 @@ pub struct BodyUpdated { } /// Details of a surface that was created under some body. -#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Builder, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2173,7 +2147,8 @@ pub struct SurfaceCreated { } /// Region-creation algorithm version. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2189,7 +2164,8 @@ pub enum RegionVersion { } /// Edge cut algorithm version. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Copy)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Copy)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] @@ -2283,7 +2259,8 @@ fn one() -> f32 { } /// A debug-view of the segment of a curve. -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, Builder)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Builder)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct CurveDebug { /// Start point of segment or circle. pub start: Option>, @@ -2300,7 +2277,8 @@ pub struct CurveDebug { } /// What type of curve is being viewed? -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] pub enum CurveTypeDebug { /// Line with a start and end. diff --git a/modeling-cmds/src/shared/safe_filepath.rs b/modeling-cmds/src/shared/safe_filepath.rs index 6dbae68f..3ef98a44 100644 --- a/modeling-cmds/src/shared/safe_filepath.rs +++ b/modeling-cmds/src/shared/safe_filepath.rs @@ -1,10 +1,10 @@ //! Filepaths safe to use in KCL projects because they cannot escape the KCL project root. -use schemars::JsonSchema; use serde_with::{DeserializeFromStr, SerializeDisplay}; use typed_path::{TypedPath, UnixComponent, WindowsComponent}; /// Filepath which is guaranteed to be relative and not contain parent directory jumps like '..' -#[derive(Debug, Clone, PartialEq, Eq, SerializeDisplay, DeserializeFromStr, JsonSchema, Default)] +#[derive(Debug, Clone, PartialEq, Eq, SerializeDisplay, DeserializeFromStr, Default)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] diff --git a/modeling-cmds/src/traits.rs b/modeling-cmds/src/traits.rs index 5651daee..b58bec2d 100644 --- a/modeling-cmds/src/traits.rs +++ b/modeling-cmds/src/traits.rs @@ -1,4 +1,3 @@ -use schemars::JsonSchema; use serde::{de::DeserializeOwned, Serialize}; use crate::ModelingCmd; @@ -14,7 +13,12 @@ pub trait ModelingCmdVariant: Serialize { } /// Anything that can be a ModelingCmd output. -pub trait ModelingCmdOutput: std::fmt::Debug + Serialize + DeserializeOwned + JsonSchema {} +#[cfg(feature = "json-schema")] +pub trait ModelingCmdOutput: std::fmt::Debug + Serialize + DeserializeOwned + schemars::JsonSchema {} + +/// Anything that can be a ModelingCmd output. +#[cfg(not(feature = "json-schema"))] +pub trait ModelingCmdOutput: std::fmt::Debug + Serialize + DeserializeOwned {} impl From for ModelingCmd where diff --git a/modeling-cmds/src/units.rs b/modeling-cmds/src/units.rs index e2cf1cf0..8994f4d1 100644 --- a/modeling-cmds/src/units.rs +++ b/modeling-cmds/src/units.rs @@ -2,7 +2,6 @@ use clap::ValueEnum; use kittycad_unit_conversion_derive::UnitConversion; use parse_display_derive::{Display, FromStr}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; #[cfg(feature = "cxx")] @@ -17,7 +16,6 @@ use crate::impl_extern_type; Eq, PartialEq, Debug, - JsonSchema, Deserialize, Serialize, Clone, @@ -26,6 +24,7 @@ use crate::impl_extern_type; UnitConversion, Hash, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "clap", derive(ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[display(style = "snake_case")] @@ -100,7 +99,6 @@ impl_extern_type! { Eq, PartialEq, Debug, - JsonSchema, Deserialize, Serialize, Clone, @@ -109,6 +107,7 @@ impl_extern_type! { UnitConversion, Hash, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "clap", derive(ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[serde(rename_all = "snake_case")] @@ -141,7 +140,6 @@ pub enum UnitAngle { Eq, PartialEq, Debug, - JsonSchema, Deserialize, Serialize, Clone, @@ -151,6 +149,7 @@ pub enum UnitAngle { Default, Hash, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "clap", derive(ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[serde(rename_all = "snake_case")] @@ -225,21 +224,9 @@ impl UnitArea { /// The valid types for density units. #[derive( - Display, - Copy, - Eq, - PartialEq, - Debug, - JsonSchema, - Deserialize, - Serialize, - Clone, - Ord, - PartialOrd, - Default, - UnitConversion, - Hash, + Display, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Clone, Ord, PartialOrd, Default, UnitConversion, Hash, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "clap", derive(ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[display(style = "snake_case")] @@ -297,7 +284,6 @@ impl UnitDensity { Eq, PartialEq, Debug, - JsonSchema, Deserialize, Serialize, Clone, @@ -306,6 +292,7 @@ impl UnitDensity { UnitConversion, Hash, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "clap", derive(ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[serde(rename_all = "snake_case")] @@ -357,7 +344,6 @@ impl UnitMass { Eq, PartialEq, Debug, - JsonSchema, Deserialize, Serialize, Clone, @@ -366,6 +352,7 @@ impl UnitMass { UnitConversion, Hash, )] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "clap", derive(ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[display(style = "snake_case")] diff --git a/modeling-cmds/src/websocket.rs b/modeling-cmds/src/websocket.rs index b22f023a..4004c127 100644 --- a/modeling-cmds/src/websocket.rs +++ b/modeling-cmds/src/websocket.rs @@ -3,7 +3,6 @@ use std::{borrow::Cow, collections::HashMap}; use parse_display_derive::{Display, FromStr}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; #[cfg(feature = "slog")] use slog::{Record, Serializer, KV}; @@ -17,7 +16,8 @@ use crate::{ }; /// The type of error sent by the KittyCAD API. -#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, Ord, PartialOrd)] +#[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, Deserialize, Serialize, Clone, Ord, PartialOrd)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub enum ErrorCode { @@ -165,7 +165,8 @@ impl ModelingBatch { /// Representation of an ICE server used for STUN/TURN /// Used to initiate WebRTC connections /// based on -#[derive(serde::Serialize, serde::Deserialize, Debug, JsonSchema, Clone, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct IceServer { /// URLs for a given STUN/TURN server. /// IceServer urls can either be a string or an array of strings @@ -264,7 +265,8 @@ pub struct SuccessWebSocketResponse { } /// Unsuccessful Websocket response. -#[derive(JsonSchema, Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] pub struct FailureWebSocketResponse { /// Always false @@ -349,7 +351,8 @@ impl WebSocketResponse { /// A raw file with unencoded contents. /// /// See the command that emits this type for its response encoding. -#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr( feature = "python", pyo3::pyclass(from_py_object), @@ -391,7 +394,8 @@ impl From for RawFile { } /// An error with an internal message for logging. -#[derive(Debug, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct LoggableApiError { /// The error shown to users pub error: ApiError, @@ -412,7 +416,8 @@ impl KV for LoggableApiError { } /// An error. -#[derive(Debug, Serialize, Deserialize, JsonSchema, Eq, PartialEq, Clone)] +#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct ApiError { /// The error code. pub error_code: ErrorCode, @@ -459,7 +464,8 @@ impl ApiError { /// Serde serializes Result into JSON as "Ok" and "Err", but we want "ok" and "err". /// So, create a new enum that serializes as lowercase. -#[derive(Debug, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case", rename = "SnakeCaseResult")] pub enum SnakeCaseResult { /// The result is Ok. @@ -487,7 +493,8 @@ impl From> for SnakeCaseResult { } /// ClientMetrics contains information regarding the state of the peer. -#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct ClientMetrics { /// Counter of the number of WebRTC frames the client has dropped from the @@ -589,7 +596,8 @@ pub struct ClientMetrics { } /// ICECandidate represents a ice candidate -#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] pub struct RtcIceCandidate { /// The stats ID. pub stats_id: String, @@ -654,7 +662,8 @@ impl From for webrtc::ice_transport::ice_candidate::RTCIceCandi } /// ICECandidateType represents the type of the ICE candidate used. -#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] pub enum RtcIceCandidateType { /// Unspecified indicates that the candidate type is unspecified. @@ -720,7 +729,8 @@ impl From for webrtc::ice_transport::ice_candidate_type::RT /// ICEProtocol indicates the transport protocol type that is used in the /// ice.URL structure. -#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] pub enum RtcIceProtocol { /// Unspecified indicates that the protocol is unspecified. @@ -757,7 +767,8 @@ impl From for webrtc::ice_transport::ice_protocol::RTCIceProtoco } /// ICECandidateInit is used to serialize ice candidates -#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[serde(rename_all = "camelCase")] // These HAVE to be camel case as per the RFC. @@ -801,7 +812,8 @@ impl From for webrtc::ice_transport::ice_candidate::RTCIceC } /// SessionDescription is used to expose local and remote session descriptions. -#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct RtcSessionDescription { /// SDP type. @@ -846,7 +858,8 @@ impl TryFrom for webrtc::peer_connection::sdp::session_de } /// SDPType describes the type of an SessionDescription. -#[derive(Default, Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize, JsonSchema)] +#[derive(Default, Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub enum RtcSdpType { @@ -903,7 +916,8 @@ impl From for webrtc::peer_connection::sdp::sdp_type::RTCSdpType { } } /// Successful Websocket response. -#[derive(JsonSchema, Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case")] pub struct ModelingSessionData { /// ID of the API call this modeling session is using.