浏览代码

Merge pull request #6838 from crobibero/openapi-nullable

Add nullable dictionary openapi mapping
Claus Vium 3 年之前
父节点
当前提交
2f92ee374a
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs

+ 12 - 0
Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs

@@ -416,6 +416,18 @@ namespace Jellyfin.Server.Extensions
                             }
                         })
                 });
+
+            // Support dictionary with nullable string value.
+            options.MapType<Dictionary<string, string?>>(() =>
+                new OpenApiSchema
+                {
+                    Type = "object",
+                    AdditionalProperties = new OpenApiSchema
+                    {
+                        Type = "string",
+                        Nullable = true
+                    }
+                });
         }
     }
 }