From efb2529a5089da79b1bfb06b816019fa7b249595 Mon Sep 17 00:00:00 2001 From: Steve Hu Date: Tue, 15 Dec 2020 14:19:46 -0500 Subject: [PATCH] fixes #154 splite openapi-meta to move specification parser to openapi-helper (#155) --- openapi-helper/pom.xml | 62 ++ .../networknt/openapi/ApiNormalisedPath.java | 0 .../com/networknt/openapi/NormalisedPath.java | 0 .../com/networknt/openapi/OpenApiHelper.java | 0 .../networknt/openapi/OpenApiOperation.java | 0 .../networknt/openapi/OpenApiHelperTest.java | 0 .../test/resources/config/client.truststore | Bin 0 -> 885 bytes .../src/test/resources/config/openapi.json | 293 ++++++ .../src/test/resources/config/openapi.yaml | 840 ++++++++++++++++++ .../src/test/resources/logback-test.xml | 72 ++ openapi-meta/pom.xml | 4 + .../parameter/ParameterDeserializer.java | 1 - pom.xml | 6 + 13 files changed, 1277 insertions(+), 1 deletion(-) create mode 100644 openapi-helper/pom.xml rename {openapi-meta => openapi-helper}/src/main/java/com/networknt/openapi/ApiNormalisedPath.java (100%) rename {openapi-meta => openapi-helper}/src/main/java/com/networknt/openapi/NormalisedPath.java (100%) rename {openapi-meta => openapi-helper}/src/main/java/com/networknt/openapi/OpenApiHelper.java (100%) rename {openapi-meta => openapi-helper}/src/main/java/com/networknt/openapi/OpenApiOperation.java (100%) rename {openapi-meta => openapi-helper}/src/test/java/com/networknt/openapi/OpenApiHelperTest.java (100%) create mode 100644 openapi-helper/src/test/resources/config/client.truststore create mode 100644 openapi-helper/src/test/resources/config/openapi.json create mode 100644 openapi-helper/src/test/resources/config/openapi.yaml create mode 100644 openapi-helper/src/test/resources/logback-test.xml diff --git a/openapi-helper/pom.xml b/openapi-helper/pom.xml new file mode 100644 index 00000000..b08a1d05 --- /dev/null +++ b/openapi-helper/pom.xml @@ -0,0 +1,62 @@ + + + + 4.0.0 + + + com.networknt + light-rest-4j + 2.0.22-SNAPSHOT + .. + + + openapi-helper + jar + An OpenAPI Specification 3.0 helper to cache the spec for other component to use + + + + com.networknt + json-overlay + + + com.networknt + openapi-parser + + + com.fasterxml.jackson.core + jackson-databind + + + org.slf4j + slf4j-api + + + + ch.qos.logback + logback-classic + test + + + junit + junit + test + + + + diff --git a/openapi-meta/src/main/java/com/networknt/openapi/ApiNormalisedPath.java b/openapi-helper/src/main/java/com/networknt/openapi/ApiNormalisedPath.java similarity index 100% rename from openapi-meta/src/main/java/com/networknt/openapi/ApiNormalisedPath.java rename to openapi-helper/src/main/java/com/networknt/openapi/ApiNormalisedPath.java diff --git a/openapi-meta/src/main/java/com/networknt/openapi/NormalisedPath.java b/openapi-helper/src/main/java/com/networknt/openapi/NormalisedPath.java similarity index 100% rename from openapi-meta/src/main/java/com/networknt/openapi/NormalisedPath.java rename to openapi-helper/src/main/java/com/networknt/openapi/NormalisedPath.java diff --git a/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHelper.java b/openapi-helper/src/main/java/com/networknt/openapi/OpenApiHelper.java similarity index 100% rename from openapi-meta/src/main/java/com/networknt/openapi/OpenApiHelper.java rename to openapi-helper/src/main/java/com/networknt/openapi/OpenApiHelper.java diff --git a/openapi-meta/src/main/java/com/networknt/openapi/OpenApiOperation.java b/openapi-helper/src/main/java/com/networknt/openapi/OpenApiOperation.java similarity index 100% rename from openapi-meta/src/main/java/com/networknt/openapi/OpenApiOperation.java rename to openapi-helper/src/main/java/com/networknt/openapi/OpenApiOperation.java diff --git a/openapi-meta/src/test/java/com/networknt/openapi/OpenApiHelperTest.java b/openapi-helper/src/test/java/com/networknt/openapi/OpenApiHelperTest.java similarity index 100% rename from openapi-meta/src/test/java/com/networknt/openapi/OpenApiHelperTest.java rename to openapi-helper/src/test/java/com/networknt/openapi/OpenApiHelperTest.java diff --git a/openapi-helper/src/test/resources/config/client.truststore b/openapi-helper/src/test/resources/config/client.truststore new file mode 100644 index 0000000000000000000000000000000000000000..ded19d0cdfacba00842ff28296dd589e9889ef96 GIT binary patch literal 885 zcmezO_TO6u1_mY|W(3o0#i>PQsYO7pO|YeY8Ut&Do~eN)0|T>}K@+o)K@*eI0%j&g zCMK4EUu!cAc-c6$+C196^D;7WvoaV&8*&?PvN4CUun9A{I~npB@PIfR!mPn1i6yCq zyawDLKD#iBb7o1UA&&tUh|49+>|c}))5$H&NVixAi$xlwq$;dA*F_07I zH8eIbG_*7{F)}wbiW28F0&&fuT-sXR#HfVqSw>a{<|amd27@L>E~X|%MuuH!GGZ5| zbnd(UqEJttZEweoXhtddR*g09%T}b^EiIa}?{w6gT(GB$rz8$^t%Tu2pV@ zyF+C5a6jPLXnSdv-{pEv>%Zbt>Z~3XM=BS(|L_nh`!mHgfX|tI=Cx1Kh12?9G2Ys) z^lxH- zGTnS(UwI~``|6j^%b#9WnJc#Yg^FGH!s%w2`t$k4XS1rXOikBRstbD8*tbQzzVN-o zF*~ycC6x)U>J)y@dK$BLspt-N_S%;0+fNsSUG>U7wr1wlkOa-DKYN~aFE)|O@olbJ zx7C!1nUR4JIfQ`80T@Dz49V8%!N%6Fe!qDl_@2Rg()HXG{&`#Vr9!%-&d&+^DwSJf zaxG`>6SHPGb?I$(@A3adm(@HgrFb>n`Gcolxh%dox>ig5+GlZJ59Lew9Q+T$ze}7v zw@5)bYrE0hyVtL1$er9H;3)fdPWP$2MppKh+y{=`&zT?bevNL%q~nvP-r$v)B+@S| z?3KIyaHuSE_`QI$C1<4Wf1d6a%=#`Qa=*o+{67 + + + + TODO create logger for audit only. + http://stackoverflow.com/questions/2488558/logback-to-log-different-messages-to-two-files + + PROFILER + + NEUTRAL + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5marker %-5level %logger{36} - %msg%n + + + + + target/test.log + false + + %d{HH:mm:ss.SSS} [%thread] %-5level %class{36}:%L %M - %msg%n + + + + + + target/audit.log + + %-5level [%thread] %date{ISO8601} %F:%L - %msg%n + true + + + target/audit.log.%i.zip + 1 + 5 + + + 200MB + + + + + + + + + + + + + + + + diff --git a/openapi-meta/pom.xml b/openapi-meta/pom.xml index 71503c09..cb6477b1 100644 --- a/openapi-meta/pom.xml +++ b/openapi-meta/pom.xml @@ -31,6 +31,10 @@ + + com.networknt + openapi-helper + com.networknt utility diff --git a/openapi-meta/src/main/java/com/networknt/openapi/parameter/ParameterDeserializer.java b/openapi-meta/src/main/java/com/networknt/openapi/parameter/ParameterDeserializer.java index 39a29974..e0d90356 100644 --- a/openapi-meta/src/main/java/com/networknt/openapi/parameter/ParameterDeserializer.java +++ b/openapi-meta/src/main/java/com/networknt/openapi/parameter/ParameterDeserializer.java @@ -8,7 +8,6 @@ import com.networknt.oas.model.Parameter; import com.networknt.openapi.OpenApiOperation; - import io.undertow.server.HttpServerExchange; import io.undertow.util.AttachmentKey; diff --git a/pom.xml b/pom.xml index 65ce1a44..cd4e28c9 100644 --- a/pom.xml +++ b/pom.xml @@ -114,6 +114,7 @@ + openapi-helper openapi-meta openapi-validator openapi-security @@ -123,6 +124,11 @@ + + com.networknt + openapi-helper + ${project.version} + com.networknt openapi-meta