Skip to content

Commit

Permalink
fix: some rest api enums
Browse files Browse the repository at this point in the history
  • Loading branch information
giangndm committed Jan 26, 2024
1 parent f5c558a commit fe4f19c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cluster/src/define/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub enum ClusterStateEndpointState {
pub enum ClusterEndpointSubscribeScope {
Full,
#[serde(rename = "stream_only")]
#[oai(rename = "stream_only")]
StreamOnly,
Manual,
}
Expand Down Expand Up @@ -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,
}

Expand Down
2 changes: 2 additions & 0 deletions packages/media-utils/src/req_res.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use serde::{Deserialize, Serialize};
pub struct Response<T: ParseFromJSON + ToJSON + Type + Send + Sync> {
pub status: bool,
#[serde(skip_serializing_if = "Option::is_none")]
#[oai(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
#[oai(skip_serializing_if = "Option::is_none")]
pub data: Option<T>,
}
2 changes: 2 additions & 0 deletions packages/transport/src/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit fe4f19c

Please sign in to comment.