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 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Jellyfin.Server/Filters/AdditionalModelFilter.cs (limited to 'Jellyfin.Server/Filters/AdditionalModelFilter.cs') 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); + } + } +} -- cgit v1.2.3