From 8800c0d78004e87e3fc2cb270c0cef6a5aece02e Mon Sep 17 00:00:00 2001 From: ajoymajumdar Date: Tue, 23 Jul 2024 16:06:22 -0700 Subject: [PATCH] Fixed a bug where the OpenAPI V3 spec was incorrect. The bug was introduced in https://github.com/datahub-project/datahub/pull/10939. --- .../io/datahubproject/openapi/config/SpringWebConfig.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/config/SpringWebConfig.java b/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/config/SpringWebConfig.java index 09a6cc7c1e4b76..31b8861666fac1 100644 --- a/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/config/SpringWebConfig.java +++ b/metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/config/SpringWebConfig.java @@ -16,6 +16,7 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -150,6 +151,11 @@ private Map concat(Supplier> a, Supplier> b) { : b.get() == null ? a.get() : Stream.concat(a.get().entrySet().stream(), b.get().entrySet().stream()) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + .collect( + Collectors.toMap( + Map.Entry::getKey, + Map.Entry::getValue, + (v1, v2) -> v1, + LinkedHashMap::new)); } }