aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs
diff options
context:
space:
mode:
authorPatrick Barron <18354464+barronpm@users.noreply.github.com>2020-08-03 21:45:15 +0000
committerGitHub <noreply@github.com>2020-08-03 21:45:15 +0000
commit8385c5459142e69eb4004d32b3d772b998c37b0b (patch)
tree0cf20aa76ec8eb100dd8d7adc850c6c1009011eb /Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs
parenta28d00eebaec733d0c3b4e85da95c1e466189883 (diff)
parentdee7bdddb6f5ce0cc09dc2b20d4dab9747eea9f0 (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.cs11
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();