WebsocketModelFilter.cs 1.4 KB

123456789101112131415161718192021222324252627282930
  1. using MediaBrowser.Common.Plugins;
  2. using MediaBrowser.Controller.LiveTv;
  3. using MediaBrowser.Model.Entities;
  4. using MediaBrowser.Model.Session;
  5. using MediaBrowser.Model.SyncPlay;
  6. using Microsoft.OpenApi.Models;
  7. using Swashbuckle.AspNetCore.SwaggerGen;
  8. namespace Jellyfin.Server.Filters
  9. {
  10. /// <summary>
  11. /// Add models used in websocket messaging.
  12. /// </summary>
  13. public class WebsocketModelFilter : IDocumentFilter
  14. {
  15. /// <inheritdoc />
  16. public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
  17. {
  18. context.SchemaGenerator.GenerateSchema(typeof(LibraryUpdateInfo), context.SchemaRepository);
  19. context.SchemaGenerator.GenerateSchema(typeof(IPlugin), context.SchemaRepository);
  20. context.SchemaGenerator.GenerateSchema(typeof(PlayRequest), context.SchemaRepository);
  21. context.SchemaGenerator.GenerateSchema(typeof(PlaystateRequest), context.SchemaRepository);
  22. context.SchemaGenerator.GenerateSchema(typeof(TimerEventInfo), context.SchemaRepository);
  23. context.SchemaGenerator.GenerateSchema(typeof(SendCommand), context.SchemaRepository);
  24. context.SchemaGenerator.GenerateSchema(typeof(GeneralCommandType), context.SchemaRepository);
  25. context.SchemaGenerator.GenerateSchema(typeof(GroupUpdate<object>), context.SchemaRepository);
  26. }
  27. }
  28. }