From fe4f19cfee4dc26781fe67b5b31c768a1d895ab9 Mon Sep 17 00:00:00 2001 From: Giang Minh Date: Sat, 27 Jan 2024 00:21:25 +0700 Subject: [PATCH] fix: some rest api enums --- packages/cluster/src/define/endpoint.rs | 3 +++ packages/media-utils/src/req_res.rs | 2 ++ packages/transport/src/kind.rs | 2 ++ 3 files changed, 7 insertions(+) diff --git a/packages/cluster/src/define/endpoint.rs b/packages/cluster/src/define/endpoint.rs index 58d79708..86a4547e 100644 --- a/packages/cluster/src/define/endpoint.rs +++ b/packages/cluster/src/define/endpoint.rs @@ -26,6 +26,7 @@ pub enum ClusterStateEndpointState { pub enum ClusterEndpointSubscribeScope { Full, #[serde(rename = "stream_only")] + #[oai(rename = "stream_only")] StreamOnly, Manual, } @@ -53,6 +54,8 @@ impl Default for ClusterEndpointSubscribeScope { #[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Copy, Clone, Enum)] pub enum ClusterEndpointPublishScope { Full, + #[serde(rename = "stream_only")] + #[oai(rename = "stream_only")] StreamOnly, } diff --git a/packages/media-utils/src/req_res.rs b/packages/media-utils/src/req_res.rs index d3b0c2c8..1800bed5 100644 --- a/packages/media-utils/src/req_res.rs +++ b/packages/media-utils/src/req_res.rs @@ -6,7 +6,9 @@ use serde::{Deserialize, Serialize}; pub struct Response { pub status: bool, #[serde(skip_serializing_if = "Option::is_none")] + #[oai(skip_serializing_if = "Option::is_none")] pub error: Option, #[serde(skip_serializing_if = "Option::is_none")] + #[oai(skip_serializing_if = "Option::is_none")] pub data: Option, } diff --git a/packages/transport/src/kind.rs b/packages/transport/src/kind.rs index 7bfec982..732a5a23 100644 --- a/packages/transport/src/kind.rs +++ b/packages/transport/src/kind.rs @@ -4,8 +4,10 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Copy, Hash, Enum)] pub enum MediaKind { #[serde(rename = "audio")] + #[oai(rename = "audio")] Audio, #[serde(rename = "video")] + #[oai(rename = "video")] Video, }