AdditionalModelFilter.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. using MediaBrowser.Common.Plugins;
  2. using MediaBrowser.Controller.LiveTv;
  3. using MediaBrowser.Model.ApiClient;
  4. using MediaBrowser.Model.Entities;
  5. using MediaBrowser.Model.Session;
  6. using MediaBrowser.Model.SyncPlay;
  7. using Microsoft.OpenApi.Models;
  8. using Swashbuckle.AspNetCore.SwaggerGen;
  9. namespace Jellyfin.Server.Filters
  10. {
  11. /// <summary>
  12. /// Add models not directly used by the API, but used for discovery and websockets.
  13. /// </summary>
  14. public class AdditionalModelFilter : IDocumentFilter
  15. {
  16. /// <inheritdoc />
  17. public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
  18. {
  19. context.SchemaGenerator.GenerateSchema(typeof(LibraryUpdateInfo), context.SchemaRepository);
  20. context.SchemaGenerator.GenerateSchema(typeof(IPlugin), context.SchemaRepository);
  21. context.SchemaGenerator.GenerateSchema(typeof(PlayRequest), context.SchemaRepository);
  22. context.SchemaGenerator.GenerateSchema(typeof(PlaystateRequest), context.SchemaRepository);
  23. context.SchemaGenerator.GenerateSchema(typeof(TimerEventInfo), context.SchemaRepository);
  24. context.SchemaGenerator.GenerateSchema(typeof(SendCommand), context.SchemaRepository);
  25. context.SchemaGenerator.GenerateSchema(typeof(GeneralCommandType), context.SchemaRepository);
  26. context.SchemaGenerator.GenerateSchema(typeof(GroupUpdate<object>), context.SchemaRepository);
  27. context.SchemaGenerator.GenerateSchema(typeof(SessionMessageType), context.SchemaRepository);
  28. context.SchemaGenerator.GenerateSchema(typeof(ServerDiscoveryInfo), context.SchemaRepository);
  29. }
  30. }
  31. }