aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Filters/WebsocketModelFilter.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-10-27 13:35:46 -0600
committercrobibero <cody@robibe.ro>2020-10-27 13:35:46 -0600
commit4f7c13ecf431004060d0d9eb6cda9bd2593394d0 (patch)
tree68230bb7f4a3cd160b9959a714bc9c1764472a62 /Jellyfin.Server/Filters/WebsocketModelFilter.cs
parent69360b749a53bd41087530f7fbe2e0c7798f704b (diff)
parentbe2f27a0695e5f3102f79a2e246e971682cff603 (diff)
Merge remote-tracking branch 'upstream/master' into query-fields
Diffstat (limited to 'Jellyfin.Server/Filters/WebsocketModelFilter.cs')
-rw-r--r--Jellyfin.Server/Filters/WebsocketModelFilter.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/Jellyfin.Server/Filters/WebsocketModelFilter.cs b/Jellyfin.Server/Filters/WebsocketModelFilter.cs
new file mode 100644
index 000000000..248802857
--- /dev/null
+++ b/Jellyfin.Server/Filters/WebsocketModelFilter.cs
@@ -0,0 +1,30 @@
+using MediaBrowser.Common.Plugins;
+using MediaBrowser.Controller.LiveTv;
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Session;
+using MediaBrowser.Model.SyncPlay;
+using Microsoft.OpenApi.Models;
+using Swashbuckle.AspNetCore.SwaggerGen;
+
+namespace Jellyfin.Server.Filters
+{
+ /// <summary>
+ /// Add models used in websocket messaging.
+ /// </summary>
+ public class WebsocketModelFilter : IDocumentFilter
+ {
+ /// <inheritdoc />
+ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
+ {
+ context.SchemaGenerator.GenerateSchema(typeof(LibraryUpdateInfo), context.SchemaRepository);
+ context.SchemaGenerator.GenerateSchema(typeof(IPlugin), context.SchemaRepository);
+ context.SchemaGenerator.GenerateSchema(typeof(PlayRequest), context.SchemaRepository);
+ context.SchemaGenerator.GenerateSchema(typeof(PlaystateRequest), context.SchemaRepository);
+ context.SchemaGenerator.GenerateSchema(typeof(TimerEventInfo), context.SchemaRepository);
+ context.SchemaGenerator.GenerateSchema(typeof(SendCommand), context.SchemaRepository);
+ context.SchemaGenerator.GenerateSchema(typeof(GeneralCommandType), context.SchemaRepository);
+
+ context.SchemaGenerator.GenerateSchema(typeof(GroupUpdate<object>), context.SchemaRepository);
+ }
+ }
+}