From 92d1a99f763d42ca4b79fa5779c40ece8532a7c0 Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Mon, 5 Jun 2023 19:34:31 +0530 Subject: [PATCH 1/5] fix: oneOf in bindings --- swagger.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/swagger.yaml b/swagger.yaml index b4a8129..bca90be 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -685,7 +685,7 @@ components: type: type: string description: The type of the stream item. Always stream. - example: stream + const: stream duration: type: integer description: The duration of the video in seconds. @@ -829,7 +829,7 @@ components: type: type: string description: The type of the channel item. Always channel. - example: channel + const: channel description: type: string description: The description of the channel. @@ -857,7 +857,7 @@ components: type: type: string description: The type of the playlist item. Always playlist. - example: playlist + const: playlist name: type: string description: The name of the playlist. @@ -872,6 +872,11 @@ components: description: The number of videos in the playlist. SearchItem: type: object + discriminator: + propertyName: type + properties: + type: + type: string oneOf: - $ref: "#/components/schemas/StreamItem" - $ref: "#/components/schemas/ChannelItem" From 9ccef76e89182c055ce12697256f689bec531130 Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Mon, 5 Jun 2023 19:41:18 +0530 Subject: [PATCH 2/5] fix: types enum --- swagger.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/swagger.yaml b/swagger.yaml index bca90be..417dce9 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -685,7 +685,8 @@ components: type: type: string description: The type of the stream item. Always stream. - const: stream + enum: + - stream duration: type: integer description: The duration of the video in seconds. @@ -829,7 +830,8 @@ components: type: type: string description: The type of the channel item. Always channel. - const: channel + enum: + - channel description: type: string description: The description of the channel. @@ -857,7 +859,8 @@ components: type: type: string description: The type of the playlist item. Always playlist. - const: playlist + enum: + - playlist name: type: string description: The name of the playlist. From 899dc5fa6b8d8e7f784bab19e3da0ddb84345bd2 Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Tue, 6 Jun 2023 15:12:40 +0530 Subject: [PATCH 3/5] fix: add type to SearchItem --- swagger.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swagger.yaml b/swagger.yaml index 417dce9..7fda000 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -880,6 +880,10 @@ components: properties: type: type: string + enum: + - stream + - channel + - playlist oneOf: - $ref: "#/components/schemas/StreamItem" - $ref: "#/components/schemas/ChannelItem" From 21cef4768c95b299aa00ca4ae8e52039ad5989ae Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Tue, 6 Jun 2023 18:11:16 +0530 Subject: [PATCH 4/5] fix: remove unwanted --- swagger.yaml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/swagger.yaml b/swagger.yaml index 7fda000..b75a398 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -685,8 +685,7 @@ components: type: type: string description: The type of the stream item. Always stream. - enum: - - stream + example: stream duration: type: integer description: The duration of the video in seconds. @@ -830,8 +829,7 @@ components: type: type: string description: The type of the channel item. Always channel. - enum: - - channel + example: channel description: type: string description: The description of the channel. @@ -859,8 +857,7 @@ components: type: type: string description: The type of the playlist item. Always playlist. - enum: - - playlist + example: playlist name: type: string description: The name of the playlist. @@ -877,13 +874,6 @@ components: type: object discriminator: propertyName: type - properties: - type: - type: string - enum: - - stream - - channel - - playlist oneOf: - $ref: "#/components/schemas/StreamItem" - $ref: "#/components/schemas/ChannelItem" From 5d916bbd2b876f039b8c3f107fe09158022e21e1 Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Tue, 6 Jun 2023 19:57:03 +0530 Subject: [PATCH 5/5] fix: add mapping --- swagger.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swagger.yaml b/swagger.yaml index b75a398..3ebeb99 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -874,6 +874,10 @@ components: type: object discriminator: propertyName: type + mapping: + stream: "#/components/schemas/StreamItem" + channel: "#/components/schemas/ChannelItem" + playlist: "#/components/schemas/PlaylistItem" oneOf: - $ref: "#/components/schemas/StreamItem" - $ref: "#/components/schemas/ChannelItem"