Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/jellyfin/commit/1f9cda6a6600a81969cf8afad3c60fa77bb5a093?style=split&whitespace=ignore-eol You should set ROOT_URL correctly, otherwise the web may not work correctly.

Add ImageTags to SwaggerGenTypes

pull/2967/head
crobibero 5 years ago
parent 70c42eb0ac
commit 1f9cda6a66

@ -1,13 +1,17 @@
using System.Collections.Generic;
using System.Linq;
using Jellyfin.Api; using Jellyfin.Api;
using Jellyfin.Api.Auth; using Jellyfin.Api.Auth;
using Jellyfin.Api.Auth.FirstTimeSetupOrElevatedPolicy; using Jellyfin.Api.Auth.FirstTimeSetupOrElevatedPolicy;
using Jellyfin.Api.Auth.RequiresElevationPolicy; using Jellyfin.Api.Auth.RequiresElevationPolicy;
using Jellyfin.Api.Constants; using Jellyfin.Api.Constants;
using Jellyfin.Api.Controllers; using Jellyfin.Api.Controllers;
using MediaBrowser.Model.Entities;
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace Jellyfin.Server.Extensions namespace Jellyfin.Server.Extensions
{ {
@ -89,7 +93,25 @@ namespace Jellyfin.Server.Extensions
return serviceCollection.AddSwaggerGen(c => return serviceCollection.AddSwaggerGen(c =>
{ {
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Jellyfin API", Version = "v1" }); c.SwaggerDoc("v1", new OpenApiInfo { Title = "Jellyfin API", Version = "v1" });
c.MapSwaggerGenTypes();
}); });
} }
private static void MapSwaggerGenTypes(this SwaggerGenOptions options)
{
// BaseItemDto.ImageTags
options.MapType<Dictionary<ImageType, string>>(() =>
new OpenApiSchema
{
Type = "object",
Properties = typeof(ImageType).GetEnumNames().ToDictionary(
name => name,
name => new OpenApiSchema
{
Type = "string",
Format = "string"
})
});
}
} }
} }

Loading…
Cancel
Save