aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Filters/WebsocketModelFilter.cs
blob: 90fca5583cf08c33a27f37b2cbb6b3e0b2cfca48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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(TimerEventInfo), context.SchemaRepository);
            context.SchemaGenerator.GenerateSchema(typeof(SendCommand), context.SchemaRepository);
            context.SchemaGenerator.GenerateSchema(typeof(GeneralCommandType), context.SchemaRepository);

            context.SchemaGenerator.GenerateSchema(typeof(GroupUpdate<string>), context.SchemaRepository);
            context.SchemaGenerator.GenerateSchema(typeof(GroupUpdate<PlayRequest>), context.SchemaRepository);
            context.SchemaGenerator.GenerateSchema(typeof(GroupUpdate<long>), context.SchemaRepository);
        }
    }
}