aboutsummaryrefslogtreecommitdiff
path: root/src/api/schema
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/schema')
-rw-r--r--src/api/schema/common.rs7
-rw-r--r--src/api/schema/panes.rs3
-rw-r--r--src/api/schema/tests.rs3
3 files changed, 13 insertions, 0 deletions
diff --git a/src/api/schema/common.rs b/src/api/schema/common.rs
index e22fa1b3..7313002c 100644
--- a/src/api/schema/common.rs
+++ b/src/api/schema/common.rs
@@ -66,6 +66,13 @@ pub enum ReadSource {
Detection,
}
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+pub(crate) enum ReadIntent {
+ #[default]
+ Interactive,
+ Passive,
+}
+
#[derive(
Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default,
)]
diff --git a/src/api/schema/panes.rs b/src/api/schema/panes.rs
index 097b6366..647f7446 100644
--- a/src/api/schema/panes.rs
+++ b/src/api/schema/panes.rs
@@ -258,6 +258,9 @@ pub struct PaneReadParams {
pub format: ReadFormat,
#[serde(default = "super::default_true")]
pub strip_ansi: bool,
+ #[serde(skip)]
+ #[schemars(skip)]
+ pub(crate) intent: super::common::ReadIntent,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs
index 16894dbf..5fe6dd27 100644
--- a/src/api/schema/tests.rs
+++ b/src/api/schema/tests.rs
@@ -412,10 +412,13 @@ fn pane_read_defaults_to_text_format() {
"#;
let request: Request = serde_json::from_str(json).unwrap();
+ let serialized = serde_json::to_value(&request).unwrap();
+ assert!(serialized["params"].get("intent").is_none());
let Method::PaneRead(params) = request.method else {
panic!("wrong method parsed");
};
assert_eq!(params.format, ReadFormat::Text);
+ assert_eq!(params.intent, ReadIntent::Interactive);
}
#[test]