From 1d53912b23f287465f673b92b337795fa8196cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Tue, 19 Jul 2022 19:50:23 -0300 Subject: [PATCH] src: stream: Make the old settings compatible. Turns out that we can make the tag "type" as optional for VideoCaptureConfiguration ("type": "video"), but required for any other, like RedirectCaptureConfiguration ("type": "redirect"). --- src/stream/types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stream/types.rs b/src/stream/types.rs index d39f125b..3dc91675 100644 --- a/src/stream/types.rs +++ b/src/stream/types.rs @@ -50,10 +50,11 @@ pub struct VideoCaptureConfiguration { } #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[serde(tag = "type", rename_all = "lowercase")] pub struct RedirectCaptureConfiguration {} #[derive(Apiv2Schema, Clone, Debug, PartialEq, Deserialize, Serialize)] -#[serde(tag = "type", rename_all = "lowercase")] +#[serde(untagged, rename_all = "lowercase")] pub enum CaptureConfiguration { VIDEO(VideoCaptureConfiguration), REDIRECT(RedirectCaptureConfiguration),