From 31d1dbfda630e45a8884f1a10d172f8cc83df9b0 Mon Sep 17 00:00:00 2001 From: crobibero Date: Sat, 3 Apr 2021 06:54:09 -0600 Subject: Add SessionDiscoveryInfo to generated api-docs --- Jellyfin.Server/Filters/AdditionalModelFilter.cs | 34 ++++++++++++++++++++++++ Jellyfin.Server/Filters/WebsocketModelFilter.cs | 32 ---------------------- 2 files changed, 34 insertions(+), 32 deletions(-) create mode 100644 Jellyfin.Server/Filters/AdditionalModelFilter.cs delete mode 100644 Jellyfin.Server/Filters/WebsocketModelFilter.cs (limited to 'Jellyfin.Server/Filters') diff --git a/Jellyfin.Server/Filters/AdditionalModelFilter.cs b/Jellyfin.Server/Filters/AdditionalModelFilter.cs new file mode 100644 index 000000000..87a59e0b4 --- /dev/null +++ b/Jellyfin.Server/Filters/AdditionalModelFilter.cs @@ -0,0 +1,34 @@ +using MediaBrowser.Common.Plugins; +using MediaBrowser.Controller.LiveTv; +using MediaBrowser.Model.ApiClient; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Session; +using MediaBrowser.Model.SyncPlay; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Jellyfin.Server.Filters +{ + /// + /// Add models not directly used by the API, but used for discovery and websockets. + /// + public class AdditionalModelFilter : IDocumentFilter + { + /// + 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), context.SchemaRepository); + + context.SchemaGenerator.GenerateSchema(typeof(SessionMessageType), context.SchemaRepository); + context.SchemaGenerator.GenerateSchema(typeof(ServerDiscoveryInfo), context.SchemaRepository); + } + } +} diff --git a/Jellyfin.Server/Filters/WebsocketModelFilter.cs b/Jellyfin.Server/Filters/WebsocketModelFilter.cs deleted file mode 100644 index 38afb201d..000000000 --- a/Jellyfin.Server/Filters/WebsocketModelFilter.cs +++ /dev/null @@ -1,32 +0,0 @@ -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 -{ - /// - /// Add models used in websocket messaging. - /// - public class WebsocketModelFilter : IDocumentFilter - { - /// - 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), context.SchemaRepository); - - context.SchemaGenerator.GenerateSchema(typeof(SessionMessageType), context.SchemaRepository); - } - } -} -- cgit v1.2.3