From 4c2a795cc522a206c0708625c041785508a78a10 Mon Sep 17 00:00:00 2001 From: akpaevj Date: Sat, 16 Dec 2023 02:35:51 +0300 Subject: [PATCH] fixed critical errors --- .../akpaev/dt/openapi/HttpServiceUtil.class | Bin 10708 -> 10670 bytes .../dt/openapi/models/OpenApiRoot.class | Bin 5302 -> 5327 bytes .../ru/akpaev/dt/openapi/HttpServiceUtil.java | 17 +++++++---------- .../akpaev/dt/openapi/models/OpenApiRoot.java | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/ru.akpaev.dt.openapi/bin/ru/akpaev/dt/openapi/HttpServiceUtil.class b/ru.akpaev.dt.openapi/bin/ru/akpaev/dt/openapi/HttpServiceUtil.class index ec45d923f60fbc8fac65cc6f1f378bfe1bc4cf1d..f49cd2befc3ba91f4363a8beb829991ddc9ee54a 100644 GIT binary patch delta 804 zcmXAnSx6OO6vuyG-dU~;=Dpf7q8Y_iD=!rU)omg1#RPjWTBHaBZyA)D8fDupqLL(` z<{>f?iqya|^VXP&(MHQ#P)|Y9zVCZh+L>bJod5a$-#PztzHjF4!j6TVvE<2#^z+c- z5giI`bxm<}rN=z6cuIjnUlpzWM_A9=ZSjV;PH|xMOx`Q-Dn43#@+vf` zm|u}dAzv)Ma#LZJm)4Z$SC&OhZhQO>i=PZQJ;~$Ke@p(l_0j4&j~}!c^78dH(TY{I z<<5mbb&|iTw7PU{v^H9;NUho*8{y;!Q{pRvMWz~vpG;e9=-PFL+gjWl*QjFZ6$vs7 z-0CH-q?>5bM3?&!UmK@wUk{>jiT(xQh-Pap4-Sz!DeUrC?3v3e*@|evcM;v&{17p0 zqap z`O{3em)#|{-c5bPZ~Ide(nk$*Y0S0#E-fyLmgJtN)kAOCc16=rQEsPn@{umSkf8V) zOxDYK1DR|jn>uE&nb~Y1pV(Hmv7MdlV7K@N>T%dhvqbIe;~b6jN%0L1kRejVA|+R) z61XEM5wk={z89C3k4`yoI!BeJbh*?_nw24uCK)@Fi7rn*o0MPBkPewDk?wT-^oo!r zBL9W&3HFIC!gS__M&@Rr8(cG(Xpm>nZ%`v12AO0~`2V#mV*uX}Q=P-1rGbMYc}Nc4 zgw0{ba>VgvRRxX-dtBHSnXr}doN#t!HDsI;_O!5_!k%FQai(yVIk*&X-U(-SsdvtU l?1E4qqqs<#3^qpoha9dD<|@+#X9_Ok8q2vJFUr}Y{sISC#{d8T delta 842 zcmZvYSx8i26vuy`&RxcC<&3sm$*^UzMWKf%y48a{gcTXsDg|LQSrO%uEmRCd*oqXF z9vUhlu(1pooVZp)P_!BJRJ{}=?W^tkI-ODIDY)nRf9HSC_dn180ugPKtPc5Fgm4RISrNt|{+|7YuGv7!-O?|j_Q@Y@t#d|sw`s(nS zs&y;UDjzLA(JDnN>&nB+)65r(uW4Ofbi1iczFYj@r`wtx(tlh0A?4o5Ug;(SH5s|p z`y>6_*})t`B-U51u1{13%S_dki092W+z&&7iGf46sYpgHnKCroPEu0QPI%U6k9&?U z#yQ(}mRiLHI?ICh9j(~op`+V+g=2U;X^|(CNMtZ>Sx7KXUpufvu+TPw&plp5$%&CK z$?NWvptN8Qd)b)ZSun6S;V&IyLm;w~AnCqFK1o3IICPcupk8Y`Pj;Vh*jU8Ar~ o-FMFwmWD1cfQ#gbd4svcNUl)KRVD~d6kNnL7IQsOIC6*j3$W+SQvd(} diff --git a/ru.akpaev.dt.openapi/bin/ru/akpaev/dt/openapi/models/OpenApiRoot.class b/ru.akpaev.dt.openapi/bin/ru/akpaev/dt/openapi/models/OpenApiRoot.class index 5efc5bf874c823ddf65e2bf30d951551d607d60b..172d01ce6c18f4b620ec8de2ac858ed176558cf3 100644 GIT binary patch delta 351 zcmYk0yGw#m7>A$pWgaU_`*P8ti~_OC76>5(QbR3KLr_GUNpu0BL0qD#pd#p-f@o@L z2t)d!EX%TsTAAJcob0Ge)BEE+zvp?6=`Z@7`QOVl5a36m34BII^PL6?c5f3VS9Y#B z6IdhR)yeRDBZ3<{8*JLhBpuCTLVP4=T0#~*hXtF`9Q5j2COi9V8z*|qSmBBp2<Wg?Y8NGA&Nb@ztbSPVr7RlXf2fyCcK`qY delta 338 zcmYk0y)Q#i9EP8BT~6E7N3XkBP$W&YwRY*$uvidFC3X=iu{8`fAHj4IiN$0xRhm?y zl&d~lS|9(9`n6q5=goQF=Q*blEk*~bzt?3T$&bcTM2u%eE|axjZve$jkUjQ&lnZ0M zvr07z*}k;xRIu?0a}sk7iyWV_Ydk0C1}0Aw*HX;$#53J22>&8Pk91*P+bM_38&x!0 z;u#gP<@Km_Y}2B9m&?xVLuQ*Yn8R)|gHNM02~Aydrb%foWN;2{lc|5L$+*M*x^Olb V;>HWP#<+?8&-UjPU(#57{{ez4M_d2^ diff --git a/ru.akpaev.dt.openapi/src/ru/akpaev/dt/openapi/HttpServiceUtil.java b/ru.akpaev.dt.openapi/src/ru/akpaev/dt/openapi/HttpServiceUtil.java index 0f12033..9c5b633 100644 --- a/ru.akpaev.dt.openapi/src/ru/akpaev/dt/openapi/HttpServiceUtil.java +++ b/ru.akpaev.dt.openapi/src/ru/akpaev/dt/openapi/HttpServiceUtil.java @@ -85,7 +85,7 @@ public class HttpServiceUtil var methodParameters = method.getParameters(); var templateHasParameters = templateParameters != null && templateParameters.size() > 0; - var methodHasParameters = templateParameters != null && templateParameters.size() > 0; + var methodHasParameters = methodParameters != null && methodParameters.size() > 0; var hasParameters = templateHasParameters && methodHasParameters; if (hasParameters) @@ -116,8 +116,12 @@ public class HttpServiceUtil for (var openApiParameter : parameters) { + var parameter = openApiParameter; + if (parameter.isRef()) + parameter = root.resolveReference(openApiParameter.getRef(), openApiParameter.getClass()); + var paramTemplateContent = ""; //$NON-NLS-1$ - var in = openApiParameter.getIn(); + var in = parameter.getIn(); switch (in) { case "path": //$NON-NLS-1$ @@ -132,14 +136,7 @@ public class HttpServiceUtil if (paramTemplateContent.length() > 0) { var paramTemplate = new StringTemplate(paramTemplateContent); - - if (openApiParameter.isRef()) - { - var value = root.resolveReference(openApiParameter.getRef(), openApiParameter.getClass()); - paramTemplate.setAttribute("PARAM_NAME", value.getName()); //$NON-NLS-1$ - } - else - paramTemplate.setAttribute("PARAM_NAME", openApiParameter.getName()); //$NON-NLS-1$ + paramTemplate.setAttribute("PARAM_NAME", parameter.getName()); //$NON-NLS-1$ builder.append(paramTemplate.toString()); builder.append(System.lineSeparator()); diff --git a/ru.akpaev.dt.openapi/src/ru/akpaev/dt/openapi/models/OpenApiRoot.java b/ru.akpaev.dt.openapi/src/ru/akpaev/dt/openapi/models/OpenApiRoot.java index e2b9164..92440b5 100644 --- a/ru.akpaev.dt.openapi/src/ru/akpaev/dt/openapi/models/OpenApiRoot.java +++ b/ru.akpaev.dt.openapi/src/ru/akpaev/dt/openapi/models/OpenApiRoot.java @@ -100,7 +100,7 @@ public class OpenApiRoot var nodeText = node.toPrettyString(); T value = mapper.readValue(nodeText, type); if (value.isRef()) - return resolveReference(ref, type); + return resolveReference(value.getRef(), type); else return value; }