From b81e818e47d6d16330693265fd87a590446c7131 Mon Sep 17 00:00:00 2001
From: david-leifker <114954101+david-leifker@users.noreply.github.com>
Date: Mon, 2 Oct 2023 12:08:37 -0500
Subject: [PATCH 1/8] feat(openapi): openapi v2 updates (#8927)
---
build.gradle | 4 +-
.../io/datahubproject/OpenApiEntities.java | 29 ++-
.../src/main/resources/application.yml | 2 +
.../health/config/SpringWebConfig.java | 35 ----
.../delegates/EntityApiDelegateImpl.java | 197 +++++++++++++++++-
.../openapi/util/OpenApiEntitiesUtil.java | 8 +-
.../OpenAPIEntityTestConfiguration.java | 19 +-
.../delegates/EntityApiDelegateImplTest.java | 54 ++++-
.../0.0.0-dev/entity-registry.yaml | 8 +
.../0.0.0-dev/metadata-models-custom.jar | Bin 0 -> 20878 bytes
.../openapi/config/SpringWebConfig.java | 25 +++
.../{ => health}/HealthController.java | 2 +-
.../openapi/util/MappingUtil.java | 119 ++++++++---
.../webapp/WEB-INF/healthServlet-servlet.xml | 14 --
.../webapp/WEB-INF/openapiServlet-servlet.xml | 4 +-
.../war/src/main/webapp/WEB-INF/web.xml | 8 +-
16 files changed, 428 insertions(+), 100 deletions(-)
delete mode 100644 metadata-service/health-servlet/src/main/java/com/datahub/health/config/SpringWebConfig.java
create mode 100644 metadata-service/openapi-entity-servlet/src/test/resources/custom-model/mycompany-dq-model/0.0.0-dev/entity-registry.yaml
create mode 100644 metadata-service/openapi-entity-servlet/src/test/resources/custom-model/mycompany-dq-model/0.0.0-dev/metadata-models-custom.jar
rename metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/{ => health}/HealthController.java (94%)
delete mode 100644 metadata-service/war/src/main/webapp/WEB-INF/healthServlet-servlet.xml
diff --git a/build.gradle b/build.gradle
index c8892045a6683..025c588da2b52 100644
--- a/build.gradle
+++ b/build.gradle
@@ -200,8 +200,8 @@ project.ext.externalDependency = [
'springBootStarterValidation': "org.springframework.boot:spring-boot-starter-validation:$springBootVersion",
'springKafka': 'org.springframework.kafka:spring-kafka:2.8.11',
'springActuator': "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion",
- 'swaggerAnnotations': 'io.swagger.core.v3:swagger-annotations:2.1.12',
- 'swaggerCli': 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.41',
+ 'swaggerAnnotations': 'io.swagger.core.v3:swagger-annotations:2.2.15',
+ 'swaggerCli': 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.46',
'testngJava8': 'org.testng:testng:7.5.1',
'testng': 'org.testng:testng:7.8.0',
'testContainers': 'org.testcontainers:testcontainers:' + testContainersVersion,
diff --git a/buildSrc/src/main/java/io/datahubproject/OpenApiEntities.java b/buildSrc/src/main/java/io/datahubproject/OpenApiEntities.java
index 7fbf013384b7d..888c4a0e99931 100644
--- a/buildSrc/src/main/java/io/datahubproject/OpenApiEntities.java
+++ b/buildSrc/src/main/java/io/datahubproject/OpenApiEntities.java
@@ -6,6 +6,7 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
+import com.google.common.collect.ImmutableSet;
import com.linkedin.metadata.models.registry.config.Entities;
import com.linkedin.metadata.models.registry.config.Entity;
import org.gradle.internal.Pair;
@@ -16,7 +17,12 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
-import java.util.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.Spliterator;
+import java.util.Spliterators;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -37,10 +43,23 @@ public class OpenApiEntities {
private String entityRegistryYaml;
private Path combinedDirectory;
- private final static Set
From 83a7dad20e7420b7283db22a2964d05ee3c42a7d Mon Sep 17 00:00:00 2001
From: Lucas Phan