diff options
Diffstat (limited to 'src/api/schema')
| -rw-r--r-- | src/api/schema/server.rs | 3 | ||||
| -rw-r--r-- | src/api/schema/tests.rs | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/api/schema/server.rs b/src/api/schema/server.rs index 7ceda633..96e51564 100644 --- a/src/api/schema/server.rs +++ b/src/api/schema/server.rs @@ -18,4 +18,7 @@ pub struct ServerCapabilities { pub live_handoff: bool, #[serde(default)] pub detached_server_daemon: bool, + /// Stable client-owned endpoint generation supported by this server. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint_protocol_generation: Option<u32>, } diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs index e4a7f2a3..06529f5e 100644 --- a/src/api/schema/tests.rs +++ b/src/api/schema/tests.rs @@ -708,6 +708,12 @@ fn scroll_changed_subscription_event_round_trips() { } #[test] +fn agent_status_request_values_remain_strict() { + assert!(serde_json::from_str::<AgentStatus>(r#""working""#).is_ok()); + assert!(serde_json::from_str::<AgentStatus>(r#""future_status""#).is_err()); +} + +#[test] fn success_response_round_trips() { let response = SuccessResponse { id: "req_1".into(), @@ -717,6 +723,7 @@ fn success_response_round_trips() { capabilities: Some(ServerCapabilities { live_handoff: true, detached_server_daemon: true, + endpoint_protocol_generation: Some(1), }), }, }; |
