Browse Source

Merge pull request #6838 from crobibero/openapi-nullable

Add nullable dictionary openapi mapping
Claus Vium 3 years ago
parent
commit
2f92ee374a
1 changed files with 12 additions and 0 deletions
  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
+                    }
+                });
         }
     }
 }