fix openapi validation errors

This commit is contained in:
crobibero
2020-08-03 14:38:51 -06:00
parent 1535f363b2
commit 9e00aa3014
18 changed files with 70 additions and 108 deletions
@@ -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();