mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Merge pull request #7488 from crobibero/flag-enum-openapi
This commit is contained in:
commit
945fb8b72e
@ -29,6 +29,7 @@ using Jellyfin.Server.Filters;
|
|||||||
using Jellyfin.Server.Formatters;
|
using Jellyfin.Server.Formatters;
|
||||||
using MediaBrowser.Common.Net;
|
using MediaBrowser.Common.Net;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
|
using MediaBrowser.Model.Session;
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
@ -428,6 +429,17 @@ namespace Jellyfin.Server.Extensions
|
|||||||
Nullable = true
|
Nullable = true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Manually describe Flags enum.
|
||||||
|
options.MapType<TranscodeReason>(() =>
|
||||||
|
new OpenApiSchema
|
||||||
|
{
|
||||||
|
Type = "string",
|
||||||
|
Enum = Enum.GetNames<TranscodeReason>()
|
||||||
|
.Select(e => new OpenApiString(e))
|
||||||
|
.Cast<IOpenApiAny>()
|
||||||
|
.ToArray()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user