diff options
| author | Anthony Lavado <anthony@lavado.ca> | 2020-10-09 20:11:57 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-09 20:11:57 -0400 |
| commit | dd43af23a4350624ef8398117f791d0658310f80 (patch) | |
| tree | 8070262146f65caeb1dddf703ad1f3101466f8b4 /Jellyfin.Server/Filters/WebsocketModelFilter.cs | |
| parent | 85d4d0d072c91183165ea6909ad2747e4708d4b4 (diff) | |
| parent | 2b75af987395c242b69f57b636121302eadaee30 (diff) | |
Merge pull request #4248 from crobibero/ws-document-filter
Manually register models used in websocket messages.
Diffstat (limited to 'Jellyfin.Server/Filters/WebsocketModelFilter.cs')
| -rw-r--r-- | Jellyfin.Server/Filters/WebsocketModelFilter.cs | 30 |
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); + } + } +} |
