Fix TranscodeReasons type in OpenAPI output

This commit is contained in:
Niels van Velzen
2022-10-22 13:59:24 +02:00
parent 679e83082f
commit 43223b9036
2 changed files with 20 additions and 5 deletions

View File

@@ -434,11 +434,15 @@ namespace Jellyfin.Server.Extensions
options.MapType<TranscodeReason>(() =>
new OpenApiSchema
{
Type = "string",
Enum = Enum.GetNames<TranscodeReason>()
.Select(e => new OpenApiString(e))
.Cast<IOpenApiAny>()
.ToArray()
Type = "array",
Items = new OpenApiSchema
{
Reference = new OpenApiReference
{
Id = nameof(TranscodeReason),
Type = ReferenceType.Schema,
}
}
});
// Swashbuckle doesn't use JsonOptions to describe responses, so we need to manually describe it.