diff options
| author | Patrick Barron <18354464+barronpm@users.noreply.github.com> | 2020-08-03 21:45:15 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-03 21:45:15 +0000 |
| commit | 8385c5459142e69eb4004d32b3d772b998c37b0b (patch) | |
| tree | 0cf20aa76ec8eb100dd8d7adc850c6c1009011eb /Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | |
| parent | a28d00eebaec733d0c3b4e85da95c1e466189883 (diff) | |
| parent | dee7bdddb6f5ce0cc09dc2b20d4dab9747eea9f0 (diff) | |
Merge pull request #3811 from crobibero/api-cleanup
Clean up api-migration branch
Diffstat (limited to 'Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs')
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index cfbabf795..6e91042df 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -198,8 +198,15 @@ namespace Jellyfin.Server.Extensions $"{description.ActionDescriptor.RouteValues["controller"]}_{description.RelativePath}"); // Use method name as operationId - c.CustomOperationIds(description => - description.TryGetMethodInfo(out MethodInfo methodInfo) ? methodInfo.Name : null); + c.CustomOperationIds( + description => + { + description.TryGetMethodInfo(out MethodInfo methodInfo); + // Attribute name, method name, none. + return description?.ActionDescriptor?.AttributeRouteInfo?.Name + ?? methodInfo?.Name + ?? null; + }); // TODO - remove when all types are supported in System.Text.Json c.AddSwaggerTypeMappings(); |
