From 5740348902a29e2ad1e538b1f27bf13ec8031a23 Mon Sep 17 00:00:00 2001 From: Ties de Kock Date: Sat, 21 Dec 2019 03:15:29 +0100 Subject: [PATCH 01/28] [java] Jersey2 and resttemplate do not correctly send defaultCookies (#4821) * Java/Jersey2 sends defaultCookies * Send cookie value instead of [value] (resttemplate) * Improve the javadoc string --- .../Java/libraries/jersey2/ApiClient.mustache | 7 +++++++ .../Java/libraries/resttemplate/ApiClient.mustache | 14 ++++++++++---- .../java/org/openapitools/client/ApiClient.java | 7 +++++++ .../java/org/openapitools/client/ApiClient.java | 7 +++++++ .../java/org/openapitools/client/ApiClient.java | 7 +++++++ .../java/org/openapitools/client/ApiClient.java | 14 ++++++++++---- .../java/org/openapitools/client/ApiClient.java | 14 ++++++++++---- 7 files changed, 58 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 0aa3683cf354..b12740b0f649 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -715,6 +715,13 @@ public class ApiClient { } } + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + for (Entry entry : defaultHeaderMap.entrySet()) { String key = entry.getKey(); if (!headerParams.containsKey(key)) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 2a327daca24d..b160b7cca231 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -659,14 +659,20 @@ public class ApiClient { } } + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ private String buildCookieHeader(MultiValueMap cookies) { final StringBuilder cookieValue = new StringBuilder(); String delimiter = ""; for (final Map.Entry> entry : cookies.entrySet()) { - for (String value : entry.getValue()) { - cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), entry.getValue())); - delimiter = "; "; - } + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; } return cookieValue.toString(); } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java index 07915c2fafe0..c92e4584cb2b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java @@ -699,6 +699,13 @@ public class ApiClient { } } + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + for (Entry entry : defaultHeaderMap.entrySet()) { String key = entry.getKey(); if (!headerParams.containsKey(key)) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 8fa20fb97953..bd0facace110 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -699,6 +699,13 @@ public class ApiClient { } } + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + for (Entry entry : defaultHeaderMap.entrySet()) { String key = entry.getKey(); if (!headerParams.containsKey(key)) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java index 8fa20fb97953..bd0facace110 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java @@ -699,6 +699,13 @@ public class ApiClient { } } + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + for (Entry entry : defaultHeaderMap.entrySet()) { String key = entry.getKey(); if (!headerParams.containsKey(key)) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index dbdccb6d1d88..74cb86734366 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -647,14 +647,20 @@ public class ApiClient { } } + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ private String buildCookieHeader(MultiValueMap cookies) { final StringBuilder cookieValue = new StringBuilder(); String delimiter = ""; for (final Map.Entry> entry : cookies.entrySet()) { - for (String value : entry.getValue()) { - cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), entry.getValue())); - delimiter = "; "; - } + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; } return cookieValue.toString(); } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 7210077ec810..0be41bbbf7a2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -642,14 +642,20 @@ public class ApiClient { } } + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ private String buildCookieHeader(MultiValueMap cookies) { final StringBuilder cookieValue = new StringBuilder(); String delimiter = ""; for (final Map.Entry> entry : cookies.entrySet()) { - for (String value : entry.getValue()) { - cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), entry.getValue())); - delimiter = "; "; - } + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; } return cookieValue.toString(); } From 966eab4cf3ce4bde2585b356611302d4e24d6284 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 21 Dec 2019 11:07:55 +0800 Subject: [PATCH 02/28] Add woleet.io to the user list (#4854) --- README.md | 1 + website/dynamic/users.yml | 5 +++++ website/static/img/companies/woleet.png | Bin 0 -> 71236 bytes 3 files changed, 6 insertions(+) create mode 100644 website/static/img/companies/woleet.png diff --git a/README.md b/README.md index 5d2ef01e41dd..228b189e0172 100644 --- a/README.md +++ b/README.md @@ -628,6 +628,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [TUI InfoTec GmbH](http://www.tui-infotec.com/) - [unblu inc.](https://www.unblu.com/) - [Veamly](https://www.veamly.com/) +- [Woleet](https://www.woleet.io/) - [WSO2](https://wso2.com/) - [Vouchery.io](https://vouchery.io) - [Xero](https://www.xero.com/) diff --git a/website/dynamic/users.yml b/website/dynamic/users.yml index 5ab0462aabcc..909dcddec374 100644 --- a/website/dynamic/users.yml +++ b/website/dynamic/users.yml @@ -313,6 +313,11 @@ image: "img/companies/veamly.png" infoLink: "https://www.veamly.com/" pinned: false +- + caption: Woleet + image: "img/companies/woleet.png" + infoLink: "https://woleet.io" + pinned: false - caption: WSO2 image: "img/companies/wso2.png" diff --git a/website/static/img/companies/woleet.png b/website/static/img/companies/woleet.png new file mode 100644 index 0000000000000000000000000000000000000000..dd26729825598b182e011d5cf0c642aa428e1903 GIT binary patch literal 71236 zcmdSBRdgIpmmnyz#b7bBEQ{G<$zo<^i@C&D0*jeT%*@Qp%*@P;7Q^W4?!RYuwtF7- zVdres$&8y37ve@{Wkg)45P4ZKL^xbHFfcGg32|XXFfhn{Ffed+n6IB_L1gQU&jxS@ zMKM9JiV6JV&x-_ObqNz088GTk7zXSMI4T(AKPaDHFmPP3FaHLEfk}en{U@vl&IAVW zS^w?x&0;^RP^J#U|_$%B!mT&UBS=NVgKN(q)#uGtZK2M}uvn2nWDIgfjZz zv-p5s8J3Vyc_2(~0wq4-A6gP5>1qlyy zKD%7v&vNJ?Co?ZhGMeCA4ItZu1$d?u;F)b$2NeMO;Ws;(#>Y%}w-d(^t&4qEzG?q7 zpXJ1rub6h7*ne2D{7L-~_iY~#ID=b5c>8^?z5^pMuly7iH46_jeh?sWk!q}*@0mY(ilxFDqM{UjVr7zwx8O;Jp7tD-Zopw>AEpVxA0qn2tEBu&)5PYs#a%nQ z=!9)*D=Vus8gv7B?qiIs4k&ZTK4{O+wyq?ZOU;i4Ji>x+v9J1#b{IWP@-SGLrNXi^ z^sEKBBI-QXmHVW|d`(6r+cOPNFMnV=qEfZxj)sx4a7`HLb8>r6C@<*TzFk%5tye~z z9J7_YAe-DMXnqFSKj8R!fwnJ#?(=wGuMCH&|8!3t%V(Bfi{&`u`33@KqrR_Gc@Om! z&JB|oxe}F8^&Us_<@Z(o@JsEx$PvMB7Bj$$!;uAlvi%TYmK%^WDfSzS*$&eGgHR}B zVTU2QtsT^p=#^*6u}qOcWT%qXivOmg!My&_o*tTVYsSWQoMOhIn5^1+KJ0PSg{niO zC`g2wbAZ*#e|Q25|4?xj?lOwo+BoM_+j-vWh^8_eNNhg4ngvZKwh9q8erS>0@T{2B z-p?$TF$I2Il7U@O)h)R(V`soy06^W%5d+b#@{Dk z!!f#i(B%s{(%9SNLC_8%(uxG9S%%8dg;6j~-kor)WcAE6Rz(YM6_?%;8>a|JA2~aC zZa9NdC$!T&+suHtRJ^X;-i**A@Y034LmZ`=xivn;Jv4gG&w6ZtP6ReUVM=JY{LnZJ z_$44Pjb$Xa9n&OEkg%-ocoYg)Q7j&A$_kgoPl55c5w+I$T%9==tTX12>eQ(geTgdz zYk?kOxE|BHM~E+xKi-DXA88Rr^IWTQ;1q{qjWLK&$7uw9Rc2tOib+;JOcNzARYmGdMcR7cOJewR4vr=}MZ<{3hAJ zS|;R>=vDW)=qX;jo7pJc2$fQMxxDyUq00$vYBg6B*KB_p=k!&H3ZdOLMoe%cd$Mf(eZlR|vL&aj`}%u- zcD8fpHvxpKK&`fM&G!+@%;b-+t=y+6%qaEKj%zbj!&M&H2|XTkDWWIQ#hL0C4(a*K z9ba27_iGrs@j3HU_w6h5r0eh-3gFG(eF7m;M<-oPIr0tfl4Y~kJY87JK!oL-;iwtz z9c+s_9d`SAnE5T7 zwWy)0!Mi2$KF^|OVl}U=LBRS>t)!e(j<_S_DYF3h%V{e<*4kD!HD?R{-kas zOw?ZFXIIo$q)!lZ=U;K35%h04u!=@vvzo{eyeO%;(etc;Ky=314!!$!BoWX`fr9Uv z!K$Th?7%ZBZi>y!tGJ(M@Y#&(Y4(0$cRi*j=q5c$UdFs5X~%+&PU{3tZ1^__8QJis z4>wMHZ~Gz`JK}M2P!%_Xt~Ix+VmP`-!&&2!4l`aJ%ex6aQYi#(r$3zv!XM0J4d46Z z;j$Q{IVT*dkC%8XxB!m!g2@4{6_a&-IM)Gi!)Tm8}bl zhDbHjr@T|Q?{0@tBCPlaM&wnku5b57(tL#>|J7vr-%qpuZHw+8l&03``^nsC(n1r@ zN>azRB5>1B{|rL^;%3U>N>rz=U}KXoF=$sj4K`e(AoK4$0ZCiSVZ9jeM+Y`CyAfBo2~X!iEczI0l=1lS%>ks zH}*J9MxX<8NBE+S)l}nLv(e@;Dqkk~h^poPy#WXKRm)%1(eR;d4>Q}b0 zUs4eiwamP&zx*&-A{1pBf5{1qpl&8e%Hjp!Lc-svT1n_554Hf%OV>jnHh3u;=X5JX%DAU1~&%UwYkPz@DX8KbB6ERM%Ikn5^+&&+u+(*Xm6G zw9!jojN5}5+e-jpl3w$$Z}1J_*t~-2JT$^D?HYENT#c+&T?u5?#R!xSb!uz7h^IS^ zkE^vk<`sI4bDL8rAqJ&!MuBly$N|+=`qnE0u8dNxjTz|^Le+~kkMh5AIYrZt|MI&s z`XAuq@U=0Vu~^#JNgw$^1L7*81L*|KrEHxjHNO~n6#5W)YI0flT|<`zg$5rnou*72 z!M24=ka$~%PZS%vLUu(PClv8&Jn3tsCVyp5r}D$c0u@UlNRh9c^mRbXNF%~or95Jp zZ{$m!=O%WXVq}1)!jf$Wqyl%0ZRpCZg$yw&SnT=#(EU-Q7n_eMH3J@P=0J{=2n4I4 zL3eVtwHGQ0HV`!vq=Hqb>1=WUBY?!smuo6AOz3}=2WAs=#(O|Ef0){)$97oMR7B&P zNV(P^3Pf^GcbJ*G0OOg}W+W((+-#JMFOnQ`=rFg>f&LN~ouJ}{nC0P`o*2bf1i*XH zS~qRH&*#g$(e0y0`8KUCS6cR*(~oi8toTB}{L%6z>SddN*3U?B!%#VyuoN_@)GULp zNVV}ijy9@CN9sBGF)p3m=`7eZ#YK)}=xVy27lL}TyHv9W?b!M_HXfgf%s?0}imM3h zj^zZqfFNF3psAlcU06(L7k3`I^3G-Pogh#8XZ8`iTQE6=u+a*)0At=)K>Hjz>T_b~I(5bu zp4C(UtB3LsJpP4q#gqo;?lC9TFAfN|GjbOSnp;K|a;_^Vu3M3KwKEEM;ctx?zgSU4 zKQ_Jc0)gz`Wy*U}OB5L8>VGAtzQqu|WH^{%yi?)GE=ZUQtOBQ0lC3t;Ly;IV@LeMWU^i z1X7=I(h#W#b))q}L}tvV5IqICXIgknPqY3lb36&q^7>rFoi|jh*GOvGZ=ymb=-i}@ zglkZ4TnPs1oHTG1b<8djcbMafFBY!&^-c<#EF@$WU5m%X>IjNX6EUUZQNum8y&4|K z+#owAdsI##SmDseGf*qNB*7u3gZ6%zOyl6uZ{Dw*vr6K`k;PN(!@Lo&^X3^$-;F<* zA2nR<1kDlugl`CRbo8>wbwJ+CK*CKxv>8pV@wLEP0`GNXu0nq*~-4xRxIr3r}=EuZtmmD$K@Wo?MZNbpFE%|6P;B1MHVZ zO$w`(iFMUarth7OOPK)|=aWK2oL!4QBDK*x?$1k&OpcqK*zdICgWC*yM7@Qa^e++1B4W4*1_}(f?bTfj?bToljCChnHrV%pT;T&H1sbfdHG9ar50r zrr(1C%sxtiT~u1rZx1{i{v+oOq;&0kc4tQwO2?M+vQgb8(pgqevdy7CLADM3NO99c2AZC#%6? zk?Z}$+(3@249V<4rB*2J8c>SX8TTdVc_Vk%A-s`9?GDQB?D7q@0mui5m}ZD<-*#(E zew}|`MHq5;edS<0dQe5EkOAX40v)e)Ji}wz#6B_I&)F)tBW^vWWhd*TUOeY@fg=GQ zHjo=(w>(2~-@wqPx)^6jxe+dWb52fHRi(eKcD0?wKoJ`-DWBFOw*272fE6aS*+}gA&&B7WaS^-0A&wHw(HBX>MFAqOES0`_6a5?TkJ6a@S$M??o zt={%lBC}xfvM+f;4lgF*@zhPCXI|<+d0Q>VXB}~Y4)1B*JKW~Ta%k#sAkT4k(4sdX z=~35RvKR0s?Ti&yaq6{Uy4tG=waN15ZhF*LJ1 zAGl9qss^jnlppnG>~-d|bIs+cGj=@t^Qk9@z{xXVhlVWm_Afwm#mNS>Ri`6xw{p9d z%?YM6X++wuvU814`#H|zc-Z6n^G)%aP*U>!J@8rlAmNu(_YGh_Zr!HC(($-o-bqg6 zup7Cc11o;=O?Vl@Vwhkp@orYHW_0^WzM$==ZUq zYojVzLpzV2Y8mhc;lq}nyNd2NPgkG<2H_Wqj5j=9E4^>O;n|qJuO!V zD4S&hB(97^84+`oe({Kpkpgaq%gOU#<%u~P5--@qrz-c9Tk*kRe)4tw)bM}Z!t#S=rdL&p#)OOxEEs(*k$>QSmb7@$BYWCPg>Qme;+pO zdXU=Zf#w$ym!rrZbr!!XLI@(n@GMofLgetCn|!weYNvk!kI`obGBT4r3MDf2NX&Y-pGY;VvHF*E9tq_WkAP%{2=A; zZTU3R;C`Vtn}3&|d#AD)<@MZl8@$fvE`QNBEhL0o+p&z7%2pv%RZdWx{`UPZ%*;)g zJA7*7I764xu*m!PSI@{fFZum;>MFHCj#Xt}l2@53Ju4TXMOj4U0=yO%_k*O^M82i= zyC>;~d%2|5^U#RV3)33yLe1(Barq|6xhBtxA|`YUT=J3&g`PjsbL%@#Xhg{_RC!fY zB&-ywbG-o zsthMCY;GZi{T8HQJgN-uS9zv1VexfV+J}Mi!_e6Q)PlH`?R{*ZJBKf#^2BN-JxUh= zk#Nt42GpES-CfQdAktcaE843{;9=w+S90F99vApGYrP<1xzfEo8iPA7)v7y`#ciBf znIj~kL{(J^vE1Whv=b8^!vvv1xU~HrK?3=@xAkmK9$%0DxvLg^1CBC`FZs@>}c zd7Vs_VEX;}tV54+3h);=DwDnM-Kn!_TnIH=3e>kET+W>a4YFY{IOuFi z6}rD=`&{#@xGGzf_H@3k=uL1pF4+zfsBXVPjvO|gc};02HU9A6R**keHF=mp*_O+R zT{o7IgJr)fbp`v8;3-Ht0qky>bP?@uXU}Y32LK;xpkqW^W85N8y$R?g zD~^sJ+vsSj6!44|I=3?hiu`21qNp8+hmqQwS&U$e?!i#T9rP81QorKSBZ*bIg;}+@ z^2WOd-RaZPg~uazMz{9-W9$i_t~V3DgA4CfC{}2;E2wS)cM8)OMq6Yccon@Zi{W#O zr1wy@ZMmDmR_xuKYHTPjb(IJtb5~s|Brw-;Zbj^|)g-_k5Syo=qcU@`=>+tH7HkUn zu?q(ncEvrX)|nZqPcu|B5U4il$*Ru4Y1*dKY|=ZFj0-hzYAR~%>-0n?q!&-CPcP(S zn2CS}7n|=5GMPeSdP0V&WD&~S^CN>9ZFCgdsVSN|nwNj4s}@XE&7_7+B0FbkUZo~C z8_iTXGZ5mD-XLNsP0@Ro)=e`pwazZPSl54T9ObiO)fF)8(XASuGnU7dH{*G~gxi@q)CEwK=TMjTPhMdikVq5=P}_@Z$yE;S|p&v@ayf zkI-dvmrnU+HwlJWR-?(dV#`jz8G$ZH(B=bXdqvYj%j$WYgdHIyuQ_kTk*(Womefuh z9Jiq~?q8!7HhYws0 zHs|ZF1G6-UE+kKHlFtVd6#MC}vq&O~A(ui`euu@jf2j*M`7*<#Ly=9~w{~4~D`8NN zc|<3_M>p%GYdI9U%8Uka{K21WBKv?oY4d80 z`fGGaE^wIvH4Q$1)$YF7m(xxHTVSl{>isK%!z?uqFWf#$G`t(*)v()PGW%-~ETfOM zVUm*nScwW?Gdv6lKB`fmDGM17-__=*q1jC5>A!O{{kN;w|2He&|8q2GvcEE~(8GU% zOPUKxQl+Hi9i1uXB1XQk_$=aqyHWGY?+31DGUmN@$WxP_o_Gk!sHM$JI#3^eDfGNS zEy#t;3sFmHnG%};U{Z+qGx?Nx3 z&HVSq(mm6+Pp=;F>_!IrZeBRybB{;DksC?%{;}W|sARA9yR5O~&G86RlA=V0XQK4%CL+S)mf!?U~I5 zwd#d<@T+y&>)lmH4i#TJ#<9f18Rnez4%4n;q)HP)R1C*~)~K4#Cd#8^fjl1Nm>7a# z)Y&4Syag(cNJ8X{!x47GqmDagEP#qAQiov5X9k;l`>2y>4H%zC31j7!II%fCK zLc1xMISl!`Ji3qSbV;`F;MOB(@l<+6((7r&8c1AS8DYpg23i}Iw5~jAu?b~t(3 zR2wv?)R+#EpHBDAD6QP&A@}FX2Std)i#sc;LeSMVx@DTVTH^a0;K3!ZO;jUTDXQK` z@im<@_2yR8w;ae~=v0{RD*gX>qK zloG(3(0^_!NZCr35oydXM=@L~Oh=6~7<3=6&3LKvpysa^2bqrZR?a#B-qK;gmRZ_p zEyYGsRI9d8mPtUB@}dg-yZT0CHCv!_+wC}Bk1OLK0F!lKT93cBZ+e1I^nk4e0Ii^o z$2`vMJ6g&zo_4YQF&e0de0HS!4owLh4Tn4U<;QLkeDudy)RgM3B>Q)ItI}9LectZ$ z%+!6=_x8m>l_Xrg)EWhm{HZn9`(I+V%Z_4`IDyKrL^kSCu^AOIF2iur+4Whz2bqFo z=Ggp9t{HNfHy(XQu-&}*gVZ+4e)6|$YCzi%;8=NO1 zy}u2y^+BFcLEIQ{f7)WNz!3iC!1MG6jhjO+R~{w2nu+EZu(1p?6%zioVDO?^q0Cw zJ|Sr+iV02KRFg!l8w>J!dpU zlcYe|_5ScEhr4^j>31;}udld)S9;4^$mXX-`Xd?8gq3yE8diQ(E+_~wv@zzoLydlk z>T-CdLR+TyfCl`6AeWg^+bW}<8}`&Y#=)8t+rU1Hk3j|jyT7J2?3m`n;CXfVW4}| zJsT{IFQ#oowkuK20=~JvLYPQ2OEWYrY0N5pz(TiHFHmRL1?WD#lK$^VQ}9p{YDgxE z4AG`eIid&|_DdXyp(V!!D)E_MXDan{(QC3>TV6j_v3(JM#Zh*|<|kb*W#%x6^mfEFI*n^jKF@y3~4c&MJC5?)5m z@Plm4^PNk7iLQg2xCDlAW2XspC?_=g(Tl=$uPqbQaMWD~3#q zerkOmQpi$rIdDmK%_2Zkj+L1`^`^3_RFm`jkoVmM>yt9e4!NC!*~fh2N5k1gJ*1~h z3UjO{_7ZEK)iP+=fZD0f3qR~V)1Pf{H02v{_WtmCLJy1KAf!=%p)TH0yLU$}@OY6f zRphTsO$rh+l2(Y%{0fD_~eMYF#1wwEvx8L_$Aa{d8jo`zN&{Zlw{vVmiVb z!lH}Opt)*MSrsGw`^ztvt5qEXw~{Yr!i^i7S2GXa26UFUu|aB?5=o7?em?8P12f*v zUF%pg#T2rocrAAVnao@8Fy5N4={Zz3mt@=**X+Zz^1F$?>#aJ`8!j3STXxD{ZgF*- zq;kSqxVH1*Hn?u!0K8N8hNEpWjC_#!YWVB-QHqPa+3khKH3#*B5ut!)7cLjVG^u)W z%d;eW%R&tG*oGE+{(bbwY=hz+v*ozChmn*_&4&dXMY-68#g@WAQMf1eh4#0z1q)#r zMqT~NEu&7ls?X2Q*$S9 zpN3b>+^kRULgC43Q)F_po4B$ys$`qXuIWyztfMm-Zw{Z>E8B)K6|{En?&5Lp9;~?h z*o%!{O-o>@Tru%p^e_}EjD|u!5wqd?F z@PhnRJmLamBU<+JptiL>NbbP(9X?J+qZLEv6kE=la<*y-sGNjVyDrH}AGV*Ore?wx znxGXI!^ha)(wNSxvr|zw5~we&3Mt+0-@U8kvifSQv*0-RQ<0tTb}H}1#3GnwTrcVY z?ID_cILHW{KwFvC0-;LA3avlaE><4rb3`d64~qq4qSg z#em#+-_O_`_%chb2lgZ2*~0?cz`Mg4ydUlD*lmH~tvSBzt`~gMabKy70G4WYkbH^} zX-HV}?JaY>KI=Uox#JyT$~k(jw|FK#yBoY&ViqKX)6huv12;%#wf{kZC{G zt6JC8^5%MaQtIGjE2hKb%W*LHU4Hcb4C{~KpmtS7_E!z3>RnfgevA6@F3-VHjghGiw#_V#0LR6*07 z5ttj=RlYjJsp}A6^5&&t2ATwK>~7c|V3(u+#PTX5*tKoTu$V|jRs(2>MBRJ*)>Wz2 z&sja4>z`wKctwOW)b~skis}*&lzg&_J=mix_$r=~PcVheuP@aqvM7PyA8Qa3@zQk)8o|q3{1t;XokB};ABLi>tykf620_LR(XDA_MpfcCktsr1hBTHHh@^~xue`p zI?kN+pn<%x++HYWH2XqsjD`cVad4LPRJVjeLr2)`H^0Ka>t~5)fP%w>RybA0f<<3?fw$`ZXSa3c#tY#+eg59oBPWxnPh5Sr2okuz;89g!N zaLlxaIWukdS%HFK%Owqft&$Wsb(?ooBaAuW*)_Xij!kG?KRk4bCdyL_jg6%whhGq? zYb#OO|1>Vuh<&7R9r=c?)kXNE56FD7u7aCLKco2VSg9%$5?%j}k9@7O zq~OQxD}+YDh$rwEHz=igAgw$@N+)BRgKCoh5s*Nzep}|I3sv#X%TgEmtFk!HkF^ucE1`!k zzmBEqozy5#&Gshh3nPQ$S?A}=wK7NaLzAcHCY)mpoB9=ToX{xAbUikqU863aO?D54 z3tag!O^}ZUf3%AMV(G2}vo;1YA;#@{{{maLapte2ygj^m0i{1%2^e2N5r897z64{Y zuV3@Tc~qjx#xjne?Ob^75-dL|9_Yje-bzO{N;#EQ@ z9Ys~LoMpTb`O#DVP{r^>mKC+LZmmI(Oz}+1%=Nn>?uNxv{RBM*KTzsnL};OX7RP2{ zJ%CbTR_r%V#R{a1mFuikw)Z%+d3yRjSPRmO zwb`m)=Lf7iy?F!*(~0F2RYe^SGmYCiO~?IP=9rah`ESZ|w;49M=>xpX3a-)HUt^Sp zkFbS$bC$s^CnL5>O7}d6PHKQ)3SA|c$nLnx(iL4TI-xIxufp4ZaI@tna=^SdO1AbI zZaoOqST=crlQ;uUZo?u$l=~6&QrgDGVt($i&pu~7^G_! zdam-wJxImJoO-DT%&yoYa#+gMnXYPLcrQ2~OuXzRO-vrz6WhAiezli){t)u8sSQ#K zC8zYRBSoAIz9%lTyk(PXn|+H)08ckJXHb1#j!;~b#Le6!RKKpI^4t4@%XH@}j*;p$ zWsunMXHdrQOts9gYtro6rcJPT>7&~?K@iP^sSF`6K**dIhGs7HO-m(`qKo*nTdMt= zyZmYTTu|3Vd&1_h>jcD4H&iN>wN|$;1=Hdh@w<$|BK#(+Q!NwxmO5j9=49(M?-omd zO|q=$F`L#J+6!>9v4ZLNIleo}(Lcr~H1!RuFrC}?x{im`x`*E;x@z7UWxY`xRwD(n zqQYbYzk6S@Mvg}!kA!T^HJYX-n)pVL8#(Z9AP*6CBvrbR(y`wDN*3gotANYUCVQtl zT$-2r?d4KH&|Y$4iK1|XOB$668N_mb7`%@!DxkFqD)m)bg7lGWtR#^}lr&LR?j8;Y z)hF~gTO{O4m@poN(88r2SM-y$b1rjn`<5{oYo1D_m zT7p^{7-Xqh&+NhvQdl>qd=E>u=GY1wQ)?p4(zyj!ZneeiL+KOQ#_~fKM46I?2}B7e zol8+bJ~i5!2ay-XPuOw4vNMDyMxa}>KSOt?OSn%pqZgt$=@jaDQ37PH_ri9~UaE~d ztDlBjtWaf+UR8{fGfTe4wZx*$nJ#SFdzT4%5^Ls%n8iE3_S59K{{2pLerjTN1U}=z zVT~@ZSOJdV^*XIJO5J^)?CEqxHJFm1PPTC}l!y!MD8X-xJm|bGr{vfG9F&6FRlj0G zZU-^f2q}^&JJZ9&wJ0RtW{QwcOGi-$YC!HMm0zUJZZN8F7|v)DD6_lI}= z*tLUk+6l*p-|nLrfwUsNKn5SvH51BlfN+6>vSmqxX8n-JUIW zzn)PL;}oesS71UkK?o}yx@&zx@ zpTEtfq|aI75RZl4^((T>Fov5jW19O<<#i=xKcV%r`>pdMyV0<39k*G0WCm6(0*EPn zm*qIBoHpYZ9_c~Yyx{=uCB;=I3&KL>k;xaU!50wdfjc4||4IzWE0warSPtm1q4)kj|&q=2J?yRYFha$i! z>oJsN#*eK#iC)m%5%*LyB73!(D7_cgt#Ap{SMgH=jzWgzu)zCdkE}O*1QQdw{teeo z4_XA1S1C4T?ijHq3Hy;0-Cl3}O6`tr{MX$i%50tMJ`?V)VLQ(qS>MDI>-IqJ;Mj=F z1>C;KySRCaV#$H|X+=Q81H=)J;@__k5=Rcf&6?0SbVoIpuQ69GY@Awi zc83YLJW39_SL>7L{B`;`iKXNac@7_R|7>qJqGI2}{|4lKhbW!)4s?@SnyG+cpHKG5YoPP|5%KGq!<6?;IO9n0ohz>x z-#FRdZ#RZE`;_vMFEK|c3H*roq@TGg#PX8HM!(63uL2pYJ`meltrzp*Lyn*LO?C8ZhGH z81Q(M-xA8L4q=v~WAJ}kjX@>-YKEy|WWX9W;=tON?A5i4~n}H6oh8`xH;e3UbV>|n;^wDm_W>`;lG+f-ewdm# zi2?`%sySRLds;(mdZ3f+Eq&Ued7GR{5VTX4>Y2s%-2z%}S}gafi@ooIYjOK$@$i@m5>Kqz ztrd0&mTKjY#MiCi2Vb14} z#klyBxE&jC5Wz7IC}vvk+O>#g8BwDKr}6S*8t6p?&4i4RR9f;vu1Nh`#ALrwu6f_d zUS3=1=(vcT54+kg(j6iF7E5jvDk|kDC!|&=O3m(;lWu!EPgSACY}g9CeycT zf!0SR_i`to#TO;-mv$wN&9n6l0O;=opYFg5{w~k^Ycr3?}$>X+wi)xYo+s zgup^4ScU>4*2c$e_hVAGmS>k!tDv&;SAPVuAw$sqlJd1+qAG0sT-C{1gDktZa_IY>UGC(6JU%f=|ML4NR@tqYR ze70j1eG6xYkKMd$-vSrMt(M*i9DSLtql6BeI@y%{-zp|2cD{X&{Z$M zLE3PSTbehbkgREp-ul)}e1+ns>C;(^c+~78BeQ;ul$$U23+b4{%vPBA#_Mbez!RDL6MMNjUKX>0{^ zAkTf@+}5T1MFp)IVPnqU7N=)f3?_G~IH@0gb%}qd8^ZN}kRMn&VF1e_m&KDaF5V@F zvS#7uIrY}wIiRk!i0eGb!)3aqdy+->3jWCIQhsTul}{WgR~s!sL)r0yxn|qPAz9}D zLaHRdDDDKt^2Z0MM$}G#3>VlYnDSmck=vX05;w|`U2wS?K!4p!a~-Oag9Neb>N>&) zdjcEKV45&NH*k*R8__fQ*6?cy?vaXd0=}<($_nRpZgRNC)-bTOSkqnY)pLwN>y%Ja z1|LWmDxSRqoE1|XVYXIP7kwdUe*JI(0e`K%4;QFE5F@JNbvOkX!kE}@W{NvYT~iYHr%~KvGd;*ez6U$$keRG3w9}TLh1Z0(+H;Y5It+ppyW-#Zx^*9LgV& z5a~TTvu9h(P%O1V%P@ak6O-b8MjUSO85{B58h8i!VuFpj!MhA8Wr*48TgZW$%!>+4 z4R$*pwuHA=Mnoh`$=Z2b)3u{aJmZS7Ypx1kiA`Ay>A6l}$ zD|kHZYm@xjl?&xgbwJ1sK{3(y@%Fg>Yn8(ggU?6o-Tq^t=6-DaXsaI&ijjX@< zf!Kt9RFsHxBH!Xd*Z7wi-n67@!sOW>4TlJ7>8n>Am}+D=Wz)G?Ka=7NIFc!NI|I!g zk83IvQ^ILeNfA(u<5;;sk%~ySI75);q(dw?;YDO|b3dE1tZmDJk~U_{LM>yw(R5K6 z+)<+TK)b&d1H}&Z!8qy3d}_!Y%OH~NFX@YBnJ6Qj49p=?<_-@SvQ_13Ym1lT4o3FN z<5@BhT3_f(Vs!Yab<0&U4lP6|tl3f~)e~Lw$LYx#ha>wHH3u!F#s*pd<7m``qLtiK zLm1@)VrcqsPGtjwp2Du{8AlP1l3F-(m)Hc3yExeZtN>B(;1!z2uK=c54cbJl*K>Jj zr0i-MR(Ixyz2=uZhWpz=T^&y4A0DMXtrXb++CA;x@2dX!Db=S-mk=PVW*+nt*S(vd z!(7FnL`sin$(CS2iYU<*=qeA!TZyE8rj{Taws#8l=P3$U8Fu<254v|nl6m`6?9yed zg~~TrOs{slNrfGEXmpKifRCzKDVmrAuh`^N<9g2XF1DMXc&VTSNd~}lxn>oqOPLu z>`Dlo4`zwpUF`$?7%+S&u`94gnm_BVmv${^3bmmt=l62XUqU;KW(BkoT(2KzZ9%KM z%d@VJ3A^P7P$s&CR>?uX1g6|xGj3GpQ$OT}JG^L#y6th5Y;!?|2|r|PwGM`xZ~O^D ze8+KQk`le`#@7%?ye_aJDJ`GnOdSW1H^YX0Q$D%}1%>d>0cN zJpG}z+M4)52^%uuCo^@=QE5}9>e4u-ex7KzSsg=*q@>v3U+T_vJFeFd8N*meg;wOo z4$%Yg8Y&NOC=*%+3W8*Co8Y;Xb}=w^!R$%gwR9bNlM>a8$>NfI5Nn~Vw~4~lv$ydPc@lq=OApIIGJ35_HgtVGSc;j zo%mI>8lHqIqr?48tH_v0=*JiCU+7{~DTIfh8uMbP8_Y39NbdNxm!B7Wz8EL7Bp|kk z0iJ>>SvYeg`9ri%qvunBMP-`j)coVt)5>F1AAF1~%yfZjnKmFDFZJ4QkO}va4OC#h z@FRuPO5$Jt1;7Io&Y+u9v5tUYAIDL_VZ!tM`sOEo{cuf_Lvoc>jgvD!eCwCEs5`0IHI!ccjyyG_(zt(=P|{99BN7X^Sux6a(Rpx3=Cg6(^<@b#HoHRl zr@od?{H4V?$U_FeL-}2f#!nzTaN3y5KuPjDEx{!?5#&yk`}9X%$Y<117Ig0O++jb^ z1c3uoA<*yj6L#E+IyX~{)pEc`7H6;Qzj+08Oo*30>>qRq@(AUm|3Hs#R*-&^`k3fx zLn#iaccBHLrRH6Stk;&`BC99!;R$LtLb>T@MxzTbA}uLGW1OAhG_ui)4U3 z7VMcucQxCx?<+NudV9Xy(%J5m4pg&03B}<==U$|m=JzqV*(v#bmK8UZA0YPr92nIz z?MxMy?%1{}w(Vr+-}~%+c`nbzdG=jhRIT;QvF02#*BIaTPJ&HcnJc>S$UL@d zTc9p7#RoDl2kbF%ie_a4p1s{hRIVn^Bxe3N=Rt*YzV|i;PJrjV+lZBY8x-qK+`z-b z<~*~nIutb_7yUe}tll;?*nWirb8yP|G`dTJaWVjoCz?ZE%X%<;3*($2PFYtV#(25p zk%LJq-h2(i{!#VE_4E$k%`BO1_Zd;E_Q%en4zAb3CDZEn_kQ7MJ^et~a%*Qn8FMoB zoga=di$?6_KP+A(qvjEM%zuuKUpHVjP z)qPG0bD@`@^d4lQ(lW6$Qn@rbzBE4F%&yPdXJuO6q?Gk^6n*ow!Fg`}RC8okhd2w% z9NuaM=L+XVLeJ3H=xyfK`&CUGqugQ7EiUe_5PNToABM=ajx9^1Jicd@tSLWE!{*S} zjm%F3L$=VPoN%6lJ4nGzGk(^_`p~=Rz6Gv)RtI+zRuNHdkqsYvt9O9zCD$>mnU5Fn z$Af)}9T(vVQ1H-x+Min?)!RQyzrnze-6UTA+aVUaob848A>%@ZROy7pSzHeoW4)%; z;H;&R8sdBAb%1t&0y(Pk6V^mjd?$W}u59)XI;V1tknpUe$GWihi;?|FtH&NqxJY5;%z%8{UvWg?`PC zaVW{{rG2P9A2LXJH+rvYACdlJ5XkPHs27qnk&YTom+>m365CdX_l(eYh!UbM-AS9{ z<*FlQoLA9*vhea&zuL5ueRIn!S#G>S-8q~5Cd^n?K+?L8bE)Y)17T*PA-86qLLBTK z*kUb460=1PIwB_o6^kN5+vl0VTp9(n5hxQwy{gOk+)-?fAZ|F>g2KcNByrUZAX${y z6D|K51d8L9svz9KD~kJpx9Wql>8ic=Bz3y)isw+>12bL+gnN0Gi0kq-H+CR7m4DMn zS}NC6Zot_+zol>I^$`Prn|L_!`w{<8LKMahToP;p)nQFAc?1SZ`{uk4T2E122h1US zjmR`qDE&P+51S7TQz-}IHAWnPJ63P+NExC&)wN|$6^~PYbaL1~jZl}MevmgN`Z;{z{q+Ean03{y#BZs`NE z`be%X>6t?Jj;q*VMtC$x&Nw{AIuMi7t z9Q$pen`}sL@BrBy+3wHFB?s!@pB^CG(fBSeLm_@m2;ofeZ^d55YNR-UqpzD53pQ>q z^S_ZD)kZ&Tg|Atq3ny$y!@-6~%$hAE>)?r4Ntj{yGl(rWx3 za$Pp{blNAiYxFrOjL!&GC(``ZB>Z-V0UOStu8oWTzzDUjyiurHQ0<+4>}_Q`$BVsq zcpWjzN6)ifQXW`Ff*?VeQF7qF;n#VE7GD?k&OouqX(=v>6YQ%t8Z@zN|KtX_KSw#H z(1?R_lzu{*;@?o?K5l@m4kq9%zZ*3gT{{og{mDbbeZLWM$qpEnZ(rNo>_`dfxuUM( zyes6k*gp&=--E7zr+wIE-=sVK#B-gKJt{c?&my!rU>BAGT>}+qE%fjfP-*RyBEKHO z$=x8c1tOa6+WIsnPc0Ec5cj=tjhFLwD>;R+%A`dSzVb${FzF3DxQc|Q|4rEkA^6Lt z(7O(m9$(eEqw`gI4cURaHoFHS*EJ7TRp(f`6brq&losxx-I3K;*}YZvq%E$<_4>u@F2q zVJpf_e5(~b<5BEDqA^O9kaP~guqnB8-H)d0R*XkxyZof(7T zr)XZ5zS@mMBE&DPTt?zt3O9Y_3AaerJ_n6{{}3JBu3~PHAsyOWIRV2#A5u8t6r8~i zug8mgJ$1lI2qzV`v(m)3e;%}4n^3@DJ#CUl@Dp-#1qKd&-Zu;STQDx#h?J0M1=S(* zLfK^UO<`N}|4b_dM(0QF5zf*VTFm!}WBeK-v$W&ad+I}fwv1UR5xXR}-ZHeSuN>1; zZ?Rc+shq##@dUb6CFptY8uLLjT^X4hcdctdx%6da(-4#(8le?c%OK+ajXa>Qb2^Mk z+@1~r=*zdm-Cpb!A7^YFq(%~j)$wE>93%6-TL-NBWY-Rb;mIZ)$Gn*vLCNmbVSaed zRNje3f8tND*7TTBV!qZyr?!Phh*;is9olqtuVd;2H8oE3*p&gN$HGLuM5pAgLA66q zgxil^q8btkh{sN6`hAxo--(Sxxm3yv1ec3V&&O>0B_P(i5pwHUy|UCXdCqaZEtkC6e2nUjxcZvJyXVGunchLMe}uvtwaDmslC0^CZjEb=C|mpnTQ)8ylA)nE8UCe=NCVs z5HAu%;9xj^d*4@h>1Qr8eWj_3&$rd@QF@1Y^!(y3WcrG<3#{x>I87Z{G5C`KEh$ul zJl+)>FjPc2fh(!-R{hKCwJw1aoz21<(zX$DjL<_BV4lt%uDqXGes#~_G_pNUC-Uns z&o{J%?HcEp#|@!GT(!({6~M?@hZ66n_RWcVt53Z-K7CprMhEJS;4q)jdc1Kv*kj^^-Ww z{Q(;B;K{oONN>NQr@r-oC#KPhfuf5^buYZLS(3PB1Fe{+EIB{mxGF2{VSe0XSUe&2s;XC5&Wr^33VjKSUB6` zySoPp{Xn|L^DI<*`qxTz$i8V$Q)J1SQPd)!d@KAMKqfs2Hk(?9>` znDuH4`tKdQN#DMvohTkhHPRMwdrrG{rr5Qj}BMWtp{8JP}G>`ic7Mpo* z^vq4IA!)AN%geng7t;_r@zs|C&-N?uB-D`s+fCw%*kq?Yw+~Y?cK+v9jJ6#y;H2>& zvZ={v5fsCDC&mf%Wt~%E3cyv09E^RGaXoEh#H{1-1!qn=Baf0B#pvK@>CninGNu|o zw~$DIot62+A+s!8e(GC|FxVC20MznJhzW+bBE5Bf;km=E(s^N4JZOxUdXp4mH)8pda;;_!s%Xqec~r`92Df?N^K{0cD{f!0 zxtm{3YBORPf>HG2LWc~gtfkHfz5PH@u#P2+Y}gaj!*|1|k>{Q|J@CMyOSq*Jyw|up zf-9Hg?BakB)?3Fju5KCOYc;<>j{>dheNHRsx)Dm08kcnvF8#QCtx*3mA28xAX-J2i znQy618QGJ4tQ{{66aWzg{8eVn+k(=vvNE)DX1k8nc~&s2Fc22iXDgCNYWAaDhrsVe zMQaBGd1_3!dl$TyJRpmAb{Tf!XW1xC!gGF%i1>*gxNjv{id`mkyL?P%OD$bc+9*M1 z2LBQh!wwX)>gD}~^+IKLI)JzqkyhY>DPSO=TMCNY*j7k(Ig3p+Fw|ZYNiy(5 zW`$N)YDGUWm_0J5#L-+Wv*{oDsuz!c-lOm4>OH;ER#o4CjMQo{QU7efpGS#bCW{11 zW*%$QoJ0$E780pqS!&s7JaiZj)p^H8qVNLL+O&r(e%TI$I^|O|;An_G;R&!_0ioja zd5!uE(b{khP?6v1*M3Mh_ld7~Y78H`c%7AC($iHXeT+{6DmWt0?U>!?jiyx3q1i|?lPn-Yh|BVBhB{-(^_U8?*-YkK$bRBgR zidq9pFoa4cW%Q}p=gZutc9(RFLaz^XsuB9}$ov zIg?V4ywJXz@h>4o?KZi5#tKu5SSQ!o?bf;@**{wEh@GC+mnAbXi2EQ@H~jfvX2{0- z03C2`+W~gp*B?-c?A@1*g89SDbsmcgD|(o_{Uya^u6{d}4pB}++zxoT(EJ7TX=(MD zP|~e1FQ`(T5vI0B;7g97QY&ePN6&Y^uV{uy{fIwNuFK_=4QAPi6cvx`Xl84eFc&z>rThdB%^ z1-p(!XzQf1_7v0-^%&`Ef>>-KM?^J13vCW@<{h~K5&L`6eiOP@K);-4ILi#5&3$93o$S^% z1s(f!0dEMOT4x$DcUa?h`TQR@NL?x}K_tyQ@+OkQrC=5d8Pf%4{V>ijKXIUx&Zoq> zZzhgtvigUdcC*0SzQS+CK+q`h;)TH+}c?G%IzCOhen_vCnua5t} zW7#ixfZKs!m%m=kq;E4xo}8U|VRunHDY@H#OnCw2MaB?-50aR}^gj$`*2Py#S6&o) zxpPhRUCXPry!53A3Vw#OuC6(gp7#Glu;qu;bI_3Qipj|8ER#E;vVmLG(V zsDHH5^(t$$+0`F$;OUC_nvsGIp8M5L{r|c5@c)G3|Bm$k4Qcv+qx1i5bP`j9tSTsy zW<^h;tOWkIItxuw2;(>=J2~^;$wHe(D+|NJg>!r0`y~L_AqnliTy<>q6H~`kqf+nO z-@9;q#=-4>P424~l79hSBsZ+oh2FR>gy^cOW?}w5P}UYud4<0{I{Gd`4SoYUgjOk*D+mVYFQ{R}yaCmWBB#S<*woFe^FZ`85=&&+7? z-#xf~Jy@5{87q_^;;4#P{=rn<)-1nUFC!9;$z|CggnudCV7$mdoj6ak`Cswdaw7d2 zQIzA`-$n17@Afj0Pqd*?J$mG|Y@K^lBcc6ZTu`@5rr8}!I_G*0L}&icNy$Rg`z=8^ zR+@9e{>=V!0YcQt*A3s4CPT@HLCR|d(s_tDfoZ6O;YiIWzYfr#9d`>tqn`!$xgBBQ zaw+}3B?B=gQNQIB`~s5$*NEd)qz+s;>joXbx4y8ae!`RWk0Fr+5V7-S2R$9Rx4m}B z=}p+)YzgklZ!I445)W4$^zkV3NOWmGI#r1-AGx2bZe8MPi_tPJlZkpU`Lm$@PUhxA zKmeBr8#(FW0qoPwRcI#qXBd59a{|Ros9)>$HfP7iM$tbtPML$-Leu^OK@iFe3 zIy!%dqIWM+&UbW7<}&am7yDr5q#iw6($73rqzG7b(a%lTl7&iZ%hidDWR#omY?kj7 z3VL9&0c(G5Q0VE|FuoOCj~-{tA2*6WTJV3cLZ0RbRMR{RSrjXv+Kyx4NSPDoS=CS* zW|2nkI>)*lFX1x2xPU0jf)Yq7>drqDi!hTJh!7!n*GaJ2v$A0pO z!L|~zjE)n7{&ryHKdZm4m8 zg)|J~Gq#aQd@w+ep)xhTY~}j3E()!H5MfIfdY)eWek3g}2B-a(;L=hpklPZC6YkUh z{P&DP^#78DoL@vQwyF*&hs8H15D=be*3}YC0hBVn1AB9($(>i7AIpfJwQ5+r+{EC7 z)4stXkBt@5zmPP@Z$y!vj?`ONgRe*U%k z8Xr*9AXwu(UEmc@mU?q04M!Afv`A9#FDpq}!CilV7uq)qG6Go7&O-rI?5M$4$#@3Y z?=hT1vWBt+_BxrpeC{?Gi3UTRio{|Iu*@5u05S$+ntbD50tvytaiUL1kq+$dyL}^6 z)@PQ7NpBT@(RzMKz5aarjJVqaXO8y1&H3u^iN)y=`qQ^Z;B zff~Ro;&+ICP;4N+_vBD^$WAJ7E_7$%il@&MZI}`cJfe2y)x~^?CmM=ED_hMoRcD>j zk<17{7Qpc|{%?1)M>ZW{2nB7wDoyl^liz4BBqwOi-1N1oV*MDa}Xo~Lk)#U%|Wirw}+BFvGJ{N#=i*Wd@oL` zG$t!n#N%4eg1%T_AdL$M&$1i{{v#P_-`D1UG z0^4+j)L7B9F{U?xrrqIL3Rdh5)@FcMmuPG|QB)-I)}-w(G}x`37seNp%Z17>x_aOW z_g7x!hH3!lNjOJ#>x!Y`g3TxdLAWDm?OKcnbbzlG$~^|t=nN*c`J0ccl!$~;9`;qu zaD`D|v=mJx@|La;_wVOG>TB^VNddkb+DG=WAckI~17?&1g?eLr^AW+)eG@WCW zV;(th2l2f7eQ^Bfv6&HO2-3_pIi3mlb@@ah`H58C*nipQ@W_N`%+;+fq)oZof&XnH znP|YuTl44(MYC2>eI}e$sKzeSA>5H=EY=pNw_Ef$&&PYr;ZB@TKxvqSc}$474A&Zm zx6(?a*W+Zej$pThxm>hponJ&eN#R!!Dr|#5mK#+ zR!>7|t8^Wj?b(|ZkDp4;u~XlPec+hmaW;4bm>uYfkp4t% zlOldi&aOU@YGQr2e^^Jz2`R1y;!XY7OAS_;7QiKJmpueiXwNx$tVd6u`p2fq_!eap zhIZ>lvy8PR5@+u~L!pFByHeiPabpTG9hl~i(@jv;uvKMc-%HZc{wYbyH`uVlt4hu= zIp)+qveUu=Mul10jX-AQOO$Yn_+WS&$D*XmAzJ_}+j07F!m&4t$N>0!wn*3|bN|b2 zZCKSYTxI`j9N>$Ud%?h5ayCah0dG|mEC;cQB-XgI{nY@S46MyZtV%jIU&!c(*CL7i zLTgpol+EvjDu~WawPR2)sMt!jbE?ScnVK`F>a3U;}(R=SvI``4q_lZ9~P_<%UW8ZGwqT6H&o3eP@ z`$0Wkt^-N^XnH4vI7K{0euLj5ui}^EdmFb~sxPsYb;CmM9H{f`Hdsla(p$Q3b>b+Z z^T$*&sLd3DNRsNUm9*u|MpI1;iwtPWhPm>9eb@9cP_W=p$CK8C3}{JcQYoHkQtmA3 z6~@OrPCz%sF{TM}MY@l*h5;>#^ZwSv|Ivbd&m13+#bfREP7OMcPBZ4^?=Mzz*JPlhNO}&?F*g25 zRbGx)nwp`3iB z!ce1kyf!g=dyM*cEl;NkvD}nwL9p;tybX}ep`8Q3-W~xISuQ)sWy((sG1NIqUvSM_ z*8PaZi(>*^ug)4DB^NLkZHxL7HU-VH-OtUy+LHuR&hyCw!hE4Q_5BvNKkFYUemkg| zfIhh&7Z*JfE>4KRp|I?sX>gJzX1)>QLQ4YzN_QE$SYcu&kD_>L&^}kh#W!bWu+tTF zkkW(5gov_($R}c?obcd($o1Dkk!@&tTxwnLe{MS3ZGb9H)zqC!c%L`qX;i&a>%FF0 z54oota~vlzQ#e2$JQjbx=%t7=7)01k=QLgmXk)0hIYrU8n6wyPorP{<(^7o$Y@PO} zCwmA``1goUa{;ySb5M)QeMR<%CCxjbQ;Yd%1(m%cp?hBF6FPoe7>b6YR>D;E#s`oagtVx zzp)06@skvGPdm3Ii#s0 zvTj`p_}7e~Z-juip_WEbVg`Rq_e;oX+T-6TcR3PAd_dGcM1&Kf;oP0Hw&F(c<(#R< z{b;QEey_9*$#mm$N8k7!5+NDee@B%9vQegPLFG+0JgKd{gWuZCR)_A`Hv0u9o7ZM%dtqUXelxEfgNZ?f95^F(I9xrukd*v`0w;f2R0N*1aomWo6^Jc6CZu zfYkAV0IB>|_yf<3b-!WxV12b!>tw;!?tKPDqI_lR?l}u2E_NG-{$xTk%jin~w%<=< z{lSI7PT7vp!(dn4S7`XPIV*%<-sPsYthyR675mgk`?$U=@ zi@hXoP0}^|r-1d!0!nbJ`A)2W`{qd`P*nLQmt-7O&Zzx5$X!K~A*0^FnqZR!fiP+T z@hwE|Aa;$G*V2;D(Q5NVI%jEy>*Xz;aPTBysnkwT6G+O!gIi@;hZ;R7SglH?(xO>8 z16O}<$qXBVK);U7T(2ef01b7SNAE#aUUA5f-kC={z1JJe@x}nXrh1S$z0;dUw^4cg zl1&J>zP7K!ka*JDtynO-%^(MNGhr(y=B_KM8?v7@nRrYuFYdz(gZ3T1w|HgUoI#E~ z_EsqC{?V1N2*V0ftdx$kjVj-ii|JHL13rkVHY`HR0~h;CcgkCs$1)ksNGYe(3E{v! zcb6<7RDdbIVXXaczQt~CK7tQUZr%7RDs;+}42wVZHH$n;p#K)87ryaMbPPUkULJ4i z1r-+|Ulh|2|8)O?vEXLY%Z@+P=o|5>i89~PPWp=B=_5oF*BZR#KB@1k?=Jk~s=eU% z5AHBZB4v@?5 zUYx{5y4AQ3t6L|aR>X;|!6xe2DNPP~7T*!UnQe?E)!fU(+La_jUSjY^v)B#A`XXh5 z-P_>56^j>)W+AD zLil1X6qkO;2x?dbU7dXHufp3GOX> z$o(CX?90j_M0^Z#VIn}#BAz(2ID(6PU&^jvD0hmtU9T4~KA7qfH>*!wlUP@%>X^2J zvRxY4f0rj}VCT@7`D+fR=EsWD>!s$tqol@P2Pw&6%9Er~{K2vjTN280H9P$x9 z$f|Adk`m(3pNGn<>zm{I_pY`mu-4;YQTYaEKCD*!6B^cU)&BQJ_5ct0Qhv{wO;iVu z>6C{+Ah{3nESjZ2t#%j@^U3P|$OJF&(5NkoS?j;RAj!%i>?ME$Y@G=&u}uP zq886{+o(}oCI}VL;y1Z!%N4pUo>Ki$E>r8HzV2f352qGbxoe00L$Ho>-~(dqgi?qr z;KQ)}m*%z_(?U5OjC7gez7sfB-TO@~fhpE4vXk#+6PK2;Kd^jm)x+?j$iuANo_Jh# zo--HH^p3e(76b6%eN*>R>&$JiHms*x7*<-Z{Kaz>j# z3>HYwwt(IKp0C!AsEj6ti{@g#7r}iIwgkf&B)I>X-N?e3XGmC(NW>P3&s6a^tg~j1 z$Xs%n`TAyUqspJW`EpHVE}$nu*dx&|hNLEl$Jrx(p3kwv8mABA6!kZIJZS&D8{74SCME^jQ8Ox>u@Uo_vio6|E4|(N-Tjs>HZ7aGe#N0n2WU~XU1#cg zbL>;2`DUGsTu2zf(c{&T5h%NxWn0qyBj?!k_sT*%j+^}iAAICvfv0U}gVDhq;NBFG z?N*}0GW7Hp!%&PF(t(@J5ZVqFFK2vE#l}=kUxyRzsSh-OkM&RIVfH~3yrIBpkkx$R zer$RqMdR%>I-^F{kGc{N+GwaR$Y2-imYolCRM^^F18J7p{BxH-HB8glH|^#K&in6^ z-H3R9xn2lw9~8<`%R%grBTK?hD9kGo0mDtnMkx!Wg}Pg1V`W}hKZ}v&=k3$LTz$n zh-uNK=cfdAUVSUUC&lxQOZIkws;5-*BLzq%)Z|Pe7w~gJ6LFO?MCnL7l!N%Z{3T`D z&IWau>A(eM(V6iZfnknd&ORZXr93DMz8xHpqeseRD#wEk6v z?^MS4i7n&!JJqG3>Fm|F`@zhixXa@arWtehQx6mn(leDFt|1uJmz1Z3ucP}UDqwx^dQY=sRq!K{zWth#cRqM`5BK6#gA?-CAdEVTf|NKg1UbSK zhq{m7sT5X~He#Jkt_Q>2p;$kp`C+|0uujGZA;_&HE#uxVg~zF}$zU6k?RytD&lLhD zBx}~~RLS-0Oy{N!vkAb9%IBI*cG5=6AASA8>6!t7zvEHqkilzzBmQ&MRjuz;cgzcY z_pNC>^f3euI2j!qk?C`R$SS_-Q@L1^is=9dO^d6l?n;cpeYN2-q>4^#eOiC0Adm{4 z&Jk-rmjN=&3|fnUMLJ8w?+102(08}#mf{sv?#tS(2WT@6l%xrLciO1y^p^drFsJ7nCUW%wa&z>NL)Br9K#PCn50>STh~EbY)~1 zGaY@uM+dd*O2%NK#f&UGOfHU-rPQYKox^P28A zQX(c&sm)r<=z4e;3uc+#)boNPQaEiiqr`|#r_14u14f$Snu^C37uw^R>U#0r5h!Hu zU5`Z1LrmE&;*x^Sjfj-rq<}wryQN8)DyOA9oqld+>lZg{U+CjF*Wv^48r6dwh#L66 z^Zz>X`g9?Ge-qS7*ZwkGudm&;XO4ng@2=k7iN`uXJl^>T8675*!0zda*J7Dh zX!8*3Yq{=YC#7px(is-qI7XroPWImBr2YzW2x{$jx40n){7EDeND=OX06zid&M;0q z*VM}~T$?75*ihVET~A)A=3{YVE7_jpQ8&mE%AAgv?RgcUt-R|5_+^=R$xa}J0S?82 ztQ#n%=i%e8c8TbU*JdgI+wiE_++R0(F_lzp;vR`;`pHBwCSgbTM`h|f!8kvPX_&DC zc&ifD)J9CcR#Zpu`B|9rF4W0{&dfnwOWYDQ_9(>@eKvJn1f8_429omqCvCB(4(yCO za-?);+vz`)hSXhc`a<5t&ot za5w2C>BfYnd~p+uAR3$rW^WN@*@NYAJ`7;l^Ax03_GIAu(Z--5%G9Cq$@SJHlIa6m zfXCj7FIO8t2Za%IrXgz`%Iz?_-xL$ZN0MQ}nH=DOi!Qc0_g48;s`e4Nv2$=69`?PbJoM$0u?^x~#z znAFN_Ly;I)TSncEU>$Qro*dB7cV>shFL-{B&>!Z<-{)d~bXVRS5O5z~)}f?2sY$sX z&JG*DTr}{FuqRPi($u1gK;4Q}&;yQFWuqSv zTI_#`(i`V~i;@2(2u&SL*q2bG(#pi6T=QIpgrvGFub^26BRWk?_W2oKYsJ+O8YAuh=! zB8v(&Wq!Z9+#C&Eb z-G)juKyQBuyvW7M*8V2zBk^0z*Mo-WsoVMbEwjYDe90iAu)dzI^%z%!h{}35Ht#3) zw@{FY$;b`qv=U*72j`_{60lQQS`7tbd8oUu?lLf;)(K-5nqfZoTuQ*N`B6i9h`GSQ#kj6&$79gAlBFSEu*K{(X^p z`409|RSITbC308Psh5Jz|$+6 zuu{!BQEpnq(N~3y#UG(vCkmHfmH6Cy+f(oOV1Y?jp2et8s!y!^iG8!(_65ljgcd3H z*g(rIq)9P$$EDt0$tKXm1E|J8yZ;l>_$j3({8h`9$`HXn zw#@Q&9u^cMW3tC!VrXr{3r1Bci}16WS-tpWA<#GWgFL#ZQX`pg6VJPk%WPWGk5<3q zy2Bm!myf6aAa3Nptd>UVOEZP7oE{0HtNVvQt8V8>(CM!Z=XqiP^2MBfU>x47yjSrQR)+gQ++TDkJ zRUQjougLVYmFU2lhe}%(ye<5M z=DNYb(5xx#( zrc}M;`$o$KvV(4~+EIk-SnAAjX%&~Td?C_y*t>tFw)f;`(|tt)=}qsAC`>WoOU-=b z(U~fw@sJ+u20HA~#IC<~{6>|zv6E@R@}*`l!6(pRfhUaW`hcgT%-Prw|SC z)oI?vTbrF4t2P%yaAHHX!#X996n8b=)BUY5kb-qc=ma!aFG#-fc3?xfM3~{(QrNf4`$tQUp0{Q1 zDaH!s#zAgDOyaNk&Vs-OANwu&6gPmE*c^rhma6n?vVTw(2f6nsX458|>**ulGe!#Z zw&-Tgd-3^D6YUKWB~>ddxy5~F?=)d&nN_gnugn=z$~4NL8-=);ra{Nsn)il-@;r!m~n7nY4hXhX&AhaZR%qVHh*EW}zRKh&D zi8;fs2Y>rPi)Q!1_mfAbeSdiMaEn+Yz7Lhj_R+btTVKRaY}0iG56HV1YB)KR_A!r_ zugJie34$$=#(rez9pOqNy`al(Z(W%cFK-9ioPefaH(hO*!#$27M_GPBuOQ9qjX_l* zx@T+A%7;hn#LT!TxoYmP6@%cuDLb>a^L1|Xv0Z{Tlz9~~#<_0q6j{hVax!COA)onk z%Pk->F0Vc&zs&Nvu0DTTCKQN`O!k?j2_DhG#!AbYrySWDX=^r=YM^zQY=5JOVB-cK z%KOg{b-Fa$yxn%>8D;2Zk3xpemAQF-@9PyjDODf*UxNYnXZ@PpAdTH+pWBn4apvWC z$P%w0!3A$)w3Vr=^P(#LrLJ?!`mtFrFs5N`CV-=$^cJg40jZ(U?k*QcpqLK8k$>71 zV1i;&f3i_6cE{x@avU3g-+_31;o;4{^J1pnNsZd-a=%(T4CaxxVk1R$Uy zzBNm(mZpcSc}Xp;rlsk>wP@J-7NK`BPw-pROV^(GqDV66*SO1_Pvy!(yMtg8sy7G5 z(m4o7x(jR1=#UQWHxLY(;pnEUS$N610eC}yzznS1rq^2X)I!a5Io$ps4d2{nY31nG z)s+d8wygWDGPswuzkH$cv1bp5l!no3Hp*>zevrcWL2FLE@RehN27=sW(HFU@Dm0T; zwK^Nz=emVEMC-g{-~#w|3=*&QCtR_RS&&qA?++;XGiyHPA2Nv>HevnouQAK9(Li~@ z+$kQ7<)>8_eN+9v*s4&%G5n#e-pvf;=uFFjPCvcFY{@~Vk*cSDrlc7~T+#cosrwXT z5yu%7?{ysZJTqXq4a52`rse*?qtM^k5ET4%h2Ao880*|cUO9b^Oov$;qH=-CK?-VvsCL%- z`}4gM8FCacz)2_CXBjnFraK7z#qT0OZm#`}gZ56j!yX3}>U~FMmrsVy0!eAb;yFmR&aj>(?3Yt;~mXS3m=sh&?LwJtG4F#sOhpb#s_gHxOIx~Adyc(FD}LlNn~oQY-Z`K94DD~p7nG1 z_*i{@wAV4^_It`3L}C-vj_b}YDFYsWuh~n_kw3o9_?54k0Jyf^HNiZH+N;aUF zEGMJ19Vfau$+ND&{2>wo>7`93FyRK?qT%Zlo?jp+XBQWPV=MxBtfszPE-Bx<+)CV7 zrS&Km6eu(+1xn&k3$$N)yW@IZ-xuk^flQ`3*k$Q`&z3|z@e=11_8Tep?IFG$7FI^4 zQ}n#ho`@o01CvUP+kX6o&e&P;0|CwxX#HuXl6#g4%R<_9Y>JHk-cJ-t}G06H{O@g<1Ac~9FG z`_h>lHBx!I5K|Us9a{IUI}3Vmif()Gl>%y&eQHi(?fyqnEU^fDs&AoOrgEwpvNKq-xy!9}FO8r$;yjSlHWl$+E6cqGmaxRb$`t%s(Siw^``V+P+0 z6#P7U`MQ;~6%AulR%a|t?(w**6wMwh?qNlu4^y;?S@fIsr(a6mAfzIo1sR<%wR?Ry z!ysc!SkBFY$jMrGu51q1$04;=m-wKf-M99*1Py>O*0Oo8q&O)Yi-e(ctj7w4S2ahk zfjHBga&IDxJquh%yDCi}x77m0i7@L`_N~7uuBTlC7QR`QR52E>+BA$DCS}&xvL?3g za>{Oq<7G0qyBS#i`S3IS0ojJ~;ifq(YAz$ZOgs3|@c68*HWfwACfXPzdk#~~2>JbU zgZrM9h=AYpl#U~1U8Vw>WT1wJi%Ua0VmleU$gaJi-cTqZ(GK7oqyu zpKGZ{`E3kI`>WV2l&YM{Ve8XLClOG@K(0u&aE-XqU)bGrONde7itg=O+xgygErQ!Z zBLEE|>}k3Fmn`)*t;GY#LvYd)*-#J9#3*-;i~P-n?K?O>Tw3@cK@vMSB<6VCE_PD< zXNjH6h8$i}qU40CP~UhRYLLo=pO`zLRB0Gu7r@U{wnnRs8umI+V_c z^mg-IWR~l#St85O_~5AhNVLkqqg}qNiWBm|=cCssfQ9g(zx$z-lSpwUHt*d7$AS?D zDX3YC$MZHFy8Sxvy}CK;*=@?eK83(eD*Z4TR4owNdYU`HbL3{)(L&VJ;7($+rr(Fv zWj-~)*NN9}9Lu>+CsD}NYgp5|K^2JzaX9#zGVoh%vU4|j>S7a7KxEKq(35J9ovU^N zwv`G#1l}MxH=i{5k$l9JAVh5)K>bfB&I6qD12F`4kaig`mFi4j2d{&9PHzmc6Qn1E zSd)*E3$YNvr&6hlMJrn{wXYkPv=aOXMkS&-1cdBkos0Me@r*UF4SoAcAWR$IhXGua z1kocekWc*7+hfkbx>W&hkNw5yGoj}A`KczC#;8?y?-|Fpv~@22gi_OB;*%kTe4thc zGW5_IW|@B5L{fR!u%X@L{Pshz z_V;+;mLtNGTe*wB_;>lG-BrwM>hkE<=-d~aASbwIZ1r7VHTlt=T!HCKv(8*?6=Mu~o8_ zAZ^++%B!IxER0rlK=oUlLe)qSpIy?nVZmFD$U7JIeHoUSyWycx)l;lAKMuiY(mO;L zA;H1_W&v1z3w}zP$=M5w8I5Eb`8q=632hNFG@ZY#bK#$t&q(il$Yo3Ov3TA$I!5NJ z(gKHLSbf*jmHP&_`c&7Bb0es0Jhp2n7v|dlm;k&aN5i1j2zA=#=F^4~)QKeM>pX7x z_H0DreWcm}Oc&($?~f4J_&DR!n{t!qp2WVrsBk;bRU2Jn)5u3q%~F|^q7egu&eNzV zYX;t3RqrKY?9}#u*4&OFO4K+n`$_NyAh`dA<2RiwkrJY#?ipoksz>70sFYs6nsXAI>9D@@uQg&+!7(lHSHd^lKOzZ@^IS&vbl>CNbNcRBTTOt~LsZw@WLu@5%o_h5B) zli)`=P8+{DK5stZX12p&_Yro8tM_G9zsfs5cDosDKEl*Us99q4fpP&-zKbpUjacSh zJ#mzv`_ClfiC% zp~qY$Gblb~?*^|+9mE0K&{Wrqn@%2@w{oR*MhuTHT)QFPO8^Vm=eboe<0k|>vA%mE z%aGb^JY`d2Ck<&a_ko8^pO%t&G5&P+xR;h1rWVlySP_r-zrLFcP3CktekxCu{pH04 zmdr;F_ra6aa}92CmM6KoR3gO8q_S$jTYLY>q zVt~t5Yw#!{eG*urE#gyN`o6^|mX^w4>I33N+Cjc2h$s1h;NmW<8^N^1BF{JH8qt*f z!?T;YHO8jkJGdFxwgY33^mXG>UFGTHrmyg##3jDEUsk$@dKn;IuS_2os?tG z2Ywrnz{75FeL?`C7jMdF$DjB!i*CKT@!m9hIns* z)ah+H_r`aO{drAaUfk8lb7d{?Roq8^(TniJd1!df`2AdCIjUw}Zu`g&Zqa)a>)bZN z>s#ap+$qGf1;Gcn?Z1=R>h||7)lEVlleccQFXcd7WVhsuh({#DD1}T(qq#u`G2Zu@ z*^u`8r!MIOVb>*-Zm7^YMlh}8fc2r&o)g`=P+tc4qD?pSf|nRES1-c3+CSl^r8Vw| zGYx$(j@DC_yKkvH8*xIB?V~QjkAU9Dew4gQbz&o zGvSs8NKK#NPI}>pI19pgY-&Nzj@)}Ep@(=nw=?rt#{WceD=LW|MS$5{Vfyvg(8_XY zY?dJW$iYj{%j}85tgrb?;O2jgZug_a>t`nWo%?3BFRp=rPATc((rLaAw%*+l)jvXE zU-k`-L&l+cA8-r$yX@vCs6eJ()=+}c=;Ofd7fb5w{)Lfqw?L+Mj(&dxm@I<7w}?wT zkOYitt4JgO5R0L|(|TT_`!wR`&JE*=>ODq^o+9d7zs{Ou_imOakxB$?fNPHX&||W3 zbsgS0;{(ayc%Jga9%tL~566Md(-yPg1FAGL1aEZZ@!5@APZmZ3Fyh~V*$B?4{V6z89)hy-chR$Oe`^)-QW3Wg zs*&j#%6qC2MvZa58vgwo3#Ov#=kc%C6U?bi_8it-Ea4YEqHnQ6VbZM<{7Lrb_JUXX z64rul`|rU)El#U==agqG6F>WdDP`cZ|*~=(3CrTC-NIH5brbhQUAFG9@vy z+yeJyZ>WP*)5*9l(w`~)i9J3RPt{>$`f$3(K)YL!s3X4Xs!7}T+kOt?AW2jeNxw%L zQ|j$L^leyluwwhG{FvIAddzUzlZJSk!^{i3E5d8r;VVQihON<$Lj%t>w;}In3Cl@) zu`64Lds;l1W`=PB(T`WvAAp6?>NteaVBJb`~SSR{!LHY+Uc)E7zWQq^+IJx zT}-HMK{3XQJ!hxYZBw>guAn^^O+^&*4mlG-3vz27#NB{CD*Bitwi&XUy*3#AV6r(B zbw%AdNq?lt8B{!pZpl8lpcWAM*73o+iW%f;hmDB+4dsf8bhy-YG%EkO4aV55d!>&o z7|RqYq3b9fsZQ_?Lb&|~qK*|hPA%>@9 zPeC|61Q`FUFa4>_cz$@9S>h`*;nJUl7jtfbSr+8WNr}c4>A$|R%KFW^9PVE4;U)3%JA2N@m2~E&r!655te(xx-hAq^<@joFsK?U+r#2MWJGQmLs5ObeW36sC z9Adn?N4Kw7{)%?g4o2VLG$^yN#f>plMIxWs)~gj*wc|J>&%#_+((7Uiwi%4%S3JNM zqk)!?{mC=D3SMWCW;Hc{R%yGuYCAQTJhlI*i0r8M$lgn6Yy`<75t8kNt_E&Q)7={J zHC~T*ob-Hf)Cec=>^^~MTlW0kGR9QYcO7IgQD3U4T`-!%!npr*c#gyv>gg7gq`jYk z4F*`r1PF5|LfHh|J_Cz(c0J`BpL*~UX2^m)k!W!uhs@u>?DQRxIC>lh|6$Z~^6{W9 zuES4G)a3$z?0Eo$-*SLApGso4=(?S3f#O~UhDqk$h;RvZCWrfJ(CI?Wxed40mvy?u z&x(hf;hy&?t}2iZxmH2U!MmZC3+=J7(DxdSbNb=?5}gn7pdD8lyZG@U5A%Dt5>5vMmLy34RqBy~^O& zuDR!r9=T)1#+f&Uz9Eh=k!>+k2t1rIw`Ul1!)(CnErxZP@6hjm|KsS3Lj(JHmANr*=>3m&!yh&JWuar+ zkzBzM>=!s_@M6zfEgfFGVuynoG!vV#wt|x@J7g=2=J}-;D;t{b zY&l{N{iZ&S`B5EZ3;oK3-0GXp3ff*U!G^c2H@+bviS1C`_lQ&Odjs`Xf1fI4!67=G z=JyWiv}G1LjdaHl1RJ?ZJ2%82_8+28dL-J!H4t;m*Y6&s z0;AUCTfxK3Xgv;gve2oQygci_lxA5O)sWgd5`nVL!QAmI{ZqR-j_qzb>0%Ud@D ze^zq18|I>CLBHyT>;$fDCl{%ZZ()oEO5jLJGwjDdi=}_UyFAKdNm3TDjN~Q%4d}!# zQ2OPbB-2Y2>r-zM%yF#&5o4zrVypet!kJNN}BtogUy;( zC*5vlz%!BQ;0(!08mgKzf&18=F%e`pxE?s;(ZW~^oy-%<^d`^eA~qZFF}Tey%1ewp z-Z3H8xmLU)bsKGr=xI@$l5`MjAeJQaOfPH-6~(3O1vMq-afQEBj8KJqT!TmBy-C;a zZ?H8D#o+f4$>6VOsZ^L7pc}&i1xh53VzvXHAp=;~L2Pyd>uJ&Ny61IY?2kO5r;hY| z80^y`fyrG2-Fp;2BR`w81uwY~{G8?!b2*~$bu_|tZ}>L4Cc>knF2X+l5hNp3aITd5 zv+6dMNt9+$w)|3QZz+8Ay1=d2t2A$8%T+~g;&1o5P$_?MTu-vI)FwY`_>(*!F+1c7 z*@XybRMXT+C-zN@PP)>PQjr~BNj@Al=3TO z9<7r)D$DexN9>4K^xkdtZ)dPGKcMbbidzScc$xa;k8E6ZFMcOe8`(6s)U-hcx+&RF z4jO+$^ixUt_QRu%OF8ZBN6qc$#~i9nIT{Mu02q1c5!y2s(@RF_T#vTC$$dA)-m1-& z`0yFy!UQDS?M}-hLKVI(qpfoE%SGmv^8D7r$FhY0g#f1Q3?8qyQTBA&wB6wVb(uqw zN7a=j;O796AriDU-o}s~C0<^T55=ZWnE`wI_WnniHTtf&PRSk=qT~@##-p?e?vp)t z&ZsW$dW}~2`lsx5c(0<8hx|_gzC>^$^S$4d$MM#TK@REbltKC%>x{h`A1LY1OyVB) zoiQ0FTo!(>efnzcQQGS@gCaw!O2qz*0SA#Iia!;0hfk=E4$LK@+1JQl^tZk1Tr1F; z@dDEca3913_hy%UJr@D5`M3)Wv#!pV4O2SYE8PUpK|n z)oHURd!~iXyxAvF{3rmUTolT;gQ$Hu@<(<Nommy)_(mrgO`y+$2!^9T~; zIQIRf^6it3b{k)TIdjx+irvUWQSDt-7nqZxzY5T}(>>y#hgdh0`HVN@xfGr~X%(@v zbIYGZd|mrgT*b)0^GP6oMF@ZY*C`nNk!u&p6gwi8whun#{fFoTqW4=RQVwQ=Uq`bR z=-r@cy`_5HXE%c8b~AbDDELsd{kEy0vhqZ*$PICLFm`?Y;_Noy5hb<{-q4Pu5V`}3N=`|HQxr7D-C<+ zTa#!oiF?JZIG=EHZm?fe-e^UtfW~<5as+hPP6oA(CH2jN;ojOZMhT>!#h6%qqN~BL zLPV!HTrk@)zW&oMo`-RXZi7%}HK~RdNoJuwr0TIvLfxqIX8hqH{u>Je&FHA-d3b1j zQ7CPM*%Z-VXPOf4s~Cp3^v3ELG2~}67r^^mth%BuxAl~3>BPrk7}kNP>yyQ7tD17| zX_P@>{^>x_bCq+l0!6YU^>xA{McrN_Z_jX$GI2a~kmULY(affecFK$3DnUi(Xapa9 zv3wmvWr0=bO zvm~l}v~Z$O`wSs&ugrg~EIF|wpR$;h7IvArM6MaQBon6!AAyxqr>9Xa%uDn1qCeC+o5Y^s4SH^jCvj7#HeMeu#m33DDk{ zvHxP!h;O&t8c#HB4d#-7jnA^2`*)E4ixQSDLo z_78hYf1{mk&gpo|9QIa(BFu`(*}5XV)$B9F3~ELOP$MKN*NM*EsaoYzHP~2i{UF%C zda5sKFy%l}^OoGNGiekjA!uG|^6}-{#PW#=ONiDrK2b8-)OLJ`m%rTn{KzrDE+{Z6 z8uk`5bi$QR=sKyafyHpzIFe0(-{&hH7%N zOnhoGh5*+Xk!`3`GB+b(Z{p5w@4{n;GofC%!{M7M_V-S@U-f0GWV3am6#uOOT`LY2 zUk&Uv{PAJNDlBKVnUeiIMK{|WQ+b)R2^R1@7)f)YDPX@HH^WDaq7I8kPJKqrIjd2D zFL-*w-8XNDKKsjozft8?;;?mV7|RXL5MxeEf5nn*ewrJ2`tFq6q}4*y=9n7<1ZB8Z znTrl+Pm9DSyX*Bos;|&L?AWT7Ofyv_8XpmiAJ-r80!?+zVA>JwpbDQyz4&FOG-bY7 zh(2DeR9^_R-uAYSyrFw-_-P44m1{6i+`i26=`dSORCcEYUURz$tVb=(p=1O*hWG_q zND2#7Mf)CS1%7TtOox_?kH1}x{n3`oQ9drUR^`n19oN==;#vo3>?TcB(xM+EYU*8? zhDvsL&2P7eq?s8LO)>4)8x>2zN{fbdyz7>ztPIp$yqs{Gm`@Jg8m~e8>r=Z`{YNuz zX8Gs}g!~cL_a*H?=5pI{e$dUqiTq|F$psFs5k#;UG=TGZnw7a&;4c@Y@pJv?(H#WX z^O-RLBjF-wpd$F!{%m$IaYKF3hqamz`ahx(zLdE()e{NmK2Or%iY>}v6yoGL9HP=` z(>COvfT2-i|K=KUW?_{z2-aCka#7DBnl66pLQ~=p{uBcHPuoH2jvGKnk^0yeAf03m zF&W0jLWL{6s|e8+G2xTP-^iKhf7qgp8QnV$%}GmOBQI#Jfqii-Kq+r@(4J*(tRaQY^Fj|a3k-=0wBCYe8q zh7W5htdh4}4wASjyNYc<<13Typt~}$sn)M=q;}j%dOZ%5HRoB_5fJSORysv_m*Sz1 zf_UY0I^@8drl15RraPt@REM2sc%8xUH>d_n>XWdsVB)^POj3cdRS^yCMQlI!3Z9mq z&UpSBHRNHX2rj1znd#_wxYPIDO}E72OJ?j;U~~H~7=*wUVtSixK3?`71=f(QJdS0< zy)Fe^h@&+~{_Jr2ef9gFCiER_KV}ZoJ*0$I+`z<_f$M>P4FA|y;yx=PnUbWJU1#@T zAn-qf{_pnR2>dq!|Bb+ZBk{>(mFq=BsmeGkfiUc&-Ks%ocP?kb|1?bh z`zeG1);{W@N8xW2+1v7UzZILCoh+le-F7>eh4K1#-n47}g-%z!CJBLHYp0+S=ZWK_ zQR&?$^y*chY7oJ!>Tt6=#g|rUST&Cq-+gA=4`)%{fUyBU3`bC7>5;_Y6>kY$^6Y&>Be!EKnqNM`lm1{{NyP|C5k>J&`lMCEv`Jy6;E*M2<4w?xa=3Vt+h&34xOV z#=}bt=l|U|GS=WbKZ3$Gy92&N*9LN|8XGigW9AE+&@l zIYuj#8wi&h;5Z$B8$NKD_Cn3>2LC;vE&`_Sp7#f=ji( zMevS|B(K8vtYz55H7OP9)v;{v7fTZH@e$kPceD4Ir|mUl!7B8B;mkz=qd+Z45qbYK zvG|uIXFd72YG%u9saLkEgbcxiPav4Be!aec233_N^L_P0UX(i(V`C|hL2|mJ79AVo ze=wE*nh=x3U@GHg3Wm&Og)nq77vUGb=qE=<-H(zd-`hQxpB08#vHL?zb-r`n&naSZ z7owE;Yx5@En!`IyzY0Fg15-t~IX{-IvYhmSh!_*U!QgK|4ECAVBkJ~(k|ZWWhW!2? z98w6Z2rW%)SHttq69h~UIWpD$ZTE{t^67Cx{PpdY-XsnuHcqM*y>3HY_kb8OpY|~z zekHIc)W<6xn3pA4Np+NE<|**-$MV_Fe%gbilusV)r~NtVmDx+BfPOwnqA;B2=aF=bw>6wHATxsZ!tM6NP4~gM}kxge@_2Oe49OA=4UxZKw)<3CTv1FF`!EB+y zrb;kaP5y;2rbY-US}DoGg7*;G*9*4U&vNzCF}GypD|NhFjiLpdGB0U649ZwLT4V+R zF6h6gWp5)fa@xNV@jq$Ms8nJ?Ne*o(R+aN5ex|R5@z$L))2(I|WZA>gnGgcw<1#I= zN(l_SHl)q}s!ABq9L_W4J~!WsYYIPT6i2ZpvTju(K!*7NKo3-6f1|&>2zrDC5|E<^ zYJ-bu8~gO#)IFiz0ZxY9fk2u5<+Q4wyjD9>V}5-9Yo9U*LD`XdhNrFFr*8vM@ z3$jdTU4^Geey#M|Y#IGwV;*>XA|qTfaxyb2NTZn>f;UWCGEk;g3QIXzwuE~lUb1S+ zd*O=r=?BsKhtQ|jVvCYsvG(g?3Z&8h-cZtfAuua+;~DPpbia;seQp))Oq}mZ0ZGjRrqu?YGoX3Lwe^z8#2!t38)*&yznJS%0_O?<= z(l6OdWY7`mu_Exu;vurwFrWDs2DwmCX8{+EMjHf}NvGhvP1nN!ee8o-#Z2z)U3~Xw zKDhl4byXHL6xODE8PTTT0Q!g~IG`jB>*JyZ_@`7>V>?q{=YnFm838+-bcYLagnJiD z`j3m}(2eXGBETElkE27gh z=bvfrAHA~f>^qAunuedNmCv0epU9lwYbs9>*IQ_ zED0~sUjbj;&i*tiVaAmw?`7lk0jI_Jk+dE~9jOt#qP*G_?=-iS-^g1NQ0P^)9REHn zEs#~G_ufV5a}(%eJB2dB9K+&@8QnAaI{dikqhn*D6V6z^fXxP)F?OE*n8Vv{K?^Ty zlSaQ8id4>Wx=iN!KNg8g4O*un=g!l4%ZVlYP_{+Trj5NPxSgNZs=bR2_prZ4Q9_Oh z6bl7|4+T-0LExSGC*M(|&iTP{R+{BNA0;c9 zmlYY{i!Q)SdqI^wZECafGM8D?y@GG)y}?5V0j$<;`Odu)V877D!1{k|(mt9--Od@H zzl*c1BilqalQ2pwgO>@~!E^a;XF|Vr4oR2~_By@}lklfKK60LtFFyK>^Wzu4j9&eH_&RvFZML$Ri3}yWH9;s?H5B?)Xa5B?K%sX+X&Sspx4Wn)bnh}NPxbA` zh=7OFy5-BZjQ-#+s^1*U6Q^_nH#TCLxe2jR%VsKr(jC%|MNZ8|TQ4c>yi=d1menCj zmoF0VGo4HXk;xXM|C+cvCzin1VK8I*nnJt3z34@K` ze5W}a(ex*}IENg6>g=X@Up~|(a>8rq!oC-v-FF@zb^BuvfiK;_IZscv`$XWaU_@Jx zg#;t717MEIX$EqXnrA+rT+;t;bf~Ym$if(c8gGR=)JeK2bF>N7_QJHi;6|Inaj=p% zJJ0%F2(bG8*ZTFphJNzF&>TdtJ=O23eAc7dHI*H{ z=sgbPWMS});*;8Gr4%Z9YpnrO1}C;xw(FJHvTJ+09Pz}x5TII*te2x?)5Um9wpHxC zm2QnP7Ik>onh(t)Dv(Jn$s&`1Q(mx1juEQ^%c>&udsgj2B7$Gs)T;iCpJ!Tw4|1u6bC@)G<7Q(Gu zTw~h*zEc+mG`gPc7dPjRG~H>}bK~HQWL<|XcRM1G^VNjCMm+zc0d}(xTFq*Vz1O|V z_C#;J?q$HqgK{r4t+XGiWm=j&z5bkjgml{oc04LY2e0O3Sy2H|aQYCFoLZaYmyX-8 zVoS0roOx_2o^0&&y;ml5%e_*PDg}XW$4SgaXz>HA7=p-ga4sGUNYa0sx#R|mNNvmf5qsg2lBhqEfHXW=ayTmv} zd(b}h-iOqa3KcMnl^}d6l4R%l;iaqYHCNY3(P?B1;8p7|<7wT(e9q*>@dETr@Y(R4 zZn-Jy%WZfc-*^QZ9QHlUzDqoX7Ulex zDgMu%iH;I?F_q_x=i(0dF_Fo^t+m#|Ws6&JINInC{H0CtWmrWZI>oVIbq_pHsgiqp z1@>#4wQD|mn@2hdr`w8Wri`6*SJCmEhEejC75WiUGzT!Z{;(o6GYtGNKYa>)!2f)^ zb<`~;^VsG}_k)bxeoo6Qi(YsAb_0F5yY7nk z;c$cIp>BsTV0WjQxOT_Rmxu@g@>CJ_-aOWGKqwfS@zs|g;e{;p5&A3^$*AB{z7~IZ zSGOC*fshDvLwbL4YrOB!l~Vna4pzlEo*t1KJvj_>C9a^h2{AKA?nhyRh& zc?5>eRIsnMWWWd)%x@k(tYfL^$|0yB!OUY*2dQ*nZ#AJxPEcki}ww@%&hfQKK z1o!ou;RZ|L6<U7-9fD?y##lR9BA*Eld_!W zEE9hs!^*;p0aG(Q@Lj~z(53P;-(|GEQg6kDx6uT#eHc)q<3p^xJ-gfv>i?KqDs=BG z%;j#LfdHxGKjMJA{_#AAP|)?QS2`U*80F(f@#5*NvMbFQHwpnvDseJ}BYg&2Uurui zTo=zrl3JQO))_&#k$II8fFj>Qw?YENAM5dTIhk@mV+2B+RSh0Drv}%}Tyd8vYVL)= zkK{=l#z&@loY=$GbRXM)z{%T3!40T=6^NUn0?@Z;Co%A4ri)Arx5%}+@j1FZ%CMd zcWGoFnc)OkPbXMp@0h>OR7)3sxmrKkH-1Q${b;QRzQ>xWpigmj@eKXGlVx7r}qknaN`aluy|!Qq!tw+lohqWnm6cR^s%B ztqo{1FFEwSTU4yaaj_+pL$~tLsBsv!uB7E#;x^v{8!vaS5$?WqbD>Hdh zUhuYgNK_-f#;@_TkGuceo)`+HNqopkb|6~tmq2;dgxk{GNxRS6k&J-HKACY&YFfp1 zBmR546$yR#?dnJcZUE{WJA3KxQo0yy&#u_7lx9_m8shhigOzMW7b)=_mMAUssTC4D z7ph2}#f8xJhu?fXaC)YX-0_#W@VLHjjZK$ci1%i1t|O6tA)l0vue|^)9h^0U`ua+b z+swJpR&1`i_Xv*;8*e5vb_MQ(?Zf=TzsNGFjZmL~Gor^e zn|RS9g#U@#bcNA~8M<{NPk3DqX=ML+K6&t)ebnT%6IE63c{fm5=|*rGrsZeyCl4z~ zv0~|IY3!f@YQ2v)8IzNi-D7Y^S>K{nJa0|EPYiNJEU%u4tNpZw6agzj#Xd(&dieS%-Aq$CyRQ1L=r~Ay_oelNUcLunO zt=)(xE;1nCwsd;JI7XA1&tD~#rV@`KbHCve_G-PlwFW^$Glr!BBC(jp^hOl zZ~SRuk54)@HRYcb5wz2f1JR!Lz09W#ubx6)EusOCcEbdwpQz11=Pd>;3#-Y2js&Wh zq299dYjZ2RmH6_7#C(2-$_}y#rRkKC#pA3SQ~$$U?|U_va4K3*QhHKRzjx;{?yD;3 z)D6jtz)`Eo-t(J@Nw(ky`MiYIMSi}At?eW`g_&r8wh5I?*y&)& zQAW`7NHe`X0I^-2n!KSv1K4nmVf67R)*TW|CjD)mG+9V8pKeuy63s$tKk*si@=ZQl zd3(*(_`(S_aog~N8a?JD-=HXFA>I+kU)*8UzwTiEh9a&&hZvD4qDoZNc{A7Y*h{T-B;VK+BHsS$%oCELEYMltp{F3bJ!FaH=(_+ zHc%e5K~0GBr!VfSYzB!$aRlM~%3X#{m80!T0s+(tfKuX12blk!d{=Y~|7Qa)q5NX09vZXVR8dE5LEA$MhiDZGvKatMV$|Pe8ghD! zovP{yev{K40eCgpTVMwcd^dXo2Gj=HIj7p3v*rj9jV#BC<8!_wN~-BEE~x@x!i13J zO*O+r5K%1GqFo;Oo+_5Kc++XEB}eF>Xgm>Lvw+6_&A;BwgFwgDa(mBrd(Ya&s;($6 zkh)Pb<);}nk|3|a!OD!L9Fgwt*+VLp>ph>pmX7X2D#KpCTNlogunH zv;gVNHJ(@%#6cDQ8|u%gJfrTcD~S93>b73!5aC|0fy>>t_byc6Y%EVgpUv)atM&vI}UdRRwBA2Frwmz;lrIUu+?O#jkF#H||VZ*o0i0k2p!9B|Y@1@9<3evGS}@q~IXdo1jMx%C|?)<5wM9 zTc~kiu<@P=JJH~;}KO&UZ3 z>>-ofKrKX2{SVC?4Hc)xRt=K-@3wa(NR{2CRaH|JD~D5fxl)QHI)1e5g-FLb6V;z> z__)RouyEsT7yTGZia60tQsQ@V^OTnLKDL9=JzA1?+`@>Cy4PFn6+j%5?`bT8Va)=D ze-NCuFWTzi`YbB5B0FlM3|cztyAhgpVo7tprZNQ78to%qAt_S|)qR!A7(&yZUKojA z69}z~z?HrYk(-WAi(5ev5b=rC9f?XRluO(7*#9f%VXT!t-eHjn5W$I*tGvnYY8QU(U{?Vax5TG`QiZ zye=_zHYa!IeqHG61r8-uvax2q)%ul)QL^*ryQW2{C0HP?Z=@rg35V=Wpk7oiVUlRB zdtY9eB39mC*GRCa=95(ZvC@*f-#9YKSqTp!0{veb`>!sE*Bcb;?h7%tf-5_WQ; zgdc=InS7upcTz20g!odF>vzsRMt2RDu+mf4uf<5$W~=C&QW7r}R*mq<_5-C`Oa2y0 zsOoS(N-UvV3au(U&?h%nn1++=%$3V=wtKyvM(S6dqLEa*DV`N-(yT*RNO6T}4-^f6uLv zc$9Js9-F!Pux!P5=nc-p!UFQfCG18uy?c15@QsS!Lr~BtA|sE`|ACmEof5JjF-5IA z{1E}MTI7us2@65U1Fgtm^1It)j6S!2^vWzh?l*{E0XsB!-z}gq%CQZl;>9lC*+)uZ zvZOqbgO2$aU)s#(WD}vpaJQ^x^bQPvzK!lS?iUjzS|yr-aTcgI`<75KZ$z)P{H_!% zHVjSPn;UjuSVB>N3F!kS=+4ra1Epj|Q&gZB$gB8sMsW; zyN?LG;Ei{l7$!_)>Ig|Kc6Fzc-(syfCY!xx zdf+K3kTaxGurx*01ocA6Z%;NzzDQ z7&cOv&CeRBBG|&aFtAlN5vbR1FLJ!ejf_9+16T8hR+C6}uO;PoCU{djkr@^v6^sIW zmWEI97p}PS*YhfoTo2%0-jCwOfRRb@Fow%e1DBd8j&z-f{(ql zf`$=)U^z`tpstJMpaknAO&yL!pVcOOekLj=AVZBqJMHdB6DVGT7~}!nN<0=U1t@!K zumH!vk}fUVgKef2Ty4Vk`dRrO^TZRNK_;}qNAe3b9|=^QlFNrZ8p`Xw(N>q%PiN;% zeWf*XqzL^Zu?Q5g80o01R}$IC&#oAsWRT4_M%|)rQpm8wG1*M;*uaw_9a%VY64c$6 z_$vEDasDqgENuRuz&p1q1B%cS3a&SdPmv%taNDv3zOjzz;TwvvvzuaiaB0KSQn~0} zIjWq{0FLbFhb7uXw*vfv*uN)q%n>_ruJ|@ZYy^M~VxZ{`$w|xJ-qg1NHkp@GwCA~7 zFTcX}PS?5w2@b)^q>Tl1O&Vo)Cg8_5aq4Wd*Pm9fi&uC$Fp6}D;=jFY=ic(d)i~n9 zU~rsIPQxAZuEt;LMm{3snY+c+fW3dbbsu#%z^GV-eiH~UmSm^Fv$isAg<+Hxqx+s2 zalbZ?C2?J|C$fwW!o432YzPeIWZHGqQ8a`Z3joLMZrWOD6^@!LN#p#Es7Z60S0j~W z7Um6y7sOJXgE8WL_7(sq7TK-cJpa4GcyhF&^R*x55B_2&CQmcR)nW0^Sv+pRqO;St z(PuU%EBUth=Z=>5o769#NY_Ob_5NdHfOpEZ&F@fUwe{f7enI*#;aOo!uQFrG5`}f+ z!DaPP&Q5Tj;f>mF-)x6qop&Xi`G)YFrkN9edLl`9Z&MWJ^_MAlC-Z?~Wh^Fzx8CYX z%QYjW3*g~As|%CEpem~Ox0rIxxf|=1bza54XPCEsi7x9#aar0f+?Mn;J;gPn%J0rd z{KL@)WI;3CzBD^-FuS{ZB%)~JK|(t~Xk2tq*a0x3T4lw31R;BmRtT?jJnWD|Mi)wM zZY{-)gx>`*&*D=lJzCg1-DkhTR&R&1dt`(iWxJS}uI^@w%N(Yq9TZy{-@#=##typB zVwm?cI=TO-T#XAS?U@67-gNJ$+N_JBtcAI!Z7jW6F&zd1YUir1RK^d~KLsVunrjb* z!4?90lbiv?l4|J@4loB__XoLN%Txw4vSJQ-(&qA|HQ?-Tp{JX^(rvPs2 zq!H>V@*zG-@dCHehG5iXf7WgLKhSbFoS_VBi)&@Vi)gE@U6kg1fw9VHwC)fSYTPiX zNlg>kgZ}TiXR`1_AUm;b=-#io`jci>CM2VZ;CBt?4k2{y6X#(5PL9oc%x~(kHRgaD z%afla2H#-udc`gi=Ty@t5W$D3XRiY0d}_L7e|GN9q|r66^ig?y(tnA=v=2m1XiGUf z=^B2(N({d~bSoa6enKpu=LlD*CO%4(rhO-o(JG$fFW{3HVbKu%YWgv@_fk&aIC>i{)+L5nPxl=z*q(Q2~kRp|HX9Am${eMd3mQ ztd<9i=$6lT?6n(6jyA%ZD|BCa30-&J^JbT=nOU?x5%aw#XB}pQvB;MA-UH;c#h8tQ zpXvE(NkV!!g3Onz(cA5hFfAUgoGFD5Ne)z7-I?tr-bjkQidGcAxkrkVJj98dhOKZ1 zk+016?O5hYeBDom7`vGT&Aj*THX~bt9GO}CG%j=5@y4G)HFulqUEIKLk#l|4W8-bi z>1pNBhmN|upx5_|p7>gAWvrue4n9ZN7n;vfUM9|2W`$9cAbj0X5+Z%>P^*r}gb|nI z%NbAG3nV_%0t+8m-=>E`0pQn`?f;c9dggQ-h2MMJ?3~1(k^p2uqM}LDtS-paVK&=W zf`OyeNS&>NA?k3ZGa-B`LU5Z2$u{mNLTi})E?r3WGbBU_>7ODUWplLN;*45uYZFYw zl5vdQiGk`{n2jHtHms`AN7-E%ZQpp`Vi1)??S?GHBlY*Wa?HZ!6mN6IBNJ8kN+mxV zn|h*Q#0KbLe3&zL)nQ2ybQ9EZjJJZyRjfH2P^GQs!ikdG@w`A7jRKfYY|2#TUiqak zc0ny{syh8|<~#&Qt$9XkS0EnI(6<|h<>?SHMQ1WpKHMV}+C(a)I? zWW^c7j)RR<`V)J#hud9KJNb>~LG&f~IW`Om~ z$Mn1W-AeA?v9cF>Y#c20>mWfI#2;(Q38C#Jg+)l1ZkZ5=_zopi>zb$|g=6|=1@eAw zhdWu)OTzqt2gUG>$B}^ySXLY0OH7XON)l1oN@^$QcqjnzQq-w{K|X;;LCs34IYaa+w?8qz zt;6#O#r{#Ckvv^kmK%Tmwjd)Q?-XGu{n zRAgil3T&WQ4VP^RTxP}X4L5h#Bq~PP`M%`X#owJW04TqK^8nkc>mxnL(g28>L+|sg&>A&qM{oGH!B8`00?D|F8g*rF_qocGPKWDc6sy?%%rPg zzepKYOv{+9zX=wS@y%jg0k3&)^D|gX54BmdxDfdtp3XD~sxpG5Xp_!8)E!_>pMm0PiH!zE;FgbVuPTBnup(bL>L+tSp@hiGf zcAUL5p1tHVtSImCS5#vg>14U=xG^94KK%!J+18U52_tx1t@$FGP<$ki=V};H-;osHM>AHw!H6E3GJ2TOflgBF+(e>uggzB}I@JN+ovmtjA(EVV8 znn9)B?T~+7OHPMVcC)$6Ed9ai{FYg#-nL{;+f zp33oN-i#*u21&3>;ZCgb(?|R`Uz`i+v7()4a>yt3K@~33Y?fW6`h`D{9e5@fm1-SAVl) z+N$sO>OCFqTNv=&+IbItMF#BflI5_rIX^5Q*XM?yf(=zkuCs(UfL#<}nOqT}`{8L< z7_uua8lI|Kpmnayna%E^Hm|!A8(Y1Lq0!#I6JBK^JXXWmzy2}Y?t%O z(+?`ZK4`QN%x`Xu`Lc3{8r!5Bzv=W7{tQv2-uuc|T~o6Kges%kQ4=smfTB`XZ#uaD zmIy&3WWa(O2>UZq_$yYbQ$)|}>>camv!{#IKe2)8_S5T*UGfqK8v3V!SZY`WWEiwR zgh-6P*e@0`$5Yb0%kqkfy*g<#EcJt)%8vGm4&lR9B%1V}_%P`|^I%{Lr1&_gut}g{ zetDWEw3Wm@R(*oh?RviCLDPTD+-Zz4xsEc%GF3%SuE{1RXCJR*uab zb|QIU$7Z|^Z&jnyL%iQvTGz5y`Zhw}&$Q4- zHQAUr4w^%|^x5c$oLM{jcT<1|Su^q9bxPYiI+g~*@%pu0&!rgCdcK)O{}L*JE?zSe z<{HF*i+bUuTy!AeQA#v)9MKx#r6xYk3>5+ca2XwAx*D<<#TLZ_+9?(>3U0_o-aF-cc9xBhi*1O9@Wen@}6-S;2|*; z-cDfV$sM{{){P~%T;4x1Z08}?kAKiiJ}T>ww?CmyFaB(Z*7EUARkWjs8p}ew@_wyc z-4EZYY428d*6VcNTQ5`ldB@51ypQe8i;=B+DS=Z5v}r2tkw>f(O=|^6&EVzhW*^#&YMWSPWSbY4bimfzkO_P1s?3V+d`+P5RT1# zwWBN|yu0o^_j&91|7voT7k!ck zd*#q=%vkZ;E7y}WUeH-ffTNs`Qxw~RAt<1ZhM5}w*o$7atXre|NB&!_Ex+5lBGvm9 zs(}|mdRzs}HM5K#bGLL4;Vx-{bQ+8b6Q9}SOL#QIaem;Ka-PYthQo;~CzTEDTS~{j zPvs=^QV)GlJ&E4b$KbevqcNR4^s^qryKGzmsiWZ{#0FqLTn)gdqs7$uz%>0kt+!%< z{qxU~w(T4K{Bb|pri!_Fvf55O_7=1HgZN&vU)|};&6#Vo%v@&?$pZl)IAt8zpEcD5dRrWY|NtlEYw8fpT9 zoh~D>cl>pF(ZU9j(G=^MNHyL+#mYdSDk63pT1a*b0R?qscXM{aMC-Hy$wkB$K+`@OsDH2F6X6yK32p zmuR#-=;XUT92jZ7P>Sc%P7VNcM~VG@cAi zcMmc`+>k0LP}0|+AN-pqR?v>bA`dX})!pTXH_S}r^!j1{-qqUAZ5`Lh>4MhJHSha! z$k~PJc~}w2n0-4ar;8+xEm&V(tK2_rZ&KLNmVe!ajGkS=-0HV6Jou*}-(ks5xv*g$ z@MCMq&8F*pup?KM38Zb%*xZKPTZrEOS{)eUi~1_PHUk~x zlV;HMBKc`_63YWAm45%dP_$#1nTMzZhBjev>j#R=&aXL$t0;~8d_S|O-)25&>tpf3 zxAL0W!*3#ADVJ<^Ehe&9k!v3k`7W0+X^8?ti6Teqtj|Piymn7idQ>_y0#7drcqgLI1j({ZLUU05tjal;{Cx7KaR=_L={^hmPN(|^!6X9wm zTu;+5E>PxImyPM#1IA}x5`0hddcD4W24TPxqsudFhp?4o7?$9YU%{U8$xnG*^~Z9? z(ocZj_v|@3AA_PqnR1P?27MiRWo}2usB-pJik_FOXk}M?q9jD10UfNh-o0jRI0z=2 z(->3}x6@oE5pu@+-6qb{3X3~1Z+G=Q{EbZ(Lw<@}k^%DlmHfTU3wg4b^wIq(iGYCS ze&hFDj?YZx;!k|TjLG-3M4#fq_G7F918C zkU@gGySuvwh5>@RGr-^){PC-L_3GaD{)1Pyzx9_>U3>5DK6{+4&SLq=Ws5LtZPDzt^l(zrO1A?@wNx>u z>>d=y5}b$UYIZr5rB%0l5%pmhCJ0QsP&#Ou!yU%S%7blO*c3~yBE&dElh-W&Z9R(U zsQK{P9s@sgH&df}Ka%ir1=TBAehIc8!WY1PYG{4G6p-$6f+~GR(c4Es81+0!V*otu z@5d2k)HTk(`uz!M)o!kC|Hh{IqB9wrip8BlMY@BIy-us(ZjY#Milq;!7Ewaw(fKgC z%lvL6fnl2eoZRD@cFF|1YKR=|QKbn@*77xj$1Xhf{z6LJY_d#U5pBbrotRfV#(D=n$9dA~pB%XsLqxSG&!s?i|< zEi$8M32QIaD&ybWwl`4W)iwfaru-5!iT#96AMC8gP6RQ{GT#ALlzY`N+#@AReI_%H zd}LKAvdbpftJiBo5vWc@T*hO9>ySv`kK%2x@U?COBfw)qoBCEO#M;Ke+GC~K%XKp) z&UOa(xTx?)zKtb)YopT^`R*u_TMZ~dE|Mr_W^X$@fQ<&Z4+Q`TRbbM{plgf5#NZys zez@Vr*>x@)M^3{S`<43K!#NRIduY1ZOqLV{E57{M|9u2kUGyyq{BOBq1Ms)o>%sBP=wz~Z{8*O{&&~+D@x-YJwFLlMN_Q0D30hwn2|zz7je;!toQ`m zQnara&O2FJ-BdrE_2c?Sh39kYmZaQNa+`>6Q63gf{7h&ayMOkT;#pX|8~Ui5`3hP{ zliK;2GOUt1j$>q(B_LKE2KVt-aDwxO#~rKbYgjP%bF2bIn5&g++bCLU8orX)HqYqS^srw;?JX* zP?O62I`<`Uo`=Pkxn+?^N2+jMT9LM6+*q9wwBY+KLVi`#5VM;;Vf!JM%gIMj!3Wo0 zBKf)spePvKLBmcA_V>OZ*>7lwM1)^;q_XvHSUh6<`}lGe>9pl-j|{b%uwjf9u`;-u zRv=xdNRDv0q@v=$4GgfLx`qh9KPwl3Z5Lf^GsJs6Hzaz*qsfePbwc#h>4DJ;o|qKu zc$p1O!-;rfRk{IC@PER7nNxej}vsd;TbLUi)oXE+zlL2yud46HDcj+^^44 z<>&TC<(^JUfqT@6`ja0p3tW5=nfrVOZwYRE1d@k4h|(>w+mQ;(1Z)9)tiv?=23@CA zl(V~IWQf*&jt{;Jt?2&P#QU^gzo*NrmaHQXxG)Fh1CELUu4EwJM+ zu-;9Z&6atWUS04@7=J>fCXdUL{n4>#Rq;kbryD;Gj-S`!CR|7$q7y+^pp^dy@; zX4y5q8Gu}L|bb_C_?}J8vOHj+@T*k$PT^_E8D6>LhoFws1nvJ zSd*_9z$_2%3PwDNC4SmmdQh`1T#)9Y`iPj4^=PDV>k@)3v9qH0c{c%cxOw^>bvwc_ z6-w&h_Gqhc5}VI4a`f&Y4ciu1i&dQAymH;&Q_f=OE|mq+wC_ty~PQ+l-Y> zm}Kv(z)|>)jgTutorzz0Mwt_TQ*4pmb)6pUYGjlIz4dh;NUF<36&O0oc3*BwG z_`;YJ^jpzk8a7i(5sN~-wu0UCyj7O{B#u1!ISsKRxqAb2K9SRP_fVUz8lVt1bCnBw zdHmYMhZ+8oiv(qp67Fu`L_OpPYYo~r=+;q|>&-uNeq=47r}aD<60_7eCTv@IC+@Y5 z$zfsVrgQnxu<>f!h=9^MT(940AKJWXsiSuPW5!!}N0SfRbFv+i8#%~c0pD`zyhAs2 zwZ8Uy>;>bojSP&Vd)v=vX<@DK_`YkT(`OneIm7#PtTGe#3su#f+pJ0Z^uHWvzruuw zH-_e?F0?#F;h-+*0|Hzy7fLodS}$QXx}6 zAD_2KfPYrnRfSojvVI8n{*>V8r@8sj7seR16yWyxX4(7ZXM0I$+J#tf$X+l}F;)Uutuu@&?c1?b>p@sQcjIm3NL>?Py_%v>vC5x-Voe{G>u{_K6@ zRhvO}8-Uy}`LmJ#ACHQW)Twa*h2Vwxh;}8$V%x36gQ-(Zjj9-xQL&S~0u$l~mS#+J zWn+E1R>@BIJJ+6#JjIf34f8xby>OZ{N4@G}-pq6Y8p##+Oy!0Ubs5Q0JTFKDRMis8 zPkc2C;PP92lZu=BaMkiT@G5`RKS0M@^)w(`Nbh{|s%8$_XVw!YX7+C8N{5U+Sp0Ut zGa7nn#wt-d^OFG;=}QDk-GK)43LH8}N_W`(t@vikM+XxN)eacJ4qvbrZmcp#POi;i zSL0C8?1aht2g+d2DZ%fxNb?^asKQ)2r@uXo8qRY_Zr;~x zp`iuU(a|zkSq}JLYZdJoQ8E8K$w0@+54Iz4ikN3+>DcJrrpBj&#jJeCQH6~Ob&9isMJ_Y~Fc&a3#DDVwqf z1qme+i!IFS4HW)4ll_S))AtgyviZYJ=*rJipcLX2$O1`LE0HqTEZ{!Q`Z&Ay?>xXc zWd3A=tOX-$iicp-`_(LOVS1Rr+PPqc27Q+h?Cp}<3uzFnsPyql10=4&5q$E&fA1E@ zkdc@#!o<555CGhXB6)5^85=Qsgm4$z=4r5cQg5frj`#@+$h2b-F_@nrfzhNuXz>f4n_^v!#l(9z`QzFEe=Dhofh2dyn5y z-qpSp3`p$$z#K7C!|g3q6-ahPahwNIxopB_)bu72sC1C&LB7*tM2&nu}e+aW5Q$JQ=n-OONm^qO`{?^EMpLVH_hPfRYq!n5% z-zckj=`~R{rpUdIXfd@l_Z3BB8m>oMN&{ZK+6Dz%A2~ni4M^CmKk%XNEVQ0PNT535 ziufR%7{QBsO7%dg2kx>RuD#oWeX09Jsv{J-SE3U6)`zF^2n>J@qn*L2~lE4pq zDmccI&YgSGQF7<+ZNuUSLYW@L6ia)LlyDj;aqqZd_sUxn&P;h1_-({pQatHOI61)p zLs5~W|EE5=I~7$`Hv8qd9#Y0UBJsQlFW?4AK$j5AihDPSd282Ti!E(NyDeoNzWkbq z5KzI7l;g5&`{*radD6q1-zQ)b!Zc$edD@np;&@^wj3yKO)1t}=+{`mE(n3}FOy>D7 z1n$Yi9^QNA4iH||R9f=RcJQAQPWe=B6;L=5UjRI{(&^h%HH!-pmhxKAYqU2<(tvdn zoY6_nKN*8wzMN&?G-22!Zb!TiMsJn!vViKP*>%Y&w%af-QZG4OF1~9}n*%3RK``v@ z`D;br82w7WeP6|ICV}uh_oqSD3L;)v6i^>LS4Y`kTwH`A`CL-2EX{VQKjU~vQ@C8x zs7MA^+U|P;hhZe?#XH@TXb}S+5E{N4x;|fSp+k#5#L6@!nk-!kVbF*_0yB!Am;?5< zm{_VFwFfJ`z&y3gq6>010E+Vv&k#HLLkUa=pCWdO{`+f1?YYms$vfx*jS82M6qJEt z_7du)l!L-o`xAFBb1Z=)BuRP9WleYujBRhL81{(f~R3MNNDSx~WlRn2|VD!3$X&vD$R z9_vF5Ub;uR^}mK+6)@=5%hyZ+Ar|guDm{FM!$$X4?4V9!2XDC@gHjKXDTo&7a>=(v zcCqRDOqNy@ZshHk$;HGr`?!X6sLaJZ0lJd3od$4ZY5@cI8$3J=0gaal%;`?Wu-jV)&LwW4Ztv~0v)1jY z?F1peDgNPJZ~JZyJ@fPrl}#@x!;kKlJEZPAqQN$Ds`fSIJb_P;*0 zu$B%97^}nNxVlwnfJ9Q3hD13(q#@YMGn|aQzz2Dc%=yg*9*5*fwdw_LDt)j4Y;rG3 z*29+KYykEiX3iI4(!9{iNUo)3&z0b!52KSNG5n!_U(US;dPOO;&Cr^% z;uHUIhgasY;b2MYoMb;j2O0Ef!Pj}IDL9oRvn-E3w?QtMVNzz_w8ZUauYxC%qxWGi zyaS!iMP$qVb1xLs()I35`rChnfoii~XqFyzp^#U4|B-5T&Luc!jI+Rm?=Fz0PGEvn z@i>7B8Si`<=^C{*(JDVZ*$^{G5XU6(Qupnbjz=JDjg*N;5Ql+PC4w5E{dGuAqTl;H zAtb$tB?1>h^_3Vy#2CQU(qs2ms!r?QFE3SCKfyvy(4P`d&Hm7-Yz5s73(r6=8lvxJ zG6#BxjdiIC=0fe8fMF*xVL+pukp$m>z%5E-YY}UbiCLb^ZmHQh5rP1CwTxsH znyJ`NKQVUNVlP(LCjaWEzKdP=lwo*e+z)O*j1m7|*I!G9UNR9)X;uOKq zFm|_93ckT)F%uuT>yuSaZ{u z$h5%6Xy##IepXhJNQ$z$mgJJV_oD|L-kSDfSEVK`&Ntd3D1?VJDGR&4JJ_A}n%Ffjg{&7aMjsqDIuuF>~>Px#f`&|wgj+hLNF=v>jFf<^=O;wQf18cV(q(Vz5{ zj4w%sB?7V=&Kd{JbS5_!Ht5d;vizL;xM1S3%urs$fzaRq7RlL}=;Qp7uK3O2#Sc87 zu=v$9MYO}|Ept6vB^u&(=Bs^#2)4t$TZk%-`bfWn2J)66?G2huT+Kci0H zc&bm^F!Q1C3CY4i$UZ~-oi~SAJE|a$k_*vG{dOHuG0?9sG%7_Ubnk)8;c~xWvZziE za1-b{_ELAlkCfyaQsvPNZdoM*;FA^Tf zeoCqVa(ZGH{y}#ttcpRl9|u)EDEZq(IagoX#$R~(y0g|jqa`l>>UAV}lYP#;7ie0* zO*Z`@au3~VgmI$f!p|vYF_+KS&wfYH9-f=wqrjbO0c&Ulh>V3Mp??&X={_TYKjq(-zDQBuf#Z>9)YxNyWh2w zi$+>-Ph9bZg+qnnCTyhkn$PwD1CKt7i`Oib_4;LMD5gFInO@<=svVxY#}qDSo$RDIJX*f0 zwT9#qfgvo{L~lL)4;y>?T14AB;Q`urb>iXr;}qB?_cqv^vuBt4mm_rSg9Q7hALn3P@5r`T8v03mQ$!}sIKw)-Ben=}u9)*_ z`nnn|rJzKdCeGBcIK|jky z*j)T;ixi%^U@tIgv^STi-hT}=_k zXzA|CvDO*(F)=^^ybA8C(H$mUeRB7{x{%Y-|Y19%BxB2W)zE4{p?l+625dvNH6 za*$thHV~2mSqv2cUTZp`AYY375?mMaTuN~BeF!MI;!b@2ApfNhis(9a6^tDnoXr(u zxd^3cxt2`NzB|2&!EuIo&(HXzQ1vfQRlD{csX+Wra)@(u0(wP0DRuPdFJrGN7{q5f zz>Hz5kr2{9nzSXjhGyqSBnz7#v3k%0*OPT>(Pou%hzOgMtMHi}jT)Hhwpncx8P+$0 zNo**K6gjS%2gh>WCv_7eVmS_YOCe)`NWV!_9`Qvwz$1MhCix*xBN8?dV_Dh-WU|TGc@5)%~?Xq=B_)jd&6gIuYQZHNbQ1@eJGl|Sy5es zMK%qii))}nB=x%FE6?5AtN*iaiS-D(KEfD@FA#d=Y!f&EV=t(lUHGxuvL&t#Fg&PL zi7iu0=H=}2hJr%-4lITRrH`Od|^&g%z-dQXb7AD)SX*Bc3>t}3cBhBv&{~7 z$*S}BEp5hbM?sqLpjOMEIv_T{i#)`Y>*BQd(%g*ay2Y|oM}-Ex4Z(mcmzEP!^{0*H z3{>$6pahv&e++E5qXxjz4#;2#*ByDP88~21t>`atggVCh&>g$E_Zq-d5CkT z=n=QIvXZVVekw9ZVWcIP+3IPQ<;81n+ucl*%=fB1;)q755OU;V!A&>hzQ)o)XZd(v zQps_(-y6I3!!%Hmk`XQfoKJAH0VqE=FmR@IIcF{P?6^gSqd`B1Z3V>sP7qnq4Up17 z82kDtyqSxL@|z~~9jODs%2n`LLWpLq?V-X7AJI7O`bTTWl-hU4WR{sDN{hdn9{MmV zUoqhVrPwJMcb`098B0)+y*X$=$)8D0`X7q;Y}u*9WMJ*bN+oY6r7|~0t{{B0qaiBW zV#a!WX50wd&s&sKQQC8ZiZfRbfuu4W#rS<)w}_iIX#dJA~nqiTY78u{ZP#tI(E<=>be`KXuLex{;Lt8Rd?)02Xmf<(yhYS zsOtrL9q|Y^XNd>PQEr$Y5s|TbAQI*SntKx^HYQS~63eUkG}`@`iD<*v+5YhJkblp4 z@T&7CNkbNuFZK{Dhw_~*|BNW_&DL3-1T#ngYscOMrmjp8ApSiJ_q{)Y<%{NffBE?rtcxju&&X8*$Syu#@S_ly1BBZ*@gkqV5tYOiv!0)K8f^IWaQ zczvoWs)59u{k8TPDNhp}#Uw9H$`=gH;%aq%kYBd*o#&UUtHk9S2GC;6onRXhSh7OT zn>kb~BzM4fGZV9`me z==B%06Z5W~{2?O`f9t{}Fbqi4S6tXK$s|BTq=%jelfoiM_~(s>`y7rDY(a)B~}xP3^NPG-nINKv8; zOyvL%^p<uXmGX}TV0d%?U&NGJ@sx>4eXIRiP1T>hv+|Kfa>>acwTeGb z1y=|qyIk80_l(P@hcsT_hpg0qU|r#MWq3m5Dg?6=OZlol>=C;33J1rE6cf!`i613f zTt~e=Lx~ShP7X(Qf#xPqy(v34xgM-Hz;;Yg#&TVeg64ZJAFwu&oKj!P zYfB_!cK7ma@D*w1jJ*ltkl+R;sH z7wrG!NqTkTw^@a%+xsQSn?kj`fliopIM!9qFiGA9(ZRDtl7?rX!i!Z*rLsivS9sRE zuv0j+ZYIOEBOtb|_Fy7U6J#fyOlb6MkWiZRfSox9C}1wvqgtoZqsg|uFwD>q4@NzA zSh}C2#cloBq>A(6RW4Y~mHzRq3v8&RvIO;c}&P8QP4?utC_+P8l^>83e<9%iwtoWhp%GEYzEcpL!hwI$!%`0sVzFn zn6T<_t)b+Y@+lRQH^b`ay@AMrTrK_BMGyJ%jE!iYM4lvns}x|bOgAQaD7-(Vy^vTI zBA26`(U$>COASKj_9ukPlJmM|N~0Swud;hXJ%kI{?yn*CEA*7Tp}6-R4MT?};_hoo z&FTdgl#fVHjm$k;Tm)aR1M4Ohv)-dtGOSolU0CDp{eW-cMk_DU{R#h<_q?gq3_I4j)y6yZ?mGF-It zKGr0|ct4OpP?p%?;O8`{XLr@@GU&P%R>GxJ>NKzNbXOF zdSNXn!;JVcb<%Le*@K zV#Ak-cq42HKe1BpivJ5>L4HVJj-D0n%X|eMIKJXqVW6xBUj#81as(XUh$5R0KZzn+ z+L8zE3wlB>XUxT9f)EaYZn6s^uX+K7CWx^|?{>&&uc3Dp1JhpLMl`Y7sl}-BVST z(qm|&>45$J>Kq9lI*NT6P`?VldW_(jG(>;^nN+*qqrOE2RXfZmj7;WzvFe~H#I+pY zq086i8D}4ekA``6sM(A1xJq+AX1}XdNjmK5NL5g_IgqubTp3Wf{*0Nu6(Qia7^7Gox@>_y`Iaa>2#bP!~d$0{lR(A*H-khuh4v2kWwYU33b(C z3SLLf7KLNMsIAF+uG#{t@`T@Melmi<$(KAt|8Y|#_KeoJ4h6ha>v{D3M;PLYcoPUf z%bxruy_d*3Jm_ua%?9vwc_aW_x^tw*mnP#K!+LAqAuXQchymI*g=sfyrX@Vrhs7AS zKIeQc!3KslD5{E}pw%X(V{u8^))<$Zrj=BeN~PmqR!THGUblU3hJ1c{K9IfA)MD zLQf-kIt@x+u;y5!Tw8N-^wGr0uddaS-O4YvUlTd+xZ|I%j5cdW6vL76P`di_K~zOB zJerqtzP~%t!Sm639J>7i^~%DVG4|<~bJniLDDm*Y0^Xi#XuZvqQe|h-A^xrny$m1z zO7Ywot-$Hmpn^uVF_QS>PHrVMo3lvy*6n6S8{}AfB z&0CnX>RdQq-#(7*!Qx+JZ7CuZ!||=HP6sihL*-7$Js?tywCV#=i4ERsTV#$V!4ZA~ zmF*9{K9^MHaa`N(ki{OAaU`j*N@;*P4@85D91x{^H6dtE*H}GY(o4`?H(n~#2Bw7$ z^@Lt|kOOHMZ`K1R8Y7_nQM;UI%_N1nSR)dIMH4%TsF?iy{q+853L`cEwb_%qF$T$g z84+}Y7BW{5wz*Ot`RsVcIi)l=^aFX2)TEik^6Z$L)^n((XpXn|7t|SVu5-y-GTlY~ zxnk>7EnPiqBWms#t$#~anO5J=Nvw9I3e=n^Y7YjRN(^J3C%v+3@)XGCkto0YD5pQ~ zRf^J8M#E?*N$K4-bD%p*@%ujFGv;e74tUnhzb)j-jZO47xoq=kg&s7I1)bB>Uwq0} zJC^fb1QGAC*czIkg{>+WhKW`tj*DZG{r%wRAul>3hVOnNm;D|!toJ=G=?V7A`_*{H zFZM{KzxO*~SI{@NPo63$I~(sG_xQC`U&1S9W1Kk4XC*STz|-m%=)a!l6KUwf2=}&= z0bM7i`Q>SG^}}AwouqIFF%Satg=W4T6!@f;@}-CI39XW#n?qXd_mugO=#~hECALVX zchMkz<%@f}Iy95$TN2Q1Qq!eQX6Pz)AI0M%#-)kTqB9TG95RcKm0Iym5~zxE`D@QH z7dW!A#b z+|89E!z}>`_Lz%ufw$?XB-Om?@YBC!-xmI=r(91d14EvEwfpm**B;mlYt&68emr~M zY2&VlBD)TP`mt9cNgHo+W7T+6dg-Rz8SbA;&7*}qNH@Hx>x)WbvV)yjHue+3v_VZn^em7HG2-6)SCC&gFH40p;=RAZ^hA|&6Ok6M}Hq6~188#ASyb=Fm zWKtZBEv)`leb2M~UcC^kfREsVd4iAP)u_=xb@)UYA~~6F`(m_oOiAg84zIe&mj?b! zI(pAGqD?~I{4o+nML8wY{o9n_jCZ~zA6aFH^;f^#gX0dkY9)-`IlS<)q! zdBOJ8d7eh1OjxGhQJ;9C2zYem%imMJ&3j?+Mu3z4JVr9rQjhBfZza(4n^{lZo;y^& z@yxlOcF0J)EoH0n*EFXA|L2hcQ+e~RP*kgvCX(cxPQX=O`$jCp&-=_kBO%H_v+=r;1C>g(0_fC9I3oEX#S!j&gW%md@2Canrr$S2g_ z-}6&yWX+I}6t+G}1snZg8li=^f@B-h?28`*i2+7oF(oEas%>QH66UkM>d(0DNEZQ<>vDQH0}1T_)&M(An_v>;eAHJ9D(f=d&Z-=iV=vLDVl zX~EgjBoG4^(&ZKJQAnTe+J2j>EcLpO!4+t=|Kw}o>w(lTIIEY~yI8oivJ`&1C*q}_ zy;I7GUd!G#jfUOG<1uXeYJu2U@<;`t#XrUSR55Q##luD|4NaOPse;p^_(i3OdqB@` z8amJfq;d9p?amEt-?Cm+Z?QfKAIB7H|oteG%IkzYQL0hkR`4!(aWRP*6-b(y!_0WkFb0}%HvIo z%%@*7`V>)-XY9#_JczK0>IPh1S=`#+xq=XKZdFmiyaX*pLoZ84w6u{xOmT;bQ23g6 z)+N*`pA;+KW!7IJV)B}(I=PU?k;DEXpy$>!2Ix60h0`p%p_G4k+_6VY3v|P ze~s_;?@eQ|5Q_7qAt_DvqKCgtos8|R9X*qx!sR}o1Mv4VI;K#~#iD3Bd3ov}@5GFh zI8KK9aUgB^GEGCG$#bMPuT4*hCwj{&#z~)B{svL(g9gYkYjmIULIh5}VL2ZicQYi5 z48Th7`~q}^JxPI(o3;l(uc)y3iJ;=DhMPuH=gy~VK`S5SjGxky!6OBppV=08ov!yU zqr;`EAJ1967>fsL&opRDPzp3=HjUt3$oGw);wK&f)OPn*`%P}CzD~6pTlOMiH272t zlbW<6a59Xx5wiFDX@{EJ8=$6XA(rHZ7IYc}f<;!zauLgJJId!y>RrD{dO%eXXv_B% zrzyqu`M|E=AecIS6pNBk1Gkh}!JOy&O7dXT3|j_+%YbU$2ht#Mp{9$wtZ|%q5kj=Q z&xTpx#!jM-^1!!q9>UfrGCdkS-E+(xs<5w=TgOqw?Mvzr{kas9>&|Ev!YpjRU=Q+I zz7kVfVDZ2D?g}baI#^?)8;DfB+&&D@|=sPeLVh*C;aq;Ft)|P zUvu|&2GRMWO1qGKVw*{MLtdK)#St9*a>$itRN^F zv>T2((j{hr)eZ9+tZLrPlW>$;2ZYt9MI4XH)F*iF6mnlmV<8}0Oj2}2&8Xl7Ni5T& zB+0Wd#d{dE9njNkG~tW!S}BtOW&yx+2@Px5y7`@+U~cphuCFyT`dG+AEfO#}solMxJZo zu|H5n&YPI(%7gA%-N+#to^fItp+O@Jn|Ef&;6a{$xi>Qhx`fKYG#_-u1wHnDh@JNP zhRqzB@UO=FOclKT+P%^V{bzfR{nSc5Xdzb5RCn2-2XSJ8`tJ-4c%Ym_A-xeQ!|7>d z?={?Z^}f9OXR<8kdnfr1c9W8(rsqEu`H_Ls8mTYEo16yikkn!*V&x_0ED74Un?;fzD;PXfn60F|>b`o3PBmtMa})7nGGDFQOU!?THd z@&qm&=pS>0&1MV74s`Y`^xfwQ?0mxFFkiVU=2Tlns7UCRR>2|#a|R+`8QaT76+Qpm z@0%(=<}FF&x^v3c-(|Y|1@QIlu2zHL zsehzAS^ECrTepOV$DVciT;Q~VE8Km4&^OMl|7SH=Ah!?O{&=StTLx|LVFzuprF{P# zZcI)7SM-1a8Hy}udk;RsKgyhXi1{)Fhc_hrbR~(c9-(%guy$vH8|uUkFl@HCb(!`K>pQ|3q{@5Rip9_=2FiBMGuN+ zqLuajLp*U2&tng%3pF?~5aZn&L=AY9LxVOy!ha>k>aZQ)VSwbtWmn+QM4wG9!j`-~ z&P$^7n&f;J=-%fvx>jVf~lT)kS^5B@BN(dE;y{lAT-O)0>mjc9t4N#%v#baQ2-CuyoTms<8_5GMQg}AM*--gK zmldhu=@)j&2<+fKjdv35y$uKN!_?t_Uj;_!Z|cu{Ar$uSNDdiTsuv;7`AtvU zChy<*#zJ`VVm;LCnS2nnfs#A>FCGc$il09|l4uI|^l@-C7)wA`2Qz^f2EgllMVQ=- zck$1vp9_A_!nm8GFdpB#=)GZBiu~HH%6L%iiNQOxIX#sD`8#=xZ68X**Xf<5Qp5J}U%MH^LO z6mQb|Q+Go*GPlB8?k(-s|DY6S>pfpx_h zhy`2)ngxx2NjvB4F3NM=BQMrfxti+-0?I4l%(IvML{p|dI0!AXY?1+fynF8kHP}*= z+0i@TuaB`RRh3gDRVxQ^N&2|Z!5%uW&r}=Zi#A;MJ>Ly5Y*yJgkrJYpaWET->(MB% z>*Z$x{ID$;c`FwjOVeBi}$)<+IR2Tq`UoyeC?^A!E?IANHq6IVkPy_k}5$mamcO5@Y z20}Gw-pK$>@UYsxNZg4PwfKXVB=|fx2)jI20$-(j+PLmQguHTEfdQ8LA~L_YuZ9jlU(`LxmSVV}B_@u;zz@7N7ezc%~XV>r$J(o$GUMabByD51o_X(WxV zt6!l+2G1i~ zu+8OO4Z|}76tV=khShGcJpbnKm_8}ZWOklWjCM)7R!$fyCvAVaoMR)DCC}-+3#4P$ zxB7Yee)yp~49bv5gn6$v6YSWGrVu}CYc$Y~J(9nNJ2*fZB{*-eHGecw%bqqZd{rT= z(|;2I*%OC`5~z)e|N1Wcdy=0Q#40c*)CR>e(-&(Fe9%z{Ipm(1y5FWn0M8WQ4zm3V z@Da2uUhjKMn|d=4Y&s%4{O29xJ6_DYB_3MO14s(8`{^yULAPWRN^qqws883WJsz>k zgch{@_M&zQ8!^qpq1kSUQ;!@s9i6>i7;@ubvZ6!rSd^kglAl83PVFW{-dviqJ5G86 zb2nB~9{+R&oS$K%qMheisB#Gt2vkA-6#E|}#$|aa5BfZ3rN&AMk^7uMmNva+ z{dU=&z=NIJ(RDaPWoag`sW5!&zdbt#k(^eiE$Le`Mmp;HdBhnk!zpbo#?rI3{_XpU zu7)W2E_V2w_?OkCk0>gGc`ksVaTs&_Sy~JE|{b@ zF*}9$eIg87i`nt3g+cSZ9iSOInr>!H$h7Etc8X06pR+2*Ml|-0RR+F5u~M5>()S)r zZB#p%t+Y0|o#IBhUW9w(?|0u+Wz_4me#szJxBX)y992rc+?JHpBR&M8dMcLLh1}U! z&9Mjh6|g}tk(mj31i2KbPDo!a1V*^XBD6hc5(78QKCw^BD(ce6@N@-R4Y)~+Jye?+ zN`>$B2`VjEaa!4W>B#!wluedY$}?rPOaP2rjU7!t8GikSS~twyb5G*fWpeoOvAH(- zkJU!_{WYT`0V!=&AJ%bbF2?Kqbww_+G`9SK4dW{zf>c6?;AexQZ&@+hEf2{sM)jh7 zn#s#fw~r$QSWgh*&HCaVlOuqu~pNi?zAXAjE8 zGM`gN$!XAA3%RIi-N?J`(Q;OYd6h5qy0Wcn695MTZLq;Wu~u#0W(2qD1m!0NwvTQ+ z6Af8b(I@wW<>BdHt?OG_HpypoJj8x>Y(+m=2S%^eb*iT)H}JI-+OIuY>fGG5b;bt< z26V@Il!(WQ8(r@e%xf16EWHw>o|=d!-+irYv`ZG>NIe@icmBg~Z&MT9c+$c(auNt9 zMIwhA^L>fo&2{A_Z~7<1en{BnMWHFsYS7s|@9(Xh@8;IC*t1U|(OsC7Gw#HTJx$X4X+|H~;3)E~ zcUtj)4r+P~zFg?3-*}w4$ll59YFD|Q^I_rQ{e*opqInWraLQ5HFm}+Ed2F-q2z-yx$ULj5G9%9au>*q>e?}A8Cmw z{U~*!g9e>m^dIXJ8+ZR(JBG#9si>T%dFRW+I6*3Ujyp`n=CdD?Dv)Q^gl40(zrjOZg|^1 zVv;30#)8pTZRR>*IRO%H7PqiC&%q7l>3G?IC>DXO2GpF5?aPu}))%{hKDJlT#?mIV zi1>NviDjoTDM{$2jY8d<0(ir}B8)7E5iDhXWF5YlS|p}}#@0^Ka>Zh2 zE7elT>MHKETXB2&iuii@h#O9`B9+lX^i=h&->xagV! zQC=CB(Ba=YLKM2Uj*!;u+nq22T!hPTcY-5g`V~QU_lYPUWrt}-lbA-%W50KugBYcB z+Flag++6e92x_oHchi28{>G2AhmoO#2jL3Uc;mOV-dK9L2ydzvGqvNI6y%ou4- znEtJ-t(x0YOY3dDZF3s8Q>8KXdPsDu|Gg+LCTYSJyKDI0*9LLIPbbE5I)4TxvFD@w~$n4`yNsAW88PX|<}(p?L>PWC{&Tu1F5eGbDCE0)8k zBrX$X|B?IrU(ek6F0xqMS^N8TDw{f~r4l=kC)Z z+_zRz$J_naAiafs9!XwHa-NCyFjg|C$$>$^n2H2Ja7^&!0IS-(T07bQoeqmP##2!? z+=z=gJ108N`f+bCldtQtGdJsVowm&mLo0-*)L*J%eRe}p>MlP2|0MK(=VAo+O_3X$ z*Pm!e1`m&ZkaWf!oi4 Date: Sat, 21 Dec 2019 18:37:03 +0800 Subject: [PATCH 03/28] [C-libcurl] Fix build error when a struct includes a pointer pointing to itself (#4846) --- .../src/main/resources/C-libcurl/model-header.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache index 780e148cbae8..28817ccd91e8 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache @@ -72,7 +72,7 @@ typedef struct {{classname}}_t { {{datatype}}_e {{name}}; //enum model {{/isEnum}} {{^isEnum}} - {{datatype}}_t *{{name}}; //model + struct {{datatype}}_t *{{name}}; //model {{/isEnum}} {{/isModel}} {{#isUuid}} From af783a8c54f790a7034a45f5efaf57f6b2a2ed7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me?= Date: Sun, 22 Dec 2019 06:09:10 +0100 Subject: [PATCH 04/28] [REQ][GO] add awsv4 signature support (#4784) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [REQ][GO] add awsv4 signature support for client OpenAPI format does not support AWS Signature method. This commit add support for AWSv4 signature in GO client generation by adding "withAWSV4Signature" option. "withAWSV4Signature" option is false by default. Signed-off-by: Jérome Jutteau * [REQ][GO] update samples for awsv4 signature support Signed-off-by: Jérome Jutteau --- .../codegen/CodegenConstants.java | 3 + .../codegen/languages/AbstractGoCodegen.java | 5 + .../codegen/languages/GoClientCodegen.java | 9 + .../src/main/resources/go/README.mustache | 15 + .../src/main/resources/go/client.mustache | 23 ++ .../main/resources/go/configuration.mustache | 14 + .../src/main/resources/go/go.mod.mustache | 1 + .../src/main/resources/go/go.sum | 2 + .../codegen/go/GoClientOptionsTest.java | 2 + .../options/GoClientOptionsProvider.java | 2 + .../petstore/go/go-petstore-withXml/README.md | 1 + .../petstore/go/go-petstore-withXml/client.go | 1 + .../go/go-petstore-withXml/configuration.go | 2 + .../petstore/go/go-petstore-withXml/go.mod | 1 + .../petstore/go/go-petstore-withXml/go.sum | 2 + .../client/petstore/go/go-petstore/README.md | 1 + .../client/petstore/go/go-petstore/client.go | 1 + .../petstore/go/go-petstore/configuration.go | 2 + samples/client/petstore/go/go-petstore/go.mod | 1 + samples/client/petstore/go/go-petstore/go.sum | 2 + .../client/petstore/go/go-petstore/README.md | 1 + .../client/petstore/go/go-petstore/client.go | 1 + .../petstore/go/go-petstore/configuration.go | 2 + .../client/petstore/go/go-petstore/go.mod | 1 + .../client/petstore/go/go-petstore/go.sum | 2 + .../go-api-server/.openapi-generator/VERSION | 2 +- .../go-api-server/go/api_another_fake.go | 45 +- .../petstore/go-api-server/go/api_default.go | 39 +- .../petstore/go-api-server/go/api_fake.go | 384 ++++++++++++++++-- .../go/api_fake_classname_tags123.go | 45 +- .../petstore/go-api-server/go/api_pet.go | 259 ++++++++++-- .../petstore/go-api-server/go/api_store.go | 103 ++++- .../petstore/go-api-server/go/api_user.go | 189 +++++++-- .../petstore/go-api-server/go/routers.go | 345 +++------------- .../server/petstore/go-api-server/main.go | 32 +- .../.openapi-generator/VERSION | 2 +- 36 files changed, 1128 insertions(+), 414 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index c0fa1f667e2d..1c79ee3b1de0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -69,6 +69,9 @@ public class CodegenConstants { public static final String WITH_GO_CODEGEN_COMMENT = "withGoCodegenComment"; public static final String WITH_GO_CODEGEN_COMMENT_DESC = "whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs"; + public static final String WITH_AWSV4_SIGNATURE_COMMENT = "withAWSV4Signature"; + public static final String WITH_AWSV4_SIGNATURE_COMMENT_DESC = "whether to include AWS v4 signature support"; + public static final String IS_GO_SUBMODULE = "isGoSubmodule"; public static final String IS_GO_SUBMODULE_DESC = "whether the generated Go module is a submodule"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 14d5f51808cd..6950cfa4e050 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -38,6 +38,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege private static final String NUMERIC_ENUM_PREFIX = "_"; protected boolean withGoCodegenComment = false; + protected boolean withAWSV4Signature = false; protected boolean withXml = false; protected boolean enumClassPrefix = false; protected boolean structPrefix = false; @@ -633,6 +634,10 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege this.withGoCodegenComment = withGoCodegenComment; } + public void setWithAWSV4Signature(boolean withAWSV4Signature) { + this.withAWSV4Signature = withAWSV4Signature; + } + public void setWithXml(boolean withXml) { this.withXml = withXml; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 2176c6f1e009..9e5080cf1f26 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -37,6 +37,7 @@ public class GoClientCodegen extends AbstractGoCodegen { public static final String WITH_GO_CODEGEN_COMMENT = "withGoCodegenComment"; public static final String WITH_XML = "withXml"; public static final String STRUCT_PREFIX = "structPrefix"; + public static final String WITH_AWSV4_SIGNATURE = "withAWSV4Signature"; public GoClientCodegen() { super(); @@ -58,6 +59,7 @@ public class GoClientCodegen extends AbstractGoCodegen { cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); cliOptions.add(CliOption.newBoolean(CodegenConstants.ENUM_CLASS_PREFIX, CodegenConstants.ENUM_CLASS_PREFIX_DESC)); cliOptions.add(CliOption.newBoolean(STRUCT_PREFIX, "whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts")); + cliOptions.add(CliOption.newBoolean(WITH_AWSV4_SIGNATURE, "whether to include AWS v4 signature support")); // option to change the order of form/body parameter cliOptions.add(CliOption.newBoolean( @@ -109,6 +111,13 @@ public class GoClientCodegen extends AbstractGoCodegen { } } + if (additionalProperties.containsKey(WITH_AWSV4_SIGNATURE)) { + setWithAWSV4Signature(Boolean.parseBoolean(additionalProperties.get(WITH_AWSV4_SIGNATURE).toString())); + if (withAWSV4Signature) { + additionalProperties.put(WITH_AWSV4_SIGNATURE, "true"); + } + } + if (additionalProperties.containsKey(WITH_XML)) { setWithXml(Boolean.parseBoolean(additionalProperties.get(WITH_XML).toString())); if (withXml) { diff --git a/modules/openapi-generator/src/main/resources/go/README.mustache b/modules/openapi-generator/src/main/resources/go/README.mustache index 5c9639022a17..b96f612f8a59 100644 --- a/modules/openapi-generator/src/main/resources/go/README.mustache +++ b/modules/openapi-generator/src/main/resources/go/README.mustache @@ -24,6 +24,9 @@ Install the following dependencies: ```shell go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 +{{#withAWSV4Signature}} +go get github.com/aws/aws-sdk-go/aws +{{/withAWSV4Signature}} go get golang.org/x/net/context go get github.com/antihax/optional ``` @@ -113,6 +116,18 @@ r, err := client.Service.Operation(auth, args) {{/isOAuth}} {{/authMethods}} +{{#withAWSV4Signature}} +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAWSv4, sw.AWSv4{ + AccessKey: "ACCESSKEYSTRING", + SecretKey: "SECRETKEYSTRING", +}) +r, err := client.Service.Operation(auth, args) +``` +{{/withAWSV4Signature}} + ## Author {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index a7c6802a0b8e..78ee276d0f3d 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -24,6 +24,10 @@ import ( "unicode/utf8" "golang.org/x/oauth2" + {{#withAWSV4Signature}} + awsv4 "github.com/aws/aws-sdk-go/aws/signer/v4" + awscredentials "github.com/aws/aws-sdk-go/aws/credentials" + {{/withAWSV4Signature}} ) var ( @@ -352,6 +356,25 @@ func (c *APIClient) prepareRequest( if auth, ok := ctx.Value(ContextAccessToken).(string); ok { localVarRequest.Header.Add("Authorization", "Bearer "+auth) } + + {{#withAWSV4Signature}} + // AWS Signature v4 Authentication + if auth, ok := ctx.Value(ContextAWSv4).(AWSv4); ok { + creds := awscredentials.NewStaticCredentials(auth.AccessKey, auth.SecretKey, "") + signer := awsv4.NewSigner(creds) + var reader *strings.Reader + if body == nil { + reader = strings.NewReader("") + } else { + reader = strings.NewReader(body.String()) + } + timestamp := time.Now() + _, err := signer.Sign(localVarRequest, reader, "oapi", "eu-west-2", timestamp) + if err != nil { + return nil, err + } + } + {{/withAWSV4Signature}} } for header, value := range c.cfg.DefaultHeader { diff --git a/modules/openapi-generator/src/main/resources/go/configuration.mustache b/modules/openapi-generator/src/main/resources/go/configuration.mustache index e6fa96d20579..ec28dd024cff 100644 --- a/modules/openapi-generator/src/main/resources/go/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go/configuration.mustache @@ -29,6 +29,11 @@ var ( // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") + + {{#withAWSV4Signature}} + // ContextAWSv4 takes an Access Key and a Secret Key for signing AWS Signature v4. + ContextAWSv4 = contextKey("awsv4") + {{/withAWSV4Signature}} ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -43,6 +48,15 @@ type APIKey struct { Prefix string } +{{#withAWSV4Signature}} +// AWSv4 provides AWS Signature to a request passed via context using ContextAWSv4 +// https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html +type AWSv4 struct { + AccessKey string + SecretKey string +} +{{/withAWSV4Signature}} + // ServerVariable stores the information about a server variable type ServerVariable struct { Description string diff --git a/modules/openapi-generator/src/main/resources/go/go.mod.mustache b/modules/openapi-generator/src/main/resources/go/go.mod.mustache index 835028905992..6c31cf3e9f14 100644 --- a/modules/openapi-generator/src/main/resources/go/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go/go.mod.mustache @@ -3,4 +3,5 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}} require ( github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + {{#withAWSV4Signature}}github.com/aws/aws-sdk-go v1.26.3{{/withAWSV4Signature}} ) diff --git a/modules/openapi-generator/src/main/resources/go/go.sum b/modules/openapi-generator/src/main/resources/go/go.sum index ce55b3c6a08f..ee6952022977 100644 --- a/modules/openapi-generator/src/main/resources/go/go.sum +++ b/modules/openapi-generator/src/main/resources/go/go.sum @@ -1,6 +1,8 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= +github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java index 7a6f4f79d197..c34f467b6990 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java @@ -58,6 +58,8 @@ public class GoClientOptionsTest extends AbstractOptionsTest { times = 1; clientCodegen.setStructPrefix(Boolean.valueOf(GoClientOptionsProvider.STRUCT_PREFIX_VALUE)); times = 1; + clientCodegen.setWithAWSV4Signature(Boolean.valueOf(GoClientOptionsProvider.WITH_AWSV4_SIGNATURE)); + times = 1; }}; } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java index 9ccf0584ab3e..e11ff84b592a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java @@ -32,6 +32,7 @@ public class GoClientOptionsProvider implements OptionsProvider { public static final Boolean PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = true; public static final boolean IS_GO_SUBMODULE_VALUE = true; public static final boolean STRUCT_PREFIX_VALUE = true; + public static final boolean WITH_AWSV4_SIGNATURE = true; @Override public String getLanguage() { @@ -50,6 +51,7 @@ public class GoClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ENUM_CLASS_PREFIX, "true") .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, "true") .put(CodegenConstants.IS_GO_SUBMODULE, "true") + .put(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT, "true") .put("structPrefix", "true") .build(); } diff --git a/samples/client/petstore/go/go-petstore-withXml/README.md b/samples/client/petstore/go/go-petstore-withXml/README.md index 052b43c30a61..59f48a22aac6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/README.md +++ b/samples/client/petstore/go/go-petstore-withXml/README.md @@ -200,6 +200,7 @@ r, err := client.Service.Operation(auth, args) ``` + ## Author diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index cc5ffa09cc6a..5a5a4c852939 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -364,6 +364,7 @@ func (c *APIClient) prepareRequest( if auth, ok := ctx.Value(ContextAccessToken).(string); ok { localVarRequest.Header.Add("Authorization", "Bearer "+auth) } + } for header, value := range c.cfg.DefaultHeader { diff --git a/samples/client/petstore/go/go-petstore-withXml/configuration.go b/samples/client/petstore/go/go-petstore-withXml/configuration.go index 59728f054c78..f0134476c59c 100644 --- a/samples/client/petstore/go/go-petstore-withXml/configuration.go +++ b/samples/client/petstore/go/go-petstore-withXml/configuration.go @@ -38,6 +38,7 @@ var ( // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") + ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -52,6 +53,7 @@ type APIKey struct { Prefix string } + // ServerVariable stores the information about a server variable type ServerVariable struct { Description string diff --git a/samples/client/petstore/go/go-petstore-withXml/go.mod b/samples/client/petstore/go/go-petstore-withXml/go.mod index 1af1846f9850..f55c1461f84f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/go.mod +++ b/samples/client/petstore/go/go-petstore-withXml/go.mod @@ -3,4 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID require ( github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + ) diff --git a/samples/client/petstore/go/go-petstore-withXml/go.sum b/samples/client/petstore/go/go-petstore-withXml/go.sum index ce55b3c6a08f..ee6952022977 100644 --- a/samples/client/petstore/go/go-petstore-withXml/go.sum +++ b/samples/client/petstore/go/go-petstore-withXml/go.sum @@ -1,6 +1,8 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= +github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 052b43c30a61..59f48a22aac6 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -200,6 +200,7 @@ r, err := client.Service.Operation(auth, args) ``` + ## Author diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 0c97916457dd..533439041493 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -363,6 +363,7 @@ func (c *APIClient) prepareRequest( if auth, ok := ctx.Value(ContextAccessToken).(string); ok { localVarRequest.Header.Add("Authorization", "Bearer "+auth) } + } for header, value := range c.cfg.DefaultHeader { diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 34f8f2429222..e3159c328b4c 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -37,6 +37,7 @@ var ( // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") + ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -51,6 +52,7 @@ type APIKey struct { Prefix string } + // ServerVariable stores the information about a server variable type ServerVariable struct { Description string diff --git a/samples/client/petstore/go/go-petstore/go.mod b/samples/client/petstore/go/go-petstore/go.mod index 1af1846f9850..f55c1461f84f 100644 --- a/samples/client/petstore/go/go-petstore/go.mod +++ b/samples/client/petstore/go/go-petstore/go.mod @@ -3,4 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID require ( github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + ) diff --git a/samples/client/petstore/go/go-petstore/go.sum b/samples/client/petstore/go/go-petstore/go.sum index ce55b3c6a08f..ee6952022977 100644 --- a/samples/client/petstore/go/go-petstore/go.sum +++ b/samples/client/petstore/go/go-petstore/go.sum @@ -1,6 +1,8 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= +github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index a50a23f7d4ae..c0f191d001d2 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -219,6 +219,7 @@ r, err := client.Service.Operation(auth, args) ``` + ## Author diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index 1b8eae88daae..730e67621edf 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -366,6 +366,7 @@ func (c *APIClient) prepareRequest( if auth, ok := ctx.Value(ContextAccessToken).(string); ok { localVarRequest.Header.Add("Authorization", "Bearer "+auth) } + } for header, value := range c.cfg.DefaultHeader { diff --git a/samples/openapi3/client/petstore/go/go-petstore/configuration.go b/samples/openapi3/client/petstore/go/go-petstore/configuration.go index 333de81350d7..c2ea841704a7 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/configuration.go +++ b/samples/openapi3/client/petstore/go/go-petstore/configuration.go @@ -37,6 +37,7 @@ var ( // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") + ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -51,6 +52,7 @@ type APIKey struct { Prefix string } + // ServerVariable stores the information about a server variable type ServerVariable struct { Description string diff --git a/samples/openapi3/client/petstore/go/go-petstore/go.mod b/samples/openapi3/client/petstore/go/go-petstore/go.mod index 1af1846f9850..f55c1461f84f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/go.mod +++ b/samples/openapi3/client/petstore/go/go-petstore/go.mod @@ -3,4 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID require ( github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/go.sum b/samples/openapi3/client/petstore/go/go-petstore/go.sum index ce55b3c6a08f..ee6952022977 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/go.sum +++ b/samples/openapi3/client/petstore/go/go-petstore/go.sum @@ -1,6 +1,8 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= +github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION index c3a2c7076fa8..58592f031f65 100644 --- a/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_another_fake.go b/samples/openapi3/server/petstore/go-api-server/go/api_another_fake.go index b30ab1a1acba..804316ecb215 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/api_another_fake.go +++ b/samples/openapi3/server/petstore/go-api-server/go/api_another_fake.go @@ -10,11 +10,48 @@ package petstoreserver import ( + "encoding/json" "net/http" + "strings" + + "github.com/gorilla/mux" ) -// Call123TestSpecialTags - To test special tags -func Call123TestSpecialTags(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +// A AnotherFakeApiController binds http requests to an api service and writes the service results to the http response +type AnotherFakeApiController struct { + service AnotherFakeApiServicer +} + +// NewAnotherFakeApiController creates a default api controller +func NewAnotherFakeApiController(s AnotherFakeApiServicer) Router { + return &AnotherFakeApiController{ service: s } +} + +// Routes returns all of the api route for the AnotherFakeApiController +func (c *AnotherFakeApiController) Routes() Routes { + return Routes{ + { + "Call123TestSpecialTags", + strings.ToUpper("Patch"), + "/v2/another-fake/dummy", + c.Call123TestSpecialTags, + }, + } +} + +// Call123TestSpecialTags - To test special tags +func (c *AnotherFakeApiController) Call123TestSpecialTags(w http.ResponseWriter, r *http.Request) { + client := &Client{} + if err := json.NewDecoder(r.Body).Decode(&client); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.Call123TestSpecialTags(*client) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_default.go b/samples/openapi3/server/petstore/go-api-server/go/api_default.go index 8de510a0dd82..c1618f26c9c6 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/api_default.go +++ b/samples/openapi3/server/petstore/go-api-server/go/api_default.go @@ -10,11 +10,42 @@ package petstoreserver import ( + "encoding/json" "net/http" + "strings" + + "github.com/gorilla/mux" ) -// FooGet - -func FooGet(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +// A DefaultApiController binds http requests to an api service and writes the service results to the http response +type DefaultApiController struct { + service DefaultApiServicer +} + +// NewDefaultApiController creates a default api controller +func NewDefaultApiController(s DefaultApiServicer) Router { + return &DefaultApiController{ service: s } +} + +// Routes returns all of the api route for the DefaultApiController +func (c *DefaultApiController) Routes() Routes { + return Routes{ + { + "FooGet", + strings.ToUpper("Get"), + "/v2/foo", + c.FooGet, + }, + } +} + +// FooGet - +func (c *DefaultApiController) FooGet(w http.ResponseWriter, r *http.Request) { + result, err := c.service.FooGet() + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_fake.go b/samples/openapi3/server/petstore/go-api-server/go/api_fake.go index 07ebda735bdb..94b55953254c 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/api_fake.go +++ b/samples/openapi3/server/petstore/go-api-server/go/api_fake.go @@ -10,89 +10,389 @@ package petstoreserver import ( + "encoding/json" "net/http" + "strings" + + "github.com/gorilla/mux" ) +// A FakeApiController binds http requests to an api service and writes the service results to the http response +type FakeApiController struct { + service FakeApiServicer +} + +// NewFakeApiController creates a default api controller +func NewFakeApiController(s FakeApiServicer) Router { + return &FakeApiController{ service: s } +} + +// Routes returns all of the api route for the FakeApiController +func (c *FakeApiController) Routes() Routes { + return Routes{ + { + "FakeHealthGet", + strings.ToUpper("Get"), + "/v2/fake/health", + c.FakeHealthGet, + }, + { + "FakeOuterBooleanSerialize", + strings.ToUpper("Post"), + "/v2/fake/outer/boolean", + c.FakeOuterBooleanSerialize, + }, + { + "FakeOuterCompositeSerialize", + strings.ToUpper("Post"), + "/v2/fake/outer/composite", + c.FakeOuterCompositeSerialize, + }, + { + "FakeOuterNumberSerialize", + strings.ToUpper("Post"), + "/v2/fake/outer/number", + c.FakeOuterNumberSerialize, + }, + { + "FakeOuterStringSerialize", + strings.ToUpper("Post"), + "/v2/fake/outer/string", + c.FakeOuterStringSerialize, + }, + { + "TestBodyWithFileSchema", + strings.ToUpper("Put"), + "/v2/fake/body-with-file-schema", + c.TestBodyWithFileSchema, + }, + { + "TestBodyWithQueryParams", + strings.ToUpper("Put"), + "/v2/fake/body-with-query-params", + c.TestBodyWithQueryParams, + }, + { + "TestClientModel", + strings.ToUpper("Patch"), + "/v2/fake", + c.TestClientModel, + }, + { + "TestEndpointParameters", + strings.ToUpper("Post"), + "/v2/fake", + c.TestEndpointParameters, + }, + { + "TestEnumParameters", + strings.ToUpper("Get"), + "/v2/fake", + c.TestEnumParameters, + }, + { + "TestGroupParameters", + strings.ToUpper("Delete"), + "/v2/fake", + c.TestGroupParameters, + }, + { + "TestInlineAdditionalProperties", + strings.ToUpper("Post"), + "/v2/fake/inline-additionalProperties", + c.TestInlineAdditionalProperties, + }, + { + "TestJsonFormData", + strings.ToUpper("Get"), + "/v2/fake/jsonFormData", + c.TestJsonFormData, + }, + { + "TestQueryParameterCollectionFormat", + strings.ToUpper("Put"), + "/v2/fake/test-query-paramters", + c.TestQueryParameterCollectionFormat, + }, + } +} + // FakeHealthGet - Health check endpoint -func FakeHealthGet(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) FakeHealthGet(w http.ResponseWriter, r *http.Request) { + result, err := c.service.FakeHealthGet() + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // FakeOuterBooleanSerialize - -func FakeOuterBooleanSerialize(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) FakeOuterBooleanSerialize(w http.ResponseWriter, r *http.Request) { + body := &bool{} + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.FakeOuterBooleanSerialize(*body) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // FakeOuterCompositeSerialize - -func FakeOuterCompositeSerialize(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) FakeOuterCompositeSerialize(w http.ResponseWriter, r *http.Request) { + outerComposite := &OuterComposite{} + if err := json.NewDecoder(r.Body).Decode(&outerComposite); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.FakeOuterCompositeSerialize(*outerComposite) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // FakeOuterNumberSerialize - -func FakeOuterNumberSerialize(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) FakeOuterNumberSerialize(w http.ResponseWriter, r *http.Request) { + body := &float32{} + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.FakeOuterNumberSerialize(*body) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // FakeOuterStringSerialize - -func FakeOuterStringSerialize(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) FakeOuterStringSerialize(w http.ResponseWriter, r *http.Request) { + body := &string{} + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.FakeOuterStringSerialize(*body) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestBodyWithFileSchema - -func TestBodyWithFileSchema(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestBodyWithFileSchema(w http.ResponseWriter, r *http.Request) { + fileSchemaTestClass := &FileSchemaTestClass{} + if err := json.NewDecoder(r.Body).Decode(&fileSchemaTestClass); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.TestBodyWithFileSchema(*fileSchemaTestClass) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestBodyWithQueryParams - -func TestBodyWithQueryParams(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestBodyWithQueryParams(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + query := query.Get("query") + user := &User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.TestBodyWithQueryParams(query, *user) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestClientModel - To test \"client\" model -func TestClientModel(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestClientModel(w http.ResponseWriter, r *http.Request) { + client := &Client{} + if err := json.NewDecoder(r.Body).Decode(&client); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.TestClientModel(*client) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestEndpointParameters - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -func TestEndpointParameters(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestEndpointParameters(w http.ResponseWriter, r *http.Request) { + err := r.ParseForm() + if err != nil { + w.WriteHeader(500) + return + } + + number := r.FormValue("number") + double := r.FormValue("double") + patternWithoutDelimiter := r.FormValue("patternWithoutDelimiter") + byte_ := r.FormValue("byte_") + integer := r.FormValue("integer") + int32_ := r.FormValue("int32_") + int64_, err := parseIntParameter( r.FormValue("int64_")) + if err != nil { + w.WriteHeader(500) + return + } + + float := r.FormValue("float") + string_ := r.FormValue("string_") + binary, err := ReadFormFileToTempFile(r, "binary") + if err != nil { + w.WriteHeader(500) + return + } + + date := r.FormValue("date") + dateTime := r.FormValue("dateTime") + password := r.FormValue("password") + callback := r.FormValue("callback") + result, err := c.service.TestEndpointParameters(number, double, patternWithoutDelimiter, byte_, integer, int32_, int64_, float, string_, binary, date, dateTime, password, callback) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestEnumParameters - To test enum parameters -func TestEnumParameters(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestEnumParameters(w http.ResponseWriter, r *http.Request) { + err := r.ParseForm() + if err != nil { + w.WriteHeader(500) + return + } + + query := r.URL.Query() + enumHeaderStringArray := r.Header.Get("enumHeaderStringArray") + enumHeaderString := r.Header.Get("enumHeaderString") + enumQueryStringArray := strings.Split(query.Get("enumQueryStringArray"), ",") + enumQueryString := query.Get("enumQueryString") + enumQueryInteger := query.Get("enumQueryInteger") + enumQueryDouble := query.Get("enumQueryDouble") + enumFormStringArray := r.FormValue("enumFormStringArray") + enumFormString := r.FormValue("enumFormString") + result, err := c.service.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestGroupParameters - Fake endpoint to test group parameters (optional) -func TestGroupParameters(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestGroupParameters(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + requiredStringGroup := query.Get("requiredStringGroup") + requiredBooleanGroup := r.Header.Get("requiredBooleanGroup") + requiredInt64Group, err := parseIntParameter(query.Get("requiredInt64Group")) + if err != nil { + w.WriteHeader(500) + return + } + + stringGroup := query.Get("stringGroup") + booleanGroup := r.Header.Get("booleanGroup") + int64Group, err := parseIntParameter(query.Get("int64Group")) + if err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestInlineAdditionalProperties - test inline additionalProperties -func TestInlineAdditionalProperties(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestInlineAdditionalProperties(w http.ResponseWriter, r *http.Request) { + requestBody := &map[string]string{} + if err := json.NewDecoder(r.Body).Decode(&requestBody); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.TestInlineAdditionalProperties(*requestBody) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestJsonFormData - test json serialization of form data -func TestJsonFormData(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestJsonFormData(w http.ResponseWriter, r *http.Request) { + err := r.ParseForm() + if err != nil { + w.WriteHeader(500) + return + } + + param := r.FormValue("param") + param2 := r.FormValue("param2") + result, err := c.service.TestJsonFormData(param, param2) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // TestQueryParameterCollectionFormat - -func TestQueryParameterCollectionFormat(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *FakeApiController) TestQueryParameterCollectionFormat(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + pipe := strings.Split(query.Get("pipe"), ",") + ioutil := strings.Split(query.Get("ioutil"), ",") + http := strings.Split(query.Get("http"), ",") + url := strings.Split(query.Get("url"), ",") + context := strings.Split(query.Get("context"), ",") + result, err := c.service.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_fake_classname_tags123.go b/samples/openapi3/server/petstore/go-api-server/go/api_fake_classname_tags123.go index 395c1b253462..998465c23a4c 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/api_fake_classname_tags123.go +++ b/samples/openapi3/server/petstore/go-api-server/go/api_fake_classname_tags123.go @@ -10,11 +10,48 @@ package petstoreserver import ( + "encoding/json" "net/http" + "strings" + + "github.com/gorilla/mux" ) -// TestClassname - To test class name in snake case -func TestClassname(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +// A FakeClassnameTags123ApiController binds http requests to an api service and writes the service results to the http response +type FakeClassnameTags123ApiController struct { + service FakeClassnameTags123ApiServicer +} + +// NewFakeClassnameTags123ApiController creates a default api controller +func NewFakeClassnameTags123ApiController(s FakeClassnameTags123ApiServicer) Router { + return &FakeClassnameTags123ApiController{ service: s } +} + +// Routes returns all of the api route for the FakeClassnameTags123ApiController +func (c *FakeClassnameTags123ApiController) Routes() Routes { + return Routes{ + { + "TestClassname", + strings.ToUpper("Patch"), + "/v2/fake_classname_test", + c.TestClassname, + }, + } +} + +// TestClassname - To test class name in snake case +func (c *FakeClassnameTags123ApiController) TestClassname(w http.ResponseWriter, r *http.Request) { + client := &Client{} + if err := json.NewDecoder(r.Body).Decode(&client); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.TestClassname(*client) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_pet.go b/samples/openapi3/server/petstore/go-api-server/go/api_pet.go index fc0d47c146c5..867c12e08952 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/api_pet.go +++ b/samples/openapi3/server/petstore/go-api-server/go/api_pet.go @@ -10,59 +10,264 @@ package petstoreserver import ( + "encoding/json" "net/http" + "strings" + + "github.com/gorilla/mux" ) +// A PetApiController binds http requests to an api service and writes the service results to the http response +type PetApiController struct { + service PetApiServicer +} + +// NewPetApiController creates a default api controller +func NewPetApiController(s PetApiServicer) Router { + return &PetApiController{ service: s } +} + +// Routes returns all of the api route for the PetApiController +func (c *PetApiController) Routes() Routes { + return Routes{ + { + "AddPet", + strings.ToUpper("Post"), + "/v2/pet", + c.AddPet, + }, + { + "DeletePet", + strings.ToUpper("Delete"), + "/v2/pet/{petId}", + c.DeletePet, + }, + { + "FindPetsByStatus", + strings.ToUpper("Get"), + "/v2/pet/findByStatus", + c.FindPetsByStatus, + }, + { + "FindPetsByTags", + strings.ToUpper("Get"), + "/v2/pet/findByTags", + c.FindPetsByTags, + }, + { + "GetPetById", + strings.ToUpper("Get"), + "/v2/pet/{petId}", + c.GetPetById, + }, + { + "UpdatePet", + strings.ToUpper("Put"), + "/v2/pet", + c.UpdatePet, + }, + { + "UpdatePetWithForm", + strings.ToUpper("Post"), + "/v2/pet/{petId}", + c.UpdatePetWithForm, + }, + { + "UploadFile", + strings.ToUpper("Post"), + "/v2/pet/{petId}/uploadImage", + c.UploadFile, + }, + { + "UploadFileWithRequiredFile", + strings.ToUpper("Post"), + "/v2/fake/{petId}/uploadImageWithRequiredFile", + c.UploadFileWithRequiredFile, + }, + } +} + // AddPet - Add a new pet to the store -func AddPet(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) AddPet(w http.ResponseWriter, r *http.Request) { + pet := &Pet{} + if err := json.NewDecoder(r.Body).Decode(&pet); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.AddPet(*pet) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // DeletePet - Deletes a pet -func DeletePet(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) DeletePet(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + petId, err := parseIntParameter(params["petId"]) + if err != nil { + w.WriteHeader(500) + return + } + + apiKey := r.Header.Get("apiKey") + result, err := c.service.DeletePet(petId, apiKey) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // FindPetsByStatus - Finds Pets by status -func FindPetsByStatus(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) FindPetsByStatus(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + status := strings.Split(query.Get("status"), ",") + result, err := c.service.FindPetsByStatus(status) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // FindPetsByTags - Finds Pets by tags -func FindPetsByTags(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) FindPetsByTags(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + tags := strings.Split(query.Get("tags"), ",") + result, err := c.service.FindPetsByTags(tags) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // GetPetById - Find pet by ID -func GetPetById(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) GetPetById(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + petId, err := parseIntParameter(params["petId"]) + if err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.GetPetById(petId) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // UpdatePet - Update an existing pet -func UpdatePet(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) UpdatePet(w http.ResponseWriter, r *http.Request) { + pet := &Pet{} + if err := json.NewDecoder(r.Body).Decode(&pet); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.UpdatePet(*pet) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // UpdatePetWithForm - Updates a pet in the store with form data -func UpdatePetWithForm(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) UpdatePetWithForm(w http.ResponseWriter, r *http.Request) { + err := r.ParseForm() + if err != nil { + w.WriteHeader(500) + return + } + + params := mux.Vars(r) + petId, err := parseIntParameter(params["petId"]) + if err != nil { + w.WriteHeader(500) + return + } + + name := r.FormValue("name") + status := r.FormValue("status") + result, err := c.service.UpdatePetWithForm(petId, name, status) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // UploadFile - uploads an image -func UploadFile(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) UploadFile(w http.ResponseWriter, r *http.Request) { + err := r.ParseForm() + if err != nil { + w.WriteHeader(500) + return + } + + params := mux.Vars(r) + petId, err := parseIntParameter(params["petId"]) + if err != nil { + w.WriteHeader(500) + return + } + + additionalMetadata := r.FormValue("additionalMetadata") + file, err := ReadFormFileToTempFile(r, "file") + if err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.UploadFile(petId, additionalMetadata, file) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // UploadFileWithRequiredFile - uploads an image (required) -func UploadFileWithRequiredFile(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *PetApiController) UploadFileWithRequiredFile(w http.ResponseWriter, r *http.Request) { + err := r.ParseForm() + if err != nil { + w.WriteHeader(500) + return + } + + params := mux.Vars(r) + petId, err := parseIntParameter(params["petId"]) + if err != nil { + w.WriteHeader(500) + return + } + + requiredFile, err := ReadFormFileToTempFile(r, "requiredFile") + if err != nil { + w.WriteHeader(500) + return + } + + additionalMetadata := r.FormValue("additionalMetadata") + result, err := c.service.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_store.go b/samples/openapi3/server/petstore/go-api-server/go/api_store.go index aa5d01548b8d..5867035964e5 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/api_store.go +++ b/samples/openapi3/server/petstore/go-api-server/go/api_store.go @@ -10,29 +10,108 @@ package petstoreserver import ( + "encoding/json" "net/http" + "strings" + + "github.com/gorilla/mux" ) +// A StoreApiController binds http requests to an api service and writes the service results to the http response +type StoreApiController struct { + service StoreApiServicer +} + +// NewStoreApiController creates a default api controller +func NewStoreApiController(s StoreApiServicer) Router { + return &StoreApiController{ service: s } +} + +// Routes returns all of the api route for the StoreApiController +func (c *StoreApiController) Routes() Routes { + return Routes{ + { + "DeleteOrder", + strings.ToUpper("Delete"), + "/v2/store/order/{order_id}", + c.DeleteOrder, + }, + { + "GetInventory", + strings.ToUpper("Get"), + "/v2/store/inventory", + c.GetInventory, + }, + { + "GetOrderById", + strings.ToUpper("Get"), + "/v2/store/order/{order_id}", + c.GetOrderById, + }, + { + "PlaceOrder", + strings.ToUpper("Post"), + "/v2/store/order", + c.PlaceOrder, + }, + } +} + // DeleteOrder - Delete purchase order by ID -func DeleteOrder(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *StoreApiController) DeleteOrder(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + orderId := params["orderId"] + result, err := c.service.DeleteOrder(orderId) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // GetInventory - Returns pet inventories by status -func GetInventory(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *StoreApiController) GetInventory(w http.ResponseWriter, r *http.Request) { + result, err := c.service.GetInventory() + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // GetOrderById - Find purchase order by ID -func GetOrderById(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *StoreApiController) GetOrderById(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + orderId, err := parseIntParameter(params["orderId"]) + if err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.GetOrderById(orderId) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // PlaceOrder - Place an order for a pet -func PlaceOrder(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *StoreApiController) PlaceOrder(w http.ResponseWriter, r *http.Request) { + order := &Order{} + if err := json.NewDecoder(r.Body).Decode(&order); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.PlaceOrder(*order) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_user.go b/samples/openapi3/server/petstore/go-api-server/go/api_user.go index aca15233a094..35fd6713eb71 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/api_user.go +++ b/samples/openapi3/server/petstore/go-api-server/go/api_user.go @@ -10,53 +10,194 @@ package petstoreserver import ( + "encoding/json" "net/http" + "strings" + + "github.com/gorilla/mux" ) +// A UserApiController binds http requests to an api service and writes the service results to the http response +type UserApiController struct { + service UserApiServicer +} + +// NewUserApiController creates a default api controller +func NewUserApiController(s UserApiServicer) Router { + return &UserApiController{ service: s } +} + +// Routes returns all of the api route for the UserApiController +func (c *UserApiController) Routes() Routes { + return Routes{ + { + "CreateUser", + strings.ToUpper("Post"), + "/v2/user", + c.CreateUser, + }, + { + "CreateUsersWithArrayInput", + strings.ToUpper("Post"), + "/v2/user/createWithArray", + c.CreateUsersWithArrayInput, + }, + { + "CreateUsersWithListInput", + strings.ToUpper("Post"), + "/v2/user/createWithList", + c.CreateUsersWithListInput, + }, + { + "DeleteUser", + strings.ToUpper("Delete"), + "/v2/user/{username}", + c.DeleteUser, + }, + { + "GetUserByName", + strings.ToUpper("Get"), + "/v2/user/{username}", + c.GetUserByName, + }, + { + "LoginUser", + strings.ToUpper("Get"), + "/v2/user/login", + c.LoginUser, + }, + { + "LogoutUser", + strings.ToUpper("Get"), + "/v2/user/logout", + c.LogoutUser, + }, + { + "UpdateUser", + strings.ToUpper("Put"), + "/v2/user/{username}", + c.UpdateUser, + }, + } +} + // CreateUser - Create user -func CreateUser(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *UserApiController) CreateUser(w http.ResponseWriter, r *http.Request) { + user := &User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.CreateUser(*user) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // CreateUsersWithArrayInput - Creates list of users with given input array -func CreateUsersWithArrayInput(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *UserApiController) CreateUsersWithArrayInput(w http.ResponseWriter, r *http.Request) { + user := &[]User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.CreateUsersWithArrayInput(*user) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // CreateUsersWithListInput - Creates list of users with given input array -func CreateUsersWithListInput(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *UserApiController) CreateUsersWithListInput(w http.ResponseWriter, r *http.Request) { + user := &[]User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.CreateUsersWithListInput(*user) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // DeleteUser - Delete user -func DeleteUser(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + username := params["username"] + result, err := c.service.DeleteUser(username) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // GetUserByName - Get user by user name -func GetUserByName(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *UserApiController) GetUserByName(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + username := params["username"] + result, err := c.service.GetUserByName(username) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // LoginUser - Logs user into the system -func LoginUser(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *UserApiController) LoginUser(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + username := query.Get("username") + password := query.Get("password") + result, err := c.service.LoginUser(username, password) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // LogoutUser - Logs out current logged in user session -func LogoutUser(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *UserApiController) LogoutUser(w http.ResponseWriter, r *http.Request) { + result, err := c.service.LogoutUser() + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } // UpdateUser - Updated user -func UpdateUser(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) +func (c *UserApiController) UpdateUser(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + username := params["username"] + user := &User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { + w.WriteHeader(500) + return + } + + result, err := c.service.UpdateUser(username, *user) + if err != nil { + w.WriteHeader(500) + return + } + + EncodeJSONResponse(result, nil, w) } diff --git a/samples/openapi3/server/petstore/go-api-server/go/routers.go b/samples/openapi3/server/petstore/go-api-server/go/routers.go index 616ae81843db..1a166f390e83 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/routers.go +++ b/samples/openapi3/server/petstore/go-api-server/go/routers.go @@ -10,13 +10,15 @@ package petstoreserver import ( - "fmt" + "encoding/json" + "io/ioutil" "net/http" - "strings" - + "os" + "strconv" "github.com/gorilla/mux" ) +// A Route defines the parameters for an api endpoint type Route struct { Name string Method string @@ -24,300 +26,71 @@ type Route struct { HandlerFunc http.HandlerFunc } +// Routes are a collection of defined api endpoints type Routes []Route -func NewRouter() *mux.Router { - router := mux.NewRouter().StrictSlash(true) - for _, route := range routes { - var handler http.Handler - handler = route.HandlerFunc - handler = Logger(handler, route.Name) +// Router defines the required methods for retrieving api routes +type Router interface { + Routes() Routes +} - router. - Methods(route.Method). - Path(route.Pattern). - Name(route.Name). - Handler(handler) +// NewRouter creates a new router for any number of api routers +func NewRouter(routers ...Router) *mux.Router { + router := mux.NewRouter().StrictSlash(true) + for _, api := range routers { + for _, route := range api.Routes() { + var handler http.Handler + handler = route.HandlerFunc + handler = Logger(handler, route.Name) + + router. + Methods(route.Method). + Path(route.Pattern). + Name(route.Name). + Handler(handler) + } } return router } -func Index(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "Hello World!") +// EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code +func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + if status != nil { + w.WriteHeader(*status) + } else { + w.WriteHeader(http.StatusOK) + } + + return json.NewEncoder(w).Encode(i) } -var routes = Routes{ - { - "Index", - "GET", - "/v2/", - Index, - }, +// ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file +func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error) { + r.ParseForm() + formFile, _, err := r.FormFile(key) + if err != nil { + return nil, err + } - { - "Call123TestSpecialTags", - strings.ToUpper("Patch"), - "/v2/another-fake/dummy", - Call123TestSpecialTags, - }, + defer formFile.Close() + file, err := ioutil.TempFile("tmp", key) + if err != nil { + return nil, err + } - { - "FooGet", - strings.ToUpper("Get"), - "/v2/foo", - FooGet, - }, + defer file.Close() + fileBytes, err := ioutil.ReadAll(formFile) + if err != nil { + return nil, err + } - { - "FakeHealthGet", - strings.ToUpper("Get"), - "/v2/fake/health", - FakeHealthGet, - }, - - { - "FakeOuterBooleanSerialize", - strings.ToUpper("Post"), - "/v2/fake/outer/boolean", - FakeOuterBooleanSerialize, - }, - - { - "FakeOuterCompositeSerialize", - strings.ToUpper("Post"), - "/v2/fake/outer/composite", - FakeOuterCompositeSerialize, - }, - - { - "FakeOuterNumberSerialize", - strings.ToUpper("Post"), - "/v2/fake/outer/number", - FakeOuterNumberSerialize, - }, - - { - "FakeOuterStringSerialize", - strings.ToUpper("Post"), - "/v2/fake/outer/string", - FakeOuterStringSerialize, - }, - - { - "TestBodyWithFileSchema", - strings.ToUpper("Put"), - "/v2/fake/body-with-file-schema", - TestBodyWithFileSchema, - }, - - { - "TestBodyWithQueryParams", - strings.ToUpper("Put"), - "/v2/fake/body-with-query-params", - TestBodyWithQueryParams, - }, - - { - "TestClientModel", - strings.ToUpper("Patch"), - "/v2/fake", - TestClientModel, - }, - - { - "TestEndpointParameters", - strings.ToUpper("Post"), - "/v2/fake", - TestEndpointParameters, - }, - - { - "TestEnumParameters", - strings.ToUpper("Get"), - "/v2/fake", - TestEnumParameters, - }, - - { - "TestGroupParameters", - strings.ToUpper("Delete"), - "/v2/fake", - TestGroupParameters, - }, - - { - "TestInlineAdditionalProperties", - strings.ToUpper("Post"), - "/v2/fake/inline-additionalProperties", - TestInlineAdditionalProperties, - }, - - { - "TestJsonFormData", - strings.ToUpper("Get"), - "/v2/fake/jsonFormData", - TestJsonFormData, - }, - - { - "TestQueryParameterCollectionFormat", - strings.ToUpper("Put"), - "/v2/fake/test-query-paramters", - TestQueryParameterCollectionFormat, - }, - - { - "TestClassname", - strings.ToUpper("Patch"), - "/v2/fake_classname_test", - TestClassname, - }, - - { - "AddPet", - strings.ToUpper("Post"), - "/v2/pet", - AddPet, - }, - - { - "DeletePet", - strings.ToUpper("Delete"), - "/v2/pet/{petId}", - DeletePet, - }, - - { - "FindPetsByStatus", - strings.ToUpper("Get"), - "/v2/pet/findByStatus", - FindPetsByStatus, - }, - - { - "FindPetsByTags", - strings.ToUpper("Get"), - "/v2/pet/findByTags", - FindPetsByTags, - }, - - { - "GetPetById", - strings.ToUpper("Get"), - "/v2/pet/{petId}", - GetPetById, - }, - - { - "UpdatePet", - strings.ToUpper("Put"), - "/v2/pet", - UpdatePet, - }, - - { - "UpdatePetWithForm", - strings.ToUpper("Post"), - "/v2/pet/{petId}", - UpdatePetWithForm, - }, - - { - "UploadFile", - strings.ToUpper("Post"), - "/v2/pet/{petId}/uploadImage", - UploadFile, - }, - - { - "UploadFileWithRequiredFile", - strings.ToUpper("Post"), - "/v2/fake/{petId}/uploadImageWithRequiredFile", - UploadFileWithRequiredFile, - }, - - { - "DeleteOrder", - strings.ToUpper("Delete"), - "/v2/store/order/{order_id}", - DeleteOrder, - }, - - { - "GetInventory", - strings.ToUpper("Get"), - "/v2/store/inventory", - GetInventory, - }, - - { - "GetOrderById", - strings.ToUpper("Get"), - "/v2/store/order/{order_id}", - GetOrderById, - }, - - { - "PlaceOrder", - strings.ToUpper("Post"), - "/v2/store/order", - PlaceOrder, - }, - - { - "CreateUser", - strings.ToUpper("Post"), - "/v2/user", - CreateUser, - }, - - { - "CreateUsersWithArrayInput", - strings.ToUpper("Post"), - "/v2/user/createWithArray", - CreateUsersWithArrayInput, - }, - - { - "CreateUsersWithListInput", - strings.ToUpper("Post"), - "/v2/user/createWithList", - CreateUsersWithListInput, - }, - - { - "DeleteUser", - strings.ToUpper("Delete"), - "/v2/user/{username}", - DeleteUser, - }, - - { - "GetUserByName", - strings.ToUpper("Get"), - "/v2/user/{username}", - GetUserByName, - }, - - { - "LoginUser", - strings.ToUpper("Get"), - "/v2/user/login", - LoginUser, - }, - - { - "LogoutUser", - strings.ToUpper("Get"), - "/v2/user/logout", - LogoutUser, - }, - - { - "UpdateUser", - strings.ToUpper("Put"), - "/v2/user/{username}", - UpdateUser, - }, + file.Write(fileBytes) + return file, nil +} + +// parseIntParameter parses a sting parameter to an int64 +func parseIntParameter(param string) (int64, error) { + return strconv.ParseInt(param, 10, 64) } diff --git a/samples/openapi3/server/petstore/go-api-server/main.go b/samples/openapi3/server/petstore/go-api-server/main.go index 235915e27a20..d4444720003b 100644 --- a/samples/openapi3/server/petstore/go-api-server/main.go +++ b/samples/openapi3/server/petstore/go-api-server/main.go @@ -13,20 +13,34 @@ import ( "log" "net/http" - // WARNING! - // Change this to a fully-qualified import path - // once you place this file into your project. - // For example, - // - // sw "github.com/myname/myrepo/go" - // - sw "./go" + petstoreserver "github.com/GIT_USER_ID/GIT_REPO_ID/go" ) func main() { log.Printf("Server started") - router := sw.NewRouter() + AnotherFakeApiService := petstoreserver.NewAnotherFakeApiService() + AnotherFakeApiController := petstoreserver.NewAnotherFakeApiController(AnotherFakeApiService) + + DefaultApiService := petstoreserver.NewDefaultApiService() + DefaultApiController := petstoreserver.NewDefaultApiController(DefaultApiService) + + FakeApiService := petstoreserver.NewFakeApiService() + FakeApiController := petstoreserver.NewFakeApiController(FakeApiService) + + FakeClassnameTags123ApiService := petstoreserver.NewFakeClassnameTags123ApiService() + FakeClassnameTags123ApiController := petstoreserver.NewFakeClassnameTags123ApiController(FakeClassnameTags123ApiService) + + PetApiService := petstoreserver.NewPetApiService() + PetApiController := petstoreserver.NewPetApiController(PetApiService) + + StoreApiService := petstoreserver.NewStoreApiService() + StoreApiController := petstoreserver.NewStoreApiController(StoreApiService) + + UserApiService := petstoreserver.NewUserApiService() + UserApiController := petstoreserver.NewUserApiController(UserApiService) + + router := petstoreserver.NewRouter(AnotherFakeApiController, DefaultApiController, FakeApiController, FakeClassnameTags123ApiController, PetApiController, StoreApiController, UserApiController) log.Fatal(http.ListenAndServe(":8080", router)) } diff --git a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION index c3a2c7076fa8..58592f031f65 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file From 1084cd38a1395483ac3f37bde88ac08d11d2d2f5 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 22 Dec 2019 13:14:44 +0800 Subject: [PATCH 05/28] update doc --- docs/generators/go-experimental.md | 1 + docs/generators/go.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/generators/go-experimental.md b/docs/generators/go-experimental.md index 432b4d8dd537..00cec6310b4a 100644 --- a/docs/generators/go-experimental.md +++ b/docs/generators/go-experimental.md @@ -13,4 +13,5 @@ sidebar_label: go-experimental |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| |enumClassPrefix|Prefix enum with class name| |false| |structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false| +|withAWSV4Signature|whether to include AWS v4 signature support| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/go.md b/docs/generators/go.md index 5e1560050c09..0801d2108f9c 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -13,4 +13,5 @@ sidebar_label: go |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| |enumClassPrefix|Prefix enum with class name| |false| |structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false| +|withAWSV4Signature|whether to include AWS v4 signature support| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| From 3959530465c228668d9a76ad0f8fa8c23358dd6c Mon Sep 17 00:00:00 2001 From: Justin Black Date: Sun, 22 Dec 2019 00:14:04 -0600 Subject: [PATCH 06/28] [Python] Updates python test framework to pytest (#4765) * Switches python generators to use pytest, useNose CLI option added if to allow nose to be used instead * Adds ensure-up-to-date changes * Adds setup.cfg to python clients so we can configure nose when useNose=true * Adds fix for python-aiohttp testing, adds files missing from ensure-up-to-date --- bin/python-server-all.sh | 1 + docs/generators/python-aiohttp.md | 1 + docs/generators/python-blueplanet.md | 1 + docs/generators/python-experimental.md | 1 + docs/generators/python-flask.md | 1 + docs/generators/python.md | 1 + .../PythonAbstractConnexionServerCodegen.java | 12 ++++ .../PythonAiohttpConnexionServerCodegen.java | 2 + .../languages/PythonClientCodegen.java | 18 ++++- .../python-aiohttp/gitignore.mustache | 66 +++++++++++++++++++ .../python-aiohttp/test-requirements.mustache | 9 ++- .../resources/python-aiohttp/tox.mustache | 10 +++ .../python-blueplanet/app/gitignore.mustache | 1 + .../app/test-requirements.mustache | 9 ++- .../python-blueplanet/app/tox.mustache | 3 +- .../resources/python-flask/gitignore.mustache | 2 + .../python-flask/requirements.mustache | 5 +- .../python-flask/test-requirements.mustache | 9 ++- .../main/resources/python-flask/tox.mustache | 3 +- .../main/resources/python/gitignore.mustache | 2 + .../test-requirements.mustache | 16 ++--- .../main/resources/python/setup_cfg.mustache | 13 ++++ .../python/test-requirements.mustache | 13 ++-- .../src/main/resources/python/tox.mustache | 8 +-- .../options/PythonClientOptionsProvider.java | 2 + .../python/PythonClientOptionsTest.java | 3 + .../client/petstore/python-asyncio/.gitignore | 2 + .../python-asyncio/dev-requirements.txt | 2 - .../client/petstore/python-asyncio/setup.cfg | 2 + .../python-asyncio/test-requirements.txt | 8 +-- .../petstore/python-asyncio/test_python3.sh | 1 - .../client/petstore/python-asyncio/tox.ini | 2 +- .../petstore/python-experimental/.gitignore | 2 + .../python-experimental/dev-requirements.txt | 3 - .../petstore/python-experimental/pom.xml | 2 +- .../petstore/python-experimental/setup.cfg | 9 --- .../python-experimental/test-requirements.txt | 11 ++-- .../python-experimental/test_python2.sh | 4 +- .../python-experimental/test_python2_and_3.sh | 1 - .../petstore/python-experimental/tox.ini | 3 +- .../client/petstore/python-tornado/.gitignore | 2 + .../python-tornado/dev-requirements.txt | 3 - .../client/petstore/python-tornado/pom.xml | 2 +- .../client/petstore/python-tornado/setup.cfg | 2 + .../python-tornado/test-requirements.txt | 8 +-- .../python-tornado/test_python2_and_3.sh | 1 - .../client/petstore/python-tornado/tox.ini | 3 +- samples/client/petstore/python/.gitignore | 2 + .../petstore/python/dev-requirements.txt | 3 - samples/client/petstore/python/pom.xml | 2 +- samples/client/petstore/python/setup.cfg | 9 --- .../petstore/python/test-requirements.txt | 8 +-- .../client/petstore/python/test_python2.sh | 6 +- .../petstore/python/test_python2_and_3.sh | 1 - .../petstore/python/tests/test_pet_api.py | 4 +- samples/client/petstore/python/tox.ini | 3 +- .../client/petstore/python/.gitignore | 2 + .../petstore/python/dev-requirements.txt | 2 + .../openapi3/client/petstore/python/pom.xml | 2 +- .../openapi3/client/petstore/python/setup.cfg | 2 + .../petstore/python/test-requirements.txt | 8 +-- .../client/petstore/python/test_python2.sh | 3 +- .../petstore/python/test_python2_and_3.sh | 1 - .../openapi3/client/petstore/python/tox.ini | 3 +- .../petstore/python-flask-python2/.gitignore | 2 + .../python-flask-python2/requirements.txt | 5 +- .../test-requirements.txt | 10 ++- .../petstore/python-flask-python2/tox.ini | 3 +- .../server/petstore/python-flask/.gitignore | 2 + .../petstore/python-flask/requirements.txt | 5 +- .../python-flask/test-requirements.txt | 10 ++- .../server/petstore/python-flask/tox.ini | 3 +- .../server/petstore/python-aiohttp/.gitignore | 66 +++++++++++++++++++ .../python-aiohttp/dev-requirements.txt | 2 + .../server/petstore/python-aiohttp/pom.xml | 2 +- .../python-aiohttp/test-requirements.txt | 8 +-- .../petstore/python-aiohttp/test_python3.sh | 11 ++-- .../server/petstore/python-aiohttp/tox.ini | 10 +++ .../.openapi-generator/VERSION | 2 +- .../petstore/python-blueplanet/app/.gitignore | 1 + .../app/test-requirements.txt | 10 ++- .../petstore/python-blueplanet/app/tox.ini | 3 +- .../petstore/python-flask-python2/.gitignore | 2 + .../python-flask-python2/dev-requirements.txt | 2 + .../petstore/python-flask-python2/pom.xml | 2 +- .../python-flask-python2/requirements.txt | 5 +- .../test-requirements.txt | 10 ++- .../python-flask-python2/test_python2.sh | 13 ++-- .../petstore/python-flask-python2/tox.ini | 3 +- .../server/petstore/python-flask/.gitignore | 2 + .../python-flask/dev-requirements.txt | 2 + samples/server/petstore/python-flask/pom.xml | 2 +- .../petstore/python-flask/requirements.txt | 5 +- .../python-flask/test-requirements.txt | 10 ++- .../petstore/python-flask/test_python3.sh | 11 ++-- samples/server/petstore/python-flask/tox.ini | 3 +- 96 files changed, 385 insertions(+), 188 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/python-aiohttp/gitignore.mustache create mode 100644 modules/openapi-generator/src/main/resources/python-aiohttp/tox.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/setup_cfg.mustache create mode 100644 samples/client/petstore/python-asyncio/setup.cfg create mode 100644 samples/client/petstore/python-tornado/setup.cfg create mode 100644 samples/openapi3/client/petstore/python/dev-requirements.txt create mode 100644 samples/openapi3/client/petstore/python/setup.cfg create mode 100644 samples/server/petstore/python-aiohttp/.gitignore create mode 100644 samples/server/petstore/python-aiohttp/dev-requirements.txt create mode 100644 samples/server/petstore/python-aiohttp/tox.ini create mode 100644 samples/server/petstore/python-flask-python2/dev-requirements.txt create mode 100644 samples/server/petstore/python-flask/dev-requirements.txt diff --git a/bin/python-server-all.sh b/bin/python-server-all.sh index 5a4f5c754891..5fe3176eed9e 100755 --- a/bin/python-server-all.sh +++ b/bin/python-server-all.sh @@ -3,3 +3,4 @@ ./bin/python-server-aiohttp-petstore.sh ./bin/python-server-flask-petstore.sh ./bin/python-server-flask-petstore-python2.sh +./bin/python-server-blueplanet-petstore.sh diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index 16a4fc8056f6..a116fc6e96b8 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -16,3 +16,4 @@ sidebar_label: python-aiohttp |defaultController|default controller| |default_controller| |supportPython2|support python2| |false| |serverPort|TCP port to listen to in app.run| |8080| +|useNose|use the nose test framework| |false| diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index 218919028605..7114953628d8 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -16,3 +16,4 @@ sidebar_label: python-blueplanet |defaultController|default controller| |default_controller| |supportPython2|support python2| |false| |serverPort|TCP port to listen to in app.run| |8080| +|useNose|use the nose test framework| |false| diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index 65aaee198574..8ba2d699ed5e 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -12,4 +12,5 @@ sidebar_label: python-experimental |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| +|useNose|use the nose test framework| |false| |library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index 05f6e46a1c6d..1b68530a8680 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -16,3 +16,4 @@ sidebar_label: python-flask |defaultController|default controller| |default_controller| |supportPython2|support python2| |false| |serverPort|TCP port to listen to in app.run| |8080| +|useNose|use the nose test framework| |false| diff --git a/docs/generators/python.md b/docs/generators/python.md index 023e92b66716..ee581848b024 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -12,4 +12,5 @@ sidebar_label: python |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| +|useNose|use the nose test framework| |false| |library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java index 5d6c5ca102ec..5b6e133cac2a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java @@ -48,6 +48,8 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme public static final String CONTROLLER_PACKAGE = "controllerPackage"; public static final String DEFAULT_CONTROLLER = "defaultController"; public static final String SUPPORT_PYTHON2 = "supportPython2"; + // nose is a python testing framework, we use pytest if USE_NOSE is unset + public static final String USE_NOSE = "useNose"; static final String MEDIA_TYPE = "mediaType"; protected int serverPort = 8080; @@ -57,6 +59,7 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme protected String defaultController; protected Map regexModifiers; protected boolean fixBodyName; + protected boolean useNose = Boolean.FALSE; public PythonAbstractConnexionServerCodegen(String templateDirectory, boolean fixBodyNameValue) { super(); @@ -156,6 +159,8 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme defaultValue("false")); cliOptions.add(new CliOption("serverPort", "TCP port to listen to in app.run"). defaultValue("8080")); + cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). + defaultValue(Boolean.FALSE.toString())); } protected void addSupportingFiles() { @@ -200,6 +205,9 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme additionalProperties.put(SUPPORT_PYTHON2, Boolean.TRUE); typeMapping.put("long", "long"); } + if (additionalProperties.containsKey(USE_NOSE)) { + setUseNose((String) additionalProperties.get(USE_NOSE)); + } supportingFiles.add(new SupportingFile("__main__.mustache", packagePath(), "__main__.py")); supportingFiles.add(new SupportingFile("util.mustache", packagePath(), "util.py")); supportingFiles.add(new SupportingFile("typing_utils.mustache", packagePath(), "typing_utils.py")); @@ -214,6 +222,10 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme controllerPackage = packageName + "." + controllerPackage; } + public void setUseNose(String val) { + this.useNose = Boolean.valueOf(val); + } + private static String packageToPath(String pkg) { return pkg.replace(".", File.separator); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java index 0f725396b660..eac3c6b0b2e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java @@ -44,5 +44,7 @@ public class PythonAiohttpConnexionServerCodegen extends PythonAbstractConnexion supportingFiles.add(new SupportingFile("conftest.mustache", testPackage, "conftest.py")); supportingFiles.add(new SupportingFile("__init__test.mustache", testPackage, "__init__.py")); supportingFiles.add(new SupportingFile("__init__main.mustache", packagePath(), "__init__.py")); + supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 4538ee1b5f20..ef410594ec91 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -40,6 +40,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig public static final String PACKAGE_URL = "packageUrl"; public static final String DEFAULT_LIBRARY = "urllib3"; + // nose is a python testing framework, we use pytest if USE_NOSE is unset + public static final String USE_NOSE = "useNose"; protected String packageName = "openapi_client"; protected String packageVersion = "1.0.0"; @@ -47,6 +49,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig protected String packageUrl; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; + protected boolean useNose = Boolean.FALSE; protected Map regexModifiers; @@ -127,7 +130,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", "assert", "else", "if", "pass", "yield", "break", "except", "import", "print", "class", "exec", "in", "raise", "continue", "finally", "is", - "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True", + "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True", "False", "async", "await")); regexModifiers = new HashMap(); @@ -151,6 +154,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig .defaultValue(Boolean.TRUE.toString())); cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC) .defaultValue(Boolean.FALSE.toString())); + cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). + defaultValue(Boolean.FALSE.toString())); supportedLibraries.put("urllib3", "urllib3-based client"); supportedLibraries.put("asyncio", "Asyncio-based client (python 3.5+)"); @@ -190,7 +195,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); - } + } Boolean generateSourceCodeOnly = false; if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { @@ -216,6 +221,10 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); } + if (additionalProperties.containsKey(USE_NOSE)) { + setUseNose((String) additionalProperties.get(USE_NOSE)); + } + String readmePath = "README.md"; String readmeTemplate = "README.mustache"; if (generateSourceCodeOnly) { @@ -228,6 +237,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini")); supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt")); + supportingFiles.add(new SupportingFile("setup_cfg.mustache", "", "setup.cfg")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); @@ -579,6 +589,10 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig this.packageName = packageName; } + public void setUseNose(String val) { + this.useNose = Boolean.valueOf(val); + } + public void setProjectName(String projectName) { this.projectName = projectName; } diff --git a/modules/openapi-generator/src/main/resources/python-aiohttp/gitignore.mustache b/modules/openapi-generator/src/main/resources/python-aiohttp/gitignore.mustache new file mode 100644 index 000000000000..43995bd42fa2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-aiohttp/gitignore.mustache @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/modules/openapi-generator/src/main/resources/python-aiohttp/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-aiohttp/test-requirements.mustache index 1cb425f65519..16ba4a48111d 100644 --- a/modules/openapi-generator/src/main/resources/python-aiohttp/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-aiohttp/test-requirements.mustache @@ -1,6 +1,13 @@ +{{#useNose}} coverage>=4.0.3 -pytest>=1.3.7 +nose>=1.3.7 pluggy>=0.3.1 py>=1.4.31 randomize>=0.13 +{{/useNose}} +{{^useNose}} +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 pytest-aiohttp>=0.3.0 +{{/useNose}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-aiohttp/tox.mustache b/modules/openapi-generator/src/main/resources/python-aiohttp/tox.mustache new file mode 100644 index 000000000000..87cc65eeeb78 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-aiohttp/tox.mustache @@ -0,0 +1,10 @@ +[tox] +envlist = py3 +skipsdist=True + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-blueplanet/app/gitignore.mustache b/modules/openapi-generator/src/main/resources/python-blueplanet/app/gitignore.mustache index a655050c2631..a77a0ebd1660 100644 --- a/modules/openapi-generator/src/main/resources/python-blueplanet/app/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/python-blueplanet/app/gitignore.mustache @@ -46,6 +46,7 @@ coverage.xml .hypothesis/ venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/modules/openapi-generator/src/main/resources/python-blueplanet/app/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-blueplanet/app/test-requirements.mustache index 7f8d96e6b40e..efad5423cb5e 100644 --- a/modules/openapi-generator/src/main/resources/python-blueplanet/app/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-blueplanet/app/test-requirements.mustache @@ -1,6 +1,13 @@ -flask_testing==0.6.1 +{{#useNose}} coverage>=4.0.3 nose>=1.3.7 pluggy>=0.3.1 py>=1.4.31 randomize>=0.13 +{{/useNose}} +{{^useNose}} +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +{{/useNose}} +flask_testing==0.6.1 \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-blueplanet/app/tox.mustache b/modules/openapi-generator/src/main/resources/python-blueplanet/app/tox.mustache index 3efa994317d9..7b3246c36e25 100644 --- a/modules/openapi-generator/src/main/resources/python-blueplanet/app/tox.mustache +++ b/modules/openapi-generator/src/main/resources/python-blueplanet/app/tox.mustache @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] \ No newline at end of file + {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-flask/gitignore.mustache b/modules/openapi-generator/src/main/resources/python-flask/gitignore.mustache index a655050c2631..43995bd42fa2 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/gitignore.mustache @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache b/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache index b5a702d5de84..921d67d029a2 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache @@ -1,4 +1,7 @@ -connexion >= 2.0.2 +connexion >= 2.5.0; python_version>="3.6" +connexion >= 2.3.0; python_version=="3.5" +connexion >= 2.3.0; python_version=="3.4" +connexion == 2.4.0; python_version<="2.7" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 {{#supportPython2}} diff --git a/modules/openapi-generator/src/main/resources/python-flask/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-flask/test-requirements.mustache index 7f8d96e6b40e..efad5423cb5e 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/test-requirements.mustache @@ -1,6 +1,13 @@ -flask_testing==0.6.1 +{{#useNose}} coverage>=4.0.3 nose>=1.3.7 pluggy>=0.3.1 py>=1.4.31 randomize>=0.13 +{{/useNose}} +{{^useNose}} +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +{{/useNose}} +flask_testing==0.6.1 \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-flask/tox.mustache b/modules/openapi-generator/src/main/resources/python-flask/tox.mustache index 1195b3391b0b..7fcd185a8d82 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/tox.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/tox.mustache @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] \ No newline at end of file + {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/gitignore.mustache b/modules/openapi-generator/src/main/resources/python/gitignore.mustache index a655050c2631..43995bd42fa2 100644 --- a/modules/openapi-generator/src/main/resources/python/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/python/gitignore.mustache @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache index 023ff960788a..338b229bae51 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache @@ -1,13 +1,13 @@ -{{^asyncio}} +{{#useNose}} coverage>=4.0.3 nose>=1.3.7 -{{/asyncio}} -{{#asyncio}} -pytest>=3.6.0 -pytest-cov>=2.6.1 -{{/asyncio}} pluggy>=0.3.1 py>=1.4.31 randomize>=0.13 -mock; python_version<="2.7" - +{{/useNose}} +{{^useNose}} +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +{{/useNose}} +mock; python_version<="2.7" \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/setup_cfg.mustache b/modules/openapi-generator/src/main/resources/python/setup_cfg.mustache new file mode 100644 index 000000000000..d89aa72ee4c1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/setup_cfg.mustache @@ -0,0 +1,13 @@ +{{#useNose}} +[nosetests] +logging-clear-handlers=true +verbosity=2 +randomize=true +exe=true +with-coverage=true +cover-package=petstore_api +cover-erase=true + +{{/useNose}} +[flake8] +max-line-length=99 diff --git a/modules/openapi-generator/src/main/resources/python/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/test-requirements.mustache index d9e3f20b5369..12021b47a1c2 100644 --- a/modules/openapi-generator/src/main/resources/python/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/test-requirements.mustache @@ -1,11 +1,12 @@ -{{^asyncio}} +{{#useNose}} coverage>=4.0.3 nose>=1.3.7 -{{/asyncio}} -{{#asyncio}} -pytest>=3.6.0 -pytest-cov>=2.6.1 -{{/asyncio}} pluggy>=0.3.1 py>=1.4.31 randomize>=0.13 +{{/useNose}} +{{^useNose}} +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +{{/useNose}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/tox.mustache b/modules/openapi-generator/src/main/resources/python/tox.mustache index 585feb3c681b..fe989faf9302 100644 --- a/modules/openapi-generator/src/main/resources/python/tox.mustache +++ b/modules/openapi-generator/src/main/resources/python/tox.mustache @@ -11,10 +11,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= -{{^asyncio}} - nosetests \ - [] -{{/asyncio}} -{{#asyncio}} - pytest -v --cov {{{packageName}}} -{{/asyncio}} + {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java index f74b17266ce3..d3afcc8f8448 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java @@ -28,6 +28,7 @@ public class PythonClientOptionsProvider implements OptionsProvider { public static final String PROJECT_NAME_VALUE = "swagger-client-python"; public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String PACKAGE_URL_VALUE = ""; + public static final String USE_NOSE_VALUE = "false"; @Override public String getLanguage() { @@ -45,6 +46,7 @@ public class PythonClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") .put(CodegenConstants.LIBRARY, "urllib3") + .put(PythonClientCodegen.USE_NOSE, USE_NOSE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java index 47d59ba78c4f..ce9d564f4701 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java @@ -56,6 +56,9 @@ public class PythonClientOptionsTest extends AbstractOptionsTest { clientCodegen.setPackageUrl(PythonClientOptionsProvider.PACKAGE_URL_VALUE); times = 1; + clientCodegen.setUseNose(PythonClientOptionsProvider.USE_NOSE_VALUE); + times = 1; + clientCodegen.packagePath(); result = PythonClientOptionsProvider.PACKAGE_NAME_VALUE.replace('.', File.separatorChar); minTimes = 1; diff --git a/samples/client/petstore/python-asyncio/.gitignore b/samples/client/petstore/python-asyncio/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/client/petstore/python-asyncio/.gitignore +++ b/samples/client/petstore/python-asyncio/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/client/petstore/python-asyncio/dev-requirements.txt b/samples/client/petstore/python-asyncio/dev-requirements.txt index 49182426e202..ccdfca629494 100644 --- a/samples/client/petstore/python-asyncio/dev-requirements.txt +++ b/samples/client/petstore/python-asyncio/dev-requirements.txt @@ -1,4 +1,2 @@ tox -coverage -randomize flake8 diff --git a/samples/client/petstore/python-asyncio/setup.cfg b/samples/client/petstore/python-asyncio/setup.cfg new file mode 100644 index 000000000000..11433ee875ab --- /dev/null +++ b/samples/client/petstore/python-asyncio/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/samples/client/petstore/python-asyncio/test-requirements.txt b/samples/client/petstore/python-asyncio/test-requirements.txt index 600ac897bb74..4ed3991cbec1 100644 --- a/samples/client/petstore/python-asyncio/test-requirements.txt +++ b/samples/client/petstore/python-asyncio/test-requirements.txt @@ -1,5 +1,3 @@ -pytest>=3.6.0 -pytest-cov>=2.6.1 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 diff --git a/samples/client/petstore/python-asyncio/test_python3.sh b/samples/client/petstore/python-asyncio/test_python3.sh index 9160e25714ad..1a8e712f73c5 100755 --- a/samples/client/petstore/python-asyncio/test_python3.sh +++ b/samples/client/petstore/python-asyncio/test_python3.sh @@ -18,7 +18,6 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests tox || exit 1 diff --git a/samples/client/petstore/python-asyncio/tox.ini b/samples/client/petstore/python-asyncio/tox.ini index 65f5351ddcc3..8989fc3c4d96 100644 --- a/samples/client/petstore/python-asyncio/tox.ini +++ b/samples/client/petstore/python-asyncio/tox.ini @@ -6,4 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - pytest -v --cov petstore_api + pytest --cov=petstore_api diff --git a/samples/client/petstore/python-experimental/.gitignore b/samples/client/petstore/python-experimental/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/client/petstore/python-experimental/.gitignore +++ b/samples/client/petstore/python-experimental/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/client/petstore/python-experimental/dev-requirements.txt b/samples/client/petstore/python-experimental/dev-requirements.txt index f50c13b5c503..ccdfca629494 100644 --- a/samples/client/petstore/python-experimental/dev-requirements.txt +++ b/samples/client/petstore/python-experimental/dev-requirements.txt @@ -1,5 +1,2 @@ -nose tox -coverage -randomize flake8 diff --git a/samples/client/petstore/python-experimental/pom.xml b/samples/client/petstore/python-experimental/pom.xml index 3c9463331861..742451c23b2f 100644 --- a/samples/client/petstore/python-experimental/pom.xml +++ b/samples/client/petstore/python-experimental/pom.xml @@ -27,7 +27,7 @@ 1.2.1 - nose-test + test integration-test exec diff --git a/samples/client/petstore/python-experimental/setup.cfg b/samples/client/petstore/python-experimental/setup.cfg index 26b7a359d580..11433ee875ab 100644 --- a/samples/client/petstore/python-experimental/setup.cfg +++ b/samples/client/petstore/python-experimental/setup.cfg @@ -1,11 +1,2 @@ -[nosetests] -logging-clear-handlers=true -verbosity=2 -randomize=true -exe=true -with-coverage=true -cover-package=petstore_api -cover-erase=true - [flake8] max-line-length=99 diff --git a/samples/client/petstore/python-experimental/test-requirements.txt b/samples/client/petstore/python-experimental/test-requirements.txt index 5816b8749532..06f7754d2044 100644 --- a/samples/client/petstore/python-experimental/test-requirements.txt +++ b/samples/client/petstore/python-experimental/test-requirements.txt @@ -1,7 +1,4 @@ -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 -mock; python_version<="2.7" - +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +mock; python_version<="2.7" \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/test_python2.sh b/samples/client/petstore/python-experimental/test_python2.sh index 35de07deec71..b2f344ec8977 100644 --- a/samples/client/petstore/python-experimental/test_python2.sh +++ b/samples/client/petstore/python-experimental/test_python2.sh @@ -19,11 +19,9 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -pip install -r test-requirements.txt -python setup.py develop ### run tests -nosetests || exit 1 +tox -e py27 || exit 1 ### static analysis of code flake8 --show-source petstore_api/ diff --git a/samples/client/petstore/python-experimental/test_python2_and_3.sh b/samples/client/petstore/python-experimental/test_python2_and_3.sh index 8511d46cd795..3205dfd07da9 100644 --- a/samples/client/petstore/python-experimental/test_python2_and_3.sh +++ b/samples/client/petstore/python-experimental/test_python2_and_3.sh @@ -18,7 +18,6 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests tox || exit 1 diff --git a/samples/client/petstore/python-experimental/tox.ini b/samples/client/petstore/python-experimental/tox.ini index 3d0be613cfc7..169d895329bf 100644 --- a/samples/client/petstore/python-experimental/tox.ini +++ b/samples/client/petstore/python-experimental/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] + pytest --cov=petstore_api diff --git a/samples/client/petstore/python-tornado/.gitignore b/samples/client/petstore/python-tornado/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/client/petstore/python-tornado/.gitignore +++ b/samples/client/petstore/python-tornado/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/client/petstore/python-tornado/dev-requirements.txt b/samples/client/petstore/python-tornado/dev-requirements.txt index f50c13b5c503..ccdfca629494 100644 --- a/samples/client/petstore/python-tornado/dev-requirements.txt +++ b/samples/client/petstore/python-tornado/dev-requirements.txt @@ -1,5 +1,2 @@ -nose tox -coverage -randomize flake8 diff --git a/samples/client/petstore/python-tornado/pom.xml b/samples/client/petstore/python-tornado/pom.xml index 821e12dfe8d3..9aae57304fc7 100644 --- a/samples/client/petstore/python-tornado/pom.xml +++ b/samples/client/petstore/python-tornado/pom.xml @@ -27,7 +27,7 @@ 1.2.1 - nose-test + test integration-test exec diff --git a/samples/client/petstore/python-tornado/setup.cfg b/samples/client/petstore/python-tornado/setup.cfg new file mode 100644 index 000000000000..11433ee875ab --- /dev/null +++ b/samples/client/petstore/python-tornado/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/samples/client/petstore/python-tornado/test-requirements.txt b/samples/client/petstore/python-tornado/test-requirements.txt index 2702246c0e6f..4ed3991cbec1 100644 --- a/samples/client/petstore/python-tornado/test-requirements.txt +++ b/samples/client/petstore/python-tornado/test-requirements.txt @@ -1,5 +1,3 @@ -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 diff --git a/samples/client/petstore/python-tornado/test_python2_and_3.sh b/samples/client/petstore/python-tornado/test_python2_and_3.sh index 7b5795ec24a9..3118c449124d 100755 --- a/samples/client/petstore/python-tornado/test_python2_and_3.sh +++ b/samples/client/petstore/python-tornado/test_python2_and_3.sh @@ -18,7 +18,6 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests tox || exit 1 diff --git a/samples/client/petstore/python-tornado/tox.ini b/samples/client/petstore/python-tornado/tox.ini index 3d0be613cfc7..169d895329bf 100644 --- a/samples/client/petstore/python-tornado/tox.ini +++ b/samples/client/petstore/python-tornado/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] + pytest --cov=petstore_api diff --git a/samples/client/petstore/python/.gitignore b/samples/client/petstore/python/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/client/petstore/python/.gitignore +++ b/samples/client/petstore/python/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/client/petstore/python/dev-requirements.txt b/samples/client/petstore/python/dev-requirements.txt index f50c13b5c503..ccdfca629494 100644 --- a/samples/client/petstore/python/dev-requirements.txt +++ b/samples/client/petstore/python/dev-requirements.txt @@ -1,5 +1,2 @@ -nose tox -coverage -randomize flake8 diff --git a/samples/client/petstore/python/pom.xml b/samples/client/petstore/python/pom.xml index db2d09246c3b..71814d4388d9 100644 --- a/samples/client/petstore/python/pom.xml +++ b/samples/client/petstore/python/pom.xml @@ -27,7 +27,7 @@ 1.2.1 - nose-test + test integration-test exec diff --git a/samples/client/petstore/python/setup.cfg b/samples/client/petstore/python/setup.cfg index 26b7a359d580..11433ee875ab 100644 --- a/samples/client/petstore/python/setup.cfg +++ b/samples/client/petstore/python/setup.cfg @@ -1,11 +1,2 @@ -[nosetests] -logging-clear-handlers=true -verbosity=2 -randomize=true -exe=true -with-coverage=true -cover-package=petstore_api -cover-erase=true - [flake8] max-line-length=99 diff --git a/samples/client/petstore/python/test-requirements.txt b/samples/client/petstore/python/test-requirements.txt index 2702246c0e6f..4ed3991cbec1 100644 --- a/samples/client/petstore/python/test-requirements.txt +++ b/samples/client/petstore/python/test-requirements.txt @@ -1,5 +1,3 @@ -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 diff --git a/samples/client/petstore/python/test_python2.sh b/samples/client/petstore/python/test_python2.sh index fb0eaed6ffa0..4c9488a33297 100755 --- a/samples/client/petstore/python/test_python2.sh +++ b/samples/client/petstore/python/test_python2.sh @@ -11,17 +11,16 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy + virtualenv $VENV --no-site-packages --always-copy --python python source $VENV/bin/activate DEACTIVE=true fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests -nosetests || exit 1 +tox -e py27 || exit 1 ### static analysis of code flake8 --show-source petstore_api/ @@ -30,4 +29,3 @@ flake8 --show-source petstore_api/ #if [ $DEACTIVE == true ]; then # deactivate #fi - diff --git a/samples/client/petstore/python/test_python2_and_3.sh b/samples/client/petstore/python/test_python2_and_3.sh index 7b5795ec24a9..3118c449124d 100755 --- a/samples/client/petstore/python/test_python2_and_3.sh +++ b/samples/client/petstore/python/test_python2_and_3.sh @@ -18,7 +18,6 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests tox || exit 1 diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 80d34f6b5f21..b7650f042eb9 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -157,7 +157,7 @@ class PetApiTests(unittest.TestCase): response = thread.get() response2 = thread2.get() - self.assertEquals(response.id, self.pet.id) + self.assertEqual(response.id, self.pet.id) self.assertIsNotNone(response2.id, self.pet.id) def test_async_with_http_info(self): @@ -167,7 +167,7 @@ class PetApiTests(unittest.TestCase): data, status, headers = thread.get() self.assertIsInstance(data, petstore_api.Pet) - self.assertEquals(status, 200) + self.assertEqual(status, 200) def test_async_exception(self): self.pet_api.add_pet(self.pet) diff --git a/samples/client/petstore/python/tox.ini b/samples/client/petstore/python/tox.ini index 3d0be613cfc7..169d895329bf 100644 --- a/samples/client/petstore/python/tox.ini +++ b/samples/client/petstore/python/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] + pytest --cov=petstore_api diff --git a/samples/openapi3/client/petstore/python/.gitignore b/samples/openapi3/client/petstore/python/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/openapi3/client/petstore/python/.gitignore +++ b/samples/openapi3/client/petstore/python/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/openapi3/client/petstore/python/dev-requirements.txt b/samples/openapi3/client/petstore/python/dev-requirements.txt new file mode 100644 index 000000000000..ccdfca629494 --- /dev/null +++ b/samples/openapi3/client/petstore/python/dev-requirements.txt @@ -0,0 +1,2 @@ +tox +flake8 diff --git a/samples/openapi3/client/petstore/python/pom.xml b/samples/openapi3/client/petstore/python/pom.xml index 2fa7d0a113f9..98955483eb8f 100644 --- a/samples/openapi3/client/petstore/python/pom.xml +++ b/samples/openapi3/client/petstore/python/pom.xml @@ -27,7 +27,7 @@ 1.2.1 - nose-test + test integration-test exec diff --git a/samples/openapi3/client/petstore/python/setup.cfg b/samples/openapi3/client/petstore/python/setup.cfg new file mode 100644 index 000000000000..11433ee875ab --- /dev/null +++ b/samples/openapi3/client/petstore/python/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/samples/openapi3/client/petstore/python/test-requirements.txt b/samples/openapi3/client/petstore/python/test-requirements.txt index 2702246c0e6f..4ed3991cbec1 100644 --- a/samples/openapi3/client/petstore/python/test-requirements.txt +++ b/samples/openapi3/client/petstore/python/test-requirements.txt @@ -1,5 +1,3 @@ -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 diff --git a/samples/openapi3/client/petstore/python/test_python2.sh b/samples/openapi3/client/petstore/python/test_python2.sh index fb0eaed6ffa0..24c3cbdd4960 100644 --- a/samples/openapi3/client/petstore/python/test_python2.sh +++ b/samples/openapi3/client/petstore/python/test_python2.sh @@ -18,10 +18,9 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests -nosetests || exit 1 +tox -e py27 || exit 1 ### static analysis of code flake8 --show-source petstore_api/ diff --git a/samples/openapi3/client/petstore/python/test_python2_and_3.sh b/samples/openapi3/client/petstore/python/test_python2_and_3.sh index daf08d5bacba..ab02e6e40809 100644 --- a/samples/openapi3/client/petstore/python/test_python2_and_3.sh +++ b/samples/openapi3/client/petstore/python/test_python2_and_3.sh @@ -18,7 +18,6 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests tox || exit 1 diff --git a/samples/openapi3/client/petstore/python/tox.ini b/samples/openapi3/client/petstore/python/tox.ini index 3d0be613cfc7..169d895329bf 100644 --- a/samples/openapi3/client/petstore/python/tox.ini +++ b/samples/openapi3/client/petstore/python/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] + pytest --cov=petstore_api diff --git a/samples/openapi3/server/petstore/python-flask-python2/.gitignore b/samples/openapi3/server/petstore/python-flask-python2/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/.gitignore +++ b/samples/openapi3/server/petstore/python-flask-python2/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/openapi3/server/petstore/python-flask-python2/requirements.txt b/samples/openapi3/server/petstore/python-flask-python2/requirements.txt index bc5357066229..5c5ce2a1a269 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/requirements.txt +++ b/samples/openapi3/server/petstore/python-flask-python2/requirements.txt @@ -1,4 +1,7 @@ -connexion >= 2.0.2 +connexion >= 2.5.0; python_version>="3.6" +connexion >= 2.3.0; python_version=="3.5" +connexion >= 2.3.0; python_version=="3.4" +connexion == 2.4.0; python_version<="2.7" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 typing >= 3.5.2.2 diff --git a/samples/openapi3/server/petstore/python-flask-python2/test-requirements.txt b/samples/openapi3/server/petstore/python-flask-python2/test-requirements.txt index 7f8d96e6b40e..a2626d875ff4 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/test-requirements.txt +++ b/samples/openapi3/server/petstore/python-flask-python2/test-requirements.txt @@ -1,6 +1,4 @@ -flask_testing==0.6.1 -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +flask_testing==0.6.1 \ No newline at end of file diff --git a/samples/openapi3/server/petstore/python-flask-python2/tox.ini b/samples/openapi3/server/petstore/python-flask-python2/tox.ini index 26985414c882..d05c607610ce 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/tox.ini +++ b/samples/openapi3/server/petstore/python-flask-python2/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] \ No newline at end of file + pytest --cov=openapi_server \ No newline at end of file diff --git a/samples/openapi3/server/petstore/python-flask/.gitignore b/samples/openapi3/server/petstore/python-flask/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/openapi3/server/petstore/python-flask/.gitignore +++ b/samples/openapi3/server/petstore/python-flask/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/openapi3/server/petstore/python-flask/requirements.txt b/samples/openapi3/server/petstore/python-flask/requirements.txt index 1a01b5804905..029a9dae4cdf 100644 --- a/samples/openapi3/server/petstore/python-flask/requirements.txt +++ b/samples/openapi3/server/petstore/python-flask/requirements.txt @@ -1,4 +1,7 @@ -connexion >= 2.0.2 +connexion >= 2.5.0; python_version>="3.6" +connexion >= 2.3.0; python_version=="3.5" +connexion >= 2.3.0; python_version=="3.4" +connexion == 2.4.0; python_version<="2.7" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 setuptools >= 21.0.0 diff --git a/samples/openapi3/server/petstore/python-flask/test-requirements.txt b/samples/openapi3/server/petstore/python-flask/test-requirements.txt index 7f8d96e6b40e..a2626d875ff4 100644 --- a/samples/openapi3/server/petstore/python-flask/test-requirements.txt +++ b/samples/openapi3/server/petstore/python-flask/test-requirements.txt @@ -1,6 +1,4 @@ -flask_testing==0.6.1 -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +flask_testing==0.6.1 \ No newline at end of file diff --git a/samples/openapi3/server/petstore/python-flask/tox.ini b/samples/openapi3/server/petstore/python-flask/tox.ini index ab4dfbb81b8b..cff71191e6cb 100644 --- a/samples/openapi3/server/petstore/python-flask/tox.ini +++ b/samples/openapi3/server/petstore/python-flask/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] \ No newline at end of file + pytest --cov=openapi_server \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp/.gitignore b/samples/server/petstore/python-aiohttp/.gitignore new file mode 100644 index 000000000000..43995bd42fa2 --- /dev/null +++ b/samples/server/petstore/python-aiohttp/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/server/petstore/python-aiohttp/dev-requirements.txt b/samples/server/petstore/python-aiohttp/dev-requirements.txt new file mode 100644 index 000000000000..ccdfca629494 --- /dev/null +++ b/samples/server/petstore/python-aiohttp/dev-requirements.txt @@ -0,0 +1,2 @@ +tox +flake8 diff --git a/samples/server/petstore/python-aiohttp/pom.xml b/samples/server/petstore/python-aiohttp/pom.xml index 8e77233a458b..26c4b7c492d1 100644 --- a/samples/server/petstore/python-aiohttp/pom.xml +++ b/samples/server/petstore/python-aiohttp/pom.xml @@ -27,7 +27,7 @@ 1.2.1 - pytest-test + test integration-test exec diff --git a/samples/server/petstore/python-aiohttp/test-requirements.txt b/samples/server/petstore/python-aiohttp/test-requirements.txt index 1cb425f65519..31b28baaf284 100644 --- a/samples/server/petstore/python-aiohttp/test-requirements.txt +++ b/samples/server/petstore/python-aiohttp/test-requirements.txt @@ -1,6 +1,4 @@ -coverage>=4.0.3 -pytest>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 pytest-aiohttp>=0.3.0 diff --git a/samples/server/petstore/python-aiohttp/test_python3.sh b/samples/server/petstore/python-aiohttp/test_python3.sh index c6a92d00aed2..65d96267d4fb 100755 --- a/samples/server/petstore/python-aiohttp/test_python3.sh +++ b/samples/server/petstore/python-aiohttp/test_python3.sh @@ -1,8 +1,7 @@ #!/bin/bash -REQUIREMENTS_FILE=requirements.txt -TEST_REQUIREMENTS_FILE=test-requirements.txt -REQUIREMENTS_OUT=requirements.txt.log +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=.venv DEACTIVE=false @@ -12,16 +11,16 @@ export LANG=en_US.UTF-8 ### set virtualenv if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --no-site-packages --always-copy --python python3 + virtualenv $VENV --no-site-packages --always-copy --python python3 source $VENV/bin/activate DEACTIVE=true fi ### install dependencies -pip install -r $REQUIREMENTS_FILE -r $TEST_REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT ### run tests -pytest || exit 1 +tox || exit 1 ### static analysis of code flake8 --show-source petstore_api/ diff --git a/samples/server/petstore/python-aiohttp/tox.ini b/samples/server/petstore/python-aiohttp/tox.ini new file mode 100644 index 000000000000..0f7cd42b8a8b --- /dev/null +++ b/samples/server/petstore/python-aiohttp/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py3 +skipsdist=True + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=openapi_server \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION index 0c89fc927e32..58592f031f65 100644 --- a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0 \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/app/.gitignore b/samples/server/petstore/python-blueplanet/app/.gitignore index a655050c2631..a77a0ebd1660 100644 --- a/samples/server/petstore/python-blueplanet/app/.gitignore +++ b/samples/server/petstore/python-blueplanet/app/.gitignore @@ -46,6 +46,7 @@ coverage.xml .hypothesis/ venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/server/petstore/python-blueplanet/app/test-requirements.txt b/samples/server/petstore/python-blueplanet/app/test-requirements.txt index 7f8d96e6b40e..a2626d875ff4 100644 --- a/samples/server/petstore/python-blueplanet/app/test-requirements.txt +++ b/samples/server/petstore/python-blueplanet/app/test-requirements.txt @@ -1,6 +1,4 @@ -flask_testing==0.6.1 -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +flask_testing==0.6.1 \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/app/tox.ini b/samples/server/petstore/python-blueplanet/app/tox.ini index 3e0b644eec48..d2eb61d57c7e 100644 --- a/samples/server/petstore/python-blueplanet/app/tox.ini +++ b/samples/server/petstore/python-blueplanet/app/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] \ No newline at end of file + pytest --cov=openapi_server \ No newline at end of file diff --git a/samples/server/petstore/python-flask-python2/.gitignore b/samples/server/petstore/python-flask-python2/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/server/petstore/python-flask-python2/.gitignore +++ b/samples/server/petstore/python-flask-python2/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/server/petstore/python-flask-python2/dev-requirements.txt b/samples/server/petstore/python-flask-python2/dev-requirements.txt new file mode 100644 index 000000000000..ccdfca629494 --- /dev/null +++ b/samples/server/petstore/python-flask-python2/dev-requirements.txt @@ -0,0 +1,2 @@ +tox +flake8 diff --git a/samples/server/petstore/python-flask-python2/pom.xml b/samples/server/petstore/python-flask-python2/pom.xml index 113c387d5f21..430bddf2ed3f 100644 --- a/samples/server/petstore/python-flask-python2/pom.xml +++ b/samples/server/petstore/python-flask-python2/pom.xml @@ -27,7 +27,7 @@ 1.2.1 - nose-test + test integration-test exec diff --git a/samples/server/petstore/python-flask-python2/requirements.txt b/samples/server/petstore/python-flask-python2/requirements.txt index bc5357066229..5c5ce2a1a269 100644 --- a/samples/server/petstore/python-flask-python2/requirements.txt +++ b/samples/server/petstore/python-flask-python2/requirements.txt @@ -1,4 +1,7 @@ -connexion >= 2.0.2 +connexion >= 2.5.0; python_version>="3.6" +connexion >= 2.3.0; python_version=="3.5" +connexion >= 2.3.0; python_version=="3.4" +connexion == 2.4.0; python_version<="2.7" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 typing >= 3.5.2.2 diff --git a/samples/server/petstore/python-flask-python2/test-requirements.txt b/samples/server/petstore/python-flask-python2/test-requirements.txt index 7f8d96e6b40e..a2626d875ff4 100644 --- a/samples/server/petstore/python-flask-python2/test-requirements.txt +++ b/samples/server/petstore/python-flask-python2/test-requirements.txt @@ -1,6 +1,4 @@ -flask_testing==0.6.1 -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +flask_testing==0.6.1 \ No newline at end of file diff --git a/samples/server/petstore/python-flask-python2/test_python2.sh b/samples/server/petstore/python-flask-python2/test_python2.sh index e579f4d7f559..89e56c485dee 100755 --- a/samples/server/petstore/python-flask-python2/test_python2.sh +++ b/samples/server/petstore/python-flask-python2/test_python2.sh @@ -1,7 +1,7 @@ #!/bin/bash -REQUIREMENTS_FILE=test-requirements.txt -REQUIREMENTS_OUT=test-requirements.txt.log +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=.venv DEACTIVE=false @@ -18,15 +18,14 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests -tox || exit 1 +tox -e py27 || exit 1 ### static analysis of code flake8 --show-source petstore_api/ ### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi +# if [ $DEACTIVE == true ]; then +# deactivate +# fi diff --git a/samples/server/petstore/python-flask-python2/tox.ini b/samples/server/petstore/python-flask-python2/tox.ini index 26985414c882..d05c607610ce 100644 --- a/samples/server/petstore/python-flask-python2/tox.ini +++ b/samples/server/petstore/python-flask-python2/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] \ No newline at end of file + pytest --cov=openapi_server \ No newline at end of file diff --git a/samples/server/petstore/python-flask/.gitignore b/samples/server/petstore/python-flask/.gitignore index a655050c2631..43995bd42fa2 100644 --- a/samples/server/petstore/python-flask/.gitignore +++ b/samples/server/petstore/python-flask/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo diff --git a/samples/server/petstore/python-flask/dev-requirements.txt b/samples/server/petstore/python-flask/dev-requirements.txt new file mode 100644 index 000000000000..ccdfca629494 --- /dev/null +++ b/samples/server/petstore/python-flask/dev-requirements.txt @@ -0,0 +1,2 @@ +tox +flake8 diff --git a/samples/server/petstore/python-flask/pom.xml b/samples/server/petstore/python-flask/pom.xml index 2834d92dbc7a..542458a0e48f 100644 --- a/samples/server/petstore/python-flask/pom.xml +++ b/samples/server/petstore/python-flask/pom.xml @@ -27,7 +27,7 @@ 1.2.1 - nose-test + test integration-test exec diff --git a/samples/server/petstore/python-flask/requirements.txt b/samples/server/petstore/python-flask/requirements.txt index 1a01b5804905..029a9dae4cdf 100644 --- a/samples/server/petstore/python-flask/requirements.txt +++ b/samples/server/petstore/python-flask/requirements.txt @@ -1,4 +1,7 @@ -connexion >= 2.0.2 +connexion >= 2.5.0; python_version>="3.6" +connexion >= 2.3.0; python_version=="3.5" +connexion >= 2.3.0; python_version=="3.4" +connexion == 2.4.0; python_version<="2.7" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 setuptools >= 21.0.0 diff --git a/samples/server/petstore/python-flask/test-requirements.txt b/samples/server/petstore/python-flask/test-requirements.txt index 7f8d96e6b40e..a2626d875ff4 100644 --- a/samples/server/petstore/python-flask/test-requirements.txt +++ b/samples/server/petstore/python-flask/test-requirements.txt @@ -1,6 +1,4 @@ -flask_testing==0.6.1 -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +flask_testing==0.6.1 \ No newline at end of file diff --git a/samples/server/petstore/python-flask/test_python3.sh b/samples/server/petstore/python-flask/test_python3.sh index 9bd589401cd3..32fb184fdd83 100755 --- a/samples/server/petstore/python-flask/test_python3.sh +++ b/samples/server/petstore/python-flask/test_python3.sh @@ -1,7 +1,7 @@ #!/bin/bash -REQUIREMENTS_FILE=test-requirements.txt -REQUIREMENTS_OUT=test-requirements.txt.log +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info VENV=.venv DEACTIVE=false @@ -18,7 +18,6 @@ fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT -python setup.py develop ### run tests tox || exit 1 @@ -27,6 +26,6 @@ tox || exit 1 flake8 --show-source petstore_api/ ### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi +# if [ $DEACTIVE == true ]; then +# deactivate +# fi diff --git a/samples/server/petstore/python-flask/tox.ini b/samples/server/petstore/python-flask/tox.ini index ab4dfbb81b8b..cff71191e6cb 100644 --- a/samples/server/petstore/python-flask/tox.ini +++ b/samples/server/petstore/python-flask/tox.ini @@ -6,5 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] \ No newline at end of file + pytest --cov=openapi_server \ No newline at end of file From 04ac754d3e5e2e90bf27ebb230fa881e01bf4949 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Sun, 22 Dec 2019 12:03:22 +0500 Subject: [PATCH 07/28] [Slim4] Add object support to Data Mocker (#4853) * [Slim4] Add new method to Mocker interface * [Slim4] Add tests and implement mockObject method * [Slim4] Accept items as object in mockArray method * [Slim4] Add test for array of objects * [Slim4] Refresh samples * [Slim4] Remove abandoned debug comment * [Slim4] Improve tests code coverage --- .../openapi_data_mocker.mustache | 131 ++++++++-- .../openapi_data_mocker_interface.mustache | 36 ++- .../openapi_data_mocker_test.mustache | 226 ++++++++++++++++-- .../php-slim4/lib/Mock/OpenApiDataMocker.php | 131 ++++++++-- .../lib/Mock/OpenApiDataMockerInterface.php | 36 ++- .../test/Mock/OpenApiDataMockerTest.php | 226 ++++++++++++++++-- 6 files changed, 710 insertions(+), 76 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker.mustache index 80d6cd2e9db8..4a335b5c312c 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker.mustache @@ -34,6 +34,7 @@ namespace {{mockPackage}}; use {{mockPackage}}\{{interfaceNamePrefix}}OpenApiDataMocker{{interfaceNameSuffix}} as IMocker; +use StdClass; use InvalidArgumentException; /** @@ -82,6 +83,13 @@ final class OpenApiDataMocker implements IMocker $maxItems = $options['maxItems'] ?? null; $uniqueItems = $options['uniqueItems'] ?? false; return $this->mockArray($items, $minItems, $maxItems, $uniqueItems); + case IMocker::DATA_TYPE_OBJECT: + $properties = $options['properties'] ?? null; + $minProperties = $options['minProperties'] ?? 0; + $maxProperties = $options['maxProperties'] ?? null; + $additionalProperties = $options['additionalProperties'] ?? null; + $required = $options['required'] ?? null; + return $this->mockObject($properties, $minProperties, $maxProperties, $additionalProperties, $required); default: throw new InvalidArgumentException('"dataType" must be one of ' . implode(', ', [ IMocker::DATA_TYPE_INTEGER, @@ -89,6 +97,7 @@ final class OpenApiDataMocker implements IMocker IMocker::DATA_TYPE_STRING, IMocker::DATA_TYPE_BOOLEAN, IMocker::DATA_TYPE_ARRAY, + IMocker::DATA_TYPE_OBJECT, ])); } } @@ -220,10 +229,10 @@ final class OpenApiDataMocker implements IMocker * Shortcut to mock array type * Equivalent to mockData(DATA_TYPE_ARRAY); * - * @param array $items Array of described items - * @param int|null $minItems (optional) An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. - * @param int|null $maxItems (optional) An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword - * @param bool|null $uniqueItems (optional) If it has boolean value true, the instance validates successfully if all of its elements are unique + * @param object|array $items Object or assoc array of described items + * @param int|null $minItems (optional) An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. + * @param int|null $maxItems (optional) An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword + * @param bool|null $uniqueItems (optional) If it has boolean value true, the instance validates successfully if all of its elements are unique * * @throws \InvalidArgumentException when invalid arguments passed * @@ -239,8 +248,12 @@ final class OpenApiDataMocker implements IMocker $minSize = 0; $maxSize = \PHP_INT_MAX; - if (is_array($items) === false || array_key_exists('type', $items) === false) { - throw new InvalidArgumentException('"items" must be assoc array with "type" key'); + if ( + (is_array($items) === false && is_object($items) === false) + || (is_array($items) && array_key_exists('type', $items) === false) + || (is_object($items) && isset($items->type) === false) + ) { + new InvalidArgumentException('"items" must be object or assoc array with "type" key'); } if ($minItems !== null) { @@ -260,9 +273,9 @@ final class OpenApiDataMocker implements IMocker $maxSize = $maxItems; } - $dataType = $items['type']; - $dataFormat = $items['format'] ?? null; $options = $this->extractSchemaProperties($items); + $dataType = $options['type']; + $dataFormat = $options['format'] ?? null; // always genarate smallest possible array to avoid huge JSON responses $arrSize = ($maxSize < 1) ? $maxSize : max($minSize, 1); @@ -273,17 +286,104 @@ final class OpenApiDataMocker implements IMocker } /** - * @internal Extract OAS properties from array or object. + * Shortcut to mock object type. + * Equivalent to mockData(DATA_TYPE_OBJECT); * - * @param array $arr Processed array + * @param object|array $properties Object or array of described properties + * @param int|null $minProperties (optional) An object instance is valid against "minProperties" if its number of properties is greater than, or equal to, the value of this keyword. + * @param int|null $maxProperties (optional) An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. + * @param bool|object|array|null $additionalProperties (optional) If "additionalProperties" is true, validation always succeeds. + * If "additionalProperties" is false, validation succeeds only if the instance is an object and all properties on the instance were covered by "properties" and/or "patternProperties". + * If "additionalProperties" is an object, validate the value as a schema to all of the properties that weren't validated by "properties" nor "patternProperties". + * @param array|null $required (optional) This array MUST have at least one element. Elements of this array must be strings, and MUST be unique. + * An object instance is valid if its property set contains all elements in this array value. + * + * @throws \InvalidArgumentException when invalid arguments passed + * + * @return object + */ + public function mockObject( + $properties, + $minProperties = 0, + $maxProperties = null, + $additionalProperties = null, + $required = null + ) { + $obj = new StdClass(); + + if (is_object($properties) === false && is_array($properties) === false) { + throw new InvalidArgumentException('The value of "properties" must be an array or object'); + } + + foreach ($properties as $propName => $propValue) { + if (is_object($propValue) === false && is_array($propValue) === false) { + throw new InvalidArgumentException('Each value of "properties" must be an array or object'); + } + } + + if ($minProperties !== null) { + if (is_integer($minProperties) === false || $minProperties < 0) { + throw new InvalidArgumentException('"minProperties" must be an integer. This integer must be greater than, or equal to, 0'); + } + } + + if ($maxProperties !== null) { + if (is_integer($maxProperties) === false || $maxProperties < 0) { + throw new InvalidArgumentException('"maxProperties" must be an integer. This integer must be greater than, or equal to, 0.'); + } + if ($maxProperties < $minProperties) { + throw new InvalidArgumentException('"maxProperties" value cannot be less than "minProperties"'); + } + } + + if ($additionalProperties !== null) { + if (is_bool($additionalProperties) === false && is_object($additionalProperties) === false && is_array($additionalProperties) === false) { + throw new InvalidArgumentException('The value of "additionalProperties" must be a boolean or object or array.'); + } + } + + if ($required !== null) { + if ( + is_array($required) === false + || count($required) > count(array_unique($required)) + ) { + throw new InvalidArgumentException('The value of "required" must be an array. Elements of this array must be unique.'); + } + foreach ($required as $requiredPropName) { + if (is_string($requiredPropName) === false) { + throw new InvalidArgumentException('Elements of "required" array must be strings'); + } + } + } + + foreach ($properties as $propName => $propValue) { + $options = $this->extractSchemaProperties($propValue); + $dataType = $options['type']; + $dataFormat = $options['dataFormat'] ?? null; + $obj->$propName = $this->mock($dataType, $dataFormat, $options); + } + + return $obj; + } + + /** + * @internal Extract OAS properties from array or object. + * @codeCoverageIgnore + * + * @param array|object $val Processed array or object * * @return array */ - private function extractSchemaProperties($arr) + private function extractSchemaProperties($val) { - $props = []; + $props = [ + 'type' => null, + 'format' => null, + ]; foreach ( [ + 'type', + 'format', 'minimum', 'maximum', 'exclusiveMinimum', @@ -304,8 +404,10 @@ final class OpenApiDataMocker implements IMocker 'example', ] as $propName ) { - if (array_key_exists($propName, $arr)) { - $props[$propName] = $arr[$propName]; + if (is_array($val) && array_key_exists($propName, $val)) { + $props[$propName] = $val[$propName]; + } elseif (is_object($val) && isset($val->$propName)) { + $props[$propName] = $val->$propName; } } return $props; @@ -313,6 +415,7 @@ final class OpenApiDataMocker implements IMocker /** * @internal + * @codeCoverageIgnore * * @return float|int */ diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_interface.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_interface.mustache index e94d55f1afd9..cbed4323a220 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_interface.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_interface.mustache @@ -63,6 +63,9 @@ interface {{interfaceNamePrefix}}OpenApiDataMocker{{interfaceNameSuffix}} /** @var string DATA_TYPE_ARRAY */ public const DATA_TYPE_ARRAY = 'array'; + /** @var string DATA_TYPE_OBJECT */ + public const DATA_TYPE_OBJECT = 'object'; + /** @var string DATA_FORMAT_INT32 Signed 32 bits */ public const DATA_FORMAT_INT32 = 'int32'; @@ -194,10 +197,10 @@ interface {{interfaceNamePrefix}}OpenApiDataMocker{{interfaceNameSuffix}} * Shortcut to mock array type * Equivalent to mockData(DATA_TYPE_ARRAY); * - * @param array $items Array of described items - * @param int|null $minItems (optional) An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. - * @param int|null $maxItems (optional) An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword - * @param bool|null $uniqueItems (optional) If it has boolean value true, the instance validates successfully if all of its elements are unique + * @param object|array $items Object or assoc array of described items + * @param int|null $minItems (optional) An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. + * @param int|null $maxItems (optional) An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword + * @param bool|null $uniqueItems (optional) If it has boolean value true, the instance validates successfully if all of its elements are unique * * @throws \InvalidArgumentException when invalid arguments passed * @@ -209,5 +212,30 @@ interface {{interfaceNamePrefix}}OpenApiDataMocker{{interfaceNameSuffix}} $maxItems = null, $uniqueItems = false ); + + /** + * Shortcut to mock object type. + * Equivalent to mockData(DATA_TYPE_OBJECT); + * + * @param object|array $properties Object or array of described properties + * @param int|null $minProperties (optional) An object instance is valid against "minProperties" if its number of properties is greater than, or equal to, the value of this keyword. + * @param int|null $maxProperties (optional) An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. + * @param bool|object|array|null $additionalProperties (optional) If "additionalProperties" is true, validation always succeeds. + * If "additionalProperties" is false, validation succeeds only if the instance is an object and all properties on the instance were covered by "properties" and/or "patternProperties". + * If "additionalProperties" is an object, validate the value as a schema to all of the properties that weren't validated by "properties" nor "patternProperties". + * @param array|null $required (optional) This array MUST have at least one element. Elements of this array must be strings, and MUST be unique. + * An object instance is valid if its property set contains all elements in this array value. + * + * @throws \InvalidArgumentException when invalid arguments passed + * + * @return object + */ + public function mockObject( + $properties, + $minProperties = 0, + $maxProperties = null, + $additionalProperties = null, + $required = null + ); } {{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_test.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_test.mustache index eef16fffd935..53a700bed733 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_test.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_test.mustache @@ -37,6 +37,7 @@ use {{mockPackage}}\OpenApiDataMocker; use {{mockPackage}}\{{interfaceNamePrefix}}OpenApiDataMocker{{interfaceNameSuffix}} as IMocker; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Constraint\IsType; +use StdClass; /** * OpenApiDataMockerTest Class Doc Comment @@ -55,7 +56,8 @@ class OpenApiDataMockerTest extends TestCase public function testMockCorrectArguments($dataType, $dataFormat, $options, $expectedType) { $mocker = new OpenApiDataMocker(); - $this->assertInternalType($expectedType, $mocker->mock($dataType)); + $data = $mocker->mock($dataType, $dataFormat, $options); + $this->assertInternalType($expectedType, $data); } public function provideMockCorrectArguments() @@ -65,6 +67,39 @@ class OpenApiDataMockerTest extends TestCase [IMocker::DATA_TYPE_NUMBER, null, null, IsType::TYPE_FLOAT], [IMocker::DATA_TYPE_STRING, null, null, IsType::TYPE_STRING], [IMocker::DATA_TYPE_BOOLEAN, null, null, IsType::TYPE_BOOL], + [IMocker::DATA_TYPE_ARRAY, null, [ + 'items' => [ + 'type' => IMocker::DATA_TYPE_INTEGER, + ], + ], IsType::TYPE_ARRAY], + [IMocker::DATA_TYPE_OBJECT, null, [ + 'properties' => [ + 'username' => [ + 'type' => IMocker::DATA_TYPE_INTEGER, + ], + ], + ], IsType::TYPE_OBJECT], + ]; + } + + /** + * @covers ::mock + * @dataProvider provideMockInvalidArguments + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage "dataType" must be one of integer, number, string, boolean, array, object + */ + public function testMockInvalidArguments($dataType, $dataFormat, $options) + { + $mocker = new OpenApiDataMocker(); + $data = $mocker->mock($dataType, $dataFormat, $options); + } + + public function provideMockInvalidArguments() + { + return [ + ['foobar', null, null], + [3.14, null, null], + [null, null, null], ]; } @@ -440,28 +475,54 @@ class OpenApiDataMockerTest extends TestCase $this->assertContainsOnly($expectedItemsType, $arr, true); } - $dataFormat = $items['dataFormat'] ?? null; + if (is_array($items)) { + $dataType = $items['type']; + $dataFormat = $items['dataFormat'] ?? null; - // items field numeric properties - $minimum = $items['minimum'] ?? null; - $maximum = $items['maximum'] ?? null; - $exclusiveMinimum = $items['exclusiveMinimum'] ?? null; - $exclusiveMaximum = $items['exclusiveMaximum'] ?? null; + // items field numeric properties + $minimum = $items['minimum'] ?? null; + $maximum = $items['maximum'] ?? null; + $exclusiveMinimum = $items['exclusiveMinimum'] ?? null; + $exclusiveMaximum = $items['exclusiveMaximum'] ?? null; - // items field string properties - $minLength = $items['minLength'] ?? null; - $maxLength = $items['maxLength'] ?? null; - $enum = $items['enum'] ?? null; - $pattern = $items['pattern'] ?? null; + // items field string properties + $minLength = $items['minLength'] ?? null; + $maxLength = $items['maxLength'] ?? null; + $enum = $items['enum'] ?? null; + $pattern = $items['pattern'] ?? null; - // items field array properties - $subItems = $items['items'] ?? null; - $subMinItems = $items['minItems'] ?? null; - $subMaxItems = $items['maxItems'] ?? null; - $subUniqueItems = $items['uniqueItems'] ?? null; + // items field array properties + $subItems = $items['items'] ?? null; + $subMinItems = $items['minItems'] ?? null; + $subMaxItems = $items['maxItems'] ?? null; + $subUniqueItems = $items['uniqueItems'] ?? null; + } else { + // is object + $dataType = $items->type; + $dataFormat = $items->dataFormat ?? null; + + // items field numeric properties + $minimum = $items->minimum ?? null; + $maximum = $items->maximum ?? null; + $exclusiveMinimum = $items->exclusiveMinimum ?? null; + $exclusiveMaximum = $items->exclusiveMaximum ?? null; + + // items field string properties + $minLength = $items->minLength ?? null; + $maxLength = $items->maxLength ?? null; + $enum = $items->enum ?? null; + $pattern = $items->pattern ?? null; + + // items field array properties + $subItems = $items->items ?? null; + $subMinItems = $items->minItems ?? null; + $subMaxItems = $items->maxItems ?? null; + $subUniqueItems = $items->uniqueItems ?? null; + } + foreach ($arr as $item) { - switch ($items['type']) { + switch ($dataType) { case IMocker::DATA_TYPE_INTEGER: $this->internalAssertNumber($item, $minimum, $maximum, $exclusiveMinimum, $exclusiveMaximum); break; @@ -486,13 +547,15 @@ class OpenApiDataMockerTest extends TestCase $intItems = ['type' => IMocker::DATA_TYPE_INTEGER, 'minimum' => 5, 'maximum' => 10]; $floatItems = ['type' => IMocker::DATA_TYPE_NUMBER, 'minimum' => -32.4, 'maximum' => 88.6, 'exclusiveMinimum' => true, 'exclusiveMaximum' => true]; $strItems = ['type' => IMocker::DATA_TYPE_STRING, 'minLength' => 20, 'maxLength' => 50]; - $boolItems = ['type' => IMocker::DATA_TYPE_BOOLEAN]; - $arrayItems = ['type' => IMocker::DATA_TYPE_ARRAY, 'items' => ['type' => IMocker::DATA_TYPE_STRING, 'minItems' => 3, 'maxItems' => 10]]; + $boolItems = (object) ['type' => IMocker::DATA_TYPE_BOOLEAN]; + $arrayItems = (object) ['type' => IMocker::DATA_TYPE_ARRAY, 'items' => ['type' => IMocker::DATA_TYPE_STRING, 'minItems' => 3, 'maxItems' => 10]]; + $objectItems = (object) ['type' => IMocker::DATA_TYPE_OBJECT, 'properties' => (object)['username' => ['type' => IMocker::DATA_TYPE_STRING]]]; $expectedInt = IsType::TYPE_INT; $expectedFloat = IsType::TYPE_FLOAT; $expectedStr = IsType::TYPE_STRING; $expectedBool = IsType::TYPE_BOOL; $expectedArray = IsType::TYPE_ARRAY; + $expectedObject = IsType::TYPE_OBJECT; return [ 'empty array' => [ @@ -531,6 +594,9 @@ class OpenApiDataMockerTest extends TestCase 'array of one array of strings' => [ $arrayItems, null, null, false, $expectedArray, 1, ], + 'array of one object' => [ + $objectItems, null, null, false, $expectedObject, 1 + ], ]; } @@ -583,5 +649,125 @@ class OpenApiDataMockerTest extends TestCase ], ]; } + + /** + * @dataProvider provideMockObjectCorrectArguments + * @covers ::mockObject + */ + public function testMockObjectWithCorrectArguments( + $properties, + $minProperties, + $maxProperties, + $additionalProperties, + $required, + $expectedKeys + ) { + $mocker = new OpenApiDataMocker(); + $obj = $mocker->mockObject( + $properties, + $minProperties, + $maxProperties, + $additionalProperties, + $required + ); + + $this->assertInternalType(IsType::TYPE_OBJECT, $obj); + $this->assertSame($expectedKeys, array_keys(get_object_vars($obj))); + } + + public function provideMockObjectCorrectArguments() + { + $additionProps = [ + 'extra' => [ + 'type' => IMocker::DATA_TYPE_STRING, + ], + ]; + return [ + 'empty object' => [ + [], 1, 10, true, null, [], + ], + 'empty object from StdClass' => [ + new StdClass(), 1, 5, false, null, [], + ], + 'object with username property' => [ + [ + 'username' => [ + 'type' => IMocker::DATA_TYPE_STRING, + ], + ], 0, 5, $additionProps, null, ['username'], + ], + 'object with foobar property' => [ + (object) [ + 'foobar' => [ + 'type' => IMocker::DATA_TYPE_INTEGER, + ], + ], 1, 1, (object) $additionProps, null, ['foobar'], + ], + ]; + } + + /** + * @dataProvider provideMockObjectInvalidArguments + * @expectedException \InvalidArgumentException + * @covers ::mockObject + */ + public function testMockObjectWithInvalidArguments( + $properties, + $minProperties, + $maxProperties, + $additionalProperties, + $required + ) { + $mocker = new OpenApiDataMocker(); + $obj = $mocker->mockObject($properties, $minProperties, $maxProperties, $additionalProperties, $required); + } + + public function provideMockObjectInvalidArguments() + { + return [ + 'properties cannot be null' => [ + null, 0, 10, false, null, + ], + 'properties cannot be a string' => [ + 'foobar', 0, 10, false, null, + ], + 'minProperties is not integer' => [ + [], 3.12, null, false, null, + ], + 'minProperties is negative' => [ + [], -10, null, false, null, + ], + 'minProperties is not number' => [ + [], '1', null, false, null, + ], + 'maxProperties is not integer' => [ + [], null, 3.12, false, null, + ], + 'maxProperties is negative' => [ + [], null, -10, false, null, + ], + 'maxProperties is not number' => [ + [], null, 'foobaz', false, null, + ], + 'maxProperties less than minProperties' => [ + [], 5, 2, false, null, + ], + 'additionalProperties is not object|array|boolean' => [ + [], null, null, 'foobar', null, + ], + 'required is object, not array' => [ + [], null, null, null, new StdClass(), + ], + 'required is not array' => [ + [], null, null, null, 'foobar', + ], + 'required array with duplicates' => [ + [], null, null, null, ['username', 'username'], + ], + 'required array of non-strings' => [ + [], null, null, null, [1, 2, 3], + ], + ]; + } } {{/apiInfo}} diff --git a/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMocker.php b/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMocker.php index fe0b10f2db70..a780debbdb8f 100644 --- a/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMocker.php +++ b/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMocker.php @@ -26,6 +26,7 @@ namespace OpenAPIServer\Mock; use OpenAPIServer\Mock\OpenApiDataMockerInterface as IMocker; +use StdClass; use InvalidArgumentException; /** @@ -74,6 +75,13 @@ final class OpenApiDataMocker implements IMocker $maxItems = $options['maxItems'] ?? null; $uniqueItems = $options['uniqueItems'] ?? false; return $this->mockArray($items, $minItems, $maxItems, $uniqueItems); + case IMocker::DATA_TYPE_OBJECT: + $properties = $options['properties'] ?? null; + $minProperties = $options['minProperties'] ?? 0; + $maxProperties = $options['maxProperties'] ?? null; + $additionalProperties = $options['additionalProperties'] ?? null; + $required = $options['required'] ?? null; + return $this->mockObject($properties, $minProperties, $maxProperties, $additionalProperties, $required); default: throw new InvalidArgumentException('"dataType" must be one of ' . implode(', ', [ IMocker::DATA_TYPE_INTEGER, @@ -81,6 +89,7 @@ final class OpenApiDataMocker implements IMocker IMocker::DATA_TYPE_STRING, IMocker::DATA_TYPE_BOOLEAN, IMocker::DATA_TYPE_ARRAY, + IMocker::DATA_TYPE_OBJECT, ])); } } @@ -212,10 +221,10 @@ final class OpenApiDataMocker implements IMocker * Shortcut to mock array type * Equivalent to mockData(DATA_TYPE_ARRAY); * - * @param array $items Array of described items - * @param int|null $minItems (optional) An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. - * @param int|null $maxItems (optional) An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword - * @param bool|null $uniqueItems (optional) If it has boolean value true, the instance validates successfully if all of its elements are unique + * @param object|array $items Object or assoc array of described items + * @param int|null $minItems (optional) An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. + * @param int|null $maxItems (optional) An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword + * @param bool|null $uniqueItems (optional) If it has boolean value true, the instance validates successfully if all of its elements are unique * * @throws \InvalidArgumentException when invalid arguments passed * @@ -231,8 +240,12 @@ final class OpenApiDataMocker implements IMocker $minSize = 0; $maxSize = \PHP_INT_MAX; - if (is_array($items) === false || array_key_exists('type', $items) === false) { - throw new InvalidArgumentException('"items" must be assoc array with "type" key'); + if ( + (is_array($items) === false && is_object($items) === false) + || (is_array($items) && array_key_exists('type', $items) === false) + || (is_object($items) && isset($items->type) === false) + ) { + new InvalidArgumentException('"items" must be object or assoc array with "type" key'); } if ($minItems !== null) { @@ -252,9 +265,9 @@ final class OpenApiDataMocker implements IMocker $maxSize = $maxItems; } - $dataType = $items['type']; - $dataFormat = $items['format'] ?? null; $options = $this->extractSchemaProperties($items); + $dataType = $options['type']; + $dataFormat = $options['format'] ?? null; // always genarate smallest possible array to avoid huge JSON responses $arrSize = ($maxSize < 1) ? $maxSize : max($minSize, 1); @@ -265,17 +278,104 @@ final class OpenApiDataMocker implements IMocker } /** - * @internal Extract OAS properties from array or object. + * Shortcut to mock object type. + * Equivalent to mockData(DATA_TYPE_OBJECT); * - * @param array $arr Processed array + * @param object|array $properties Object or array of described properties + * @param int|null $minProperties (optional) An object instance is valid against "minProperties" if its number of properties is greater than, or equal to, the value of this keyword. + * @param int|null $maxProperties (optional) An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. + * @param bool|object|array|null $additionalProperties (optional) If "additionalProperties" is true, validation always succeeds. + * If "additionalProperties" is false, validation succeeds only if the instance is an object and all properties on the instance were covered by "properties" and/or "patternProperties". + * If "additionalProperties" is an object, validate the value as a schema to all of the properties that weren't validated by "properties" nor "patternProperties". + * @param array|null $required (optional) This array MUST have at least one element. Elements of this array must be strings, and MUST be unique. + * An object instance is valid if its property set contains all elements in this array value. + * + * @throws \InvalidArgumentException when invalid arguments passed + * + * @return object + */ + public function mockObject( + $properties, + $minProperties = 0, + $maxProperties = null, + $additionalProperties = null, + $required = null + ) { + $obj = new StdClass(); + + if (is_object($properties) === false && is_array($properties) === false) { + throw new InvalidArgumentException('The value of "properties" must be an array or object'); + } + + foreach ($properties as $propName => $propValue) { + if (is_object($propValue) === false && is_array($propValue) === false) { + throw new InvalidArgumentException('Each value of "properties" must be an array or object'); + } + } + + if ($minProperties !== null) { + if (is_integer($minProperties) === false || $minProperties < 0) { + throw new InvalidArgumentException('"minProperties" must be an integer. This integer must be greater than, or equal to, 0'); + } + } + + if ($maxProperties !== null) { + if (is_integer($maxProperties) === false || $maxProperties < 0) { + throw new InvalidArgumentException('"maxProperties" must be an integer. This integer must be greater than, or equal to, 0.'); + } + if ($maxProperties < $minProperties) { + throw new InvalidArgumentException('"maxProperties" value cannot be less than "minProperties"'); + } + } + + if ($additionalProperties !== null) { + if (is_bool($additionalProperties) === false && is_object($additionalProperties) === false && is_array($additionalProperties) === false) { + throw new InvalidArgumentException('The value of "additionalProperties" must be a boolean or object or array.'); + } + } + + if ($required !== null) { + if ( + is_array($required) === false + || count($required) > count(array_unique($required)) + ) { + throw new InvalidArgumentException('The value of "required" must be an array. Elements of this array must be unique.'); + } + foreach ($required as $requiredPropName) { + if (is_string($requiredPropName) === false) { + throw new InvalidArgumentException('Elements of "required" array must be strings'); + } + } + } + + foreach ($properties as $propName => $propValue) { + $options = $this->extractSchemaProperties($propValue); + $dataType = $options['type']; + $dataFormat = $options['dataFormat'] ?? null; + $obj->$propName = $this->mock($dataType, $dataFormat, $options); + } + + return $obj; + } + + /** + * @internal Extract OAS properties from array or object. + * @codeCoverageIgnore + * + * @param array|object $val Processed array or object * * @return array */ - private function extractSchemaProperties($arr) + private function extractSchemaProperties($val) { - $props = []; + $props = [ + 'type' => null, + 'format' => null, + ]; foreach ( [ + 'type', + 'format', 'minimum', 'maximum', 'exclusiveMinimum', @@ -296,8 +396,10 @@ final class OpenApiDataMocker implements IMocker 'example', ] as $propName ) { - if (array_key_exists($propName, $arr)) { - $props[$propName] = $arr[$propName]; + if (is_array($val) && array_key_exists($propName, $val)) { + $props[$propName] = $val[$propName]; + } elseif (is_object($val) && isset($val->$propName)) { + $props[$propName] = $val->$propName; } } return $props; @@ -305,6 +407,7 @@ final class OpenApiDataMocker implements IMocker /** * @internal + * @codeCoverageIgnore * * @return float|int */ diff --git a/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMockerInterface.php b/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMockerInterface.php index fc6e28986d72..78fd9a859a56 100644 --- a/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMockerInterface.php +++ b/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMockerInterface.php @@ -55,6 +55,9 @@ interface OpenApiDataMockerInterface /** @var string DATA_TYPE_ARRAY */ public const DATA_TYPE_ARRAY = 'array'; + /** @var string DATA_TYPE_OBJECT */ + public const DATA_TYPE_OBJECT = 'object'; + /** @var string DATA_FORMAT_INT32 Signed 32 bits */ public const DATA_FORMAT_INT32 = 'int32'; @@ -186,10 +189,10 @@ interface OpenApiDataMockerInterface * Shortcut to mock array type * Equivalent to mockData(DATA_TYPE_ARRAY); * - * @param array $items Array of described items - * @param int|null $minItems (optional) An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. - * @param int|null $maxItems (optional) An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword - * @param bool|null $uniqueItems (optional) If it has boolean value true, the instance validates successfully if all of its elements are unique + * @param object|array $items Object or assoc array of described items + * @param int|null $minItems (optional) An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. + * @param int|null $maxItems (optional) An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword + * @param bool|null $uniqueItems (optional) If it has boolean value true, the instance validates successfully if all of its elements are unique * * @throws \InvalidArgumentException when invalid arguments passed * @@ -201,4 +204,29 @@ interface OpenApiDataMockerInterface $maxItems = null, $uniqueItems = false ); + + /** + * Shortcut to mock object type. + * Equivalent to mockData(DATA_TYPE_OBJECT); + * + * @param object|array $properties Object or array of described properties + * @param int|null $minProperties (optional) An object instance is valid against "minProperties" if its number of properties is greater than, or equal to, the value of this keyword. + * @param int|null $maxProperties (optional) An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. + * @param bool|object|array|null $additionalProperties (optional) If "additionalProperties" is true, validation always succeeds. + * If "additionalProperties" is false, validation succeeds only if the instance is an object and all properties on the instance were covered by "properties" and/or "patternProperties". + * If "additionalProperties" is an object, validate the value as a schema to all of the properties that weren't validated by "properties" nor "patternProperties". + * @param array|null $required (optional) This array MUST have at least one element. Elements of this array must be strings, and MUST be unique. + * An object instance is valid if its property set contains all elements in this array value. + * + * @throws \InvalidArgumentException when invalid arguments passed + * + * @return object + */ + public function mockObject( + $properties, + $minProperties = 0, + $maxProperties = null, + $additionalProperties = null, + $required = null + ); } diff --git a/samples/server/petstore/php-slim4/test/Mock/OpenApiDataMockerTest.php b/samples/server/petstore/php-slim4/test/Mock/OpenApiDataMockerTest.php index 221e6c6bf662..2b925cddeffc 100644 --- a/samples/server/petstore/php-slim4/test/Mock/OpenApiDataMockerTest.php +++ b/samples/server/petstore/php-slim4/test/Mock/OpenApiDataMockerTest.php @@ -29,6 +29,7 @@ use OpenAPIServer\Mock\OpenApiDataMocker; use OpenAPIServer\Mock\OpenApiDataMockerInterface as IMocker; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Constraint\IsType; +use StdClass; /** * OpenApiDataMockerTest Class Doc Comment @@ -47,7 +48,8 @@ class OpenApiDataMockerTest extends TestCase public function testMockCorrectArguments($dataType, $dataFormat, $options, $expectedType) { $mocker = new OpenApiDataMocker(); - $this->assertInternalType($expectedType, $mocker->mock($dataType)); + $data = $mocker->mock($dataType, $dataFormat, $options); + $this->assertInternalType($expectedType, $data); } public function provideMockCorrectArguments() @@ -57,6 +59,39 @@ class OpenApiDataMockerTest extends TestCase [IMocker::DATA_TYPE_NUMBER, null, null, IsType::TYPE_FLOAT], [IMocker::DATA_TYPE_STRING, null, null, IsType::TYPE_STRING], [IMocker::DATA_TYPE_BOOLEAN, null, null, IsType::TYPE_BOOL], + [IMocker::DATA_TYPE_ARRAY, null, [ + 'items' => [ + 'type' => IMocker::DATA_TYPE_INTEGER, + ], + ], IsType::TYPE_ARRAY], + [IMocker::DATA_TYPE_OBJECT, null, [ + 'properties' => [ + 'username' => [ + 'type' => IMocker::DATA_TYPE_INTEGER, + ], + ], + ], IsType::TYPE_OBJECT], + ]; + } + + /** + * @covers ::mock + * @dataProvider provideMockInvalidArguments + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage "dataType" must be one of integer, number, string, boolean, array, object + */ + public function testMockInvalidArguments($dataType, $dataFormat, $options) + { + $mocker = new OpenApiDataMocker(); + $data = $mocker->mock($dataType, $dataFormat, $options); + } + + public function provideMockInvalidArguments() + { + return [ + ['foobar', null, null], + [3.14, null, null], + [null, null, null], ]; } @@ -432,28 +467,54 @@ class OpenApiDataMockerTest extends TestCase $this->assertContainsOnly($expectedItemsType, $arr, true); } - $dataFormat = $items['dataFormat'] ?? null; + if (is_array($items)) { + $dataType = $items['type']; + $dataFormat = $items['dataFormat'] ?? null; - // items field numeric properties - $minimum = $items['minimum'] ?? null; - $maximum = $items['maximum'] ?? null; - $exclusiveMinimum = $items['exclusiveMinimum'] ?? null; - $exclusiveMaximum = $items['exclusiveMaximum'] ?? null; + // items field numeric properties + $minimum = $items['minimum'] ?? null; + $maximum = $items['maximum'] ?? null; + $exclusiveMinimum = $items['exclusiveMinimum'] ?? null; + $exclusiveMaximum = $items['exclusiveMaximum'] ?? null; - // items field string properties - $minLength = $items['minLength'] ?? null; - $maxLength = $items['maxLength'] ?? null; - $enum = $items['enum'] ?? null; - $pattern = $items['pattern'] ?? null; + // items field string properties + $minLength = $items['minLength'] ?? null; + $maxLength = $items['maxLength'] ?? null; + $enum = $items['enum'] ?? null; + $pattern = $items['pattern'] ?? null; - // items field array properties - $subItems = $items['items'] ?? null; - $subMinItems = $items['minItems'] ?? null; - $subMaxItems = $items['maxItems'] ?? null; - $subUniqueItems = $items['uniqueItems'] ?? null; + // items field array properties + $subItems = $items['items'] ?? null; + $subMinItems = $items['minItems'] ?? null; + $subMaxItems = $items['maxItems'] ?? null; + $subUniqueItems = $items['uniqueItems'] ?? null; + } else { + // is object + $dataType = $items->type; + $dataFormat = $items->dataFormat ?? null; + + // items field numeric properties + $minimum = $items->minimum ?? null; + $maximum = $items->maximum ?? null; + $exclusiveMinimum = $items->exclusiveMinimum ?? null; + $exclusiveMaximum = $items->exclusiveMaximum ?? null; + + // items field string properties + $minLength = $items->minLength ?? null; + $maxLength = $items->maxLength ?? null; + $enum = $items->enum ?? null; + $pattern = $items->pattern ?? null; + + // items field array properties + $subItems = $items->items ?? null; + $subMinItems = $items->minItems ?? null; + $subMaxItems = $items->maxItems ?? null; + $subUniqueItems = $items->uniqueItems ?? null; + } + foreach ($arr as $item) { - switch ($items['type']) { + switch ($dataType) { case IMocker::DATA_TYPE_INTEGER: $this->internalAssertNumber($item, $minimum, $maximum, $exclusiveMinimum, $exclusiveMaximum); break; @@ -478,13 +539,15 @@ class OpenApiDataMockerTest extends TestCase $intItems = ['type' => IMocker::DATA_TYPE_INTEGER, 'minimum' => 5, 'maximum' => 10]; $floatItems = ['type' => IMocker::DATA_TYPE_NUMBER, 'minimum' => -32.4, 'maximum' => 88.6, 'exclusiveMinimum' => true, 'exclusiveMaximum' => true]; $strItems = ['type' => IMocker::DATA_TYPE_STRING, 'minLength' => 20, 'maxLength' => 50]; - $boolItems = ['type' => IMocker::DATA_TYPE_BOOLEAN]; - $arrayItems = ['type' => IMocker::DATA_TYPE_ARRAY, 'items' => ['type' => IMocker::DATA_TYPE_STRING, 'minItems' => 3, 'maxItems' => 10]]; + $boolItems = (object) ['type' => IMocker::DATA_TYPE_BOOLEAN]; + $arrayItems = (object) ['type' => IMocker::DATA_TYPE_ARRAY, 'items' => ['type' => IMocker::DATA_TYPE_STRING, 'minItems' => 3, 'maxItems' => 10]]; + $objectItems = (object) ['type' => IMocker::DATA_TYPE_OBJECT, 'properties' => (object)['username' => ['type' => IMocker::DATA_TYPE_STRING]]]; $expectedInt = IsType::TYPE_INT; $expectedFloat = IsType::TYPE_FLOAT; $expectedStr = IsType::TYPE_STRING; $expectedBool = IsType::TYPE_BOOL; $expectedArray = IsType::TYPE_ARRAY; + $expectedObject = IsType::TYPE_OBJECT; return [ 'empty array' => [ @@ -523,6 +586,9 @@ class OpenApiDataMockerTest extends TestCase 'array of one array of strings' => [ $arrayItems, null, null, false, $expectedArray, 1, ], + 'array of one object' => [ + $objectItems, null, null, false, $expectedObject, 1 + ], ]; } @@ -575,4 +641,124 @@ class OpenApiDataMockerTest extends TestCase ], ]; } + + /** + * @dataProvider provideMockObjectCorrectArguments + * @covers ::mockObject + */ + public function testMockObjectWithCorrectArguments( + $properties, + $minProperties, + $maxProperties, + $additionalProperties, + $required, + $expectedKeys + ) { + $mocker = new OpenApiDataMocker(); + $obj = $mocker->mockObject( + $properties, + $minProperties, + $maxProperties, + $additionalProperties, + $required + ); + + $this->assertInternalType(IsType::TYPE_OBJECT, $obj); + $this->assertSame($expectedKeys, array_keys(get_object_vars($obj))); + } + + public function provideMockObjectCorrectArguments() + { + $additionProps = [ + 'extra' => [ + 'type' => IMocker::DATA_TYPE_STRING, + ], + ]; + return [ + 'empty object' => [ + [], 1, 10, true, null, [], + ], + 'empty object from StdClass' => [ + new StdClass(), 1, 5, false, null, [], + ], + 'object with username property' => [ + [ + 'username' => [ + 'type' => IMocker::DATA_TYPE_STRING, + ], + ], 0, 5, $additionProps, null, ['username'], + ], + 'object with foobar property' => [ + (object) [ + 'foobar' => [ + 'type' => IMocker::DATA_TYPE_INTEGER, + ], + ], 1, 1, (object) $additionProps, null, ['foobar'], + ], + ]; + } + + /** + * @dataProvider provideMockObjectInvalidArguments + * @expectedException \InvalidArgumentException + * @covers ::mockObject + */ + public function testMockObjectWithInvalidArguments( + $properties, + $minProperties, + $maxProperties, + $additionalProperties, + $required + ) { + $mocker = new OpenApiDataMocker(); + $obj = $mocker->mockObject($properties, $minProperties, $maxProperties, $additionalProperties, $required); + } + + public function provideMockObjectInvalidArguments() + { + return [ + 'properties cannot be null' => [ + null, 0, 10, false, null, + ], + 'properties cannot be a string' => [ + 'foobar', 0, 10, false, null, + ], + 'minProperties is not integer' => [ + [], 3.12, null, false, null, + ], + 'minProperties is negative' => [ + [], -10, null, false, null, + ], + 'minProperties is not number' => [ + [], '1', null, false, null, + ], + 'maxProperties is not integer' => [ + [], null, 3.12, false, null, + ], + 'maxProperties is negative' => [ + [], null, -10, false, null, + ], + 'maxProperties is not number' => [ + [], null, 'foobaz', false, null, + ], + 'maxProperties less than minProperties' => [ + [], 5, 2, false, null, + ], + 'additionalProperties is not object|array|boolean' => [ + [], null, null, 'foobar', null, + ], + 'required is object, not array' => [ + [], null, null, null, new StdClass(), + ], + 'required is not array' => [ + [], null, null, null, 'foobar', + ], + 'required array with duplicates' => [ + [], null, null, null, ['username', 'username'], + ], + 'required array of non-strings' => [ + [], null, null, null, [1, 2, 3], + ], + ]; + } } From ca4f71874859c19c624d11e82bb37fc7cef6f5e9 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Sun, 22 Dec 2019 12:04:30 +0500 Subject: [PATCH 08/28] [Slim4] Add ModelUtils and StringUtils (#4855) * [Slim4] Add StringUtils and ModelUtils classes * [Slim4] Refresh samples --- .../languages/PhpSlim4ServerCodegen.java | 17 ++- .../php-slim4-server/composer.mustache | 4 +- .../model_utils_trait.mustache | 132 ++++++++++++++++ .../model_utils_trait_test.mustache | 111 ++++++++++++++ .../php-slim4-server/phpunit.xml.mustache | 4 + .../string_utils_trait.mustache | 141 ++++++++++++++++++ .../string_utils_trait_test.mustache | 108 ++++++++++++++ .../server/petstore/php-slim4/composer.json | 4 +- .../php-slim4/lib/Utils/ModelUtilsTrait.php | 123 +++++++++++++++ .../php-slim4/lib/Utils/StringUtilsTrait.php | 132 ++++++++++++++++ .../petstore/php-slim4/phpunit.xml.dist | 4 + .../test/Utils/ModelUtilsTraitTest.php | 102 +++++++++++++ .../test/Utils/StringUtilsTraitTest.php | 99 ++++++++++++ 13 files changed, 978 insertions(+), 3 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/model_utils_trait.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/model_utils_trait_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/string_utils_trait.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/string_utils_trait_test.mustache create mode 100644 samples/server/petstore/php-slim4/lib/Utils/ModelUtilsTrait.php create mode 100644 samples/server/petstore/php-slim4/lib/Utils/StringUtilsTrait.php create mode 100644 samples/server/petstore/php-slim4/test/Utils/ModelUtilsTraitTest.php create mode 100644 samples/server/petstore/php-slim4/test/Utils/StringUtilsTraitTest.php diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java index b2b8fd31e765..4ec5c1f1166b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java @@ -42,6 +42,8 @@ public class PhpSlim4ServerCodegen extends PhpSlimServerCodegen { protected String psr7Implementation = "slim-psr7"; protected String mockDirName = "Mock"; protected String mockPackage = ""; + protected String utilsDirName = "Utils"; + protected String utilsPackage = ""; public PhpSlim4ServerCodegen() { super(); @@ -51,6 +53,7 @@ public class PhpSlim4ServerCodegen extends PhpSlimServerCodegen { .build(); mockPackage = invokerPackage + "\\" + mockDirName; + utilsPackage = invokerPackage + "\\" + utilsDirName; outputFolder = "generated-code" + File.separator + "slim4"; embeddedTemplateDir = templateDir = "php-slim4-server"; @@ -86,8 +89,9 @@ public class PhpSlim4ServerCodegen extends PhpSlimServerCodegen { super.processOpts(); if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { - // Update the invokerPackage for the default mockPackage + // Update mockPackage and utilsPackage mockPackage = invokerPackage + "\\" + mockDirName; + utilsPackage = invokerPackage + "\\" + utilsDirName; } // make mock src path available in mustache template @@ -95,6 +99,11 @@ public class PhpSlim4ServerCodegen extends PhpSlimServerCodegen { additionalProperties.put("mockSrcPath", "./" + toSrcPath(mockPackage, srcBasePath)); additionalProperties.put("mockTestPath", "./" + toSrcPath(mockPackage, testBasePath)); + // same for utils package + additionalProperties.put("utilsPackage", utilsPackage); + additionalProperties.put("utilsSrcPath", "./" + toSrcPath(utilsPackage, srcBasePath)); + additionalProperties.put("utilsTestPath", "./" + toSrcPath(utilsPackage, testBasePath)); + if (additionalProperties.containsKey(PSR7_IMPLEMENTATION)) { this.setPsr7Implementation((String) additionalProperties.get(PSR7_IMPLEMENTATION)); } @@ -132,6 +141,12 @@ public class PhpSlim4ServerCodegen extends PhpSlimServerCodegen { supportingFiles.add(new SupportingFile("openapi_data_mocker_interface.mustache", toSrcPath(mockPackage, srcBasePath), toInterfaceName("OpenApiDataMocker") + ".php")); supportingFiles.add(new SupportingFile("openapi_data_mocker.mustache", toSrcPath(mockPackage, srcBasePath), "OpenApiDataMocker.php")); supportingFiles.add(new SupportingFile("openapi_data_mocker_test.mustache", toSrcPath(mockPackage, testBasePath), "OpenApiDataMockerTest.php")); + + // traits of ported utils + supportingFiles.add(new SupportingFile("string_utils_trait.mustache", toSrcPath(utilsPackage, srcBasePath), toTraitName("StringUtils") + ".php")); + supportingFiles.add(new SupportingFile("string_utils_trait_test.mustache", toSrcPath(utilsPackage, testBasePath), toTraitName("StringUtils") + "Test.php")); + supportingFiles.add(new SupportingFile("model_utils_trait.mustache", toSrcPath(utilsPackage, srcBasePath), toTraitName("ModelUtils") + ".php")); + supportingFiles.add(new SupportingFile("model_utils_trait_test.mustache", toSrcPath(utilsPackage, testBasePath), toTraitName("ModelUtils") + "Test.php")); } /** diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache index cc4f128875ff..68b2c89e92fd 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache @@ -43,11 +43,13 @@ "test": [ "@test-apis", "@test-models", - "@test-mock" + "@test-mock", + "@test-utils" ], "test-apis": "phpunit --testsuite Apis", "test-models": "phpunit --testsuite Models", "test-mock": "phpunit --testsuite Mock", + "test-utils": "phpunit --testsuite Utils", "phpcs": "phpcs", "phplint": "phplint ./ --exclude=vendor" } diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/model_utils_trait.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/model_utils_trait.mustache new file mode 100644 index 000000000000..7f068fa1c77f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/model_utils_trait.mustache @@ -0,0 +1,132 @@ + ModelReturn (after camelize) + } + + // model name starts with number + if (preg_match('/^\d.*/', $name) === 1) { + $name = 'model_' . $name; // e.g. 200Response => Model200Response (after camelize) + } + + // add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime) + if (preg_match('/^\\\\.*/', $name) !== 1) { + if (is_string($modelNamePrefix) && !empty($modelNamePrefix)) { + $name = $modelNamePrefix . '_' . $name; + } + + if (is_string($modelNameSuffix) && !empty($modelNameSuffix)) { + $name = $name . '_' . $modelNameSuffix; + } + } + + // camelize the model name + // phone_number => PhoneNumber + return self::camelize($name); + } +} +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/model_utils_trait_test.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/model_utils_trait_test.mustache new file mode 100644 index 000000000000..f3d365eba67e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/model_utils_trait_test.mustache @@ -0,0 +1,111 @@ +assertSame($expectedRef, ModelUtils::getSimpleRef($ref)); + } + + public function provideRefs() + { + return [ + 'Reference Object OAS 3.0' => [ + '#/components/schemas/Pet', 'Pet', + ], + 'Reference Object Swagger 2.0' => [ + '#/definitions/Pet', 'Pet', + ], + 'Underscored classname' => [ + '#/components/schemas/_foobar_Objects', '_foobar_Objects', + ], + 'Relative Documents With Embedded Schema' => [ + 'definitions.json#/Pet', null, + ], + 'null as argument' => [ + null, null, + ], + 'number as argument' => [ + 156, null, + ], + ]; + } + + /** + * @covers ::toModelName + * @dataProvider provideModelNames + */ + public function testToModelName($name, $prefix, $suffix, $expectedModel) + { + $this->assertSame($expectedModel, ModelUtils::toModelName($name, $prefix, $suffix)); + } + + public function provideModelNames() + { + return [ + // fixtures from modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java + ['abcd', null, null, 'Abcd'], + ['some-value', null, null, 'SomeValue'], + ['some_value', null, null, 'SomeValue'], + ['$type', null, null, 'Type'], + ['123', null, null, 'Model123'], + ['$123', null, null, 'Model123'], + ['return', null, null, 'ModelReturn'], + ['200Response', null, null, 'Model200Response'], + ['abcd', 'SuperModel', null, 'SuperModelAbcd'], + ['abcd', null, 'WithEnd', 'AbcdWithEnd'], + ['abcd', 'WithStart', 'AndEnd', 'WithStartAbcdAndEnd'], + ['_foobar_Objects', null, null, 'FoobarObjects'], + [null, null, null, null], + ]; + } +} +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache index 81e19e736051..82f864390833 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache @@ -20,12 +20,16 @@ {{mockTestPath}} + + {{utilsTestPath}} + {{apiSrcPath}} {{modelSrcPath}} {{mockSrcPath}} + {{utilsSrcPath}} diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/string_utils_trait.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/string_utils_trait.mustache new file mode 100644 index 000000000000..6d5d15feff63 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/string_utils_trait.mustache @@ -0,0 +1,141 @@ + 0) { + $str .= strtoupper(substr($z, 0, 1)) . substr($z, 1); + } + } + $word = $str; + + // Uppercase the class name. + $p = '/(\.?)(\w)([^\.]*)$/'; + $word = preg_replace_callback($p, function ($matches) { + $rep = $matches[1] . strtoupper($matches[2]) . $matches[3]; + $rep = preg_replace('/\$/', '\\\$', $rep); + return $rep; + }, $word); + + // Remove all underscores (underscore_case to camelCase) + $p = '/(_)(.)/'; + while (preg_match($p, $word, $matches) === 1) { + $original = $matches[2][0]; + $upperCase = strtoupper($original); + if ($original === $upperCase) { + $word = preg_replace($p, '$2', $word); + } else { + $word = preg_replace($p, $upperCase, $word); + } + } + + // Remove all hyphens (hyphen-case to camelCase) + $p = '/(-)(.)/'; + while (preg_match($p, $word, $matches) === 1) { + $upperCase = strtoupper($matches[2][0]); + $word = preg_replace($p, $upperCase, $word); + } + + if ($lowercaseFirstLetter === true && strlen($word) > 0) { + $i = 0; + $charAt = substr($word, $i, 1); + while ( + $i + 1 < strlen($word) + && !( + ($charAt >= 'a' && $charAt <= 'z') + || ($charAt >= 'A' && $charAt <= 'Z') + ) + ) { + $i++; + $charAt = substr($word, $i, 1); + } + $i++; + $word = strtolower(substr($word, 0, $i)) . substr($word, $i); + } + + // remove all underscore + $word = str_replace('_', '', $word); + + return $word; + } + + /** + * Checks whether string is reserved php keyword. + * This is recreated method of @link modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java class. + * + * @param string $word Checked string + * + * @return bool + */ + public static function isReservedWord($word) + { + if (is_string($word) === false) { + return false; + } + // __halt_compiler is ommited because class names with underscores not allowed anyway + return in_array( + strtolower($word), + ['abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor'] + ); + } +} +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/string_utils_trait_test.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/string_utils_trait_test.mustache new file mode 100644 index 000000000000..9698d6bcf6c9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/string_utils_trait_test.mustache @@ -0,0 +1,108 @@ +assertSame($expectedWord, StringUtils::camelize($word, $lowercaseFirstLetter)); + } + + public function provideWordsForCamelizeTest() + { + return [ + // fixtures from modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java + ['openApiServer/model/pet', null, 'OpenApiServerModelPet'], + ['abcd', null, 'Abcd'], + ['some-value', null, 'SomeValue'], + ['some-Value', null, 'SomeValue'], + ['some_value', null, 'SomeValue'], + ['some_Value', null, 'SomeValue'], + ['$type', null, '$Type'], + + ['abcd', true, 'abcd'], + ['some-value', true, 'someValue'], + ['some_value', true, 'someValue'], + ['Abcd', true, 'abcd'], + ['$type', true, '$type'], + + ['123', true, '123'], + ['$123', true, '$123'], + ]; + } + + /** + * @covers ::isReservedWord + * @dataProvider provideWordsForIsReservedTest + */ + public function testisReservedWord($word, $expected) + { + $this->assertSame($expected, StringUtils::isReservedWord($word)); + } + + public function provideWordsForIsReservedTest() + { + return [ + ['return', true], + ['switch', true], + ['class', true], + ['interface', true], + ['ABSTRACT', true], + ['Trait', true], + ['final', true], + ['foobar', false], + ['DateTime', false], + ['Pet', false], + [123, false], + [null, false], + ]; + } +} +{{/apiInfo}} diff --git a/samples/server/petstore/php-slim4/composer.json b/samples/server/petstore/php-slim4/composer.json index 4a45af2568d2..d7d8142f6d10 100644 --- a/samples/server/petstore/php-slim4/composer.json +++ b/samples/server/petstore/php-slim4/composer.json @@ -30,11 +30,13 @@ "test": [ "@test-apis", "@test-models", - "@test-mock" + "@test-mock", + "@test-utils" ], "test-apis": "phpunit --testsuite Apis", "test-models": "phpunit --testsuite Models", "test-mock": "phpunit --testsuite Mock", + "test-utils": "phpunit --testsuite Utils", "phpcs": "phpcs", "phplint": "phplint ./ --exclude=vendor" } diff --git a/samples/server/petstore/php-slim4/lib/Utils/ModelUtilsTrait.php b/samples/server/petstore/php-slim4/lib/Utils/ModelUtilsTrait.php new file mode 100644 index 000000000000..97bb2ae884a7 --- /dev/null +++ b/samples/server/petstore/php-slim4/lib/Utils/ModelUtilsTrait.php @@ -0,0 +1,123 @@ + ModelReturn (after camelize) + } + + // model name starts with number + if (preg_match('/^\d.*/', $name) === 1) { + $name = 'model_' . $name; // e.g. 200Response => Model200Response (after camelize) + } + + // add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime) + if (preg_match('/^\\\\.*/', $name) !== 1) { + if (is_string($modelNamePrefix) && !empty($modelNamePrefix)) { + $name = $modelNamePrefix . '_' . $name; + } + + if (is_string($modelNameSuffix) && !empty($modelNameSuffix)) { + $name = $name . '_' . $modelNameSuffix; + } + } + + // camelize the model name + // phone_number => PhoneNumber + return self::camelize($name); + } +} diff --git a/samples/server/petstore/php-slim4/lib/Utils/StringUtilsTrait.php b/samples/server/petstore/php-slim4/lib/Utils/StringUtilsTrait.php new file mode 100644 index 000000000000..bd0464fa598c --- /dev/null +++ b/samples/server/petstore/php-slim4/lib/Utils/StringUtilsTrait.php @@ -0,0 +1,132 @@ + 0) { + $str .= strtoupper(substr($z, 0, 1)) . substr($z, 1); + } + } + $word = $str; + + // Uppercase the class name. + $p = '/(\.?)(\w)([^\.]*)$/'; + $word = preg_replace_callback($p, function ($matches) { + $rep = $matches[1] . strtoupper($matches[2]) . $matches[3]; + $rep = preg_replace('/\$/', '\\\$', $rep); + return $rep; + }, $word); + + // Remove all underscores (underscore_case to camelCase) + $p = '/(_)(.)/'; + while (preg_match($p, $word, $matches) === 1) { + $original = $matches[2][0]; + $upperCase = strtoupper($original); + if ($original === $upperCase) { + $word = preg_replace($p, '$2', $word); + } else { + $word = preg_replace($p, $upperCase, $word); + } + } + + // Remove all hyphens (hyphen-case to camelCase) + $p = '/(-)(.)/'; + while (preg_match($p, $word, $matches) === 1) { + $upperCase = strtoupper($matches[2][0]); + $word = preg_replace($p, $upperCase, $word); + } + + if ($lowercaseFirstLetter === true && strlen($word) > 0) { + $i = 0; + $charAt = substr($word, $i, 1); + while ( + $i + 1 < strlen($word) + && !( + ($charAt >= 'a' && $charAt <= 'z') + || ($charAt >= 'A' && $charAt <= 'Z') + ) + ) { + $i++; + $charAt = substr($word, $i, 1); + } + $i++; + $word = strtolower(substr($word, 0, $i)) . substr($word, $i); + } + + // remove all underscore + $word = str_replace('_', '', $word); + + return $word; + } + + /** + * Checks whether string is reserved php keyword. + * This is recreated method of @link modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java class. + * + * @param string $word Checked string + * + * @return bool + */ + public static function isReservedWord($word) + { + if (is_string($word) === false) { + return false; + } + // __halt_compiler is ommited because class names with underscores not allowed anyway + return in_array( + strtolower($word), + ['abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor'] + ); + } +} diff --git a/samples/server/petstore/php-slim4/phpunit.xml.dist b/samples/server/petstore/php-slim4/phpunit.xml.dist index 50cde966d40a..d09042687960 100644 --- a/samples/server/petstore/php-slim4/phpunit.xml.dist +++ b/samples/server/petstore/php-slim4/phpunit.xml.dist @@ -20,12 +20,16 @@ ./test/Mock + + ./test/Utils + ./lib/Api ./lib/Model ./lib/Mock + ./lib/Utils diff --git a/samples/server/petstore/php-slim4/test/Utils/ModelUtilsTraitTest.php b/samples/server/petstore/php-slim4/test/Utils/ModelUtilsTraitTest.php new file mode 100644 index 000000000000..9ed05378f2b0 --- /dev/null +++ b/samples/server/petstore/php-slim4/test/Utils/ModelUtilsTraitTest.php @@ -0,0 +1,102 @@ +assertSame($expectedRef, ModelUtils::getSimpleRef($ref)); + } + + public function provideRefs() + { + return [ + 'Reference Object OAS 3.0' => [ + '#/components/schemas/Pet', 'Pet', + ], + 'Reference Object Swagger 2.0' => [ + '#/definitions/Pet', 'Pet', + ], + 'Underscored classname' => [ + '#/components/schemas/_foobar_Objects', '_foobar_Objects', + ], + 'Relative Documents With Embedded Schema' => [ + 'definitions.json#/Pet', null, + ], + 'null as argument' => [ + null, null, + ], + 'number as argument' => [ + 156, null, + ], + ]; + } + + /** + * @covers ::toModelName + * @dataProvider provideModelNames + */ + public function testToModelName($name, $prefix, $suffix, $expectedModel) + { + $this->assertSame($expectedModel, ModelUtils::toModelName($name, $prefix, $suffix)); + } + + public function provideModelNames() + { + return [ + // fixtures from modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java + ['abcd', null, null, 'Abcd'], + ['some-value', null, null, 'SomeValue'], + ['some_value', null, null, 'SomeValue'], + ['$type', null, null, 'Type'], + ['123', null, null, 'Model123'], + ['$123', null, null, 'Model123'], + ['return', null, null, 'ModelReturn'], + ['200Response', null, null, 'Model200Response'], + ['abcd', 'SuperModel', null, 'SuperModelAbcd'], + ['abcd', null, 'WithEnd', 'AbcdWithEnd'], + ['abcd', 'WithStart', 'AndEnd', 'WithStartAbcdAndEnd'], + ['_foobar_Objects', null, null, 'FoobarObjects'], + [null, null, null, null], + ]; + } +} diff --git a/samples/server/petstore/php-slim4/test/Utils/StringUtilsTraitTest.php b/samples/server/petstore/php-slim4/test/Utils/StringUtilsTraitTest.php new file mode 100644 index 000000000000..d06aa405eeba --- /dev/null +++ b/samples/server/petstore/php-slim4/test/Utils/StringUtilsTraitTest.php @@ -0,0 +1,99 @@ +assertSame($expectedWord, StringUtils::camelize($word, $lowercaseFirstLetter)); + } + + public function provideWordsForCamelizeTest() + { + return [ + // fixtures from modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java + ['openApiServer/model/pet', null, 'OpenApiServerModelPet'], + ['abcd', null, 'Abcd'], + ['some-value', null, 'SomeValue'], + ['some-Value', null, 'SomeValue'], + ['some_value', null, 'SomeValue'], + ['some_Value', null, 'SomeValue'], + ['$type', null, '$Type'], + + ['abcd', true, 'abcd'], + ['some-value', true, 'someValue'], + ['some_value', true, 'someValue'], + ['Abcd', true, 'abcd'], + ['$type', true, '$type'], + + ['123', true, '123'], + ['$123', true, '$123'], + ]; + } + + /** + * @covers ::isReservedWord + * @dataProvider provideWordsForIsReservedTest + */ + public function testisReservedWord($word, $expected) + { + $this->assertSame($expected, StringUtils::isReservedWord($word)); + } + + public function provideWordsForIsReservedTest() + { + return [ + ['return', true], + ['switch', true], + ['class', true], + ['interface', true], + ['ABSTRACT', true], + ['Trait', true], + ['final', true], + ['foobar', false], + ['DateTime', false], + ['Pet', false], + [123, false], + [null, false], + ]; + } +} From c0994c479dc0ad1bc30b785835f147d57600d862 Mon Sep 17 00:00:00 2001 From: Man Date: Sun, 22 Dec 2019 08:34:29 +0100 Subject: [PATCH 09/28] #4848 [asciidoc] add option to not generate metadata (#4852) * #4848 [asciidoc] add option to not generate metadata (asciidoc attributes) cli / additionalParameters: generateHeaders=true|false * #4848 [asciidoc] new options ascidoc generator * #4848 [asciidoc] add option to not generate metadata (asciidoc attributes) cli / additionalParameters: generateHeaders=true|false --- docs/generators/asciidoc.md | 5 ++- .../AsciidocDocumentationCodegen.java | 21 ++++++++-- .../asciidoc-documentation/index.mustache | 6 ++- .../asciidoc/AsciidocGeneratorTest.java | 38 ++++++++++++++++++- .../asciidoc/.openapi-generator/VERSION | 2 +- samples/documentation/asciidoc/index.adoc | 4 +- 6 files changed, 65 insertions(+), 11 deletions(-) diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index ed61ca4c77ad..d69dbacdb764 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -20,5 +20,6 @@ sidebar_label: asciidoc |groupId|groupId in generated pom.xml| |null| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| -|snippetDir|path with includable markup snippets (e.g. test output generated by restdoc, default: .| |.| -|specDir|path with includable markup spec files (e.g. handwritten additional docs, default: .| |..| +|snippetDir|path with includable markup snippets (e.g. test output generated by restdoc, default: .)| |.| +|specDir|path with includable markup spec files (e.g. handwritten additional docs, default: ..)| |..| +|headerAttributes|generation of asciidoc header meta data attributes (set to false to suppress, default: true)| |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java index 23fa88fb05ed..0a29173079fa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java @@ -46,6 +46,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code public static final String SPEC_DIR = "specDir"; public static final String SNIPPET_DIR = "snippetDir"; + public static final String HEADER_ATTRIBUTES_FLAG = "headerAttributes"; /** * Lambda emitting an asciidoc "include::filename.adoc[]" if file is found in @@ -201,11 +202,14 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC)); cliOptions.add(new CliOption(SNIPPET_DIR, - "path with includable markup snippets (e.g. test output generated by restdoc, default: .") + "path with includable markup snippets (e.g. test output generated by restdoc, default: .)") .defaultValue(".")); cliOptions.add(new CliOption(SPEC_DIR, - "path with includable markup spec files (e.g. handwritten additional docs, default: .") - .defaultValue("..")); + "path with includable markup spec files (e.g. handwritten additional docs, default: ..)") + .defaultValue("..")); + cliOptions.add(CliOption.newBoolean(HEADER_ATTRIBUTES_FLAG, + "generation of asciidoc header meta data attributes (set to false to suppress, default: true)", + true)); additionalProperties.put("appName", "OpenAPI Sample description"); additionalProperties.put("appDescription", "A sample OpenAPI documentation"); @@ -260,6 +264,17 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code this.linkSnippetMarkupLambda = new LinkMarkupLambda(snippetDir); additionalProperties.put("snippetlink", this.linkSnippetMarkupLambda); + + if(this.additionalProperties.get(HEADER_ATTRIBUTES_FLAG) == null || + ! (this.additionalProperties.get(HEADER_ATTRIBUTES_FLAG) instanceof String) ) { + { + this.additionalProperties.put(HEADER_ATTRIBUTES_FLAG, true); + } + } else { + String headerAttributesFlagValue = (String) this.additionalProperties.get(HEADER_ATTRIBUTES_FLAG); + LOGGER.debug("asciidoc: header attributes flag..: " + headerAttributesFlagValue); + this.additionalProperties.put(HEADER_ATTRIBUTES_FLAG, "TRUE".equalsIgnoreCase(headerAttributesFlagValue)); // change attribute in map to type boolean. + } } @Override diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache index f3783348c04e..910b46266aaa 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache @@ -1,4 +1,5 @@ -= {{{appName}}} += {{{appName}}} +{{#headerAttributes}} {{infoEmail}} {{#version}}{{{version}}}{{/version}} :toc: left @@ -8,9 +9,10 @@ :keywords: openapi, rest, {{appName}} :specDir: {{specDir}} :snippetDir: {{snippetDir}} -:generator-template: v1 2019-11-19 +:generator-template: v1 2019-12-20 :info-url: {{infoUrl}} :app-name: {{appName}} +{{/headerAttributes}} [abstract] .Abstract diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocGeneratorTest.java index 746a5bd87afa..a685a47e4286 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocGeneratorTest.java @@ -22,7 +22,7 @@ import org.testng.annotations.Test; import io.swagger.v3.oas.models.OpenAPI; -/** check against ping.yaml spec. */ +/** unit test asciidoc markup generation against ping.yaml openapi spec. */ public class AsciidocGeneratorTest { private static final Logger LOGGER = LoggerFactory.getLogger(AsciidocGeneratorTest.class); @@ -113,5 +113,41 @@ public class AsciidocGeneratorTest { Assert.assertTrue(markupFileGenerated, "index.adoc is not generated!"); } + + + @Test + public void testHeaderAttributesFlagRemovesAttributesFromMarkupHeaderSection() throws Exception { + File output = Files.createTempDirectory("test").toFile(); + + LOGGER.info("test: generating sample markup " + output.getAbsolutePath()); + + Map props = new TreeMap(); + props.put("specDir", "spec"); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("asciidoc") + .setInputSpec("src/test/resources/3_0/ping.yaml") + .setOutputDir(output.getAbsolutePath()) + .addAdditionalProperty(AsciidocDocumentationCodegen.HEADER_ATTRIBUTES_FLAG, "false") // option avoids generation of attributes + .addAdditionalProperty(AsciidocDocumentationCodegen.SPEC_DIR, "SPEC-DIR") + .addAdditionalProperty(AsciidocDocumentationCodegen.SNIPPET_DIR, "MY/SNIPPET/DIR"); + + DefaultGenerator generator = new DefaultGenerator(); + boolean markupFileGenerated = false; + List files = generator.opts(configurator.toClientOptInput()).generate(); + for (File file : files) { + if (file.getName().equals("index.adoc")) { + markupFileGenerated = true; + String markupContent = FileUtils.readFileToString(file, StandardCharsets.UTF_8); + Assert.assertFalse(markupContent.contains(":specDir: SPEC-DIR"), + "not expected :specDir: in: " + markupContent.substring(0, 250)); + Assert.assertFalse(markupContent.contains(":snippetDir: MY/SNIPPET/DIR"), + "not expected :snippetDir: in: " + markupContent.substring(0, 250)); + Assert.assertFalse(markupContent.contains(":toc:"), + "not expected :toc: in: " + markupContent.substring(0, 250)); // typical attributes not found in markup. + } + } + Assert.assertTrue(markupFileGenerated, "index.adoc is not generated!"); + } } diff --git a/samples/documentation/asciidoc/.openapi-generator/VERSION b/samples/documentation/asciidoc/.openapi-generator/VERSION index e4955748d3e7..58592f031f65 100644 --- a/samples/documentation/asciidoc/.openapi-generator/VERSION +++ b/samples/documentation/asciidoc/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/asciidoc/index.adoc b/samples/documentation/asciidoc/index.adoc index 295ff3358441..d29824f6dc6d 100644 --- a/samples/documentation/asciidoc/index.adoc +++ b/samples/documentation/asciidoc/index.adoc @@ -1,4 +1,4 @@ -= OpenAPI Petstore += OpenAPI Petstore team@openapitools.org 1.0.0 :toc: left @@ -8,7 +8,7 @@ team@openapitools.org :keywords: openapi, rest, OpenAPI Petstore :specDir: modules\openapi-generator\src\main\resources\asciidoc-documentation :snippetDir: . -:generator-template: v1 2019-11-19 +:generator-template: v1 2019-12-20 :info-url: https://openapi-generator.tech :app-name: OpenAPI Petstore From e90fa5c4df00d7c568e95a43afc152ad68950d37 Mon Sep 17 00:00:00 2001 From: Josh Burton Date: Sun, 22 Dec 2019 21:05:32 +1300 Subject: [PATCH 10/28] Fixes issue where only some instances of List or Map were replaced with Built equivalents (#4645) If there was a type that had a nested type of List or Map, e.g. `Map>` only the outer types would be replaced with the Built variants, causing issues when running the builder. --- .../languages/DartDioClientCodegen.java | 49 +++++++------------ .../main/resources/dart-dio/class.mustache | 2 - 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 764a0ddac9e3..66fc2a468fd2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -285,37 +285,26 @@ public class DartDioClientCodegen extends DartClientCodegen { property.isNullable = true; } - if (property.isListContainer) { - //Updates any List properties on a model to a BuiltList. This happens in post processing rather - //than type mapping as we only want this to apply to models, not every other class. - if ("List".equals(property.baseType)) { - property.setDatatype( - property.dataType.replaceAll(property.baseType, "BuiltList")); - property.setBaseType("BuiltList"); - model.imports.add("BuiltList"); - if ("Object".equals(property.items.baseType)) { - property.setDatatype( - property.dataType.replaceAll("Object", "JsonObject")); - property.items.setDatatype("JsonObject"); - model.imports.add("JsonObject"); - } - } - } - if (property.isMapContainer) { - //Updates any List properties on a model to a BuiltList. This happens in post processing rather - //than type mapping as we only want this to apply to models, not every other class. - if ("Map".equals(property.baseType)) { - property.setDatatype(property.dataType.replaceAll(property.baseType, "BuiltMap")); - property.setBaseType("BuiltMap"); - model.imports.add("BuiltMap"); - if ("Object".equals(property.items.baseType)) { - property.setDatatype(property.dataType.replaceAll("Object", "JsonObject")); - property.items.setDatatype("JsonObject"); - model.imports.add("JsonObject"); - } - } - } + property.setDatatype(property.getDataType() + .replaceAll("\\bList\\b", "BuiltList") + .replaceAll("\\bMap\\b", "BuiltMap") + .replaceAll("\\bObject\\b", "JsonObject") + ); + property.setBaseType(property.getBaseType() + .replaceAll("\\bList\\b", "BuiltList") + .replaceAll("\\bMap\\b", "BuiltMap") + .replaceAll("\\bObject\\b", "JsonObject") + ); + if (property.dataType.contains("BuiltList")) { + model.imports.add("BuiltList"); + } + if (property.dataType.contains("BuiltMap")) { + model.imports.add("BuiltMap"); + } + if (property.dataType.contains("JsonObject")) { + model.imports.add("JsonObject"); + } } @Override diff --git a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache index cf95d3ce0ebb..c7e26935d341 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache @@ -10,8 +10,6 @@ abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builde {{#isNullable}} @nullable {{/isNullable}} - - {{#description}}/* {{{description}}} */{{/description}} @BuiltValueField(wireName: '{{baseName}}') {{{dataType}}} get {{name}}; {{#allowableValues}} From a95e3e36846a36a2e2f26b4b8ca1f47eab9a6911 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 22 Dec 2019 18:18:16 +0800 Subject: [PATCH 11/28] Fix boolean option in asciidoc generator (#4856) * fix boolean option in asciidoc generator * minor code format chagne --- bin/asciidoc-documentation-petstore.sh | 2 +- .../AsciidocDocumentationCodegen.java | 31 +++++++++++-------- samples/documentation/asciidoc/index.adoc | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/bin/asciidoc-documentation-petstore.sh b/bin/asciidoc-documentation-petstore.sh index 2d3d4adb40a4..2f1ae34f9505 100755 --- a/bin/asciidoc-documentation-petstore.sh +++ b/bin/asciidoc-documentation-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/openapi-generator/src/main/resources/asciidoc-documentation --additional-properties=specDir=modules/openapi-generator/src/main/resources/asciidoc-documentation,snippetDir=. -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g asciidoc -o samples/documentation/asciidoc" +ags="generate -t modules/openapi-generator/src/main/resources/asciidoc-documentation --additional-properties=specDir=modules/openapi-generator/src/main/resources/asciidoc-documentation,snippetDir=. -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g asciidoc -o samples/documentation/asciidoc $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java index 0a29173079fa..22c577100261 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java @@ -141,6 +141,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code protected String groupId = "org.openapitools"; protected String artifactId = "openapi-client"; protected String artifactVersion = "1.0.0"; + protected boolean headerAttributes = true; private IncludeMarkupLambda includeSpecMarkupLambda; private IncludeMarkupLambda includeSnippetMarkupLambda; @@ -160,7 +161,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code static String sanitize(final String name) { String sanitized = name == null ? "" : name.trim(); sanitized = sanitized.replace("//", "/"); // rest paths may or may not end with slashes, leading to redundant - // path separators. + // path separators. return sanitized.startsWith(File.separator) || sanitized.startsWith("/") ? sanitized.substring(1) : sanitized; } @@ -203,13 +204,13 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code cliOptions.add(new CliOption(SNIPPET_DIR, "path with includable markup snippets (e.g. test output generated by restdoc, default: .)") - .defaultValue(".")); + .defaultValue(".")); cliOptions.add(new CliOption(SPEC_DIR, "path with includable markup spec files (e.g. handwritten additional docs, default: ..)") - .defaultValue("..")); + .defaultValue("..")); cliOptions.add(CliOption.newBoolean(HEADER_ATTRIBUTES_FLAG, "generation of asciidoc header meta data attributes (set to false to suppress, default: true)", - true)); + true)); additionalProperties.put("appName", "OpenAPI Sample description"); additionalProperties.put("appDescription", "A sample OpenAPI documentation"); @@ -240,6 +241,14 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code return input; // just return the original string } + public boolean isHeaderAttributes() { + return headerAttributes; + } + + public void setHeaderAttributes(boolean headerAttributes) { + this.headerAttributes = headerAttributes; + } + @Override public void processOpts() { super.processOpts(); @@ -264,16 +273,12 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code this.linkSnippetMarkupLambda = new LinkMarkupLambda(snippetDir); additionalProperties.put("snippetlink", this.linkSnippetMarkupLambda); - - if(this.additionalProperties.get(HEADER_ATTRIBUTES_FLAG) == null || - ! (this.additionalProperties.get(HEADER_ATTRIBUTES_FLAG) instanceof String) ) { - { - this.additionalProperties.put(HEADER_ATTRIBUTES_FLAG, true); - } + + + if (additionalProperties.containsKey(HEADER_ATTRIBUTES_FLAG)) { + this.setHeaderAttributes(convertPropertyToBooleanAndWriteBack(HEADER_ATTRIBUTES_FLAG)); } else { - String headerAttributesFlagValue = (String) this.additionalProperties.get(HEADER_ATTRIBUTES_FLAG); - LOGGER.debug("asciidoc: header attributes flag..: " + headerAttributesFlagValue); - this.additionalProperties.put(HEADER_ATTRIBUTES_FLAG, "TRUE".equalsIgnoreCase(headerAttributesFlagValue)); // change attribute in map to type boolean. + additionalProperties.put(HEADER_ATTRIBUTES_FLAG, headerAttributes); } } diff --git a/samples/documentation/asciidoc/index.adoc b/samples/documentation/asciidoc/index.adoc index d29824f6dc6d..200288b5a5ac 100644 --- a/samples/documentation/asciidoc/index.adoc +++ b/samples/documentation/asciidoc/index.adoc @@ -6,7 +6,7 @@ team@openapitools.org :toclevels: 3 :source-highlighter: highlightjs :keywords: openapi, rest, OpenAPI Petstore -:specDir: modules\openapi-generator\src\main\resources\asciidoc-documentation +:specDir: modules/openapi-generator/src/main/resources/asciidoc-documentation :snippetDir: . :generator-template: v1 2019-12-20 :info-url: https://openapi-generator.tech From 2949b53820b450bd149938370aaa78f05168bcb2 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Mon, 23 Dec 2019 08:39:49 +0500 Subject: [PATCH 12/28] [Slim4] Add integration tests (#4858) * [Slim4] Add integration tests * [Slim4] Remove unnecessary syntax check script Composer package called "phplint" processes the same syntax check and even faster. It can use cache when files hasn't been changed. * [Slim4] Exclude composer.lock from codebase Travis CI fails, it cannot install dependencies from lock file under different PHP(7.1.33) version. --- .../resources/php-slim4-server/.gitignore | 2 +- samples/server/petstore/php-slim4/.gitignore | 2 +- .../server/petstore/php-slim4/composer.lock | 2626 ----------------- .../php-slim4/php_syntax_checker.bash | 11 - samples/server/petstore/php-slim4/pom.xml | 31 +- 5 files changed, 32 insertions(+), 2640 deletions(-) delete mode 100644 samples/server/petstore/php-slim4/composer.lock delete mode 100755 samples/server/petstore/php-slim4/php_syntax_checker.bash diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/.gitignore b/modules/openapi-generator/src/main/resources/php-slim4-server/.gitignore index db204792ea34..3203d7d7814e 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/.gitignore +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/.gitignore @@ -5,7 +5,7 @@ composer.phar # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock +composer.lock # phplint tool creates cache file which is not necessary in a codebase /.phplint-cache diff --git a/samples/server/petstore/php-slim4/.gitignore b/samples/server/petstore/php-slim4/.gitignore index db204792ea34..3203d7d7814e 100644 --- a/samples/server/petstore/php-slim4/.gitignore +++ b/samples/server/petstore/php-slim4/.gitignore @@ -5,7 +5,7 @@ composer.phar # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock +composer.lock # phplint tool creates cache file which is not necessary in a codebase /.phplint-cache diff --git a/samples/server/petstore/php-slim4/composer.lock b/samples/server/petstore/php-slim4/composer.lock deleted file mode 100644 index 350f44d6feb6..000000000000 --- a/samples/server/petstore/php-slim4/composer.lock +++ /dev/null @@ -1,2626 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "c45e90198360fe632369c0cc2e9e6523", - "packages": [ - { - "name": "dyorg/slim-token-authentication", - "version": "dev-slim4", - "source": { - "type": "git", - "url": "https://github.com/ybelenko/slim-token-authentication.git", - "reference": "87c64d370922c492188d2a782b23609341199259" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ybelenko/slim-token-authentication/zipball/87c64d370922c492188d2a782b23609341199259", - "reference": "87c64d370922c492188d2a782b23609341199259", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "equip/dispatch": "^2.0", - "phpunit/phpunit": "^6.5", - "slim/psr7": "^0.4.0", - "slim/slim": "^4.0", - "squizlabs/php_codesniffer": "~2.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Dyorg\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Dyorg\\": "tests", - "Dyorg\\TokenAuthentication\\Example\\": "example" - } - }, - "scripts": { - "test": [ - "phpunit" - ] - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dyorg Almeida", - "email": "dyorg@rabbiit.com", - "homepage": "https://rabbiit.com/", - "role": "Developer" - } - ], - "description": "Slim 4.0+ Token Authentication Middleware", - "homepage": "https://github.com/dyorg/slim-token-authentication", - "keywords": [ - "auth", - "authentication", - "authorization", - "middleware", - "slim", - "token" - ], - "support": { - "source": "https://github.com/ybelenko/slim-token-authentication/tree/slim4" - }, - "time": "2019-08-11T03:59:16+00:00" - }, - { - "name": "fig/http-message-util", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message-util.git", - "reference": "35b19404371b31b3a43823c755398c48c9966db4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/35b19404371b31b3a43823c755398c48c9966db4", - "reference": "35b19404371b31b3a43823c755398c48c9966db4", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Fig\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2018-11-19T16:19:58+00:00" - }, - { - "name": "nikic/fast-route", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/FastRoute.git", - "reference": "181d480e08d9476e61381e04a71b34dc0432e812" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", - "reference": "181d480e08d9476e61381e04a71b34dc0432e812", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|~5.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "description": "Fast request router for PHP", - "keywords": [ - "router", - "routing" - ], - "time": "2018-02-13T20:26:39+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/http-factory", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "time": "2019-04-30T12:38:16+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/http-server-handler", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side request handler", - "keywords": [ - "handler", - "http", - "http-interop", - "psr", - "psr-15", - "psr-7", - "request", - "response", - "server" - ], - "time": "2018-10-30T16:46:14+00:00" - }, - { - "name": "psr/http-server-middleware", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0", - "psr/http-server-handler": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side middleware", - "keywords": [ - "http", - "http-interop", - "middleware", - "psr", - "psr-15", - "psr-7", - "request", - "response" - ], - "time": "2018-10-30T17:12:04+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "~3.7.0", - "satooshi/php-coveralls": ">=1.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" - }, - { - "name": "slim/psr7", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim-Psr7.git", - "reference": "d312896b7cd4aca7d4b86b64acdfcb5cc3da758f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/d312896b7cd4aca7d4b86b64acdfcb5cc3da758f", - "reference": "d312896b7cd4aca7d4b86b64acdfcb5cc3da758f", - "shasum": "" - }, - "require": { - "fig/http-message-util": "^1.1", - "php": "^7.1", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^2" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-json": "*", - "http-interop/http-factory-tests": "^0.5.0", - "php-http/psr7-integration-tests": "dev-master", - "phpstan/phpstan": "^0.10", - "phpunit/phpunit": "^6.0|^7.0", - "squizlabs/php_codesniffer": "^3.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Slim\\Psr7\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - }, - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Pierre Berube", - "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" - } - ], - "description": "Strict PSR-7 implementation", - "homepage": "https://www.slimframework.com", - "keywords": [ - "http", - "psr-7", - "psr7" - ], - "time": "2019-08-02T17:06:08+00:00" - }, - { - "name": "slim/slim", - "version": "4.3.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim.git", - "reference": "26020e9a099e69b0b12918115894f7106364dcb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/26020e9a099e69b0b12918115894f7106364dcb7", - "reference": "26020e9a099e69b0b12918115894f7106364dcb7", - "shasum": "" - }, - "require": { - "ext-json": "*", - "nikic/fast-route": "^1.3", - "php": "^7.1", - "psr/container": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "psr/http-server-handler": "^1.0", - "psr/http-server-middleware": "^1.0" - }, - "require-dev": { - "ext-simplexml": "*", - "guzzlehttp/psr7": "^1.5", - "http-interop/http-factory-guzzle": "^1.0", - "nyholm/psr7": "^1.1", - "nyholm/psr7-server": "^0.3.0", - "phpspec/prophecy": "^1.8", - "phpstan/phpstan": "^0.11.5", - "phpunit/phpunit": "^7.5", - "slim/http": "^0.7", - "slim/psr7": "^0.3", - "squizlabs/php_codesniffer": "^3.4.2", - "zendframework/zend-diactoros": "^2.1" - }, - "suggest": { - "ext-simplexml": "Needed to support XML format in BodyParsingMiddleware", - "ext-xml": "Needed to support XML format in BodyParsingMiddleware", - "slim/psr7": "Slim PSR-7 implementation. See http://www.slimframework.com/docs/v4/start/installation.html for more information." - }, - "type": "library", - "autoload": { - "psr-4": { - "Slim\\": "Slim", - "Slim\\Tests\\": "tests" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - }, - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Pierre Berube", - "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - } - ], - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "https://www.slimframework.com", - "keywords": [ - "api", - "framework", - "micro", - "router" - ], - "time": "2019-10-05T21:24:58+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2019-10-21T16:45:58+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.9.3", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2019-08-09T12:45:53+00:00" - }, - { - "name": "overtrue/phplint", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/overtrue/phplint.git", - "reference": "deaee8c3459087ea5d17031206b8722a96dd330b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/overtrue/phplint/zipball/deaee8c3459087ea5d17031206b8722a96dd330b", - "reference": "deaee8c3459087ea5d17031206b8722a96dd330b", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=5.5.9", - "symfony/console": "^3.2|^4.0|^5.0", - "symfony/finder": "^3.0|^4.0|^5.0", - "symfony/process": "^3.0|^4.0|^5.0", - "symfony/yaml": "^3.0|^4.0|^5.0" - }, - "require-dev": { - "jakub-onderka/php-console-highlighter": "^0.3.2 || ^0.4" - }, - "bin": [ - "bin/phplint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Overtrue\\PHPLint\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "overtrue", - "email": "anzhengchao@gmail.com" - } - ], - "description": "a php syntax check tool.", - "keywords": [ - "check", - "lint", - "phplint", - "syntax" - ], - "time": "2019-12-07T13:46:15+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08T19:23:20+00:00" - }, - { - "name": "phar-io/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2018-08-07T13:53:10+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-09-12T14:27:41+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "shasum": "" - }, - "require": { - "php": "^7.1", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.9.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2019-10-03T11:07:50+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "6.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "suggest": { - "ext-xdebug": "^2.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2018-10-31T16:06:48+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2018-09-13T20:33:42+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2019-06-07T04:22:29+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2019-09-17T06:23:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "7.5.18", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fcf6c4bfafaadc07785528b06385cce88935474d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fcf6c4bfafaadc07785528b06385cce88935474d", - "reference": "fcf6c4bfafaadc07785528b06385cce88935474d", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2019-12-06T05:14:37+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "shasum": "" - }, - "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2018-07-12T15:12:46+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "time": "2019-02-04T06:01:07+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2019-11-20T08:46:58+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2019-09-14T09:02:43+00:00" - }, - { - "name": "sebastian/global-state", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2017-04-27T15:39:26+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2018-10-04T04:07:39+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.5.3", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", - "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2019-12-04T04:46:47+00:00" - }, - { - "name": "symfony/console", - "version": "v5.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "dae5ef273d700771168ab889d9f8a19b2d206656" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/dae5ef273d700771168ab889d9f8a19b2d206656", - "reference": "dae5ef273d700771168ab889d9f8a19b2d206656", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2019-12-01T10:51:15+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "17874dd8ab9a19422028ad56172fb294287a701b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/17874dd8ab9a19422028ad56172fb294287a701b", - "reference": "17874dd8ab9a19422028ad56172fb294287a701b", - "shasum": "" - }, - "require": { - "php": "^7.2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2019-11-18T17:27:11+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.13.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.13-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2019-11-27T13:56:44+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.13-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2019-11-27T14:18:11+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.13.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", - "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.13-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2019-11-27T16:25:15+00:00" - }, - { - "name": "symfony/process", - "version": "v5.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "1568a2e8370fbc7416ef64eb5a698e4a05db5ff4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1568a2e8370fbc7416ef64eb5a698e4a05db5ff4", - "reference": "1568a2e8370fbc7416ef64eb5a698e4a05db5ff4", - "shasum": "" - }, - "require": { - "php": "^7.2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2019-11-28T14:20:16+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-11-18T17:27:11+00:00" - }, - { - "name": "symfony/yaml", - "version": "v5.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "51b684480184fa767b97e28eaca67664e48dd3e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/51b684480184fa767b97e28eaca67664e48dd3e9", - "reference": "51b684480184fa767b97e28eaca67664e48dd3e9", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<4.4" - }, - "require-dev": { - "symfony/console": "^4.4|^5.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2019-11-18T17:27:11+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "vimeo/psalm": "<3.6.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2019-11-24T13:36:37+00:00" - } - ], - "aliases": [], - "minimum-stability": "RC", - "stability-flags": { - "dyorg/slim-token-authentication": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.1" - }, - "platform-dev": [] -} diff --git a/samples/server/petstore/php-slim4/php_syntax_checker.bash b/samples/server/petstore/php-slim4/php_syntax_checker.bash deleted file mode 100755 index 09c32c89511a..000000000000 --- a/samples/server/petstore/php-slim4/php_syntax_checker.bash +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# a simple script to perform a syntax check on php files using "php -l" - -for i in $( find . -name "*.php" ); do - result=`php -l $i | grep "No syntax errors detected"` - exit_status=$? - if [ $exit_status -eq 1 ]; then - echo "Syntax errors with $i" - exit 1; - fi -done diff --git a/samples/server/petstore/php-slim4/pom.xml b/samples/server/petstore/php-slim4/pom.xml index 30f1410a70cb..cde894e95827 100644 --- a/samples/server/petstore/php-slim4/pom.xml +++ b/samples/server/petstore/php-slim4/pom.xml @@ -26,6 +26,19 @@ exec-maven-plugin 1.2.1 + + bundle-install + pre-integration-test + + exec + + + composer + + install + + + syntax-check integration-test @@ -33,7 +46,23 @@ exec - ./php_syntax_checker.bash + composer + + phplint + + + + + bundle-test + integration-test + + exec + + + composer + + test + From 0c92b0c4a4ac11f3553a4011108c1446aedf6c92 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Tue, 24 Dec 2019 15:09:22 +0000 Subject: [PATCH 13/28] [Rust Server] Handle multiple response type (#4441) - Ensure response IDs are unique, even if the first sentence is identical - Handle responses where different responses produce a different type of data - Use the correct mime type for plain text and byte streams - Tidy up whitespace in client-mod.mustache - Specify locale for String.format - Add test for multiple response types - Update samples --- .../codegen/languages/RustServerCodegen.java | 165 +++++++--- .../resources/rust-server/client-mod.mustache | 42 +-- .../resources/rust-server/mimetypes.mustache | 2 +- .../resources/rust-server/server-mod.mustache | 20 +- .../resources/3_0/rust-server/openapi-v3.yaml | 50 +++ .../rust-server/output/openapi-v3/README.md | 3 + .../output/openapi-v3/api/openapi.yaml | 53 ++++ .../openapi-v3/docs/InlineResponse201.md | 10 + .../output/openapi-v3/docs/default_api.md | 23 ++ .../output/openapi-v3/examples/client.rs | 7 + .../openapi-v3/examples/server_lib/server.rs | 8 + .../output/openapi-v3/src/client/mod.rs | 216 +++++++++++-- .../rust-server/output/openapi-v3/src/lib.rs | 42 +++ .../output/openapi-v3/src/mimetypes.rs | 35 +++ .../output/openapi-v3/src/models.rs | 26 ++ .../output/openapi-v3/src/server/mod.rs | 144 ++++++++- .../src/client/mod.rs | 293 ++++++++---------- .../src/mimetypes.rs | 14 +- .../src/server/mod.rs | 32 -- .../output/rust-server-test/src/client/mod.rs | 50 ++- .../output/rust-server-test/src/server/mod.rs | 8 +- 21 files changed, 905 insertions(+), 338 deletions(-) create mode 100644 samples/server/petstore/rust-server/output/openapi-v3/docs/InlineResponse201.md diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index f456ac9f17af..92d66ddee8f2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -26,6 +26,7 @@ import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.XML; import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.servers.Server; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -65,6 +66,11 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { private static final String uuidType = "uuid::Uuid"; private static final String bytesType = "swagger::ByteArray"; + private static final String xmlMimeType = "application/xml"; + private static final String octetMimeType = "application/octet-stream"; + private static final String plainMimeType = "text/plain"; + private static final String jsonMimeType = "application/json"; + public RustServerCodegen() { super(); @@ -485,11 +491,11 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { } private boolean isMimetypeXml(String mimetype) { - return mimetype.toLowerCase(Locale.ROOT).startsWith("application/xml"); + return mimetype.toLowerCase(Locale.ROOT).startsWith(xmlMimeType); } private boolean isMimetypePlainText(String mimetype) { - return mimetype.toLowerCase(Locale.ROOT).startsWith("text/plain"); + return mimetype.toLowerCase(Locale.ROOT).startsWith(plainMimeType); } private boolean isMimetypeHtmlText(String mimetype) { @@ -505,7 +511,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { } private boolean isMimetypeOctetStream(String mimetype) { - return mimetype.toLowerCase(Locale.ROOT).startsWith("application/octet-stream"); + return mimetype.toLowerCase(Locale.ROOT).startsWith(octetMimeType); } private boolean isMimetypePlain(String mimetype) { @@ -563,36 +569,17 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { processParam(param, op); } - List consumes = new ArrayList(); - - boolean consumesPlainText = false; - boolean consumesXml = false; - // if "consumes" is defined (per operation or using global definition) - if (consumes != null && !consumes.isEmpty()) { - consumes.addAll(getConsumesInfo(this.openAPI, operation)); - List> c = new ArrayList>(); - for (String mimeType : consumes) { - Map mediaType = new HashMap(); - - if (isMimetypeXml(mimeType)) { - additionalProperties.put("usesXml", true); - consumesXml = true; - } else if (isMimetypePlain(mimeType)) { - consumesPlainText = true; - } else if (isMimetypeWwwFormUrlEncoded(mimeType)) { - additionalProperties.put("usesUrlEncodedForm", true); - } - - mediaType.put("mediaType", mimeType); - c.add(mediaType); - } - op.consumes = c; - op.hasConsumes = true; - } - - - List produces = new ArrayList(getProducesInfo(this.openAPI, operation)); + // We keep track of the 'default' model type for this API. If there are + // *any* XML responses, then we set the default to XML, otherwise we + // let the default be JSON. It would be odd for an API to want to use + // both XML and JSON on a single operation, and if we don't know + // anything then JSON is a more modern (ergo reasonable) choice. + boolean defaultsToXml = false; + // Determine the types that this operation produces. `getProducesInfo` + // simply lists all the types, and then we add the correct imports to + // the generated library. + List produces = new ArrayList(getProducesInfo(openAPI, operation)); boolean producesXml = false; boolean producesPlainText = false; if (produces != null && !produces.isEmpty()) { @@ -602,6 +589,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { if (isMimetypeXml(mimeType)) { additionalProperties.put("usesXml", true); + defaultsToXml = true; producesXml = true; } else if (isMimetypePlain(mimeType)) { producesPlainText = true; @@ -621,32 +609,132 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { param.vendorExtensions.put("typeName", toModelName(param.baseName)); } + // Set for deduplication of response IDs + Set responseIds = new HashSet(); + for (CodegenResponse rsp : op.responses) { + + // Get the original API response so we get process the schema + // directly. + ApiResponse original; + if (rsp.code == "0") { + original = operation.getResponses().get("default"); + } else { + original = operation.getResponses().get(rsp.code); + } String[] words = rsp.message.split("[^A-Za-z ]"); + + // Create a unique responseID for this response. String responseId; + if (rsp.vendorExtensions.containsKey("x-responseId")) { + // If it's been specified directly, use that. responseId = (String) rsp.vendorExtensions.get("x-responseId"); } else if (words.length != 0) { + // If there's a description, build it from the description. responseId = camelize(words[0].replace(" ", "_")); } else { + // Otherwise fall back to the http response code. responseId = "Status" + rsp.code; } + + // Deduplicate response IDs that would otherwise contain the same + // text. We rely on the ID being unique, but since we form it from + // the raw description field we can't require that the spec writer + // provides unique descriptions. + int idTieBreaker = 2; + while (responseIds.contains(responseId)) { + String trial = String.format(Locale.ROOT, "%s_%d", responseId, idTieBreaker); + if (!responseIds.contains(trial)) { + responseId = trial; + } else { + idTieBreaker++; + } + } + + responseIds.add(responseId); + rsp.vendorExtensions.put("x-responseId", responseId); rsp.vendorExtensions.put("x-uppercaseResponseId", underscore(responseId).toUpperCase(Locale.ROOT)); rsp.vendorExtensions.put("uppercase_operation_id", underscore(op.operationId).toUpperCase(Locale.ROOT)); if (rsp.dataType != null) { rsp.vendorExtensions.put("uppercase_data_type", (rsp.dataType.replace("models::", "")).toUpperCase(Locale.ROOT)); - // Default to producing json if nothing else is specified + // Get the mimetype which is produced by this response. Note + // that although in general responses produces a set of + // different mimetypes currently we only support 1 per + // response. + String firstProduces = null; + + if (original.getContent() != null) { + for (String mimetype : original.getContent().keySet()) { + firstProduces = mimetype; + break; + } + } + + // The output mime type. This allows us to do sensible fallback + // to JSON/XML rather than using only the default operation + // mimetype. + String outputMime; + + if (firstProduces == null) { + if (producesXml) { + outputMime = xmlMimeType; + } else if (producesPlainText) { + if (rsp.dataType.equals(bytesType)) { + outputMime = octetMimeType; + } else { + outputMime = plainMimeType; + } + } else { + outputMime = jsonMimeType; + } + } else { + // If we know exactly what mimetype this response is + // going to produce, then use that. If we have not found + // anything, then we'll fall back to the 'producesXXX' + // definitions we worked out above for the operation as a + // whole. + if (isMimetypeXml(firstProduces)) { + producesXml = true; + producesPlainText = false; + } else if (isMimetypePlain(firstProduces)) { + producesXml = false; + producesPlainText = true; + } else { + producesXml = false; + producesPlainText = false; + } + + outputMime = firstProduces; + } + + rsp.vendorExtensions.put("mimeType", outputMime); + + // Write out the type of data we actually expect this response + // to make. if (producesXml) { rsp.vendorExtensions.put("producesXml", true); - } else if (producesPlainText && rsp.dataType.equals(bytesType)) { - rsp.vendorExtensions.put("producesPlainText", true); + } else if (producesPlainText) { + // Plain text means that there is not structured data in + // this response. So it'll either be a UTF-8 encoded string + // 'plainText' or some generic 'bytes'. + // + // Note that we don't yet distinguish between string/binary + // and string/bytes - that is we don't auto-detect whether + // base64 encoding should be done. They both look like + // 'producesBytes'. + if (rsp.dataType.equals(bytesType)) { + rsp.vendorExtensions.put("producesBytes", true); + } else { + rsp.vendorExtensions.put("producesPlainText", true); + } } else { rsp.vendorExtensions.put("producesJson", true); - // If the data type is just "object", then ensure that the Rust data type - // is "serde_json::Value". This allows us to define APIs that - // can return arbitrary JSON bodies. + // If the data type is just "object", then ensure that the + // Rust data type is "serde_json::Value". This allows us + // to define APIs that can return arbitrary JSON bodies. if (rsp.dataType.equals("object")) { rsp.dataType = "serde_json::Value"; } @@ -686,7 +774,6 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { Map operations = (Map) objs.get("operations"); List operationList = (List) operations.get("operation"); - for (CodegenOperation op : operationList) { boolean consumesPlainText = false; boolean consumesXml = false; diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache index 9c1bd23e0c9c..ab4173052de4 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache @@ -491,24 +491,30 @@ impl Api for Client where .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| {{#vendorExtensions}} -{{#producesPlainText}} - Ok(swagger::ByteArray(body.to_vec())) -{{/producesPlainText}}{{^producesPlainText}} - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| -{{#producesXml}} - // ToDo: this will move to swagger-rs and become a standard From conversion trait - // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream - serde_xml_rs::from_str::<{{{dataType}}}>(body) - .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) -{{/producesXml}}{{#producesJson}} - serde_json::from_str::<{{{dataType}}}>(body) - .map_err(|e| e.into()) -{{/producesJson}} - ) -{{/producesPlainText}}{{/vendorExtensions}} - ) + {{#producesBytes}} + Ok(swagger::ByteArray(body.to_vec())) + {{/producesBytes}} + {{^producesBytes}} + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + {{#producesXml}} + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::<{{{dataType}}}>(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + {{/producesXml}} + {{#producesJson}} + serde_json::from_str::<{{{dataType}}}>(body) + .map_err(|e| e.into()) + {{/producesJson}} + {{#producesPlainText}} + Ok(body.to_string()) + {{/producesPlainText}} + ) + {{/producesBytes}} +{{/vendorExtensions}} + ) .map(move |body| { {{{operationId}}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}}{{^headers}}(body){{/headers}}{{#headers}}{{#-first}}{ body: body, {{/-first}}{{{name}}}: response_{{{name}}}{{^-last}}, {{/-last}}{{#-last}} }{{/-last}}{{/headers}} }) diff --git a/modules/openapi-generator/src/main/resources/rust-server/mimetypes.mustache b/modules/openapi-generator/src/main/resources/rust-server/mimetypes.mustache index b8492bebf984..7df7d28f46eb 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/mimetypes.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/mimetypes.mustache @@ -7,7 +7,7 @@ pub mod responses { {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#responses}}{{#produces}}{{#-first}}{{#dataType}} lazy_static! { /// Create Mime objects for the response content types for {{{operationId}}} - pub static ref {{#vendorExtensions}}{{{uppercase_operation_id}}}_{{x-uppercaseResponseId}}{{/vendorExtensions}}: Mime = "{{{mediaType}}}".parse().unwrap(); + pub static ref {{#vendorExtensions}}{{{uppercase_operation_id}}}_{{x-uppercaseResponseId}}: Mime = "{{{mimeType}}}".parse().unwrap();{{/vendorExtensions}} } {{/dataType}}{{/-first}}{{/produces}}{{/responses}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} } diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache index 1806ac1208b7..40579a07a4b2 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache @@ -444,18 +444,28 @@ where response.headers_mut().set(ContentType(mimetypes::responses::{{#vendorExtensions}}{{{uppercase_operation_id}}}_{{x-uppercaseResponseId}}{{/vendorExtensions}}.clone())); {{/dataType}}{{/-first}}{{/produces}} {{#dataType}} -{{#vendorExtensions}}{{#producesXml}}{{^has_namespace}} +{{#vendorExtensions}} + {{#producesXml}} + {{^has_namespace}} let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); -{{/has_namespace}}{{#has_namespace}} + {{/has_namespace}} + {{#has_namespace}} let mut namespaces = BTreeMap::new(); // An empty string is used to indicate a global namespace in xmltree. namespaces.insert("".to_string(), {{{dataType}}}::NAMESPACE.to_string()); let body = serde_xml_rs::to_string_with_namespaces(&body, namespaces).expect("impossible to fail to serialize"); -{{/has_namespace}}{{/producesXml}}{{#producesJson}} + {{/has_namespace}} + {{/producesXml}} + {{#producesJson}} let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); -{{/producesJson}}{{#producesPlainText}} + {{/producesJson}} + {{#producesBytes}} let body = body.0; -{{/producesPlainText}}{{/vendorExtensions}} + {{/producesBytes}} + {{#producesPlainText}} + let body = body; + {{/producesPlainText}} +{{/vendorExtensions}} response.set_body(body); {{/dataType}} }, diff --git a/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml b/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml index 2e558056871a..619a49d1c503 100644 --- a/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml @@ -45,6 +45,56 @@ paths: description: 'OK' '400': description: Bad Request + /multiget: + get: + summary: Get some stuff. + responses: + 200: + description: JSON rsp + content: + application/json: + schema: + $ref: "#/components/schemas/anotherXmlObject" + 201: + description: XML rsp + content: + application/xml: + schema: + type: object + properties: + foo: + type: string + 202: + description: octet rsp + content: + application/octet-stream: + schema: + type: string + format: binary + 203: + description: string rsp + content: + text/plain: + schema: + type: string + 204: + description: Duplicate Response long text. One. + content: + application/json: + schema: + $ref: "#/components/schemas/anotherXmlObject" + 205: + description: Duplicate Response long text. Two. + content: + application/json: + schema: + $ref: "#/components/schemas/anotherXmlObject" + 206: + description: Duplicate Response long text. Three. + content: + application/json: + schema: + $ref: "#/components/schemas/anotherXmlObject" /xml_other: post: requestBody: diff --git a/samples/server/petstore/rust-server/output/openapi-v3/README.md b/samples/server/petstore/rust-server/output/openapi-v3/README.md index d51e1c48832c..248f4335fac4 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/README.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/README.md @@ -61,6 +61,7 @@ cargo run --example server To run a client, follow one of the following simple steps: ``` +cargo run --example client MultigetGet cargo run --example client MultipleAuthSchemeGet cargo run --example client ReadonlyAuthSchemeGet cargo run --example client RequiredOctetStreamPut @@ -104,6 +105,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[****](docs/default_api.md#) | **GET** /multiget | Get some stuff. [****](docs/default_api.md#) | **GET** /multiple_auth_scheme | [****](docs/default_api.md#) | **GET** /readonly_auth_scheme | [****](docs/default_api.md#) | **PUT** /required_octet_stream | @@ -122,6 +124,7 @@ Method | HTTP request | Description - [AnotherXmlInner](docs/AnotherXmlInner.md) - [AnotherXmlObject](docs/AnotherXmlObject.md) - [DuplicateXmlObject](docs/DuplicateXmlObject.md) + - [InlineResponse201](docs/InlineResponse201.md) - [UuidObject](docs/UuidObject.md) - [XmlArray](docs/XmlArray.md) - [XmlInner](docs/XmlInner.md) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml index e903c1c2fe52..8181f26db03c 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml @@ -30,6 +30,53 @@ paths: description: OK 400: description: Bad Request + /multiget: + get: + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/anotherXmlObject' + description: JSON rsp + 201: + content: + application/xml: + schema: + $ref: '#/components/schemas/inline_response_201' + description: XML rsp + 202: + content: + application/octet-stream: + schema: + format: binary + type: string + description: octet rsp + 203: + content: + text/plain: + schema: + type: string + description: string rsp + 204: + content: + application/json: + schema: + $ref: '#/components/schemas/anotherXmlObject' + description: Duplicate Response long text. One. + 205: + content: + application/json: + schema: + $ref: '#/components/schemas/anotherXmlObject' + description: Duplicate Response long text. Two. + 206: + content: + application/json: + schema: + $ref: '#/components/schemas/anotherXmlObject' + description: Duplicate Response long text. Three. + summary: Get some stuff. /xml_other: post: requestBody: @@ -186,6 +233,8 @@ components: name: snake_another_xml_inner anotherXmlObject: description: An XML object + example: + inner_string: inner_string properties: inner_string: type: string @@ -193,6 +242,10 @@ components: xml: name: snake_another_xml_object namespace: http://foo.bar + inline_response_201: + properties: + foo: + type: string securitySchemes: authScheme: flows: diff --git a/samples/server/petstore/rust-server/output/openapi-v3/docs/InlineResponse201.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/InlineResponse201.md new file mode 100644 index 000000000000..142fba463560 --- /dev/null +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/InlineResponse201.md @@ -0,0 +1,10 @@ +# InlineResponse201 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | **String** | | [optional] [default to None] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md index 82b8c773ff40..1322f6438387 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +****](default_api.md#) | **GET** /multiget | Get some stuff. ****](default_api.md#) | **GET** /multiple_auth_scheme | ****](default_api.md#) | **GET** /readonly_auth_scheme | ****](default_api.md#) | **PUT** /required_octet_stream | @@ -16,6 +17,28 @@ Method | HTTP request | Description ****](default_api.md#) | **PUT** /xml | +# **** +> models::AnotherXmlObject () +Get some stuff. + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**models::AnotherXmlObject**](anotherXmlObject.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/octet-stream, application/xml, text/plain, + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **** > (ctx, ) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs index dcbe006993af..a6de3fc9bc27 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs @@ -19,6 +19,7 @@ use tokio_core::reactor; #[allow(unused_imports)] use openapi_v3::{ApiNoContext, ContextWrapperExt, ApiError, + MultigetGetResponse, MultipleAuthSchemeGetResponse, ReadonlyAuthSchemeGetResponse, RequiredOctetStreamPutResponse, @@ -37,6 +38,7 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ + "MultigetGet", "MultipleAuthSchemeGet", "ReadonlyAuthSchemeGet", "RequiredOctetStreamPut", @@ -87,6 +89,11 @@ fn main() { match matches.value_of("operation") { + Some("MultigetGet") => { + let result = core.run(client.multiget_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + Some("MultipleAuthSchemeGet") => { let result = core.run(client.multiple_auth_scheme_get()); println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs index 56c760181776..9d845aaeed2d 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs @@ -11,6 +11,7 @@ use swagger::{Has, XSpanIdString}; use uuid; use openapi_v3::{Api, ApiError, + MultigetGetResponse, MultipleAuthSchemeGetResponse, ReadonlyAuthSchemeGetResponse, RequiredOctetStreamPutResponse, @@ -37,6 +38,13 @@ impl Server { impl Api for Server where C: Has{ + /// Get some stuff. + fn multiget_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("multiget_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + fn multiple_auth_scheme_get(&self, context: &C) -> Box> { let context = context.clone(); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs index b67f0353b297..98d7205ada51 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs @@ -37,6 +37,7 @@ use swagger; use swagger::{ApiError, XSpanId, XSpanIdString, Has, AuthData}; use {Api, + MultigetGetResponse, MultipleAuthSchemeGetResponse, ReadonlyAuthSchemeGetResponse, RequiredOctetStreamPutResponse, @@ -252,6 +253,187 @@ impl Api for Client where F: Future + 'static, C: Has + Has>{ + fn multiget_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/multiget", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) + .map(move |body| { + MultigetGetResponse::JSONRsp(body) + }) + ) as Box> + }, + 201 => { + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + ) + ) + .map(move |body| { + MultigetGetResponse::XMLRsp(body) + }) + ) as Box> + }, + 202 => { + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + Ok(swagger::ByteArray(body.to_vec())) + ) + .map(move |body| { + MultigetGetResponse::OctetRsp(body) + }) + ) as Box> + }, + 203 => { + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + Ok(body.to_string()) + ) + ) + .map(move |body| { + MultigetGetResponse::StringRsp(body) + }) + ) as Box> + }, + 204 => { + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) + .map(move |body| { + MultigetGetResponse::DuplicateResponseLongText(body) + }) + ) as Box> + }, + 205 => { + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) + .map(move |body| { + MultigetGetResponse::DuplicateResponseLongText_2(body) + }) + ) as Box> + }, + 206 => { + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) + .map(move |body| { + MultigetGetResponse::DuplicateResponseLongText_3(body) + }) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + fn multiple_auth_scheme_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/multiple_auth_scheme", @@ -503,16 +685,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { ResponsesWithHeadersGetResponse::Success{ body: body, success_info: response_success_info } }) @@ -600,16 +779,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { UuidGetResponse::DuplicateResponseLongText(body) }) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs index 255d779db328..ea2d2b92a1ef 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs @@ -51,6 +51,37 @@ pub const BASE_PATH: &'static str = ""; pub const API_VERSION: &'static str = "1.0.7"; +#[derive(Debug, PartialEq)] +pub enum MultigetGetResponse { + /// JSON rsp + JSONRsp + (models::AnotherXmlObject) + , + /// XML rsp + XMLRsp + (models::InlineResponse201) + , + /// octet rsp + OctetRsp + (swagger::ByteArray) + , + /// string rsp + StringRsp + (String) + , + /// Duplicate Response long text. One. + DuplicateResponseLongText + (models::AnotherXmlObject) + , + /// Duplicate Response long text. Two. + DuplicateResponseLongText_2 + (models::AnotherXmlObject) + , + /// Duplicate Response long text. Three. + DuplicateResponseLongText_3 + (models::AnotherXmlObject) +} + #[derive(Debug, PartialEq)] pub enum MultipleAuthSchemeGetResponse { /// Check that limiting to multiple required auth schemes works @@ -142,6 +173,9 @@ pub enum XmlPutResponse { /// API pub trait Api { + /// Get some stuff. + fn multiget_get(&self, context: &C) -> Box>; + fn multiple_auth_scheme_get(&self, context: &C) -> Box>; @@ -177,6 +211,9 @@ pub trait Api { /// API without a `Context` pub trait ApiNoContext { + /// Get some stuff. + fn multiget_get(&self) -> Box>; + fn multiple_auth_scheme_get(&self) -> Box>; @@ -223,6 +260,11 @@ impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { + /// Get some stuff. + fn multiget_get(&self) -> Box> { + self.api().multiget_get(&self.context()) + } + fn multiple_auth_scheme_get(&self) -> Box> { self.api().multiple_auth_scheme_get(&self.context()) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs index 3f70e612d016..28f79f4ed2b4 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs @@ -5,6 +5,41 @@ pub mod responses { // The macro is called per-operation to beat the recursion limit + lazy_static! { + /// Create Mime objects for the response content types for MultigetGet + pub static ref MULTIGET_GET_JSON_RSP: Mime = "application/json".parse().unwrap(); + } + + lazy_static! { + /// Create Mime objects for the response content types for MultigetGet + pub static ref MULTIGET_GET_XML_RSP: Mime = "application/xml".parse().unwrap(); + } + + lazy_static! { + /// Create Mime objects for the response content types for MultigetGet + pub static ref MULTIGET_GET_OCTET_RSP: Mime = "application/octet-stream".parse().unwrap(); + } + + lazy_static! { + /// Create Mime objects for the response content types for MultigetGet + pub static ref MULTIGET_GET_STRING_RSP: Mime = "text/plain".parse().unwrap(); + } + + lazy_static! { + /// Create Mime objects for the response content types for MultigetGet + pub static ref MULTIGET_GET_DUPLICATE_RESPONSE_LONG_TEXT: Mime = "application/json".parse().unwrap(); + } + + lazy_static! { + /// Create Mime objects for the response content types for MultigetGet + pub static ref MULTIGET_GET_DUPLICATE_RESPONSE_LONG_TEXT_2: Mime = "application/json".parse().unwrap(); + } + + lazy_static! { + /// Create Mime objects for the response content types for MultigetGet + pub static ref MULTIGET_GET_DUPLICATE_RESPONSE_LONG_TEXT_3: Mime = "application/json".parse().unwrap(); + } + lazy_static! { /// Create Mime objects for the response content types for ResponsesWithHeadersGet pub static ref RESPONSES_WITH_HEADERS_GET_SUCCESS: Mime = "application/json".parse().unwrap(); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs index 081175d56fbd..b3adc1f3ad15 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs @@ -218,6 +218,32 @@ impl DuplicateXmlObject { } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] +pub struct InlineResponse201 { + #[serde(rename = "foo")] + #[serde(skip_serializing_if="Option::is_none")] + pub foo: Option, + +} + +impl InlineResponse201 { + pub fn new() -> InlineResponse201 { + InlineResponse201 { + foo: None, + } + } +} + +impl InlineResponse201 { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + /// Test a model containing a UUID #[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] #[cfg_attr(feature = "conversion", derive(LabelledGeneric))] diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs index 2298f08c7076..61a5361fc093 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs @@ -35,6 +35,7 @@ use swagger::{ApiError, XSpanId, XSpanIdString, Has, RequestParser}; use swagger::auth::Scopes; use {Api, + MultigetGetResponse, MultipleAuthSchemeGetResponse, ReadonlyAuthSchemeGetResponse, RequiredOctetStreamPutResponse, @@ -58,6 +59,7 @@ mod paths { lazy_static! { pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ + r"^/multiget$", r"^/multiple_auth_scheme$", r"^/readonly_auth_scheme$", r"^/required_octet_stream$", @@ -68,14 +70,15 @@ mod paths { r"^/xml_other$" ]).unwrap(); } - pub static ID_MULTIPLE_AUTH_SCHEME: usize = 0; - pub static ID_READONLY_AUTH_SCHEME: usize = 1; - pub static ID_REQUIRED_OCTET_STREAM: usize = 2; - pub static ID_RESPONSES_WITH_HEADERS: usize = 3; - pub static ID_UUID: usize = 4; - pub static ID_XML: usize = 5; - pub static ID_XML_EXTRA: usize = 6; - pub static ID_XML_OTHER: usize = 7; + pub static ID_MULTIGET: usize = 0; + pub static ID_MULTIPLE_AUTH_SCHEME: usize = 1; + pub static ID_READONLY_AUTH_SCHEME: usize = 2; + pub static ID_REQUIRED_OCTET_STREAM: usize = 3; + pub static ID_RESPONSES_WITH_HEADERS: usize = 4; + pub static ID_UUID: usize = 5; + pub static ID_XML: usize = 6; + pub static ID_XML_EXTRA: usize = 7; + pub static ID_XML_OTHER: usize = 8; } pub struct NewService { @@ -141,6 +144,124 @@ where // Please update both places if changing how this code is autogenerated. match &method { + // MultigetGet - GET /multiget + &hyper::Method::Get if path.matched(paths::ID_MULTIGET) => { + Box::new({ + {{ + Box::new(api_impl.multiget_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + MultigetGetResponse::JSONRsp + + (body) + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + response.headers_mut().set(ContentType(mimetypes::responses::MULTIGET_GET_JSON_RSP.clone())); + + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + response.set_body(body); + }, + MultigetGetResponse::XMLRsp + + (body) + + + => { + response.set_status(StatusCode::try_from(201).unwrap()); + + response.headers_mut().set(ContentType(mimetypes::responses::MULTIGET_GET_XML_RSP.clone())); + + let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); + response.set_body(body); + }, + MultigetGetResponse::OctetRsp + + (body) + + + => { + response.set_status(StatusCode::try_from(202).unwrap()); + + response.headers_mut().set(ContentType(mimetypes::responses::MULTIGET_GET_OCTET_RSP.clone())); + + let body = body.0; + response.set_body(body); + }, + MultigetGetResponse::StringRsp + + (body) + + + => { + response.set_status(StatusCode::try_from(203).unwrap()); + + response.headers_mut().set(ContentType(mimetypes::responses::MULTIGET_GET_STRING_RSP.clone())); + + let body = body; + response.set_body(body); + }, + MultigetGetResponse::DuplicateResponseLongText + + (body) + + + => { + response.set_status(StatusCode::try_from(204).unwrap()); + + response.headers_mut().set(ContentType(mimetypes::responses::MULTIGET_GET_DUPLICATE_RESPONSE_LONG_TEXT.clone())); + + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + response.set_body(body); + }, + MultigetGetResponse::DuplicateResponseLongText_2 + + (body) + + + => { + response.set_status(StatusCode::try_from(205).unwrap()); + + response.headers_mut().set(ContentType(mimetypes::responses::MULTIGET_GET_DUPLICATE_RESPONSE_LONG_TEXT_2.clone())); + + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + response.set_body(body); + }, + MultigetGetResponse::DuplicateResponseLongText_3 + + (body) + + + => { + response.set_status(StatusCode::try_from(206).unwrap()); + + response.headers_mut().set(ContentType(mimetypes::responses::MULTIGET_GET_DUPLICATE_RESPONSE_LONG_TEXT_3.clone())); + + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + response.set_body(body); + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + }} + }) as Box> + }, + // MultipleAuthSchemeGet - GET /multiple_auth_scheme &hyper::Method::Get if path.matched(paths::ID_MULTIPLE_AUTH_SCHEME) => { { @@ -339,9 +460,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::RESPONSES_WITH_HEADERS_GET_SUCCESS.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, ResponsesWithHeadersGetResponse::PreconditionFailed @@ -397,9 +516,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::UUID_GET_DUPLICATE_RESPONSE_LONG_TEXT.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -771,6 +888,9 @@ impl RequestParser for ApiRequestParser { let path = paths::GLOBAL_REGEX_SET.matches(request.uri().path()); match request.method() { + // MultigetGet - GET /multiget + &hyper::Method::Get if path.matched(paths::ID_MULTIGET) => Ok("MultigetGet"), + // MultipleAuthSchemeGet - GET /multiple_auth_scheme &hyper::Method::Get if path.matched(paths::ID_MULTIPLE_AUTH_SCHEME) => Ok("MultipleAuthSchemeGet"), diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs index d7a48cd205ab..045a7903c625 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs @@ -319,16 +319,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { TestSpecialTagsResponse::SuccessfulOperation(body) }) @@ -403,16 +400,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { FakeOuterBooleanSerializeResponse::OutputBoolean(body) }) @@ -486,16 +480,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { FakeOuterCompositeSerializeResponse::OutputComposite(body) }) @@ -569,16 +560,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { FakeOuterNumberSerializeResponse::OutputNumber(body) }) @@ -652,16 +640,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { FakeOuterStringSerializeResponse::OutputString(body) }) @@ -796,16 +781,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { TestClientModelResponse::SuccessfulOperation(body) }) @@ -1210,16 +1192,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { TestClassnameResponse::SuccessfulOperation(body) }) @@ -1452,17 +1431,15 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - // ToDo: this will move to swagger-rs and become a standard From conversion trait - // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream - serde_xml_rs::from_str::>(body) - .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::>(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + ) + ) .map(move |body| { FindPetsByStatusResponse::SuccessfulOperation(body) }) @@ -1549,17 +1526,15 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - // ToDo: this will move to swagger-rs and become a standard From conversion trait - // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream - serde_xml_rs::from_str::>(body) - .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::>(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + ) + ) .map(move |body| { FindPetsByTagsResponse::SuccessfulOperation(body) }) @@ -1646,17 +1621,15 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - // ToDo: this will move to swagger-rs and become a standard From conversion trait - // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream - serde_xml_rs::from_str::(body) - .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + ) + ) .map(move |body| { GetPetByIdResponse::SuccessfulOperation(body) }) @@ -1976,16 +1949,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { UploadFileResponse::SuccessfulOperation(body) }) @@ -2133,16 +2103,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::>(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::>(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { GetInventoryResponse::SuccessfulOperation(body) }) @@ -2207,17 +2174,15 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - // ToDo: this will move to swagger-rs and become a standard From conversion trait - // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream - serde_xml_rs::from_str::(body) - .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + ) + ) .map(move |body| { GetOrderByIdResponse::SuccessfulOperation(body) }) @@ -2304,17 +2269,15 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - // ToDo: this will move to swagger-rs and become a standard From conversion trait - // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream - serde_xml_rs::from_str::(body) - .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + ) + ) .map(move |body| { PlaceOrderResponse::SuccessfulOperation(body) }) @@ -2654,17 +2617,15 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - // ToDo: this will move to swagger-rs and become a standard From conversion trait - // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream - serde_xml_rs::from_str::(body) - .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + ) + ) .map(move |body| { GetUserByNameResponse::SuccessfulOperation(body) }) @@ -2759,17 +2720,15 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - // ToDo: this will move to swagger-rs and become a standard From conversion trait - // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream - serde_xml_rs::from_str::(body) - .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + serde_xml_rs::from_str::(body) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e))) + ) + ) .map(move |body| { LoginUserResponse::SuccessfulOperation{ body: body, x_rate_limit: response_x_rate_limit, x_expires_after: response_x_expires_after } }) diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs index e947e94b3631..b32609c12a70 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs @@ -42,17 +42,17 @@ pub mod responses { lazy_static! { /// Create Mime objects for the response content types for FindPetsByStatus - pub static ref FIND_PETS_BY_STATUS_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); + pub static ref FIND_PETS_BY_STATUS_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } lazy_static! { /// Create Mime objects for the response content types for FindPetsByTags - pub static ref FIND_PETS_BY_TAGS_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); + pub static ref FIND_PETS_BY_TAGS_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } lazy_static! { /// Create Mime objects for the response content types for GetPetById - pub static ref GET_PET_BY_ID_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); + pub static ref GET_PET_BY_ID_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } lazy_static! { @@ -67,22 +67,22 @@ pub mod responses { lazy_static! { /// Create Mime objects for the response content types for GetOrderById - pub static ref GET_ORDER_BY_ID_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); + pub static ref GET_ORDER_BY_ID_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } lazy_static! { /// Create Mime objects for the response content types for PlaceOrder - pub static ref PLACE_ORDER_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); + pub static ref PLACE_ORDER_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } lazy_static! { /// Create Mime objects for the response content types for GetUserByName - pub static ref GET_USER_BY_NAME_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); + pub static ref GET_USER_BY_NAME_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } lazy_static! { /// Create Mime objects for the response content types for LoginUser - pub static ref LOGIN_USER_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); + pub static ref LOGIN_USER_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index d37730a9a0e0..abe6c8a8f3c5 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -258,9 +258,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::TEST_SPECIAL_TAGS_SUCCESSFUL_OPERATION.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -325,9 +323,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::FAKE_OUTER_BOOLEAN_SERIALIZE_OUTPUT_BOOLEAN.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -392,9 +388,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::FAKE_OUTER_COMPOSITE_SERIALIZE_OUTPUT_COMPOSITE.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -459,9 +453,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::FAKE_OUTER_NUMBER_SERIALIZE_OUTPUT_NUMBER.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -526,9 +518,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::FAKE_OUTER_STRING_SERIALIZE_OUTPUT_STRING.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -671,9 +661,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::TEST_CLIENT_MODEL_SUCCESSFUL_OPERATION.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -986,9 +974,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::TEST_CLASSNAME_SUCCESSFUL_OPERATION.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -1232,9 +1218,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::FIND_PETS_BY_STATUS_SUCCESSFUL_OPERATION.clone())); - let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, FindPetsByStatusResponse::InvalidStatusValue @@ -1313,9 +1297,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::FIND_PETS_BY_TAGS_SUCCESSFUL_OPERATION.clone())); - let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, FindPetsByTagsResponse::InvalidTagValue @@ -1386,9 +1368,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::GET_PET_BY_ID_SUCCESSFUL_OPERATION.clone())); - let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, GetPetByIdResponse::InvalidIDSupplied @@ -1711,9 +1691,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::UPLOAD_FILE_SUCCESSFUL_OPERATION.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -1822,9 +1800,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::GET_INVENTORY_SUCCESSFUL_OPERATION.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -1879,9 +1855,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::GET_ORDER_BY_ID_SUCCESSFUL_OPERATION.clone())); - let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, GetOrderByIdResponse::InvalidIDSupplied @@ -1961,9 +1935,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::PLACE_ORDER_SUCCESSFUL_OPERATION.clone())); - let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, PlaceOrderResponse::InvalidOrder @@ -2273,9 +2245,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::GET_USER_BY_NAME_SUCCESSFUL_OPERATION.clone())); - let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, GetUserByNameResponse::InvalidUsernameSupplied @@ -2358,9 +2328,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::LOGIN_USER_SUCCESSFUL_OPERATION.clone())); - let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, LoginUserResponse::InvalidUsername diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs index 64b47aa5f242..c273afb2df3b 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs @@ -406,16 +406,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { FileResponseGetResponse::Success(body) }) @@ -484,16 +481,12 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + Ok(body.to_string()) + ) + ) .map(move |body| { HtmlPostResponse::Success(body) }) @@ -558,16 +551,13 @@ impl Api for Client where .concat2() .map_err(|e| ApiError(format!("Failed to read response: {}", e))) .and_then(|body| - - str::from_utf8(&body) - .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) - .and_then(|body| - - serde_json::from_str::(body) - .map_err(|e| e.into()) - ) - - ) + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + ) .map(move |body| { RawJsonGetResponse::Success(body) }) diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs index eae8b97db411..addb74304039 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -244,9 +244,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::FILE_RESPONSE_GET_SUCCESS.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, @@ -300,9 +298,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::HTML_POST_SUCCESS.clone())); - - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - + let body = body; response.set_body(body); }, }, @@ -345,9 +341,7 @@ where response.headers_mut().set(ContentType(mimetypes::responses::RAW_JSON_GET_SUCCESS.clone())); - let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); - response.set_body(body); }, }, From 4b01943b0689fc3987cfd78e8e43dbbf11a65f8e Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Thu, 26 Dec 2019 14:49:28 +0800 Subject: [PATCH 14/28] [C-libcurl] Assign the data type to the function parameter when it is "Free Form Object" in OpenAPI description(swagger.json) (#4861) --- .../src/main/resources/C-libcurl/api-body.mustache | 2 +- .../src/main/resources/C-libcurl/api-header.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 56c719f1e083..88e3a26d0aab 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -22,7 +22,7 @@ // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isListContainer}}{{{.}}}_t*{{/isListContainer}}{{#isMapContainer}}{{{.}}}{{/isMapContainer}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} -{{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}} ,{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{{baseName}}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{^isListContainer}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isListContainer}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{#isContainer}}{{#isListContainer}}{{dataType}}_t *{{/isListContainer}}{{#isMapContainer}}{{dataType}}{{/isMapContainer}}{{/isContainer}} {{{paramName}}}{{/allParams}}) +{{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}} ,{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{{baseName}}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{^isListContainer}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isListContainer}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{#isContainer}}{{#isListContainer}}{{dataType}}_t *{{/isListContainer}}{{#isMapContainer}}{{dataType}}{{/isMapContainer}}{{/isContainer}} {{{paramName}}}{{/allParams}}) { list_t *localVarQueryParameters = {{#hasQueryParams}}list_create();{{/hasQueryParams}}{{^hasQueryParams}}NULL;{{/hasQueryParams}} list_t *localVarHeaderParameters = {{#hasHeaderParams}}list_create();{{/hasHeaderParams}}{{^hasHeaderParams}}NULL;{{/hasHeaderParams}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache index a20e4be02fda..4556d2d02940 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache @@ -19,7 +19,7 @@ // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isListContainer}}{{{.}}}_t*{{/isListContainer}}{{#isMapContainer}}{{{.}}}{{/isMapContainer}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} -{{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}} ,{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{{baseName}}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{^isListContainer}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isListContainer}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{#isContainer}}{{#isListContainer}}{{dataType}}_t *{{/isListContainer}}{{#isMapContainer}}{{dataType}}{{/isMapContainer}}{{/isContainer}} {{{paramName}}}{{/allParams}}); +{{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}} ,{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{{baseName}}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{^isListContainer}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isListContainer}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{#isContainer}}{{#isListContainer}}{{dataType}}_t *{{/isListContainer}}{{#isMapContainer}}{{dataType}}{{/isMapContainer}}{{/isContainer}} {{{paramName}}}{{/allParams}}); {{/operation}} From a8bc3360fd3088c5d799fa866188c1be2d81135b Mon Sep 17 00:00:00 2001 From: Stephane Carrez Date: Thu, 26 Dec 2019 07:50:35 +0100 Subject: [PATCH 15/28] Fix 3522: [BUG][Ada] Wrong style for generated Ada model types and missing security scopes (#4863) * [Ada] Operation security scopes are ignored when generating the server (#1043) - Update fromOperation() to keep the operation required scopes for each auth method and store that information in the x-scopes vendor extensions attribute - Update postProcessOperationsWithModels() to process the operation required scopes and build a list of authMethods which only contain the required scopes for the operation and store these authMethods in the x-auth-scopes attribute. - Update postProcessAuthMethod() to handle the logic of filtering and building the operation authMethod (new instances are created because we must not modify the global authMethod definitions) - Update the Ada server templates to use the x-auth-scopes instead of authMethods Add a URL prefix parameter for the Ada server instantiation * Fix Ada code generator - update to generate Ada style type names (broken by the use of Camelize) - update the templates for Ada Util and Swagger libraries * Update generated GNAT project to add the 'utilada_xml' dependency * Update the Ada samples * Fix compilation of the petstore Ada sample --- .../codegen/languages/AbstractAdaCodegen.java | 42 +++++- .../main/resources/Ada/gnat-project.mustache | 7 +- .../src/main/resources/Ada/server.mustache | 11 +- .../petstore/ada/.openapi-generator/VERSION | 2 +- samples/client/petstore/ada/petstore.gpr | 5 +- .../src/client/samples-petstore-clients.adb | 32 ++-- .../src/client/samples-petstore-clients.ads | 32 ++-- .../ada/src/model/samples-petstore-models.adb | 70 ++++----- .../ada/src/model/samples-petstore-models.ads | 138 +++++++++--------- samples/client/petstore/ada/src/petstore.adb | 24 ++- 10 files changed, 199 insertions(+), 164 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java index 05e732b23f9c..50f2db60053f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java @@ -26,6 +26,7 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.servers.Server; +import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; @@ -163,7 +164,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg addOption(CodegenConstants.PROJECT_NAME, "GNAT project name", this.projectName); - modelNameSuffix = "_Type"; + modelNameSuffix = "Type"; embeddedTemplateDir = templateDir = "Ada"; languageSpecificPrimitives = new HashSet( @@ -242,11 +243,37 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg * @return capitalized model name */ public String toModelName(final String name) { - String result = super.toModelName(name); - if (result.matches("^\\d.*") || result.startsWith("_")) { - result = "Model_" + result; + String result = camelize(sanitizeName(name)); + + if (!StringUtils.isEmpty(modelNamePrefix)) { + result = modelNamePrefix + "_" + result; } - return result.replaceAll("[\\.-]", "_").replaceAll("__+", "_"); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(name)) { + String modelName = "Model_" + result; + LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName); + return modelName; + } + + // model name starts with number + if (result.matches("^\\d.*")) { + String modelName = "Model_" + result; // e.g. 200Response => Model_200Response (after camelize) + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); + return modelName; + } + + if (languageSpecificPrimitives.contains(result)) { + String modelName = "Model_" + result; + LOGGER.warn(name + " (model name matches existing language type) cannot be used as a model name. Renamed to " + modelName); + return modelName; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + result = result + "_" + modelNameSuffix; + } + + return result; } @Override @@ -517,7 +544,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg if (v instanceof CodegenModel) { CodegenModel m = (CodegenModel) v; List d = new ArrayList(); - for (CodegenProperty p : m.allVars) { + for (CodegenProperty p : m.vars) { boolean isModel = false; CodegenProperty item = p; if (p.isContainer) { @@ -531,9 +558,10 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg isModel = true; } p.vendorExtensions.put("x-is-model-type", isModel); + Boolean required = p.getRequired(); // Convert optional members to use the Nullable_ type. - if (!p.required && nullableTypeMapping.containsKey(p.dataType)) { + if (!Boolean.TRUE.equals(required) && nullableTypeMapping.containsKey(p.dataType)) { p.dataType = nullableTypeMapping.get(p.dataType); } } diff --git a/modules/openapi-generator/src/main/resources/Ada/gnat-project.mustache b/modules/openapi-generator/src/main/resources/Ada/gnat-project.mustache index c1fa58eebeab..1f8ded35698c 100644 --- a/modules/openapi-generator/src/main/resources/Ada/gnat-project.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/gnat-project.mustache @@ -6,11 +6,12 @@ -- -- NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech). with "config"; -with "util"; -with "util_http"; +with "utilada_sys"; +with "utilada_xml"; +with "utilada_http"; with "security"; with "swagger";{{#isServer}} -with "servlet"; +with "servletada"; with "swagger_server";{{/isServer}} project {{{projectName}}} is diff --git a/modules/openapi-generator/src/main/resources/Ada/server.mustache b/modules/openapi-generator/src/main/resources/Ada/server.mustache index 08aba9f071ae..f0a0fd00885d 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server.mustache @@ -2,17 +2,22 @@ with Ada.IO_Exceptions; with AWS.Config.Set; with Swagger.Servers.AWS; with Swagger.Servers.Applications; +with Util.Strings; with Util.Log.Loggers; with Util.Properties; +with Util.Properties.Basic; with {{package}}.Servers; procedure {{package}}.Server is procedure Configure (Config : in out AWS.Config.Object); + use Util.Properties.Basic; + CONFIG_PATH : constant String := "{{packageConfig}}.properties"; + Port : Natural := 8080; procedure Configure (Config : in out AWS.Config.Object) is begin - AWS.Config.Set.Server_Port (Config, 8080); + AWS.Config.Set.Server_Port (Config, Port); AWS.Config.Set.Max_Connection (Config, 8); AWS.Config.Set.Accept_Queue_Size (Config, 512); end Configure; @@ -25,13 +30,15 @@ begin Props.Load_Properties (CONFIG_PATH); Util.Log.Loggers.Initialize (Props); + Port := Integer_Property.Get (Props, "swagger.port", Port); App.Configure (Props); {{package}}.Servers.Server_Impl.Register (App); WS.Configure (Configure'Access); WS.Register_Application ("{{basePathWithoutHost}}", App'Unchecked_Access); App.Dump_Routes (Util.Log.INFO_LEVEL); - Log.Info ("Connect you browser to: http://localhost:8080{{basePathWithoutHost}}/ui/index.html"); + Log.Info ("Connect you browser to: http://localhost:{0}{{basePathWithoutHost}}/ui/index.html", + Util.Strings.Image (Port)); WS.Start; diff --git a/samples/client/petstore/ada/.openapi-generator/VERSION b/samples/client/petstore/ada/.openapi-generator/VERSION index afa636560641..58592f031f65 100644 --- a/samples/client/petstore/ada/.openapi-generator/VERSION +++ b/samples/client/petstore/ada/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ada/petstore.gpr b/samples/client/petstore/ada/petstore.gpr index 4c8ce69b930c..e4036b9bfa46 100644 --- a/samples/client/petstore/ada/petstore.gpr +++ b/samples/client/petstore/ada/petstore.gpr @@ -6,8 +6,9 @@ -- -- NOTE: Auto generated by the swagger code generator program. with "config"; -with "util"; -with "util_http"; +with "utilada_sys"; +with "utilada_xml"; +with "utilada_http"; with "security"; with "swagger"; project Petstore is diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb index e479690cf443..1920cbf1fe40 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb @@ -1,10 +1,10 @@ -- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- --- OpenAPI spec version: 1.0.0 +-- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. @@ -14,7 +14,7 @@ package body Samples.Petstore.Clients is -- Add a new pet to the store procedure Add_Pet (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.PetType) is + P_Body : in Samples.Petstore.Models.Pet_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; begin @@ -46,7 +46,7 @@ package body Samples.Petstore.Clients is procedure Find_Pets_By_Status (Client : in out Client_Type; Status : in Swagger.UString_Vectors.Vector; - Result : out Samples.Petstore.Models.PetType_Vectors.Vector) is + Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin @@ -64,7 +64,7 @@ package body Samples.Petstore.Clients is procedure Find_Pets_By_Tags (Client : in out Client_Type; Tags : in Swagger.UString_Vectors.Vector; - Result : out Samples.Petstore.Models.PetType_Vectors.Vector) is + Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin @@ -82,7 +82,7 @@ package body Samples.Petstore.Clients is procedure Get_Pet_By_Id (Client : in out Client_Type; Pet_Id : in Swagger.Long; - Result : out Samples.Petstore.Models.PetType) is + Result : out Samples.Petstore.Models.Pet_Type) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin @@ -98,7 +98,7 @@ package body Samples.Petstore.Clients is -- Update an existing pet procedure Update_Pet (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.PetType) is + P_Body : in Samples.Petstore.Models.Pet_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; begin @@ -136,7 +136,7 @@ package body Samples.Petstore.Clients is Pet_Id : in Swagger.Long; Additional_Metadata : in Swagger.Nullable_UString; File : in Swagger.File_Part_Type; - Result : out Samples.Petstore.Models.ApiResponseType) is + Result : out Samples.Petstore.Models.ApiResponse_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; Reply : Swagger.Value_Type; @@ -186,7 +186,7 @@ package body Samples.Petstore.Clients is procedure Get_Order_By_Id (Client : in out Client_Type; Order_Id : in Swagger.Long; - Result : out Samples.Petstore.Models.OrderType) is + Result : out Samples.Petstore.Models.Order_Type) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin @@ -202,8 +202,8 @@ package body Samples.Petstore.Clients is -- Place an order for a pet procedure Place_Order (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.OrderType; - Result : out Samples.Petstore.Models.OrderType) is + P_Body : in Samples.Petstore.Models.Order_Type; + Result : out Samples.Petstore.Models.Order_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; Reply : Swagger.Value_Type; @@ -222,7 +222,7 @@ package body Samples.Petstore.Clients is -- This can only be done by the logged in user. procedure Create_User (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.UserType) is + P_Body : in Samples.Petstore.Models.User_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; begin @@ -237,7 +237,7 @@ package body Samples.Petstore.Clients is -- Creates list of users with given input array procedure Create_Users_With_Array_Input (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.UserType_Vectors.Vector) is + P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; begin @@ -252,7 +252,7 @@ package body Samples.Petstore.Clients is -- Creates list of users with given input array procedure Create_Users_With_List_Input (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.UserType_Vectors.Vector) is + P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; begin @@ -282,7 +282,7 @@ package body Samples.Petstore.Clients is procedure Get_User_By_Name (Client : in out Client_Type; Username : in Swagger.UString; - Result : out Samples.Petstore.Models.UserType) is + Result : out Samples.Petstore.Models.User_Type) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin @@ -330,7 +330,7 @@ package body Samples.Petstore.Clients is procedure Update_User (Client : in out Client_Type; Username : in Swagger.UString; - P_Body : in Samples.Petstore.Models.UserType) is + P_Body : in Samples.Petstore.Models.User_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; begin diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads index 581760b24047..adc6a3c692ab 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads @@ -1,10 +1,10 @@ -- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- --- OpenAPI spec version: 1.0.0 +-- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. @@ -17,7 +17,7 @@ package Samples.Petstore.Clients is -- Add a new pet to the store procedure Add_Pet (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.PetType); + P_Body : in Samples.Petstore.Models.Pet_Type); -- Deletes a pet procedure Delete_Pet @@ -30,26 +30,26 @@ package Samples.Petstore.Clients is procedure Find_Pets_By_Status (Client : in out Client_Type; Status : in Swagger.UString_Vectors.Vector; - Result : out Samples.Petstore.Models.PetType_Vectors.Vector); + Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector); -- Finds Pets by tags -- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. procedure Find_Pets_By_Tags (Client : in out Client_Type; Tags : in Swagger.UString_Vectors.Vector; - Result : out Samples.Petstore.Models.PetType_Vectors.Vector); + Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector); -- Find pet by ID -- Returns a single pet procedure Get_Pet_By_Id (Client : in out Client_Type; Pet_Id : in Swagger.Long; - Result : out Samples.Petstore.Models.PetType); + Result : out Samples.Petstore.Models.Pet_Type); -- Update an existing pet procedure Update_Pet (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.PetType); + P_Body : in Samples.Petstore.Models.Pet_Type); -- Updates a pet in the store with form data procedure Update_Pet_With_Form @@ -64,7 +64,7 @@ package Samples.Petstore.Clients is Pet_Id : in Swagger.Long; Additional_Metadata : in Swagger.Nullable_UString; File : in Swagger.File_Part_Type; - Result : out Samples.Petstore.Models.ApiResponseType); + Result : out Samples.Petstore.Models.ApiResponse_Type); -- Delete purchase order by ID -- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -83,29 +83,29 @@ package Samples.Petstore.Clients is procedure Get_Order_By_Id (Client : in out Client_Type; Order_Id : in Swagger.Long; - Result : out Samples.Petstore.Models.OrderType); + Result : out Samples.Petstore.Models.Order_Type); -- Place an order for a pet procedure Place_Order (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.OrderType; - Result : out Samples.Petstore.Models.OrderType); + P_Body : in Samples.Petstore.Models.Order_Type; + Result : out Samples.Petstore.Models.Order_Type); -- Create user -- This can only be done by the logged in user. procedure Create_User (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.UserType); + P_Body : in Samples.Petstore.Models.User_Type); -- Creates list of users with given input array procedure Create_Users_With_Array_Input (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.UserType_Vectors.Vector); + P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector); -- Creates list of users with given input array procedure Create_Users_With_List_Input (Client : in out Client_Type; - P_Body : in Samples.Petstore.Models.UserType_Vectors.Vector); + P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector); -- Delete user -- This can only be done by the logged in user. @@ -117,7 +117,7 @@ package Samples.Petstore.Clients is procedure Get_User_By_Name (Client : in out Client_Type; Username : in Swagger.UString; - Result : out Samples.Petstore.Models.UserType); + Result : out Samples.Petstore.Models.User_Type); -- Logs user into the system procedure Login_User @@ -135,6 +135,6 @@ package Samples.Petstore.Clients is procedure Update_User (Client : in out Client_Type; Username : in Swagger.UString; - P_Body : in Samples.Petstore.Models.UserType); + P_Body : in Samples.Petstore.Models.User_Type); end Samples.Petstore.Clients; diff --git a/samples/client/petstore/ada/src/model/samples-petstore-models.adb b/samples/client/petstore/ada/src/model/samples-petstore-models.adb index d03b9401c378..db3f9463478e 100644 --- a/samples/client/petstore/ada/src/model/samples-petstore-models.adb +++ b/samples/client/petstore/ada/src/model/samples-petstore-models.adb @@ -1,10 +1,10 @@ -- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- --- OpenAPI spec version: 1.0.0 +-- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. @@ -17,7 +17,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in ApiResponseType) is + Value : in ApiResponse_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("code", Value.Code); @@ -28,7 +28,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in ApiResponseType_Vectors.Vector) is + Value : in ApiResponse_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop @@ -39,7 +39,7 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out ApiResponseType) is + Value : out ApiResponse_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); @@ -50,9 +50,9 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out ApiResponseType_Vectors.Vector) is + Value : out ApiResponse_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; - Item : ApiResponseType; + Item : ApiResponse_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); @@ -67,7 +67,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in TagType) is + Value : in Tag_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); @@ -77,7 +77,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in TagType_Vectors.Vector) is + Value : in Tag_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop @@ -88,7 +88,7 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out TagType) is + Value : out Tag_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); @@ -98,9 +98,9 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out TagType_Vectors.Vector) is + Value : out Tag_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; - Item : TagType; + Item : Tag_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); @@ -115,7 +115,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in CategoryType) is + Value : in Category_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); @@ -125,7 +125,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in CategoryType_Vectors.Vector) is + Value : in Category_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop @@ -136,7 +136,7 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out CategoryType) is + Value : out Category_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); @@ -146,9 +146,9 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out CategoryType_Vectors.Vector) is + Value : out Category_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; - Item : CategoryType; + Item : Category_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); @@ -163,7 +163,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in PetType) is + Value : in Pet_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); @@ -177,7 +177,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in PetType_Vectors.Vector) is + Value : in Pet_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop @@ -188,23 +188,23 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out PetType) is + Value : out Pet_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); - Swagger.Streams.Deserialize (Object, "category", Value.Category); + Deserialize (Object, "category", Value.Category); Swagger.Streams.Deserialize (Object, "name", Value.Name); Swagger.Streams.Deserialize (Object, "photoUrls", Value.Photo_Urls); - Swagger.Streams.Deserialize (Object, "tags", Value.Tags); + Deserialize (Object, "tags", Value.Tags); Swagger.Streams.Deserialize (Object, "status", Value.Status); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out PetType_Vectors.Vector) is + Value : out Pet_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; - Item : PetType; + Item : Pet_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); @@ -219,7 +219,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in UserType) is + Value : in User_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); @@ -235,7 +235,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in UserType_Vectors.Vector) is + Value : in User_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop @@ -246,7 +246,7 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out UserType) is + Value : out User_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); @@ -262,9 +262,9 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out UserType_Vectors.Vector) is + Value : out User_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; - Item : UserType; + Item : User_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); @@ -279,7 +279,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in OrderType) is + Value : in Order_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); @@ -293,7 +293,7 @@ package body Samples.Petstore.Models is procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in OrderType_Vectors.Vector) is + Value : in Order_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop @@ -304,23 +304,23 @@ package body Samples.Petstore.Models is procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out OrderType) is + Value : out Order_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "petId", Value.Pet_Id); Swagger.Streams.Deserialize (Object, "quantity", Value.Quantity); - Swagger.Streams.Deserialize (Object, "shipDate", Value.Ship_Date); + Deserialize (Object, "shipDate", Value.Ship_Date); Swagger.Streams.Deserialize (Object, "status", Value.Status); Swagger.Streams.Deserialize (Object, "complete", Value.Complete); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out OrderType_Vectors.Vector) is + Value : out Order_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; - Item : OrderType; + Item : Order_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); diff --git a/samples/client/petstore/ada/src/model/samples-petstore-models.ads b/samples/client/petstore/ada/src/model/samples-petstore-models.ads index f52cb0676fc4..4b0e867aa076 100644 --- a/samples/client/petstore/ada/src/model/samples-petstore-models.ads +++ b/samples/client/petstore/ada/src/model/samples-petstore-models.ads @@ -1,10 +1,10 @@ -- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- --- OpenAPI spec version: 1.0.0 +-- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. @@ -17,32 +17,32 @@ package Samples.Petstore.Models is -- An uploaded response -- Describes the result of uploading an image resource -- ------------------------------ - type ApiResponseType is + type ApiResponse_Type is record - Code : Integer; - P_Type : Swagger.UString; - Message : Swagger.UString; + Code : Swagger.Nullable_Integer; + P_Type : Swagger.Nullable_UString; + Message : Swagger.Nullable_UString; end record; - package ApiResponseType_Vectors is + package ApiResponse_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, - Element_Type => ApiResponseType); + Element_Type => ApiResponse_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in ApiResponseType); + Value : in ApiResponse_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in ApiResponseType_Vectors.Vector); + Value : in ApiResponse_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out ApiResponseType); + Value : out ApiResponse_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out ApiResponseType_Vectors.Vector); + Value : out ApiResponse_Type_Vectors.Vector); @@ -50,31 +50,31 @@ package Samples.Petstore.Models is -- Pet Tag -- A tag for a pet -- ------------------------------ - type TagType is + type Tag_Type is record - Id : Swagger.Long; - Name : Swagger.UString; + Id : Swagger.Nullable_Long; + Name : Swagger.Nullable_UString; end record; - package TagType_Vectors is + package Tag_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, - Element_Type => TagType); + Element_Type => Tag_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in TagType); + Value : in Tag_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in TagType_Vectors.Vector); + Value : in Tag_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out TagType); + Value : out Tag_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out TagType_Vectors.Vector); + Value : out Tag_Type_Vectors.Vector); @@ -82,31 +82,31 @@ package Samples.Petstore.Models is -- Pet category -- A category for a pet -- ------------------------------ - type CategoryType is + type Category_Type is record - Id : Swagger.Long; - Name : Swagger.UString; + Id : Swagger.Nullable_Long; + Name : Swagger.Nullable_UString; end record; - package CategoryType_Vectors is + package Category_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, - Element_Type => CategoryType); + Element_Type => Category_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in CategoryType); + Value : in Category_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in CategoryType_Vectors.Vector); + Value : in Category_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out CategoryType); + Value : out Category_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out CategoryType_Vectors.Vector); + Value : out Category_Type_Vectors.Vector); @@ -114,35 +114,35 @@ package Samples.Petstore.Models is -- a Pet -- A pet for sale in the pet store -- ------------------------------ - type PetType is + type Pet_Type is record - Id : Swagger.Long; - Category : Samples.Petstore.Models.CategoryType; + Id : Swagger.Nullable_Long; + Category : Samples.Petstore.Models.Category_Type; Name : Swagger.UString; Photo_Urls : Swagger.UString_Vectors.Vector; - Tags : Samples.Petstore.Models.TagType_Vectors.Vector; - Status : Swagger.UString; + Tags : Samples.Petstore.Models.Tag_Type_Vectors.Vector; + Status : Swagger.Nullable_UString; end record; - package PetType_Vectors is + package Pet_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, - Element_Type => PetType); + Element_Type => Pet_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in PetType); + Value : in Pet_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in PetType_Vectors.Vector); + Value : in Pet_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out PetType); + Value : out Pet_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out PetType_Vectors.Vector); + Value : out Pet_Type_Vectors.Vector); @@ -150,37 +150,37 @@ package Samples.Petstore.Models is -- a User -- A User who is purchasing from the pet store -- ------------------------------ - type UserType is + type User_Type is record - Id : Swagger.Long; - Username : Swagger.UString; - First_Name : Swagger.UString; - Last_Name : Swagger.UString; - Email : Swagger.UString; - Password : Swagger.UString; - Phone : Swagger.UString; - User_Status : Integer; + Id : Swagger.Nullable_Long; + Username : Swagger.Nullable_UString; + First_Name : Swagger.Nullable_UString; + Last_Name : Swagger.Nullable_UString; + Email : Swagger.Nullable_UString; + Password : Swagger.Nullable_UString; + Phone : Swagger.Nullable_UString; + User_Status : Swagger.Nullable_Integer; end record; - package UserType_Vectors is + package User_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, - Element_Type => UserType); + Element_Type => User_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in UserType); + Value : in User_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in UserType_Vectors.Vector); + Value : in User_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out UserType); + Value : out User_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out UserType_Vectors.Vector); + Value : out User_Type_Vectors.Vector); @@ -188,35 +188,35 @@ package Samples.Petstore.Models is -- Pet Order -- An order for a pets from the pet store -- ------------------------------ - type OrderType is + type Order_Type is record - Id : Swagger.Long; - Pet_Id : Swagger.Long; - Quantity : Integer; - Ship_Date : Swagger.Datetime; - Status : Swagger.UString; - Complete : Boolean; + Id : Swagger.Nullable_Long; + Pet_Id : Swagger.Nullable_Long; + Quantity : Swagger.Nullable_Integer; + Ship_Date : Swagger.Nullable_Date; + Status : Swagger.Nullable_UString; + Complete : Swagger.Nullable_Boolean; end record; - package OrderType_Vectors is + package Order_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, - Element_Type => OrderType); + Element_Type => Order_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in OrderType); + Value : in Order_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; - Value : in OrderType_Vectors.Vector); + Value : in Order_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out OrderType); + Value : out Order_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; - Value : out OrderType_Vectors.Vector); + Value : out Order_Type_Vectors.Vector); diff --git a/samples/client/petstore/ada/src/petstore.adb b/samples/client/petstore/ada/src/petstore.adb index 9c1db2490ad5..6254252e57c0 100644 --- a/samples/client/petstore/ada/src/petstore.adb +++ b/samples/client/petstore/ada/src/petstore.adb @@ -5,12 +5,10 @@ with Util.Http.Clients.Curl; with Ada.Text_IO; with Ada.Command_Line; with Ada.Calendar.Formatting; -with Ada.Strings.Unbounded; with Ada.Exceptions; -procedure Test is +procedure Petstore is use Ada.Text_IO; - use type Ada.Strings.Unbounded.Unbounded_String; procedure Usage; procedure Print_Pet (Pet : in Samples.Petstore.Models.Pet_Type); @@ -65,7 +63,7 @@ procedure Test is Need_Indent := False; Put ("URLs : "); for Url of Pet.Photo_Urls loop - Put_Line ((if Need_Indent then " " else "") & Swagger.To_String (Url.Value)); + Put_Line ((if Need_Indent then " " else "") & Url); Need_Indent := True; end loop; end if; @@ -130,10 +128,10 @@ procedure Test is begin for I in Arg .. Arg_Count loop declare - Status : Swagger.Nullable_UString_Vectors.Vector; + Status : Swagger.UString_Vectors.Vector; P : constant String := Ada.Command_Line.Argument (I); begin - Status.Append ((Is_Null => False, Value => Swagger.To_UString (P))); + Status.Append (New_Item => P); C.Find_Pets_By_Status (Status, Pets); for Pet of Pets loop Print_Pet (Pet); @@ -143,17 +141,17 @@ procedure Test is end List_Pet; procedure List_Inventory (C : in out Samples.Petstore.Clients.Client_Type) is - List : Swagger.Nullable_Integer_Map; - Iter : Swagger.Nullable_Integer_Maps.Cursor; + List : Swagger.Integer_Map; + Iter : Swagger.Integer_Maps.Cursor; begin C.Get_Inventory (List); Ada.Text_IO.Put_Line ("Inventory size " & Natural'Image (Natural (List.Length))); Iter := List.First; - while Swagger.Nullable_Integer_Maps.Has_Element (Iter) loop - Put (Swagger.Nullable_Integer_Maps.Key (Iter)); + while Swagger.Integer_Maps.Has_Element (Iter) loop + Put (Swagger.Integer_Maps.Key (Iter)); Set_Col (70); - Put_Line (Natural'Image (Swagger.Nullable_Integer_Maps.Element (Iter).Value)); - Swagger.Nullable_Integer_Maps.Next (Iter); + Put_Line (Natural'Image (Swagger.Integer_Maps.Element (Iter))); + Swagger.Integer_Maps.Next (Iter); end loop; end List_Inventory; @@ -271,4 +269,4 @@ begin Put_Line ("Constraint error raised: " & Ada.Exceptions.Exception_Message (E)); end; -end Test; +end Petstore; From ad4b9c711b18981cd197a3569a7f0c09c550ca18 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Thu, 26 Dec 2019 12:05:36 +0500 Subject: [PATCH 16/28] [MySQL] snake_case table and column names (#4860) * [MySQL] Add identifierNamingConvention option Possible values are "original" to not transform original names and "snake_case". * [MySQL] Add option tests * [MySQL] Update doc * [MySQL] Add original name to comment --- docs/generators/mysql-schema.md | 1 + .../codegen/languages/MysqlSchemaCodegen.java | 122 ++++++++++++++++-- .../codegen/mysql/MysqlSchemaCodegenTest.java | 20 +++ .../codegen/mysql/MysqlSchemaOptionsTest.java | 2 + .../options/MysqlSchemaOptionsProvider.java | 2 + 5 files changed, 139 insertions(+), 8 deletions(-) diff --git a/docs/generators/mysql-schema.md b/docs/generators/mysql-schema.md index 63a48d23da0d..6b48a721cb44 100644 --- a/docs/generators/mysql-schema.md +++ b/docs/generators/mysql-schema.md @@ -7,3 +7,4 @@ sidebar_label: mysql-schema | ------ | ----------- | ------ | ------- | |defaultDatabaseName|Default database name for all MySQL queries| || |jsonDataTypeEnabled|Use special JSON MySQL data type for complex model properties. Requires MySQL version 5.7.8. Generates TEXT data type when disabled| |true| +|identifierNamingConvention|Naming convention of MySQL identifiers(table names and column names). This is not related to database name which is defined by defaultDatabaseName option|
**original**
Do not transform original names
**snake_case**
Use snake_case names
|original| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java index 3376c2359ce8..788a981f75a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java @@ -24,12 +24,15 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.openapitools.codegen.utils.StringUtils.underscore; + public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig { private static final Logger LOGGER = LoggerFactory.getLogger(MysqlSchemaCodegen.class); public static final String CODEGEN_VENDOR_EXTENSION_KEY = "x-mysqlSchema"; public static final String DEFAULT_DATABASE_NAME = "defaultDatabaseName"; public static final String JSON_DATA_TYPE_ENABLED = "jsonDataTypeEnabled"; + public static final String IDENTIFIER_NAMING_CONVENTION = "identifierNamingConvention"; public static final Integer ENUM_MAX_ELEMENTS = 65535; public static final Integer IDENTIFIER_MAX_LENGTH = 64; @@ -53,6 +56,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig protected String tableNamePrefix = "tbl_", tableNameSuffix = ""; protected String columnNamePrefix = "col_", columnNameSuffix = ""; protected Boolean jsonDataTypeEnabled = true; + protected String identifierNamingConvention = "original"; public MysqlSchemaCodegen() { super(); @@ -158,6 +162,16 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig cliOptions.clear(); addOption(DEFAULT_DATABASE_NAME, "Default database name for all MySQL queries", defaultDatabaseName); addSwitch(JSON_DATA_TYPE_ENABLED, "Use special JSON MySQL data type for complex model properties. Requires MySQL version 5.7.8. Generates TEXT data type when disabled", jsonDataTypeEnabled); + + // we used to snake_case table/column names, let's add this option + CliOption identifierNamingOpt = new CliOption(IDENTIFIER_NAMING_CONVENTION, + "Naming convention of MySQL identifiers(table names and column names). This is not related to database name which is defined by " + DEFAULT_DATABASE_NAME + " option"); + + identifierNamingOpt.addEnum("original", "Do not transform original names") + .addEnum("snake_case", "Use snake_case names") + .setDefault("original"); + + cliOptions.add(identifierNamingOpt); } @Override @@ -195,6 +209,10 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig additionalProperties.put(JSON_DATA_TYPE_ENABLED, getJsonDataTypeEnabled()); } + if (additionalProperties.containsKey(IDENTIFIER_NAMING_CONVENTION)) { + this.setIdentifierNamingConvention((String) additionalProperties.get(IDENTIFIER_NAMING_CONVENTION)); + } + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("mysql_schema.mustache", "", "mysql_schema.sql")); } @@ -208,11 +226,18 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig Map mo = (Map) _mo; CodegenModel model = (CodegenModel) mo.get("model"); String modelName = model.getName(); + String tableName = this.toTableName(modelName); String modelDescription = model.getDescription(); Map modelVendorExtensions = model.getVendorExtensions(); Map mysqlSchema = new HashMap(); Map tableDefinition = new HashMap(); + if (this.getIdentifierNamingConvention().equals("snake_case") && !modelName.equals(tableName)) { + // add original name in table comment + String commentExtra = "Original model name - " + modelName + "."; + modelDescription = (modelDescription == null || modelDescription.isEmpty()) ? commentExtra : modelDescription + ". " + commentExtra; + } + if (modelVendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + modelName + "' model, autogeneration skipped"); @@ -220,7 +245,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig } else { modelVendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); mysqlSchema.put("tableDefinition", tableDefinition); - tableDefinition.put("tblName", toTableName(modelName)); + tableDefinition.put("tblName", tableName); tableDefinition.put("tblComment", modelDescription); } } @@ -271,6 +296,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig Map columnDefinition = new HashMap(); ArrayList columnDataTypeArguments = new ArrayList(); String baseName = property.getBaseName(); + String colName = this.toColumnName(baseName); String dataType = property.getDataType(); String dataFormat = property.getDataFormat(); String description = property.getDescription(); @@ -290,9 +316,15 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig return; } + if (this.getIdentifierNamingConvention().equals("snake_case") && !baseName.equals(colName)) { + // add original name in column comment + String commentExtra = "Original param name - " + baseName + "."; + description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; + } + vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); - columnDefinition.put("colName", toColumnName(baseName)); + columnDefinition.put("colName", colName); if (Boolean.TRUE.equals(isEnum)) { Map allowableValues = property.getAllowableValues(); @@ -352,6 +384,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig Map columnDefinition = new HashMap(); ArrayList columnDataTypeArguments = new ArrayList(); String baseName = property.getBaseName(); + String colName = this.toColumnName(baseName); String dataType = property.getDataType(); String dataFormat = property.getDataFormat(); String description = property.getDescription(); @@ -370,9 +403,15 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig return; } + if (this.getIdentifierNamingConvention().equals("snake_case") && !baseName.equals(colName)) { + // add original name in column comment + String commentExtra = "Original param name - " + baseName + "."; + description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; + } + vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); - columnDefinition.put("colName", toColumnName(baseName)); + columnDefinition.put("colName", colName); if (Boolean.TRUE.equals(isEnum)) { Map allowableValues = property.getAllowableValues(); @@ -431,6 +470,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig Map columnDefinition = new HashMap(); ArrayList columnDataTypeArguments = new ArrayList(); String baseName = property.getBaseName(); + String colName = this.toColumnName(baseName); String description = property.getDescription(); String defaultValue = property.getDefaultValue(); Boolean required = property.getRequired(); @@ -441,9 +481,15 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig return; } + if (this.getIdentifierNamingConvention().equals("snake_case") && !baseName.equals(colName)) { + // add original name in column comment + String commentExtra = "Original param name - " + baseName + "."; + description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; + } + vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); - columnDefinition.put("colName", toColumnName(baseName)); + columnDefinition.put("colName", colName); columnDefinition.put("colDataType", "TINYINT"); columnDefinition.put("colDataTypeArguments", columnDataTypeArguments); columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(1, false)); @@ -477,6 +523,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig Map columnDefinition = new HashMap(); ArrayList columnDataTypeArguments = new ArrayList(); String baseName = property.getBaseName(); + String colName = this.toColumnName(baseName); String dataType = property.getDataType(); String dataFormat = property.getDataFormat(); String description = property.getDescription(); @@ -492,9 +539,15 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig return; } + if (this.getIdentifierNamingConvention().equals("snake_case") && !baseName.equals(colName)) { + // add original name in column comment + String commentExtra = "Original param name - " + baseName + "."; + description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; + } + vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); - columnDefinition.put("colName", toColumnName(baseName)); + columnDefinition.put("colName", colName); if (Boolean.TRUE.equals(isEnum)) { Map allowableValues = property.getAllowableValues(); @@ -548,6 +601,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig Map mysqlSchema = new HashMap(); Map columnDefinition = new HashMap(); String baseName = property.getBaseName(); + String colName = this.toColumnName(baseName); String dataType = property.getDataType(); Boolean required = property.getRequired(); String description = property.getDescription(); @@ -559,9 +613,15 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig return; } + if (this.getIdentifierNamingConvention().equals("snake_case") && !baseName.equals(colName)) { + // add original name in column comment + String commentExtra = "Original param name - " + baseName + "."; + description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; + } + vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); - columnDefinition.put("colName", toColumnName(baseName)); + columnDefinition.put("colName", colName); columnDefinition.put("colDataType", dataType); if (Boolean.TRUE.equals(required)) { @@ -592,6 +652,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig Map mysqlSchema = new HashMap(); Map columnDefinition = new HashMap(); String baseName = property.getBaseName(); + String colName = this.toColumnName(baseName); String dataType = property.getDataType(); Boolean required = property.getRequired(); String description = property.getDescription(); @@ -603,9 +664,15 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig return; } + if (this.getIdentifierNamingConvention().equals("snake_case") && !baseName.equals(colName)) { + // add original name in column comment + String commentExtra = "Original param name - " + baseName + "."; + description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; + } + vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); - columnDefinition.put("colName", toColumnName(baseName)); + columnDefinition.put("colName", colName); columnDefinition.put("colDataType", dataType); if (Boolean.FALSE.equals(getJsonDataTypeEnabled())) { columnDefinition.put("colDataType", "TEXT"); @@ -640,6 +707,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig Map mysqlSchema = new HashMap(); Map columnDefinition = new HashMap(); String baseName = property.getBaseName(); + String colName = this.toColumnName(baseName); Boolean required = property.getRequired(); String description = property.getDescription(); String defaultValue = property.getDefaultValue(); @@ -650,9 +718,15 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig return; } + if (this.getIdentifierNamingConvention().equals("snake_case") && !baseName.equals(colName)) { + // add original name in column comment + String commentExtra = "Original param name - " + baseName + "."; + description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; + } + vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); - columnDefinition.put("colName", toColumnName(baseName)); + columnDefinition.put("colName", colName); columnDefinition.put("colDataType", "TEXT"); if (Boolean.TRUE.equals(required)) { @@ -897,6 +971,9 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public String toTableName(String name) { String identifier = toMysqlIdentifier(name, tableNamePrefix, tableNameSuffix); + if (identifierNamingConvention.equals("snake_case")) { + identifier = underscore(identifier); + } if (identifier.length() > IDENTIFIER_MAX_LENGTH) { LOGGER.warn("Table name cannot exceed 64 chars. Name '" + name + "' will be truncated"); identifier = identifier.substring(0, IDENTIFIER_MAX_LENGTH); @@ -913,6 +990,9 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig */ public String toColumnName(String name) { String identifier = toMysqlIdentifier(name, columnNamePrefix, columnNameSuffix); + if (identifierNamingConvention.equals("snake_case")) { + identifier = underscore(identifier); + } if (identifier.length() > IDENTIFIER_MAX_LENGTH) { LOGGER.warn("Column name cannot exceed 64 chars. Name '" + name + "' will be truncated"); identifier = identifier.substring(0, IDENTIFIER_MAX_LENGTH); @@ -1054,4 +1134,30 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig return this.jsonDataTypeEnabled; } + /** + * Sets identifier naming convention for table names and column names. + * This is not related to database name which is defined by defaultDatabaseName option. + * + * @param naming identifier naming convention (original|snake_case) + */ + public void setIdentifierNamingConvention(String naming) { + switch (naming) { + case "original": + case "snake_case": + this.identifierNamingConvention = naming; + break; + default: + LOGGER.warn("\"" + (String) naming + "\" is invalid \"identifierNamingConvention\" argument. Current \"" + (String) this.identifierNamingConvention + "\" used instead."); + } + } + + /** + * Returns identifier naming convention for table names and column names. + * + * @return identifier naming convention + */ + public String getIdentifierNamingConvention() { + return this.identifierNamingConvention; + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaCodegenTest.java index 7cf9fc80d3b9..b1fa6b646b50 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaCodegenTest.java @@ -274,4 +274,24 @@ public class MysqlSchemaCodegenTest { Assert.assertFalse(codegen.getJsonDataTypeEnabled()); } + @Test + public void testSetIdentifierNamingConvention() { + final MysqlSchemaCodegen codegen = new MysqlSchemaCodegen(); + Assert.assertSame("original", codegen.getIdentifierNamingConvention()); + codegen.setIdentifierNamingConvention("invalidValue"); + Assert.assertSame("original", codegen.getIdentifierNamingConvention()); + codegen.setIdentifierNamingConvention("snake_case"); + Assert.assertSame("snake_case", codegen.getIdentifierNamingConvention()); + codegen.setIdentifierNamingConvention("anotherInvalid"); + Assert.assertSame("snake_case", codegen.getIdentifierNamingConvention()); + } + + @Test + public void testGetIdentifierNamingConvention() { + final MysqlSchemaCodegen codegen = new MysqlSchemaCodegen(); + Assert.assertSame("original", codegen.getIdentifierNamingConvention()); + codegen.setIdentifierNamingConvention("snake_case"); + Assert.assertSame("snake_case", codegen.getIdentifierNamingConvention()); + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaOptionsTest.java index 677eaacdf846..01ce4a04884f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaOptionsTest.java @@ -45,6 +45,8 @@ public class MysqlSchemaOptionsTest extends AbstractOptionsTest { times = 1; clientCodegen.setJsonDataTypeEnabled(Boolean.valueOf(MysqlSchemaOptionsProvider.JSON_DATA_TYPE_ENABLED_VALUE)); times = 1; + clientCodegen.setIdentifierNamingConvention(MysqlSchemaOptionsProvider.IDENTIFIER_NAMING_CONVENTION_VALUE); + times = 1; }}; } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/MysqlSchemaOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/MysqlSchemaOptionsProvider.java index 1af42991c938..67218e924679 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/MysqlSchemaOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/MysqlSchemaOptionsProvider.java @@ -24,6 +24,7 @@ import java.util.Map; public class MysqlSchemaOptionsProvider implements OptionsProvider { public static final String DEFAULT_DATABASE_NAME_VALUE = "database_name"; public static final String JSON_DATA_TYPE_ENABLED_VALUE = "false"; + public static final String IDENTIFIER_NAMING_CONVENTION_VALUE = "snake_case"; @Override public String getLanguage() { @@ -35,6 +36,7 @@ public class MysqlSchemaOptionsProvider implements OptionsProvider { ImmutableMap.Builder builder = new ImmutableMap.Builder(); return builder.put(MysqlSchemaCodegen.DEFAULT_DATABASE_NAME, DEFAULT_DATABASE_NAME_VALUE) .put(MysqlSchemaCodegen.JSON_DATA_TYPE_ENABLED, JSON_DATA_TYPE_ENABLED_VALUE) + .put(MysqlSchemaCodegen.IDENTIFIER_NAMING_CONVENTION, IDENTIFIER_NAMING_CONVENTION_VALUE) .build(); } From d9c3af54e607cbdc03a7d1d8205c427ee7ace7e7 Mon Sep 17 00:00:00 2001 From: Javier Luque Sanabria Date: Thu, 26 Dec 2019 09:07:42 +0100 Subject: [PATCH 17/28] [Kotlin][Client] Update Reserved Keywords (#4793) * Update reservedWords from here: https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java * Order keywords. --- .../languages/AbstractKotlinCodegen.java | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index ed895fd5ac19..bed71307d4d2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -93,58 +93,24 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co // this includes hard reserved words defined by https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java // as well as keywords from https://kotlinlang.org/docs/reference/keyword-reference.html reservedWords = new HashSet(Arrays.asList( - "abstract", - "annotation", "as", "break", - "case", - "catch", "class", - "companion", - "const", - "constructor", "continue", - "crossinline", - "data", - "delegate", "do", "else", - "enum", - "external", "false", - "final", - "finally", "for", "fun", "if", "in", - "infix", - "init", - "inline", - "inner", "interface", - "internal", "is", - "it", - "lateinit", - "lazy", - "noinline", "null", "object", - "open", - "operator", - "out", - "override", "package", - "private", - "protected", - "public", - "reified", "return", - "sealed", "super", - "suspend", - "tailrec", "this", "throw", "true", @@ -153,7 +119,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co "typeof", "val", "var", - "vararg", "when", "while" )); From 9cab53403454e2f341d52f58406180ac294a2b88 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Thu, 26 Dec 2019 00:12:58 -0800 Subject: [PATCH 18/28] [Java] Fix serialized name of discriminator in JSON.mustache (#4672) * Use propertyBaseName instead of propertyName for discriminator * Revert "Use propertyBaseName instead of propertyName for discriminator" This reverts commit 389c5471ba0a71a8ba558c2859e64f08a5186f00. * Use propertyBaseName instead of propertyName for discriminator --- modules/openapi-generator/src/main/resources/Java/JSON.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/Java/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/JSON.mustache index b7f458c9d123..b951c3c555db 100644 --- a/modules/openapi-generator/src/main/resources/Java/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/JSON.mustache @@ -75,7 +75,7 @@ public class JSON { {{/mappedModels}} classByDiscriminatorValue.put("{{classname}}".toUpperCase(Locale.ROOT), {{classname}}.class); return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "{{{propertyName}}}")); + getDiscriminatorValue(readElement, "{{{propertyBaseName}}}")); } }) {{/discriminator}} From daec02b8c555484f61aceb2b40c887f6325f84cd Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Fri, 27 Dec 2019 14:42:05 +0800 Subject: [PATCH 19/28] [C-libcurl] Fix build error when the request operation has more than 1 parameter. (#4870) --- .../src/main/resources/C-libcurl/api-body.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 88e3a26d0aab..36ce98d9275a 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -39,7 +39,7 @@ {{#pathParams}} // Path Params - long sizeOfPathParams_{{{paramName}}} = {{#pathParams}}{{#isLong}}sizeof({{paramName}})+3{{/isLong}}{{#isString}}strlen({{paramName}})+3{{/isString}}{{/pathParams}} + strlen("{ {{paramName}} }"); + long sizeOfPathParams_{{{paramName}}} = {{#pathParams}}{{#isLong}}sizeof({{paramName}})+3{{/isLong}}{{#isString}}strlen({{paramName}})+3{{/isString}}{{#hasMore}} + {{/hasMore}}{{/pathParams}} + strlen("{ {{paramName}} }"); {{#isNumeric}} if({{paramName}} == 0){ goto end; From 376e419d0beffe2aaf419efe0143412b89b3738c Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 27 Dec 2019 02:42:32 -0500 Subject: [PATCH 20/28] Support models with multi-level hierarchy (via roxspring) (#4503) * Example of broken multi-level hierarchy * Support for multiple levels of hierarchy in model objects * Support for multiple levels of hierarchy in generators * Regenerated samples * Temporarily skip scalaz sample verification, which is having issue with Java version in CI container * Re-enable scalaz in verify samples Co-authored-by: Rob Oxspring --- .../openapitools/codegen/DefaultCodegen.java | 8 +- .../languages/AbstractEiffelCodegen.java | 2 +- .../languages/CSharpClientCodegen.java | 2 +- .../languages/CSharpNetCoreClientCodegen.java | 2 +- .../codegen/utils/ModelUtils.java | 35 +- .../codegen/DefaultCodegenTest.java | 1 + .../codegen/java/jaxrs/JavaJaxrsBaseTest.java | 1 + ...ith-fake-endpoints-models-for-testing.yaml | 8 + .../csharp-netcore/OpenAPIClient/README.md | 2 + .../OpenAPIClient/docs/BigCat.md | 10 + .../OpenAPIClient/docs/BigCatAllOf.md | 9 + .../Model/BigCatAllOfTests.cs | 71 ++++ .../Model/BigCatTests.cs | 71 ++++ .../src/Org.OpenAPITools/Model/Animal.cs | 2 + .../src/Org.OpenAPITools/Model/BigCat.cs | 158 ++++++++ .../src/Org.OpenAPITools/Model/BigCatAllOf.cs | 148 ++++++++ .../OpenAPIClientCore/README.md | 2 + .../OpenAPIClientCore/docs/BigCat.md | 10 + .../OpenAPIClientCore/docs/BigCatAllOf.md | 9 + .../Model/BigCatAllOfTests.cs | 71 ++++ .../Model/BigCatTests.cs | 71 ++++ .../src/Org.OpenAPITools/Model/Animal.cs | 2 + .../src/Org.OpenAPITools/Model/BigCat.cs | 158 ++++++++ .../src/Org.OpenAPITools/Model/BigCatAllOf.cs | 148 ++++++++ .../petstore/csharp/OpenAPIClient/README.md | 2 + .../csharp/OpenAPIClient/docs/BigCat.md | 14 + .../csharp/OpenAPIClient/docs/BigCatAllOf.md | 13 + .../Model/BigCatAllOfTests.cs | 79 ++++ .../Model/BigCatTests.cs | 79 ++++ .../src/Org.OpenAPITools/Model/Animal.cs | 1 + .../src/Org.OpenAPITools/Model/BigCat.cs | 163 +++++++++ .../src/Org.OpenAPITools/Model/BigCatAllOf.cs | 156 ++++++++ .../src/Org.OpenAPITools/Model/Cat.cs | 10 + .../lib/openapi_petstore/model/big_cat.ex | 31 ++ .../openapi_petstore/model/big_cat_all_of.ex | 25 ++ .../petstore/go/go-petstore-withXml/README.md | 2 + .../go/go-petstore-withXml/api/openapi.yaml | 13 + .../go/go-petstore-withXml/docs/BigCat.md | 14 + .../go-petstore-withXml/docs/BigCatAllOf.md | 11 + .../go/go-petstore-withXml/model_big_cat.go | 18 + .../model_big_cat_all_of.go | 15 + .../client/petstore/go/go-petstore/README.md | 2 + .../petstore/go/go-petstore/api/openapi.yaml | 13 + .../petstore/go/go-petstore/docs/BigCat.md | 14 + .../go/go-petstore/docs/BigCatAllOf.md | 11 + .../petstore/go/go-petstore/model_big_cat.go | 17 + .../go/go-petstore/model_big_cat_all_of.go | 14 + .../lib/OpenAPIPetstore/Model.hs | 103 ++++++ .../lib/OpenAPIPetstore/ModelLens.hs | 33 ++ .../petstore/haskell-http-client/openapi.yaml | 13 + .../haskell-http-client/tests/Instances.hs | 22 ++ .../haskell-http-client/tests/Test.hs | 2 + .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../java/google-api-client/docs/BigCat.md | 23 ++ .../google-api-client/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../petstore/java/jersey1/docs/BigCat.md | 23 ++ .../petstore/java/jersey1/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../java/jersey2-java6/docs/BigCat.md | 23 ++ .../java/jersey2-java6/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 144 ++++++++ .../client/model/BigCatAllOf.java | 140 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../java/jersey2-java8/docs/BigCat.md | 23 ++ .../java/jersey2-java8/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../petstore/java/jersey2/docs/BigCat.md | 23 ++ .../petstore/java/jersey2/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../petstore/java/native/docs/BigCat.md | 23 ++ .../petstore/java/native/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../docs/BigCat.md | 23 ++ .../docs/BigCatAllOf.md | 23 ++ .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/BigCat.java | 182 ++++++++++ .../client/model/BigCatAllOf.java | 175 +++++++++ .../client/model/BigCatAllOfTest.java | 51 +++ .../openapitools/client/model/BigCatTest.java | 77 ++++ .../petstore/java/okhttp-gson/docs/BigCat.md | 23 ++ .../java/okhttp-gson/docs/BigCatAllOf.md | 23 ++ .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/BigCat.java | 154 ++++++++ .../client/model/BigCatAllOf.java | 150 ++++++++ .../client/model/BigCatAllOfTest.java | 51 +++ .../openapitools/client/model/BigCatTest.java | 77 ++++ .../petstore/java/rest-assured/docs/BigCat.md | 23 ++ .../java/rest-assured/docs/BigCatAllOf.md | 23 ++ .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/BigCat.java | 154 ++++++++ .../client/model/BigCatAllOf.java | 150 ++++++++ .../client/model/BigCatAllOfTest.java | 51 +++ .../openapitools/client/model/BigCatTest.java | 77 ++++ .../petstore/java/resteasy/docs/BigCat.md | 23 ++ .../java/resteasy/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../java/resttemplate-withXml/docs/BigCat.md | 23 ++ .../resttemplate-withXml/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 152 ++++++++ .../client/model/BigCatAllOf.java | 148 ++++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../petstore/java/resttemplate/docs/BigCat.md | 23 ++ .../java/resttemplate/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../org/openapitools/client/model/BigCat.java | 154 ++++++++ .../client/model/BigCatAllOf.java | 150 ++++++++ .../client/model/BigCatAllOfTest.java | 51 +++ .../openapitools/client/model/BigCatTest.java | 77 ++++ .../java/retrofit2-play24/docs/BigCat.md | 23 ++ .../java/retrofit2-play24/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 147 ++++++++ .../client/model/BigCatAllOf.java | 143 ++++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../java/retrofit2-play25/docs/BigCat.md | 23 ++ .../java/retrofit2-play25/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 147 ++++++++ .../client/model/BigCatAllOf.java | 143 ++++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../java/retrofit2-play26/docs/BigCat.md | 23 ++ .../java/retrofit2-play26/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 147 ++++++++ .../client/model/BigCatAllOf.java | 143 ++++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../petstore/java/retrofit2/docs/BigCat.md | 23 ++ .../java/retrofit2/docs/BigCatAllOf.md | 23 ++ .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/BigCat.java | 154 ++++++++ .../client/model/BigCatAllOf.java | 150 ++++++++ .../client/model/BigCatAllOfTest.java | 51 +++ .../openapitools/client/model/BigCatTest.java | 77 ++++ .../petstore/java/retrofit2rx/docs/BigCat.md | 23 ++ .../java/retrofit2rx/docs/BigCatAllOf.md | 23 ++ .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/BigCat.java | 154 ++++++++ .../client/model/BigCatAllOf.java | 150 ++++++++ .../client/model/BigCatAllOfTest.java | 51 +++ .../openapitools/client/model/BigCatTest.java | 77 ++++ .../petstore/java/retrofit2rx2/docs/BigCat.md | 23 ++ .../java/retrofit2rx2/docs/BigCatAllOf.md | 23 ++ .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/BigCat.java | 154 ++++++++ .../client/model/BigCatAllOf.java | 150 ++++++++ .../client/model/BigCatAllOfTest.java | 51 +++ .../openapitools/client/model/BigCatTest.java | 77 ++++ .../client/petstore/java/vertx/docs/BigCat.md | 23 ++ .../petstore/java/vertx/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../petstore/java/webclient/docs/BigCat.md | 23 ++ .../java/webclient/docs/BigCatAllOf.md | 23 ++ .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/BigCat.java | 145 ++++++++ .../client/model/BigCatAllOf.java | 141 +++++++ .../client/model/BigCatAllOfTest.java | 49 +++ .../openapitools/client/model/BigCatTest.java | 75 ++++ .../client/petstore/javascript-es6/README.md | 2 + .../petstore/javascript-es6/docs/BigCat.md | 24 ++ .../javascript-es6/docs/BigCatAllOf.md | 24 ++ .../petstore/javascript-es6/src/index.js | 14 + .../javascript-es6/src/model/BigCat.js | 132 +++++++ .../javascript-es6/src/model/BigCatAllOf.js | 104 ++++++ .../javascript-es6/test/model/BigCat.spec.js | 65 ++++ .../test/model/BigCatAllOf.spec.js | 65 ++++ .../petstore/javascript-promise-es6/README.md | 2 + .../javascript-promise-es6/docs/BigCat.md | 24 ++ .../docs/BigCatAllOf.md | 24 ++ .../javascript-promise-es6/src/index.js | 14 + .../src/model/BigCat.js | 132 +++++++ .../src/model/BigCatAllOf.js | 104 ++++++ .../test/model/BigCat.spec.js | 65 ++++ .../test/model/BigCatAllOf.spec.js | 65 ++++ .../petstore/javascript-promise/README.md | 2 + .../javascript-promise/docs/BigCat.md | 24 ++ .../javascript-promise/docs/BigCatAllOf.md | 24 ++ .../petstore/javascript-promise/src/index.js | 16 +- .../javascript-promise/src/model/BigCat.js | 137 +++++++ .../src/model/BigCatAllOf.js | 105 ++++++ .../test/model/BigCat.spec.js | 67 ++++ .../test/model/BigCatAllOf.spec.js | 67 ++++ samples/client/petstore/javascript/README.md | 2 + .../client/petstore/javascript/docs/BigCat.md | 24 ++ .../petstore/javascript/docs/BigCatAllOf.md | 24 ++ .../client/petstore/javascript/src/index.js | 16 +- .../petstore/javascript/src/model/BigCat.js | 137 +++++++ .../javascript/src/model/BigCatAllOf.js | 105 ++++++ .../javascript/test/model/BigCat.spec.js | 67 ++++ .../javascript/test/model/BigCatAllOf.spec.js | 67 ++++ samples/client/petstore/perl/README.md | 6 + samples/client/petstore/perl/docs/BigCat.md | 15 + .../client/petstore/perl/docs/BigCatAllOf.md | 15 + .../lib/WWW/OpenAPIClient/Object/BigCat.pm | 198 ++++++++++ .../WWW/OpenAPIClient/Object/BigCatAllOf.pm | 184 ++++++++++ .../client/petstore/perl/t/BigCatAllOfTest.t | 33 ++ samples/client/petstore/perl/t/BigCatTest.t | 33 ++ .../petstore/php/OpenAPIClient-php/README.md | 2 + .../OpenAPIClient-php/docs/Model/BigCat.md | 11 + .../docs/Model/BigCatAllOf.md | 11 + .../OpenAPIClient-php/lib/Model/BigCat.php | 337 +++++++++++++++++ .../lib/Model/BigCatAllOf.php | 343 ++++++++++++++++++ .../test/Model/BigCatAllOfTest.php | 87 +++++ .../test/Model/BigCatTest.php | 87 +++++ .../client/petstore/python-asyncio/README.md | 2 + .../petstore/python-asyncio/docs/BigCat.md | 10 + .../python-asyncio/docs/BigCatAllOf.md | 10 + .../python-asyncio/petstore_api/__init__.py | 2 + .../petstore_api/models/__init__.py | 2 + .../petstore_api/models/animal.py | 3 +- .../petstore_api/models/big_cat.py | 126 +++++++ .../petstore_api/models/big_cat_all_of.py | 126 +++++++ .../python-asyncio/test/test_big_cat.py | 39 ++ .../test/test_big_cat_all_of.py | 39 ++ .../client/petstore/python-tornado/README.md | 2 + .../petstore/python-tornado/docs/BigCat.md | 10 + .../python-tornado/docs/BigCatAllOf.md | 10 + .../python-tornado/petstore_api/__init__.py | 2 + .../petstore_api/models/__init__.py | 2 + .../petstore_api/models/animal.py | 3 +- .../petstore_api/models/big_cat.py | 126 +++++++ .../petstore_api/models/big_cat_all_of.py | 126 +++++++ .../python-tornado/test/test_big_cat.py | 39 ++ .../test/test_big_cat_all_of.py | 39 ++ samples/client/petstore/python/README.md | 2 + samples/client/petstore/python/docs/BigCat.md | 10 + .../petstore/python/docs/BigCatAllOf.md | 10 + .../petstore/python/petstore_api/__init__.py | 2 + .../python/petstore_api/models/__init__.py | 2 + .../python/petstore_api/models/animal.py | 3 +- .../python/petstore_api/models/big_cat.py | 126 +++++++ .../petstore_api/models/big_cat_all_of.py | 126 +++++++ .../petstore/python/test/test_big_cat.py | 39 ++ .../python/test/test_big_cat_all_of.py | 39 ++ .../client/petstore/ruby-faraday/README.md | 2 + .../petstore/ruby-faraday/docs/BigCat.md | 17 + .../petstore/ruby-faraday/docs/BigCatAllOf.md | 17 + .../petstore/ruby-faraday/lib/petstore.rb | 2 + .../lib/petstore/models/big_cat.rb | 252 +++++++++++++ .../lib/petstore/models/big_cat_all_of.rb | 240 ++++++++++++ .../spec/models/big_cat_all_of_spec.rb | 45 +++ .../ruby-faraday/spec/models/big_cat_spec.rb | 45 +++ samples/client/petstore/ruby/README.md | 2 + samples/client/petstore/ruby/docs/BigCat.md | 17 + .../client/petstore/ruby/docs/BigCatAllOf.md | 17 + samples/client/petstore/ruby/lib/petstore.rb | 2 + .../ruby/lib/petstore/models/big_cat.rb | 252 +++++++++++++ .../lib/petstore/models/big_cat_all_of.rb | 240 ++++++++++++ .../ruby/spec/models/big_cat_all_of_spec.rb | 45 +++ .../petstore/ruby/spec/models/big_cat_spec.rb | 45 +++ .../petstore/scalaz/project/build.properties | 2 +- .../schema/petstore/mysql/mysql_schema.sql | 19 + .../java/org/openapitools/model/BigCat.java | 113 ++++++ .../org/openapitools/model/BigCatAllOf.java | 110 ++++++ .../app/apimodels/BigCat.java | 112 ++++++ .../app/apimodels/BigCatAllOf.java | 109 ++++++ .../public/openapi.json | 15 + .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 97 +++++ .../org/openapitools/model/BigCatAllOf.java | 95 +++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 137 +++++++ .../org/openapitools/model/BigCatAllOf.java | 134 +++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 113 ++++++ .../org/openapitools/model/BigCatAllOf.java | 110 ++++++ .../src/main/openapi/openapi.yaml | 13 + .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 113 ++++++ .../org/openapitools/model/BigCatAllOf.java | 110 ++++++ .../jaxrs-spec/src/main/openapi/openapi.yaml | 13 + .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 136 +++++++ .../org/openapitools/model/BigCatAllOf.java | 133 +++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 136 +++++++ .../org/openapitools/model/BigCatAllOf.java | 133 +++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 136 +++++++ .../org/openapitools/model/BigCatAllOf.java | 133 +++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 136 +++++++ .../org/openapitools/model/BigCatAllOf.java | 133 +++++++ samples/server/petstore/php-slim/README.md | 2 + .../petstore/php-slim/lib/Model/BigCat.php | 39 ++ .../php-slim/lib/Model/BigCatAllOf.php | 30 ++ .../php-slim/test/Model/BigCatAllOfTest.php | 84 +++++ .../php-slim/test/Model/BigCatTest.php | 105 ++++++ .../petstore/php-ze-ph/src/App/DTO/BigCat.php | 36 ++ .../php-ze-ph/src/App/DTO/BigCatAllOf.php | 18 + .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../src/main/resources/openapi.yaml | 13 + .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ .../openapitools/virtualan/model/Animal.java | 1 + .../openapitools/virtualan/model/BigCat.java | 118 ++++++ .../virtualan/model/BigCatAllOf.java | 115 ++++++ .../java/org/openapitools/model/Animal.java | 1 + .../java/org/openapitools/model/BigCat.java | 118 ++++++ .../org/openapitools/model/BigCatAllOf.java | 115 ++++++ 372 files changed, 23296 insertions(+), 21 deletions(-) create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCat.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCat.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatTests.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCat.cs create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCatAllOf.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClient/docs/BigCat.md create mode 100644 samples/client/petstore/csharp/OpenAPIClient/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs create mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex create mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex create mode 100644 samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md create mode 100644 samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/go/go-petstore-withXml/model_big_cat.go create mode 100644 samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go create mode 100644 samples/client/petstore/go/go-petstore/docs/BigCat.md create mode 100644 samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/go/go-petstore/model_big_cat.go create mode 100644 samples/client/petstore/go/go-petstore/model_big_cat_all_of.go create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/google-api-client/docs/BigCat.md create mode 100644 samples/client/petstore/java/google-api-client/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/jersey1/docs/BigCat.md create mode 100644 samples/client/petstore/java/jersey1/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/jersey2-java6/docs/BigCat.md create mode 100644 samples/client/petstore/java/jersey2-java6/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/docs/BigCat.md create mode 100644 samples/client/petstore/java/jersey2-java8/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/jersey2/docs/BigCat.md create mode 100644 samples/client/petstore/java/jersey2/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/native/docs/BigCat.md create mode 100644 samples/client/petstore/java/native/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/docs/BigCat.md create mode 100644 samples/client/petstore/java/okhttp-gson/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/rest-assured/docs/BigCat.md create mode 100644 samples/client/petstore/java/rest-assured/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/resteasy/docs/BigCat.md create mode 100644 samples/client/petstore/java/resteasy/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/docs/BigCat.md create mode 100644 samples/client/petstore/java/resttemplate-withXml/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/resttemplate/docs/BigCat.md create mode 100644 samples/client/petstore/java/resttemplate/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/retrofit2-play24/docs/BigCat.md create mode 100644 samples/client/petstore/java/retrofit2-play24/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/retrofit2-play25/docs/BigCat.md create mode 100644 samples/client/petstore/java/retrofit2-play25/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/retrofit2-play26/docs/BigCat.md create mode 100644 samples/client/petstore/java/retrofit2-play26/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/retrofit2/docs/BigCat.md create mode 100644 samples/client/petstore/java/retrofit2/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/retrofit2rx/docs/BigCat.md create mode 100644 samples/client/petstore/java/retrofit2rx/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/retrofit2rx2/docs/BigCat.md create mode 100644 samples/client/petstore/java/retrofit2rx2/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/vertx/docs/BigCat.md create mode 100644 samples/client/petstore/java/vertx/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/webclient/docs/BigCat.md create mode 100644 samples/client/petstore/java/webclient/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/javascript-es6/docs/BigCat.md create mode 100644 samples/client/petstore/javascript-es6/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/javascript-es6/src/model/BigCat.js create mode 100644 samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js create mode 100644 samples/client/petstore/javascript-es6/test/model/BigCat.spec.js create mode 100644 samples/client/petstore/javascript-es6/test/model/BigCatAllOf.spec.js create mode 100644 samples/client/petstore/javascript-promise-es6/docs/BigCat.md create mode 100644 samples/client/petstore/javascript-promise-es6/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/javascript-promise-es6/src/model/BigCat.js create mode 100644 samples/client/petstore/javascript-promise-es6/src/model/BigCatAllOf.js create mode 100644 samples/client/petstore/javascript-promise-es6/test/model/BigCat.spec.js create mode 100644 samples/client/petstore/javascript-promise-es6/test/model/BigCatAllOf.spec.js create mode 100644 samples/client/petstore/javascript-promise/docs/BigCat.md create mode 100644 samples/client/petstore/javascript-promise/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/javascript-promise/src/model/BigCat.js create mode 100644 samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js create mode 100644 samples/client/petstore/javascript-promise/test/model/BigCat.spec.js create mode 100644 samples/client/petstore/javascript-promise/test/model/BigCatAllOf.spec.js create mode 100644 samples/client/petstore/javascript/docs/BigCat.md create mode 100644 samples/client/petstore/javascript/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/javascript/src/model/BigCat.js create mode 100644 samples/client/petstore/javascript/src/model/BigCatAllOf.js create mode 100644 samples/client/petstore/javascript/test/model/BigCat.spec.js create mode 100644 samples/client/petstore/javascript/test/model/BigCatAllOf.spec.js create mode 100644 samples/client/petstore/perl/docs/BigCat.md create mode 100644 samples/client/petstore/perl/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCat.pm create mode 100644 samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm create mode 100644 samples/client/petstore/perl/t/BigCatAllOfTest.t create mode 100644 samples/client/petstore/perl/t/BigCatTest.t create mode 100644 samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCat.md create mode 100644 samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCatAllOf.md create mode 100644 samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php create mode 100644 samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php create mode 100644 samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php create mode 100644 samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatTest.php create mode 100644 samples/client/petstore/python-asyncio/docs/BigCat.md create mode 100644 samples/client/petstore/python-asyncio/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/big_cat.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/big_cat_all_of.py create mode 100644 samples/client/petstore/python-asyncio/test/test_big_cat.py create mode 100644 samples/client/petstore/python-asyncio/test/test_big_cat_all_of.py create mode 100644 samples/client/petstore/python-tornado/docs/BigCat.md create mode 100644 samples/client/petstore/python-tornado/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/big_cat.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/big_cat_all_of.py create mode 100644 samples/client/petstore/python-tornado/test/test_big_cat.py create mode 100644 samples/client/petstore/python-tornado/test/test_big_cat_all_of.py create mode 100644 samples/client/petstore/python/docs/BigCat.md create mode 100644 samples/client/petstore/python/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/python/petstore_api/models/big_cat.py create mode 100644 samples/client/petstore/python/petstore_api/models/big_cat_all_of.py create mode 100644 samples/client/petstore/python/test/test_big_cat.py create mode 100644 samples/client/petstore/python/test/test_big_cat_all_of.py create mode 100644 samples/client/petstore/ruby-faraday/docs/BigCat.md create mode 100644 samples/client/petstore/ruby-faraday/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb create mode 100644 samples/client/petstore/ruby/docs/BigCat.md create mode 100644 samples/client/petstore/ruby/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/ruby/lib/petstore/models/big_cat.rb create mode 100644 samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb create mode 100644 samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb create mode 100644 samples/client/petstore/ruby/spec/models/big_cat_spec.rb create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java create mode 100644 samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/php-slim/lib/Model/BigCat.php create mode 100644 samples/server/petstore/php-slim/lib/Model/BigCatAllOf.php create mode 100644 samples/server/petstore/php-slim/test/Model/BigCatAllOfTest.php create mode 100644 samples/server/petstore/php-slim/test/Model/BigCatTest.php create mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/BigCat.php create mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/BigCatAllOf.php create mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java create mode 100644 samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index a7b1dfdcb730..df595d68f08f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1876,7 +1876,7 @@ public class DefaultCodegen implements CodegenConfig { // parent model final String parentName = ModelUtils.getParentName(composed, allDefinitions); - final List allParents = ModelUtils.getAllParentsName(composed, allDefinitions); + final List allParents = ModelUtils.getAllParentsName(composed, allDefinitions, false); final Schema parent = StringUtils.isBlank(parentName) || allDefinitions == null ? null : allDefinitions.get(parentName); // TODO revise the logic below to set dicriminator, xml attributes @@ -2083,10 +2083,8 @@ public class DefaultCodegen implements CodegenConfig { Map allDefinitions = ModelUtils.getSchemas(this.openAPI); allDefinitions.forEach((childName, child) -> { if (child instanceof ComposedSchema && ((ComposedSchema) child).getAllOf() != null) { - Set parentSchemas = ((ComposedSchema) child).getAllOf().stream() - .filter(s -> s.get$ref() != null) - .map(s -> ModelUtils.getSimpleRef(s.get$ref())) - .collect(Collectors.toSet()); + + final List parentSchemas = ModelUtils.getAllParentsName((ComposedSchema) child, allDefinitions, true); if (parentSchemas.contains(schemaName)) { discriminator.getMappedModels().add(new MappedModel(childName, toModelName(childName))); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java index 49cf187a13a6..4b95e1038d48 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java @@ -477,7 +477,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co // Because the child models extend the parents, the enums will be available via the parent. // Only bother with reconciliation if the parent model has enums. - if (!parentCodegenModel.hasEnums) { + if (parentCodegenModel == null || !parentCodegenModel.hasEnums) { return codegenModel; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index 3efe1b9a6b0b..99232bc47bf8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -572,7 +572,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { } for (final CodegenProperty property : codegenModel.readWriteVars) { - if (property.defaultValue == null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { + if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { property.defaultValue = "\"" + name + "\""; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 34dd208b583f..20013cdf8ef5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -252,7 +252,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { } for (final CodegenProperty property : codegenModel.readWriteVars) { - if (property.defaultValue == null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { + if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { property.defaultValue = "\"" + name + "\""; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index ad53e421ef51..89c84256d6ec 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -937,7 +937,7 @@ public class ModelUtils { if (s == null) { LOGGER.error("Failed to obtain schema from {}", parentName); return "UNKNOWN_PARENT_NAME"; - } else if (s.getDiscriminator() != null && StringUtils.isNotEmpty(s.getDiscriminator().getPropertyName())) { + } else if (hasOrInheritsDiscriminator(s, allSchemas)) { // discriminator.propertyName is used return parentName; } else { @@ -961,7 +961,7 @@ public class ModelUtils { return null; } - public static List getAllParentsName(ComposedSchema composedSchema, Map allSchemas) { + public static List getAllParentsName(ComposedSchema composedSchema, Map allSchemas, boolean includeAncestors) { List interfaces = getInterfaces(composedSchema); List names = new ArrayList(); @@ -974,9 +974,12 @@ public class ModelUtils { if (s == null) { LOGGER.error("Failed to obtain schema from {}", parentName); names.add("UNKNOWN_PARENT_NAME"); - } else if (s.getDiscriminator() != null && StringUtils.isNotEmpty(s.getDiscriminator().getPropertyName())) { + } else if (hasOrInheritsDiscriminator(s, allSchemas)) { // discriminator.propertyName is used names.add(parentName); + if (includeAncestors && s instanceof ComposedSchema) { + names.addAll(getAllParentsName((ComposedSchema) s, allSchemas, true)); + } } else { LOGGER.debug("Not a parent since discriminator.propertyName is not set {}", s.get$ref()); // not a parent since discriminator.propertyName is not set @@ -990,6 +993,32 @@ public class ModelUtils { return names; } + private static boolean hasOrInheritsDiscriminator(Schema schema, Map allSchemas) { + if (schema.getDiscriminator() != null && StringUtils.isNotEmpty(schema.getDiscriminator().getPropertyName())) { + return true; + } + else if (StringUtils.isNotEmpty(schema.get$ref())) { + String parentName = getSimpleRef(schema.get$ref()); + Schema s = allSchemas.get(parentName); + if (s != null) { + return hasOrInheritsDiscriminator(s, allSchemas); + } + else { + LOGGER.error("Failed to obtain schema from {}", parentName); + } + } + else if (schema instanceof ComposedSchema) { + final ComposedSchema composed = (ComposedSchema) schema; + final List interfaces = getInterfaces(composed); + for (Schema i : interfaces) { + if (hasOrInheritsDiscriminator(i, allSchemas)) { + return true; + } + } + } + return false; + } + public static boolean isNullable(Schema schema) { if (schema == null) { return false; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 0f25bf02e8c7..d6fa3a188030 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -488,6 +488,7 @@ public class DefaultCodegenTest { test.setPropertyBaseName("className"); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Dog", "Dog")); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); + test.getMappedModels().add(new CodegenDiscriminator.MappedModel("BigCat", "BigCat")); Assert.assertEquals(discriminator, test); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java index ca580b8a75d1..a37aab8ce790 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java @@ -45,6 +45,7 @@ public abstract class JavaJaxrsBaseTest { String jsonSubType = "@JsonSubTypes({\n" + " @JsonSubTypes.Type(value = Dog.class, name = \"Dog\"),\n" + " @JsonSubTypes.Type(value = Cat.class, name = \"Cat\"),\n" + + " @JsonSubTypes.Type(value = BigDog.class, name = \"BigDog\"),\n" + "})"; assertFileContains(generator, outputPath + "/src/gen/java/org/openapitools/model/Animal.java", jsonTypeInfo, jsonSubType); } diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 73d734f75faa..02c9e70300b3 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1330,6 +1330,14 @@ definitions: properties: declawed: type: boolean + BigCat: + allOf: + - $ref: '#/definitions/Cat' + - type: object + properties: + kind: + type: string + enum: [lions, tigers, leopards, jaguars] Animal: type: object discriminator: className diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md index 46e3202f7158..eb8098a2e3b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md @@ -145,6 +145,8 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.BigCat](docs/BigCat.md) + - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCat.md new file mode 100644 index 000000000000..41c336e4ca9b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCat.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BigCat +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCatAllOf.md new file mode 100644 index 000000000000..88a739b7e4ab --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCatAllOf.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.BigCatAllOf +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..f1b24c7f8fe0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + public BigCatAllOfTests() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BigCatAllOf + /// + [Fact] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" BigCatAllOf + //Assert.IsInstanceOfType (instance, "variable 'instance' is a BigCatAllOf"); + } + + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..4bda812119c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + public BigCatTests() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BigCat + /// + [Fact] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" BigCat + //Assert.IsInstanceOfType (instance, "variable 'instance' is a BigCat"); + } + + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index 8631afa2dba2..43b638c4a8d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -34,8 +34,10 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable, IValidatableObject { /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..2fd960256c46 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + /// className (required). + /// color (default to "red"). + /// declawed. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BigCat).AreEqual; + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..5244a8f34882 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,148 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCatAllOf {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BigCatAllOf).AreEqual; + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index 78b126b56416..fd42741e8d4b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -157,6 +157,8 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.BigCat](docs/BigCat.md) + - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCat.md new file mode 100644 index 000000000000..41c336e4ca9b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCat.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BigCat +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCatAllOf.md new file mode 100644 index 000000000000..88a739b7e4ab --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCatAllOf.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.BigCatAllOf +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..f1b24c7f8fe0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + public BigCatAllOfTests() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BigCatAllOf + /// + [Fact] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" BigCatAllOf + //Assert.IsInstanceOfType (instance, "variable 'instance' is a BigCatAllOf"); + } + + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..4bda812119c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + public BigCatTests() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BigCat + /// + [Fact] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" BigCat + //Assert.IsInstanceOfType (instance, "variable 'instance' is a BigCat"); + } + + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs index 8631afa2dba2..43b638c4a8d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs @@ -34,8 +34,10 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable, IValidatableObject { /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..2fd960256c46 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + /// className (required). + /// color (default to "red"). + /// declawed. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BigCat).AreEqual; + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..5244a8f34882 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,148 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCatAllOf {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as BigCatAllOf).AreEqual; + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index 7bd9201f88b7..5f55053b6f59 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -159,6 +159,8 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.BigCat](docs/BigCat.md) + - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/BigCat.md b/samples/client/petstore/csharp/OpenAPIClient/docs/BigCat.md new file mode 100644 index 000000000000..6247107ab35f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/BigCat.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/BigCatAllOf.md b/samples/client/petstore/csharp/OpenAPIClient/docs/BigCatAllOf.md new file mode 100644 index 000000000000..864c2298e03c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/BigCatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..4cbdb4b8a5e5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCatAllOf + /// + [Test] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCatAllOf + //Assert.IsInstanceOf(typeof(BigCatAllOf), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..1d78ea9f1e6d --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCat + /// + [Test] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCat + //Assert.IsInstanceOf(typeof(BigCat), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index d158ed573a6d..eb9b58f20753 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -32,6 +32,7 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable, IValidatableObject { /// diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..ffdab926c34c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCat); + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in base.BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..79871b557bab --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCatAllOf {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCatAllOf); + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 1c28fb2755f7..42674c5ffce8 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -122,6 +122,16 @@ namespace Org.OpenAPITools.Model /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach(var x in base.BaseValidate(validationContext)) yield return x; yield break; diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex new file mode 100644 index 000000000000..46d755bde725 --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex @@ -0,0 +1,31 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenapiPetstore.Model.BigCat do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"className", + :"color", + :"declawed", + :"kind" + ] + + @type t :: %__MODULE__{ + :"className" => String.t, + :"color" => String.t | nil, + :"declawed" => boolean() | nil, + :"kind" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenapiPetstore.Model.BigCat do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex new file mode 100644 index 000000000000..739bdd5ee4dc --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenapiPetstore.Model.BigCatAllOf do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"kind" + ] + + @type t :: %__MODULE__{ + :"kind" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenapiPetstore.Model.BigCatAllOf do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/go/go-petstore-withXml/README.md b/samples/client/petstore/go/go-petstore-withXml/README.md index 59f48a22aac6..b4fd0109ce2e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/README.md +++ b/samples/client/petstore/go/go-petstore-withXml/README.md @@ -86,6 +86,8 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BigCat](docs/BigCat.md) + - [BigCatAllOf](docs/BigCatAllOf.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index 94c46a5bb5db..be5513053398 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -1422,6 +1422,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2086,6 +2090,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md b/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md new file mode 100644 index 000000000000..a23cd724fb99 --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md @@ -0,0 +1,14 @@ +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to red] +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md b/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md new file mode 100644 index 000000000000..03d37ee1031a --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md @@ -0,0 +1,11 @@ +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go new file mode 100644 index 000000000000..a0a9c70fd860 --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go @@ -0,0 +1,18 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore +// BigCat struct for BigCat +type BigCat struct { + ClassName string `json:"className" xml:"className"` + Color string `json:"color,omitempty" xml:"color"` + Declawed bool `json:"declawed,omitempty" xml:"declawed"` + Kind string `json:"kind,omitempty" xml:"kind"` +} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go new file mode 100644 index 000000000000..49e5fa32504c --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore +// BigCatAllOf struct for BigCatAllOf +type BigCatAllOf struct { + Kind string `json:"kind,omitempty" xml:"kind"` +} diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 59f48a22aac6..b4fd0109ce2e 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -86,6 +86,8 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BigCat](docs/BigCat.md) + - [BigCatAllOf](docs/BigCatAllOf.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 94c46a5bb5db..be5513053398 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1422,6 +1422,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2086,6 +2090,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/go/go-petstore/docs/BigCat.md b/samples/client/petstore/go/go-petstore/docs/BigCat.md new file mode 100644 index 000000000000..a23cd724fb99 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/BigCat.md @@ -0,0 +1,14 @@ +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to red] +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md b/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md new file mode 100644 index 000000000000..03d37ee1031a --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md @@ -0,0 +1,11 @@ +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/go/go-petstore/model_big_cat.go b/samples/client/petstore/go/go-petstore/model_big_cat.go new file mode 100644 index 000000000000..70d790c65426 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_big_cat.go @@ -0,0 +1,17 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore +// BigCat struct for BigCat +type BigCat struct { + ClassName string `json:"className"` + Color string `json:"color,omitempty"` + Declawed bool `json:"declawed,omitempty"` + Kind string `json:"kind,omitempty"` +} diff --git a/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go new file mode 100644 index 000000000000..93e796483ac8 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go @@ -0,0 +1,14 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore +// BigCatAllOf struct for BigCatAllOf +type BigCatAllOf struct { + Kind string `json:"kind,omitempty"` +} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 8bfb741aeb1a..1331ed4b237d 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -653,6 +653,75 @@ mkArrayTest = , arrayTestArrayArrayOfModel = Nothing } +-- ** BigCat +-- | BigCat +data BigCat = BigCat + { bigCatClassName :: !(Text) -- ^ /Required/ "className" + , bigCatColor :: !(Maybe Text) -- ^ "color" + , bigCatDeclawed :: !(Maybe Bool) -- ^ "declawed" + , bigCatKind :: !(Maybe E'Kind) -- ^ "kind" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON BigCat +instance A.FromJSON BigCat where + parseJSON = A.withObject "BigCat" $ \o -> + BigCat + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") + <*> (o .:? "kind") + +-- | ToJSON BigCat +instance A.ToJSON BigCat where + toJSON BigCat {..} = + _omitNulls + [ "className" .= bigCatClassName + , "color" .= bigCatColor + , "declawed" .= bigCatDeclawed + , "kind" .= bigCatKind + ] + + +-- | Construct a value of type 'BigCat' (by applying it's required fields, if any) +mkBigCat + :: Text -- ^ 'bigCatClassName' + -> BigCat +mkBigCat bigCatClassName = + BigCat + { bigCatClassName + , bigCatColor = Nothing + , bigCatDeclawed = Nothing + , bigCatKind = Nothing + } + +-- ** BigCatAllOf +-- | BigCatAllOf +data BigCatAllOf = BigCatAllOf + { bigCatAllOfKind :: !(Maybe E'Kind) -- ^ "kind" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON BigCatAllOf +instance A.FromJSON BigCatAllOf where + parseJSON = A.withObject "BigCatAllOf" $ \o -> + BigCatAllOf + <$> (o .:? "kind") + +-- | ToJSON BigCatAllOf +instance A.ToJSON BigCatAllOf where + toJSON BigCatAllOf {..} = + _omitNulls + [ "kind" .= bigCatAllOfKind + ] + + +-- | Construct a value of type 'BigCatAllOf' (by applying it's required fields, if any) +mkBigCatAllOf + :: BigCatAllOf +mkBigCatAllOf = + BigCatAllOf + { bigCatAllOfKind = Nothing + } + -- ** Capitalization -- | Capitalization data Capitalization = Capitalization @@ -2199,6 +2268,40 @@ toE'JustSymbol = \case s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s +-- ** E'Kind + +-- | Enum of 'Text' +data E'Kind + = E'Kind'Lions -- ^ @"lions"@ + | E'Kind'Tigers -- ^ @"tigers"@ + | E'Kind'Leopards -- ^ @"leopards"@ + | E'Kind'Jaguars -- ^ @"jaguars"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Kind where toJSON = A.toJSON . fromE'Kind +instance A.FromJSON E'Kind where parseJSON o = P.either P.fail (pure . P.id) . toE'Kind =<< A.parseJSON o +instance WH.ToHttpApiData E'Kind where toQueryParam = WH.toQueryParam . fromE'Kind +instance WH.FromHttpApiData E'Kind where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Kind +instance MimeRender MimeMultipartFormData E'Kind where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Kind' enum +fromE'Kind :: E'Kind -> Text +fromE'Kind = \case + E'Kind'Lions -> "lions" + E'Kind'Tigers -> "tigers" + E'Kind'Leopards -> "leopards" + E'Kind'Jaguars -> "jaguars" + +-- | parse 'E'Kind' enum +toE'Kind :: Text -> P.Either String E'Kind +toE'Kind = \case + "lions" -> P.Right E'Kind'Lions + "tigers" -> P.Right E'Kind'Tigers + "leopards" -> P.Right E'Kind'Leopards + "jaguars" -> P.Right E'Kind'Jaguars + s -> P.Left $ "toE'Kind: enum parse failure: " P.++ P.show s + + -- ** E'Status -- | Enum of 'Text' . diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index 4926ee6c8302..32c3b2159809 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -228,6 +228,39 @@ arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> Ar +-- * BigCat + +-- | 'bigCatClassName' Lens +bigCatClassNameL :: Lens_' BigCat (Text) +bigCatClassNameL f BigCat{..} = (\bigCatClassName -> BigCat { bigCatClassName, ..} ) <$> f bigCatClassName +{-# INLINE bigCatClassNameL #-} + +-- | 'bigCatColor' Lens +bigCatColorL :: Lens_' BigCat (Maybe Text) +bigCatColorL f BigCat{..} = (\bigCatColor -> BigCat { bigCatColor, ..} ) <$> f bigCatColor +{-# INLINE bigCatColorL #-} + +-- | 'bigCatDeclawed' Lens +bigCatDeclawedL :: Lens_' BigCat (Maybe Bool) +bigCatDeclawedL f BigCat{..} = (\bigCatDeclawed -> BigCat { bigCatDeclawed, ..} ) <$> f bigCatDeclawed +{-# INLINE bigCatDeclawedL #-} + +-- | 'bigCatKind' Lens +bigCatKindL :: Lens_' BigCat (Maybe E'Kind) +bigCatKindL f BigCat{..} = (\bigCatKind -> BigCat { bigCatKind, ..} ) <$> f bigCatKind +{-# INLINE bigCatKindL #-} + + + +-- * BigCatAllOf + +-- | 'bigCatAllOfKind' Lens +bigCatAllOfKindL :: Lens_' BigCatAllOf (Maybe E'Kind) +bigCatAllOfKindL f BigCatAllOf{..} = (\bigCatAllOfKind -> BigCatAllOf { bigCatAllOfKind, ..} ) <$> f bigCatAllOfKind +{-# INLINE bigCatAllOfKindL #-} + + + -- * Capitalization -- | 'capitalizationSmallCamel' Lens diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 94c46a5bb5db..be5513053398 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1422,6 +1422,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2086,6 +2090,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 3b5bf7a9842c..bb674c55b3a4 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -223,6 +223,25 @@ genArrayTest n = <*> arbitraryReducedMaybe n -- arrayTestArrayArrayOfInteger :: Maybe [[Integer]] <*> arbitraryReducedMaybe n -- arrayTestArrayArrayOfModel :: Maybe [[ReadOnlyFirst]] +instance Arbitrary BigCat where + arbitrary = sized genBigCat + +genBigCat :: Int -> Gen BigCat +genBigCat n = + BigCat + <$> arbitrary -- bigCatClassName :: Text + <*> arbitraryReducedMaybe n -- bigCatColor :: Maybe Text + <*> arbitraryReducedMaybe n -- bigCatDeclawed :: Maybe Bool + <*> arbitraryReducedMaybe n -- bigCatKind :: Maybe E'Kind + +instance Arbitrary BigCatAllOf where + arbitrary = sized genBigCatAllOf + +genBigCatAllOf :: Int -> Gen BigCatAllOf +genBigCatAllOf n = + BigCatAllOf + <$> arbitraryReducedMaybe n -- bigCatAllOfKind :: Maybe E'Kind + instance Arbitrary Capitalization where arbitrary = sized genCapitalization @@ -598,6 +617,9 @@ instance Arbitrary E'Inner where instance Arbitrary E'JustSymbol where arbitrary = arbitraryBoundedEnum +instance Arbitrary E'Kind where + arbitrary = arbitraryBoundedEnum + instance Arbitrary E'Status where arbitrary = arbitraryBoundedEnum diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index 6db1f28e4d6d..bcb0761e838b 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -33,6 +33,8 @@ main = propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) propMimeEq MimeJSON (Proxy :: Proxy ArrayOfNumberOnly) propMimeEq MimeJSON (Proxy :: Proxy ArrayTest) + propMimeEq MimeJSON (Proxy :: Proxy BigCat) + propMimeEq MimeJSON (Proxy :: Proxy BigCatAllOf) propMimeEq MimeJSON (Proxy :: Proxy Capitalization) propMimeEq MimeJSON (Proxy :: Proxy Cat) propMimeEq MimeJSON (Proxy :: Proxy CatAllOf) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index 845a10ecb10d..714c03c8e783 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -38,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/google-api-client/docs/BigCat.md b/samples/client/petstore/java/google-api-client/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/google-api-client/docs/BigCatAllOf.md b/samples/client/petstore/java/google-api-client/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey1/docs/BigCat.md b/samples/client/petstore/java/jersey1/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey1/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey1/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-java6/docs/BigCat.md b/samples/client/petstore/java/jersey2-java6/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-java6/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2-java6/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java index cb94f281e853..741e51b2a6e9 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..a3e0b8be2e1b --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return ObjectUtils.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return ObjectUtils.hashCodeMulti(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..c3b5efaddd35 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return ObjectUtils.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return ObjectUtils.hashCodeMulti(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/docs/BigCat.md b/samples/client/petstore/java/jersey2-java8/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2-java8/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2/docs/BigCat.md b/samples/client/petstore/java/jersey2/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/native/docs/BigCat.md b/samples/client/petstore/java/native/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/native/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/native/docs/BigCatAllOf.md b/samples/client/petstore/java/native/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/native/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java index e23989865e01..3f214bf1fbf4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java @@ -58,6 +58,7 @@ public class JSON { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..d3bc09ea37fd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,182 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * BigCat + */ + +public class BigCat extends Cat implements Parcelable { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public BigCat() { + super(); + } + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + super.writeToParcel(out, flags); + out.writeValue(kind); + } + + BigCat(Parcel in) { + super(in); + kind = (KindEnum)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public BigCat createFromParcel(Parcel in) { + return new BigCat(in); + } + public BigCat[] newArray(int size) { + return new BigCat[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..1cc92cea52c8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,175 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf implements Parcelable { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public BigCatAllOf() { + } + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + out.writeValue(kind); + } + + BigCatAllOf(Parcel in) { + kind = (KindEnum)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public BigCatAllOf createFromParcel(Parcel in) { + return new BigCatAllOf(in); + } + public BigCatAllOf[] newArray(int size) { + return new BigCatAllOf[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/docs/BigCat.md b/samples/client/petstore/java/okhttp-gson/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/BigCatAllOf.md b/samples/client/petstore/java/okhttp-gson/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index e23989865e01..3f214bf1fbf4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -58,6 +58,7 @@ public class JSON { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/rest-assured/docs/BigCat.md b/samples/client/petstore/java/rest-assured/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/rest-assured/docs/BigCatAllOf.md b/samples/client/petstore/java/rest-assured/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java index e23989865e01..3f214bf1fbf4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java @@ -58,6 +58,7 @@ public class JSON { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resteasy/docs/BigCat.md b/samples/client/petstore/java/resteasy/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resteasy/docs/BigCatAllOf.md b/samples/client/petstore/java/resteasy/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/BigCat.md b/samples/client/petstore/java/resttemplate-withXml/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/BigCatAllOf.md b/samples/client/petstore/java/resttemplate-withXml/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index 38646431b455..9b0fa3ff89d8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ import javax.xml.bind.annotation.*; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) @XmlRootElement(name = "Animal") diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..a578309d5b51 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,152 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +@XmlRootElement(name = "BigCat") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BigCat") +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @XmlElement(name = "kind") + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "kind") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..65817c4f4c8d --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,148 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +@XmlRootElement(name = "BigCatAllOf") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BigCatAllOf") +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @XmlElement(name = "kind") + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "kind") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resttemplate/docs/BigCat.md b/samples/client/petstore/java/resttemplate/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resttemplate/docs/BigCatAllOf.md b/samples/client/petstore/java/resttemplate/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play24/docs/BigCat.md b/samples/client/petstore/java/retrofit2-play24/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2-play24/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java index fa37d5584483..6f607263996a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ import javax.validation.Valid; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..fa4339d591bc --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..754e37125b36 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play25/docs/BigCat.md b/samples/client/petstore/java/retrofit2-play25/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2-play25/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java index fa37d5584483..6f607263996a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ import javax.validation.Valid; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..fa4339d591bc --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..754e37125b36 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/docs/BigCat.md b/samples/client/petstore/java/retrofit2-play26/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play26/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2-play26/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index fa37d5584483..6f607263996a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ import javax.validation.Valid; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..fa4339d591bc --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..754e37125b36 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2/docs/BigCat.md b/samples/client/petstore/java/retrofit2/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java index 607f7de40b21..f5933046f948 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java @@ -55,6 +55,7 @@ public class JSON { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2rx/docs/BigCat.md b/samples/client/petstore/java/retrofit2rx/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2rx/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java index 607f7de40b21..f5933046f948 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java @@ -55,6 +55,7 @@ public class JSON { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2rx2/docs/BigCat.md b/samples/client/petstore/java/retrofit2rx2/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2rx2/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java index 607f7de40b21..f5933046f948 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java @@ -55,6 +55,7 @@ public class JSON { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/vertx/docs/BigCat.md b/samples/client/petstore/java/vertx/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/vertx/docs/BigCatAllOf.md b/samples/client/petstore/java/vertx/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/webclient/docs/BigCat.md b/samples/client/petstore/java/webclient/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/webclient/docs/BigCatAllOf.md b/samples/client/petstore/java/webclient/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index 711b08bb799e..09bc0b0ffe97 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -174,6 +174,8 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayTest](docs/ArrayTest.md) + - [OpenApiPetstore.BigCat](docs/BigCat.md) + - [OpenApiPetstore.BigCatAllOf](docs/BigCatAllOf.md) - [OpenApiPetstore.Capitalization](docs/Capitalization.md) - [OpenApiPetstore.Cat](docs/Cat.md) - [OpenApiPetstore.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/javascript-es6/docs/BigCat.md b/samples/client/petstore/javascript-es6/docs/BigCat.md new file mode 100644 index 000000000000..bbd79b2ba1bb --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/BigCat.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-es6/docs/BigCatAllOf.md b/samples/client/petstore/javascript-es6/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c5e83bfdaebb --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-es6/src/index.js b/samples/client/petstore/javascript-es6/src/index.js index 105b2767803f..e4dc27efbc35 100644 --- a/samples/client/petstore/javascript-es6/src/index.js +++ b/samples/client/petstore/javascript-es6/src/index.js @@ -26,6 +26,8 @@ import ApiResponse from './model/ApiResponse'; import ArrayOfArrayOfNumberOnly from './model/ArrayOfArrayOfNumberOnly'; import ArrayOfNumberOnly from './model/ArrayOfNumberOnly'; import ArrayTest from './model/ArrayTest'; +import BigCat from './model/BigCat'; +import BigCatAllOf from './model/BigCatAllOf'; import Capitalization from './model/Capitalization'; import Cat from './model/Cat'; import CatAllOf from './model/CatAllOf'; @@ -183,6 +185,18 @@ export { */ ArrayTest, + /** + * The BigCat model constructor. + * @property {module:model/BigCat} + */ + BigCat, + + /** + * The BigCatAllOf model constructor. + * @property {module:model/BigCatAllOf} + */ + BigCatAllOf, + /** * The Capitalization model constructor. * @property {module:model/Capitalization} diff --git a/samples/client/petstore/javascript-es6/src/model/BigCat.js b/samples/client/petstore/javascript-es6/src/model/BigCat.js new file mode 100644 index 000000000000..764e45d31dc9 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/BigCat.js @@ -0,0 +1,132 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import BigCatAllOf from './BigCatAllOf'; +import Cat from './Cat'; + +/** + * The BigCat model module. + * @module model/BigCat + * @version 1.0.0 + */ +class BigCat { + /** + * Constructs a new BigCat. + * @alias module:model/BigCat + * @extends module:model/Cat + * @implements module:model/Cat + * @implements module:model/BigCatAllOf + * @param className {String} + */ + constructor(className) { + Cat.initialize(this, className);BigCatAllOf.initialize(this); + BigCat.initialize(this, className); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a BigCat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCat} obj Optional instance to populate. + * @return {module:model/BigCat} The populated BigCat instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BigCat(); + Cat.constructFromObject(data, obj); + Cat.constructFromObject(data, obj); + BigCatAllOf.constructFromObject(data, obj); + + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {module:model/BigCat.KindEnum} kind + */ +BigCat.prototype['kind'] = undefined; + + +// Implement Cat interface: +/** + * @member {String} className + */ +Cat.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Cat.prototype['color'] = 'red'; +/** + * @member {Boolean} declawed + */ +Cat.prototype['declawed'] = undefined; +// Implement BigCatAllOf interface: +/** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +BigCatAllOf.prototype['kind'] = undefined; + + + +/** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ +BigCat['KindEnum'] = { + + /** + * value: "lions" + * @const + */ + "lions": "lions", + + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" +}; + + + +export default BigCat; + diff --git a/samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js b/samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js new file mode 100644 index 000000000000..1b79f1a2849f --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js @@ -0,0 +1,104 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The BigCatAllOf model module. + * @module model/BigCatAllOf + * @version 1.0.0 + */ +class BigCatAllOf { + /** + * Constructs a new BigCatAllOf. + * @alias module:model/BigCatAllOf + */ + constructor() { + + BigCatAllOf.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a BigCatAllOf from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCatAllOf} obj Optional instance to populate. + * @return {module:model/BigCatAllOf} The populated BigCatAllOf instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BigCatAllOf(); + + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +BigCatAllOf.prototype['kind'] = undefined; + + + + + +/** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ +BigCatAllOf['KindEnum'] = { + + /** + * value: "lions" + * @const + */ + "lions": "lions", + + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" +}; + + + +export default BigCatAllOf; + diff --git a/samples/client/petstore/javascript-es6/test/model/BigCat.spec.js b/samples/client/petstore/javascript-es6/test/model/BigCat.spec.js new file mode 100644 index 000000000000..c21833ff2293 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/BigCat.spec.js @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCat', function() { + it('should create an instance of BigCat', function() { + // uncomment below and update the code to test BigCat + //var instane = new OpenApiPetstore.BigCat(); + //expect(instance).to.be.a(OpenApiPetstore.BigCat); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instane = new OpenApiPetstore.BigCat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/test/model/BigCatAllOf.spec.js b/samples/client/petstore/javascript-es6/test/model/BigCatAllOf.spec.js new file mode 100644 index 000000000000..c27440b42c34 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/BigCatAllOf.spec.js @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCatAllOf(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCatAllOf', function() { + it('should create an instance of BigCatAllOf', function() { + // uncomment below and update the code to test BigCatAllOf + //var instane = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be.a(OpenApiPetstore.BigCatAllOf); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instane = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index b325aae54043..ed1a7dcbddf9 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -172,6 +172,8 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayTest](docs/ArrayTest.md) + - [OpenApiPetstore.BigCat](docs/BigCat.md) + - [OpenApiPetstore.BigCatAllOf](docs/BigCatAllOf.md) - [OpenApiPetstore.Capitalization](docs/Capitalization.md) - [OpenApiPetstore.Cat](docs/Cat.md) - [OpenApiPetstore.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/javascript-promise-es6/docs/BigCat.md b/samples/client/petstore/javascript-promise-es6/docs/BigCat.md new file mode 100644 index 000000000000..bbd79b2ba1bb --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/BigCat.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-promise-es6/docs/BigCatAllOf.md b/samples/client/petstore/javascript-promise-es6/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c5e83bfdaebb --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-promise-es6/src/index.js b/samples/client/petstore/javascript-promise-es6/src/index.js index 105b2767803f..e4dc27efbc35 100644 --- a/samples/client/petstore/javascript-promise-es6/src/index.js +++ b/samples/client/petstore/javascript-promise-es6/src/index.js @@ -26,6 +26,8 @@ import ApiResponse from './model/ApiResponse'; import ArrayOfArrayOfNumberOnly from './model/ArrayOfArrayOfNumberOnly'; import ArrayOfNumberOnly from './model/ArrayOfNumberOnly'; import ArrayTest from './model/ArrayTest'; +import BigCat from './model/BigCat'; +import BigCatAllOf from './model/BigCatAllOf'; import Capitalization from './model/Capitalization'; import Cat from './model/Cat'; import CatAllOf from './model/CatAllOf'; @@ -183,6 +185,18 @@ export { */ ArrayTest, + /** + * The BigCat model constructor. + * @property {module:model/BigCat} + */ + BigCat, + + /** + * The BigCatAllOf model constructor. + * @property {module:model/BigCatAllOf} + */ + BigCatAllOf, + /** * The Capitalization model constructor. * @property {module:model/Capitalization} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/BigCat.js b/samples/client/petstore/javascript-promise-es6/src/model/BigCat.js new file mode 100644 index 000000000000..764e45d31dc9 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/model/BigCat.js @@ -0,0 +1,132 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import BigCatAllOf from './BigCatAllOf'; +import Cat from './Cat'; + +/** + * The BigCat model module. + * @module model/BigCat + * @version 1.0.0 + */ +class BigCat { + /** + * Constructs a new BigCat. + * @alias module:model/BigCat + * @extends module:model/Cat + * @implements module:model/Cat + * @implements module:model/BigCatAllOf + * @param className {String} + */ + constructor(className) { + Cat.initialize(this, className);BigCatAllOf.initialize(this); + BigCat.initialize(this, className); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a BigCat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCat} obj Optional instance to populate. + * @return {module:model/BigCat} The populated BigCat instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BigCat(); + Cat.constructFromObject(data, obj); + Cat.constructFromObject(data, obj); + BigCatAllOf.constructFromObject(data, obj); + + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {module:model/BigCat.KindEnum} kind + */ +BigCat.prototype['kind'] = undefined; + + +// Implement Cat interface: +/** + * @member {String} className + */ +Cat.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Cat.prototype['color'] = 'red'; +/** + * @member {Boolean} declawed + */ +Cat.prototype['declawed'] = undefined; +// Implement BigCatAllOf interface: +/** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +BigCatAllOf.prototype['kind'] = undefined; + + + +/** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ +BigCat['KindEnum'] = { + + /** + * value: "lions" + * @const + */ + "lions": "lions", + + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" +}; + + + +export default BigCat; + diff --git a/samples/client/petstore/javascript-promise-es6/src/model/BigCatAllOf.js b/samples/client/petstore/javascript-promise-es6/src/model/BigCatAllOf.js new file mode 100644 index 000000000000..1b79f1a2849f --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/model/BigCatAllOf.js @@ -0,0 +1,104 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The BigCatAllOf model module. + * @module model/BigCatAllOf + * @version 1.0.0 + */ +class BigCatAllOf { + /** + * Constructs a new BigCatAllOf. + * @alias module:model/BigCatAllOf + */ + constructor() { + + BigCatAllOf.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a BigCatAllOf from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCatAllOf} obj Optional instance to populate. + * @return {module:model/BigCatAllOf} The populated BigCatAllOf instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BigCatAllOf(); + + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +BigCatAllOf.prototype['kind'] = undefined; + + + + + +/** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ +BigCatAllOf['KindEnum'] = { + + /** + * value: "lions" + * @const + */ + "lions": "lions", + + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" +}; + + + +export default BigCatAllOf; + diff --git a/samples/client/petstore/javascript-promise-es6/test/model/BigCat.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/BigCat.spec.js new file mode 100644 index 000000000000..c21833ff2293 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/model/BigCat.spec.js @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCat', function() { + it('should create an instance of BigCat', function() { + // uncomment below and update the code to test BigCat + //var instane = new OpenApiPetstore.BigCat(); + //expect(instance).to.be.a(OpenApiPetstore.BigCat); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instane = new OpenApiPetstore.BigCat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/test/model/BigCatAllOf.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/BigCatAllOf.spec.js new file mode 100644 index 000000000000..c27440b42c34 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/model/BigCatAllOf.spec.js @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCatAllOf(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCatAllOf', function() { + it('should create an instance of BigCatAllOf', function() { + // uncomment below and update the code to test BigCatAllOf + //var instane = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be.a(OpenApiPetstore.BigCatAllOf); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instane = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 95124df42847..0f3fb9b8afc3 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -160,6 +160,8 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayTest](docs/ArrayTest.md) + - [OpenApiPetstore.BigCat](docs/BigCat.md) + - [OpenApiPetstore.BigCatAllOf](docs/BigCatAllOf.md) - [OpenApiPetstore.Capitalization](docs/Capitalization.md) - [OpenApiPetstore.Cat](docs/Cat.md) - [OpenApiPetstore.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/javascript-promise/docs/BigCat.md b/samples/client/petstore/javascript-promise/docs/BigCat.md new file mode 100644 index 000000000000..bbd79b2ba1bb --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/BigCat.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-promise/docs/BigCatAllOf.md b/samples/client/petstore/javascript-promise/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c5e83bfdaebb --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index 5d11babba2f8..f5a430e16b97 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -16,12 +16,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesAnyType', 'model/AdditionalPropertiesArray', 'model/AdditionalPropertiesBoolean', 'model/AdditionalPropertiesClass', 'model/AdditionalPropertiesInteger', 'model/AdditionalPropertiesNumber', 'model/AdditionalPropertiesObject', 'model/AdditionalPropertiesString', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/CatAllOf', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/DogAllOf', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', 'model/XmlItem', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesAnyType', 'model/AdditionalPropertiesArray', 'model/AdditionalPropertiesBoolean', 'model/AdditionalPropertiesClass', 'model/AdditionalPropertiesInteger', 'model/AdditionalPropertiesNumber', 'model/AdditionalPropertiesObject', 'model/AdditionalPropertiesString', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/BigCat', 'model/BigCatAllOf', 'model/Capitalization', 'model/Cat', 'model/CatAllOf', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/DogAllOf', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', 'model/XmlItem', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesAnyType'), require('./model/AdditionalPropertiesArray'), require('./model/AdditionalPropertiesBoolean'), require('./model/AdditionalPropertiesClass'), require('./model/AdditionalPropertiesInteger'), require('./model/AdditionalPropertiesNumber'), require('./model/AdditionalPropertiesObject'), require('./model/AdditionalPropertiesString'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/CatAllOf'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/DogAllOf'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./model/XmlItem'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesAnyType'), require('./model/AdditionalPropertiesArray'), require('./model/AdditionalPropertiesBoolean'), require('./model/AdditionalPropertiesClass'), require('./model/AdditionalPropertiesInteger'), require('./model/AdditionalPropertiesNumber'), require('./model/AdditionalPropertiesObject'), require('./model/AdditionalPropertiesString'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/BigCat'), require('./model/BigCatAllOf'), require('./model/Capitalization'), require('./model/Cat'), require('./model/CatAllOf'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/DogAllOf'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./model/XmlItem'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesAnyType, AdditionalPropertiesArray, AdditionalPropertiesBoolean, AdditionalPropertiesClass, AdditionalPropertiesInteger, AdditionalPropertiesNumber, AdditionalPropertiesObject, AdditionalPropertiesString, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, CatAllOf, Category, ClassModel, Client, Dog, DogAllOf, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, XmlItem, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesAnyType, AdditionalPropertiesArray, AdditionalPropertiesBoolean, AdditionalPropertiesClass, AdditionalPropertiesInteger, AdditionalPropertiesNumber, AdditionalPropertiesObject, AdditionalPropertiesString, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, BigCat, BigCatAllOf, Capitalization, Cat, CatAllOf, Category, ClassModel, Client, Dog, DogAllOf, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, XmlItem, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -126,6 +126,16 @@ * @property {module:model/ArrayTest} */ ArrayTest: ArrayTest, + /** + * The BigCat model constructor. + * @property {module:model/BigCat} + */ + BigCat: BigCat, + /** + * The BigCatAllOf model constructor. + * @property {module:model/BigCatAllOf} + */ + BigCatAllOf: BigCatAllOf, /** * The Capitalization model constructor. * @property {module:model/Capitalization} diff --git a/samples/client/petstore/javascript-promise/src/model/BigCat.js b/samples/client/petstore/javascript-promise/src/model/BigCat.js new file mode 100644 index 000000000000..e567df251ca3 --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/BigCat.js @@ -0,0 +1,137 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BigCatAllOf', 'model/Cat'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BigCatAllOf'), require('./Cat')); + } else { + // Browser globals (root is window) + if (!root.OpenApiPetstore) { + root.OpenApiPetstore = {}; + } + root.OpenApiPetstore.BigCat = factory(root.OpenApiPetstore.ApiClient, root.OpenApiPetstore.BigCatAllOf, root.OpenApiPetstore.Cat); + } +}(this, function(ApiClient, BigCatAllOf, Cat) { + 'use strict'; + + + + /** + * The BigCat model module. + * @module model/BigCat + * @version 1.0.0 + */ + + /** + * Constructs a new BigCat. + * @alias module:model/BigCat + * @class + * @extends module:model/Cat + * @implements module:model/Cat + * @implements module:model/BigCatAllOf + * @param className {String} + */ + var exports = function(className) { + var _this = this; + + Cat.call(_this, className); + }; + + /** + * Constructs a BigCat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCat} obj Optional instance to populate. + * @return {module:model/BigCat} The populated BigCat instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + Cat.constructFromObject(data, obj); + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + exports.prototype = Object.create(Cat.prototype); + exports.prototype.constructor = exports; + + /** + * @member {module:model/BigCat.KindEnum} kind + */ + exports.prototype['kind'] = undefined; + + // Implement Cat interface: + /** + * @member {String} className + */ +exports.prototype['className'] = undefined; + + /** + * @member {String} color + * @default 'red' + */ +exports.prototype['color'] = 'red'; + + /** + * @member {Boolean} declawed + */ +exports.prototype['declawed'] = undefined; + + // Implement BigCatAllOf interface: + /** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +exports.prototype['kind'] = undefined; + + + /** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ + exports.KindEnum = { + /** + * value: "lions" + * @const + */ + "lions": "lions", + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js b/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js new file mode 100644 index 000000000000..719ff31ec624 --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.OpenApiPetstore) { + root.OpenApiPetstore = {}; + } + root.OpenApiPetstore.BigCatAllOf = factory(root.OpenApiPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + /** + * The BigCatAllOf model module. + * @module model/BigCatAllOf + * @version 1.0.0 + */ + + /** + * Constructs a new BigCatAllOf. + * @alias module:model/BigCatAllOf + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a BigCatAllOf from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCatAllOf} obj Optional instance to populate. + * @return {module:model/BigCatAllOf} The populated BigCatAllOf instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + /** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ + exports.prototype['kind'] = undefined; + + + /** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ + exports.KindEnum = { + /** + * value: "lions" + * @const + */ + "lions": "lions", + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript-promise/test/model/BigCat.spec.js b/samples/client/petstore/javascript-promise/test/model/BigCat.spec.js new file mode 100644 index 000000000000..2001b0a31fc1 --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/BigCat.spec.js @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCat', function() { + it('should create an instance of BigCat', function() { + // uncomment below and update the code to test BigCat + //var instance = new OpenApiPetstore.BigCat(); + //expect(instance).to.be.a(OpenApiPetstore.BigCat); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instance = new OpenApiPetstore.BigCat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise/test/model/BigCatAllOf.spec.js b/samples/client/petstore/javascript-promise/test/model/BigCatAllOf.spec.js new file mode 100644 index 000000000000..50d3277f5a6e --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/BigCatAllOf.spec.js @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCatAllOf(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCatAllOf', function() { + it('should create an instance of BigCatAllOf', function() { + // uncomment below and update the code to test BigCatAllOf + //var instance = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be.a(OpenApiPetstore.BigCatAllOf); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instance = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index c11860f76757..6b9b593afa04 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -163,6 +163,8 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayTest](docs/ArrayTest.md) + - [OpenApiPetstore.BigCat](docs/BigCat.md) + - [OpenApiPetstore.BigCatAllOf](docs/BigCatAllOf.md) - [OpenApiPetstore.Capitalization](docs/Capitalization.md) - [OpenApiPetstore.Cat](docs/Cat.md) - [OpenApiPetstore.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/javascript/docs/BigCat.md b/samples/client/petstore/javascript/docs/BigCat.md new file mode 100644 index 000000000000..bbd79b2ba1bb --- /dev/null +++ b/samples/client/petstore/javascript/docs/BigCat.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript/docs/BigCatAllOf.md b/samples/client/petstore/javascript/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c5e83bfdaebb --- /dev/null +++ b/samples/client/petstore/javascript/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index 5d11babba2f8..f5a430e16b97 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -16,12 +16,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesAnyType', 'model/AdditionalPropertiesArray', 'model/AdditionalPropertiesBoolean', 'model/AdditionalPropertiesClass', 'model/AdditionalPropertiesInteger', 'model/AdditionalPropertiesNumber', 'model/AdditionalPropertiesObject', 'model/AdditionalPropertiesString', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/CatAllOf', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/DogAllOf', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', 'model/XmlItem', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesAnyType', 'model/AdditionalPropertiesArray', 'model/AdditionalPropertiesBoolean', 'model/AdditionalPropertiesClass', 'model/AdditionalPropertiesInteger', 'model/AdditionalPropertiesNumber', 'model/AdditionalPropertiesObject', 'model/AdditionalPropertiesString', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/BigCat', 'model/BigCatAllOf', 'model/Capitalization', 'model/Cat', 'model/CatAllOf', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/DogAllOf', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', 'model/XmlItem', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesAnyType'), require('./model/AdditionalPropertiesArray'), require('./model/AdditionalPropertiesBoolean'), require('./model/AdditionalPropertiesClass'), require('./model/AdditionalPropertiesInteger'), require('./model/AdditionalPropertiesNumber'), require('./model/AdditionalPropertiesObject'), require('./model/AdditionalPropertiesString'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/CatAllOf'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/DogAllOf'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./model/XmlItem'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesAnyType'), require('./model/AdditionalPropertiesArray'), require('./model/AdditionalPropertiesBoolean'), require('./model/AdditionalPropertiesClass'), require('./model/AdditionalPropertiesInteger'), require('./model/AdditionalPropertiesNumber'), require('./model/AdditionalPropertiesObject'), require('./model/AdditionalPropertiesString'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/BigCat'), require('./model/BigCatAllOf'), require('./model/Capitalization'), require('./model/Cat'), require('./model/CatAllOf'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/DogAllOf'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./model/XmlItem'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesAnyType, AdditionalPropertiesArray, AdditionalPropertiesBoolean, AdditionalPropertiesClass, AdditionalPropertiesInteger, AdditionalPropertiesNumber, AdditionalPropertiesObject, AdditionalPropertiesString, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, CatAllOf, Category, ClassModel, Client, Dog, DogAllOf, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, XmlItem, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesAnyType, AdditionalPropertiesArray, AdditionalPropertiesBoolean, AdditionalPropertiesClass, AdditionalPropertiesInteger, AdditionalPropertiesNumber, AdditionalPropertiesObject, AdditionalPropertiesString, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, BigCat, BigCatAllOf, Capitalization, Cat, CatAllOf, Category, ClassModel, Client, Dog, DogAllOf, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, XmlItem, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -126,6 +126,16 @@ * @property {module:model/ArrayTest} */ ArrayTest: ArrayTest, + /** + * The BigCat model constructor. + * @property {module:model/BigCat} + */ + BigCat: BigCat, + /** + * The BigCatAllOf model constructor. + * @property {module:model/BigCatAllOf} + */ + BigCatAllOf: BigCatAllOf, /** * The Capitalization model constructor. * @property {module:model/Capitalization} diff --git a/samples/client/petstore/javascript/src/model/BigCat.js b/samples/client/petstore/javascript/src/model/BigCat.js new file mode 100644 index 000000000000..e567df251ca3 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/BigCat.js @@ -0,0 +1,137 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BigCatAllOf', 'model/Cat'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BigCatAllOf'), require('./Cat')); + } else { + // Browser globals (root is window) + if (!root.OpenApiPetstore) { + root.OpenApiPetstore = {}; + } + root.OpenApiPetstore.BigCat = factory(root.OpenApiPetstore.ApiClient, root.OpenApiPetstore.BigCatAllOf, root.OpenApiPetstore.Cat); + } +}(this, function(ApiClient, BigCatAllOf, Cat) { + 'use strict'; + + + + /** + * The BigCat model module. + * @module model/BigCat + * @version 1.0.0 + */ + + /** + * Constructs a new BigCat. + * @alias module:model/BigCat + * @class + * @extends module:model/Cat + * @implements module:model/Cat + * @implements module:model/BigCatAllOf + * @param className {String} + */ + var exports = function(className) { + var _this = this; + + Cat.call(_this, className); + }; + + /** + * Constructs a BigCat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCat} obj Optional instance to populate. + * @return {module:model/BigCat} The populated BigCat instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + Cat.constructFromObject(data, obj); + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + exports.prototype = Object.create(Cat.prototype); + exports.prototype.constructor = exports; + + /** + * @member {module:model/BigCat.KindEnum} kind + */ + exports.prototype['kind'] = undefined; + + // Implement Cat interface: + /** + * @member {String} className + */ +exports.prototype['className'] = undefined; + + /** + * @member {String} color + * @default 'red' + */ +exports.prototype['color'] = 'red'; + + /** + * @member {Boolean} declawed + */ +exports.prototype['declawed'] = undefined; + + // Implement BigCatAllOf interface: + /** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +exports.prototype['kind'] = undefined; + + + /** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ + exports.KindEnum = { + /** + * value: "lions" + * @const + */ + "lions": "lions", + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/BigCatAllOf.js b/samples/client/petstore/javascript/src/model/BigCatAllOf.js new file mode 100644 index 000000000000..719ff31ec624 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/BigCatAllOf.js @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.OpenApiPetstore) { + root.OpenApiPetstore = {}; + } + root.OpenApiPetstore.BigCatAllOf = factory(root.OpenApiPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + /** + * The BigCatAllOf model module. + * @module model/BigCatAllOf + * @version 1.0.0 + */ + + /** + * Constructs a new BigCatAllOf. + * @alias module:model/BigCatAllOf + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a BigCatAllOf from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCatAllOf} obj Optional instance to populate. + * @return {module:model/BigCatAllOf} The populated BigCatAllOf instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + /** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ + exports.prototype['kind'] = undefined; + + + /** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ + exports.KindEnum = { + /** + * value: "lions" + * @const + */ + "lions": "lions", + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/test/model/BigCat.spec.js b/samples/client/petstore/javascript/test/model/BigCat.spec.js new file mode 100644 index 000000000000..2001b0a31fc1 --- /dev/null +++ b/samples/client/petstore/javascript/test/model/BigCat.spec.js @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCat', function() { + it('should create an instance of BigCat', function() { + // uncomment below and update the code to test BigCat + //var instance = new OpenApiPetstore.BigCat(); + //expect(instance).to.be.a(OpenApiPetstore.BigCat); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instance = new OpenApiPetstore.BigCat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript/test/model/BigCatAllOf.spec.js b/samples/client/petstore/javascript/test/model/BigCatAllOf.spec.js new file mode 100644 index 000000000000..50d3277f5a6e --- /dev/null +++ b/samples/client/petstore/javascript/test/model/BigCatAllOf.spec.js @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCatAllOf(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCatAllOf', function() { + it('should create an instance of BigCatAllOf', function() { + // uncomment below and update the code to test BigCatAllOf + //var instance = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be.a(OpenApiPetstore.BigCatAllOf); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instance = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 6f5090566a95..c3c9c8ab6831 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -245,6 +245,8 @@ use WWW::OpenAPIClient::Object::ApiResponse; use WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly; use WWW::OpenAPIClient::Object::ArrayOfNumberOnly; use WWW::OpenAPIClient::Object::ArrayTest; +use WWW::OpenAPIClient::Object::BigCat; +use WWW::OpenAPIClient::Object::BigCatAllOf; use WWW::OpenAPIClient::Object::Capitalization; use WWW::OpenAPIClient::Object::Cat; use WWW::OpenAPIClient::Object::CatAllOf; @@ -310,6 +312,8 @@ use WWW::OpenAPIClient::Object::ApiResponse; use WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly; use WWW::OpenAPIClient::Object::ArrayOfNumberOnly; use WWW::OpenAPIClient::Object::ArrayTest; +use WWW::OpenAPIClient::Object::BigCat; +use WWW::OpenAPIClient::Object::BigCatAllOf; use WWW::OpenAPIClient::Object::Capitalization; use WWW::OpenAPIClient::Object::Cat; use WWW::OpenAPIClient::Object::CatAllOf; @@ -422,6 +426,8 @@ Class | Method | HTTP request | Description - [WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [WWW::OpenAPIClient::Object::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [WWW::OpenAPIClient::Object::ArrayTest](docs/ArrayTest.md) + - [WWW::OpenAPIClient::Object::BigCat](docs/BigCat.md) + - [WWW::OpenAPIClient::Object::BigCatAllOf](docs/BigCatAllOf.md) - [WWW::OpenAPIClient::Object::Capitalization](docs/Capitalization.md) - [WWW::OpenAPIClient::Object::Cat](docs/Cat.md) - [WWW::OpenAPIClient::Object::CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/perl/docs/BigCat.md b/samples/client/petstore/perl/docs/BigCat.md new file mode 100644 index 000000000000..131eb61c20b1 --- /dev/null +++ b/samples/client/petstore/perl/docs/BigCat.md @@ -0,0 +1,15 @@ +# WWW::OpenAPIClient::Object::BigCat + +## Load the model package +```perl +use WWW::OpenAPIClient::Object::BigCat; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/perl/docs/BigCatAllOf.md b/samples/client/petstore/perl/docs/BigCatAllOf.md new file mode 100644 index 000000000000..d6561af78683 --- /dev/null +++ b/samples/client/petstore/perl/docs/BigCatAllOf.md @@ -0,0 +1,15 @@ +# WWW::OpenAPIClient::Object::BigCatAllOf + +## Load the model package +```perl +use WWW::OpenAPIClient::Object::BigCatAllOf; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCat.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCat.pm new file mode 100644 index 000000000000..f1cebb8ec7b2 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCat.pm @@ -0,0 +1,198 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +package WWW::OpenAPIClient::Object::BigCat; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + +use WWW::OpenAPIClient::Object::BigCatAllOf; +use WWW::OpenAPIClient::Object::Cat; + +use base ("Class::Accessor", "Class::Data::Inheritable", "WWW::OpenAPIClient::Object::Cat"); + +# +# +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. +# REF: https://openapi-generator.tech +# + +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new plain object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + $self->init(%args); + + return $self; +} + +# initialize the object +sub init +{ + my ($self, %args) = @_; + + foreach my $attribute (keys %{$self->attribute_map}) { + my $args_key = $self->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } + + # initialize parent object Cat + $self->WWW::OpenAPIClient::Object::Cat::init(%args); +} + +# return perl hash +sub to_hash { + my $self = shift; + my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); + + # call Cat to_hash and then combine hash + $_hash = { %$_hash, %$self->WWW::OpenAPIClient::Object::Cat::to_hash }; + + return $_hash; +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; + } + } + + # combine parent (Cat) TO_JSON + $_data = { %$_data, %$self->WWW::OpenAPIClient::Object::Cat::TO_JSON }; + + return $_data; +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { + $_hash{$_key} = $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \%_hash; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + # call parent (Cat) from_hash + $self->WWW::OpenAPIClient::Object::Cat::from_hash($hash); + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + + +__PACKAGE__->class_documentation({description => '', + class => 'BigCat', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ + 'kind' => { + datatype => 'string', + base_name => 'kind', + description => '', + format => '', + read_only => '', + }, +}); + +__PACKAGE__->openapi_types( { + 'kind' => 'string' +} ); + +__PACKAGE__->attribute_map( { + 'kind' => 'kind' +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm new file mode 100644 index 000000000000..8a36a3e02f6c --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm @@ -0,0 +1,184 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +package WWW::OpenAPIClient::Object::BigCatAllOf; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + + +use base ("Class::Accessor", "Class::Data::Inheritable"); + +# +# +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. +# REF: https://openapi-generator.tech +# + +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new plain object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + $self->init(%args); + + return $self; +} + +# initialize the object +sub init +{ + my ($self, %args) = @_; + + foreach my $attribute (keys %{$self->attribute_map}) { + my $args_key = $self->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } +} + +# return perl hash +sub to_hash { + my $self = shift; + my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); + + return $_hash; +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; + } + } + + return $_data; +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { + $_hash{$_key} = $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \%_hash; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + + +__PACKAGE__->class_documentation({description => '', + class => 'BigCatAllOf', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ + 'kind' => { + datatype => 'string', + base_name => 'kind', + description => '', + format => '', + read_only => '', + }, +}); + +__PACKAGE__->openapi_types( { + 'kind' => 'string' +} ); + +__PACKAGE__->attribute_map( { + 'kind' => 'kind' +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/t/BigCatAllOfTest.t b/samples/client/petstore/perl/t/BigCatAllOfTest.t new file mode 100644 index 000000000000..5708cbf33460 --- /dev/null +++ b/samples/client/petstore/perl/t/BigCatAllOfTest.t @@ -0,0 +1,33 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the OpenAPI Generator +# Please update the test cases below to test the model. +# Ref: https://openapi-generator.tech +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::OpenAPIClient::Object::BigCatAllOf'); + +my $instance = WWW::OpenAPIClient::Object::BigCatAllOf->new(); + +isa_ok($instance, 'WWW::OpenAPIClient::Object::BigCatAllOf'); + diff --git a/samples/client/petstore/perl/t/BigCatTest.t b/samples/client/petstore/perl/t/BigCatTest.t new file mode 100644 index 000000000000..b1d4d7966bf3 --- /dev/null +++ b/samples/client/petstore/perl/t/BigCatTest.t @@ -0,0 +1,33 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the OpenAPI Generator +# Please update the test cases below to test the model. +# Ref: https://openapi-generator.tech +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::OpenAPIClient::Object::BigCat'); + +my $instance = WWW::OpenAPIClient::Object::BigCat->new(); + +isa_ok($instance, 'WWW::OpenAPIClient::Object::BigCat'); + diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index f84c670fa306..87ba21d247f5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -137,6 +137,8 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md) - [ArrayTest](docs/Model/ArrayTest.md) + - [BigCat](docs/Model/BigCat.md) + - [BigCatAllOf](docs/Model/BigCatAllOf.md) - [Capitalization](docs/Model/Capitalization.md) - [Cat](docs/Model/Cat.md) - [CatAllOf](docs/Model/CatAllOf.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCat.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCat.md new file mode 100644 index 000000000000..8aa1c543ea38 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCat.md @@ -0,0 +1,11 @@ +# # BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCatAllOf.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCatAllOf.md new file mode 100644 index 000000000000..7241eb084353 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCatAllOf.md @@ -0,0 +1,11 @@ +# # BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php new file mode 100644 index 000000000000..8dc2e88283da --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php @@ -0,0 +1,337 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'kind' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'kind' => 'kind' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'kind' => 'setKind' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'kind' => 'getKind' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const KIND_LIONS = 'lions'; + const KIND_TIGERS = 'tigers'; + const KIND_LEOPARDS = 'leopards'; + const KIND_JAGUARS = 'jaguars'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKindAllowableValues() + { + return [ + self::KIND_LIONS, + self::KIND_TIGERS, + self::KIND_LEOPARDS, + self::KIND_JAGUARS, + ]; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + $this->container['kind'] = isset($data['kind']) ? $data['kind'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'kind', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets kind + * + * @return string|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param string|null $kind kind + * + * @return $this + */ + public function setKind($kind) + { + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($kind) && !in_array($kind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'kind', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['kind'] = $kind; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php new file mode 100644 index 000000000000..44fa1674e57a --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php @@ -0,0 +1,343 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'kind' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'kind' => 'kind' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'kind' => 'setKind' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'kind' => 'getKind' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const KIND_LIONS = 'lions'; + const KIND_TIGERS = 'tigers'; + const KIND_LEOPARDS = 'leopards'; + const KIND_JAGUARS = 'jaguars'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKindAllowableValues() + { + return [ + self::KIND_LIONS, + self::KIND_TIGERS, + self::KIND_LEOPARDS, + self::KIND_JAGUARS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['kind'] = isset($data['kind']) ? $data['kind'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'kind', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets kind + * + * @return string|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param string|null $kind kind + * + * @return $this + */ + public function setKind($kind) + { + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($kind) && !in_array($kind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'kind', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['kind'] = $kind; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php new file mode 100644 index 000000000000..0dffa0380dbf --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php @@ -0,0 +1,87 @@ + :'kind' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'BigCatAllOf', + :'Cat' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true && super + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb new file mode 100644 index 000000000000..d2649d0e4534 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb @@ -0,0 +1,240 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'date' + +module Petstore + class BigCatAllOf + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb new file mode 100644 index 000000000000..4a547a5ac504 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb @@ -0,0 +1,45 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::BigCatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BigCatAllOf' do + before do + # run before each test + @instance = Petstore::BigCatAllOf.new + end + + after do + # run after each test + end + + describe 'test an instance of BigCatAllOf' do + it 'should create an instance of BigCatAllOf' do + expect(@instance).to be_instance_of(Petstore::BigCatAllOf) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { @instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb new file mode 100644 index 000000000000..c6e0cfbce688 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb @@ -0,0 +1,45 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::BigCat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BigCat' do + before do + # run before each test + @instance = Petstore::BigCat.new + end + + after do + # run after each test + end + + describe 'test an instance of BigCat' do + it 'should create an instance of BigCat' do + expect(@instance).to be_instance_of(Petstore::BigCat) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { @instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index c3cbbb05666f..0e684d1ce3e2 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -129,6 +129,8 @@ Class | Method | HTTP request | Description - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Petstore::ArrayTest](docs/ArrayTest.md) + - [Petstore::BigCat](docs/BigCat.md) + - [Petstore::BigCatAllOf](docs/BigCatAllOf.md) - [Petstore::Capitalization](docs/Capitalization.md) - [Petstore::Cat](docs/Cat.md) - [Petstore::CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/ruby/docs/BigCat.md b/samples/client/petstore/ruby/docs/BigCat.md new file mode 100644 index 000000000000..7c48311d4223 --- /dev/null +++ b/samples/client/petstore/ruby/docs/BigCat.md @@ -0,0 +1,17 @@ +# Petstore::BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::BigCat.new(kind: null) +``` + + diff --git a/samples/client/petstore/ruby/docs/BigCatAllOf.md b/samples/client/petstore/ruby/docs/BigCatAllOf.md new file mode 100644 index 000000000000..101cad0da23b --- /dev/null +++ b/samples/client/petstore/ruby/docs/BigCatAllOf.md @@ -0,0 +1,17 @@ +# Petstore::BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::BigCatAllOf.new(kind: null) +``` + + diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index d2f2aba6aef0..80a7e34a9d42 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -30,6 +30,8 @@ require 'petstore/models/api_response' require 'petstore/models/array_of_array_of_number_only' require 'petstore/models/array_of_number_only' require 'petstore/models/array_test' +require 'petstore/models/big_cat' +require 'petstore/models/big_cat_all_of' require 'petstore/models/capitalization' require 'petstore/models/cat' require 'petstore/models/cat_all_of' diff --git a/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb b/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb new file mode 100644 index 000000000000..46bcc0afa7c4 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb @@ -0,0 +1,252 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'date' + +module Petstore + class BigCat < Cat + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'BigCatAllOf', + :'Cat' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true && super + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb new file mode 100644 index 000000000000..d2649d0e4534 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb @@ -0,0 +1,240 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'date' + +module Petstore + class BigCatAllOf + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb new file mode 100644 index 000000000000..4a547a5ac504 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb @@ -0,0 +1,45 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::BigCatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BigCatAllOf' do + before do + # run before each test + @instance = Petstore::BigCatAllOf.new + end + + after do + # run after each test + end + + describe 'test an instance of BigCatAllOf' do + it 'should create an instance of BigCatAllOf' do + expect(@instance).to be_instance_of(Petstore::BigCatAllOf) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { @instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby/spec/models/big_cat_spec.rb b/samples/client/petstore/ruby/spec/models/big_cat_spec.rb new file mode 100644 index 000000000000..c6e0cfbce688 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/big_cat_spec.rb @@ -0,0 +1,45 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::BigCat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BigCat' do + before do + # run before each test + @instance = Petstore::BigCat.new + end + + after do + # run after each test + end + + describe 'test an instance of BigCat' do + it 'should create an instance of BigCat' do + expect(@instance).to be_instance_of(Petstore::BigCat) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { @instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/scalaz/project/build.properties b/samples/client/petstore/scalaz/project/build.properties index cf19fd026fd1..64317fdae59f 100644 --- a/samples/client/petstore/scalaz/project/build.properties +++ b/samples/client/petstore/scalaz/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.15 \ No newline at end of file +sbt.version=0.13.15 diff --git a/samples/schema/petstore/mysql/mysql_schema.sql b/samples/schema/petstore/mysql/mysql_schema.sql index e08b704631a6..21145731600d 100644 --- a/samples/schema/petstore/mysql/mysql_schema.sql +++ b/samples/schema/petstore/mysql/mysql_schema.sql @@ -142,6 +142,25 @@ CREATE TABLE IF NOT EXISTS `ArrayTest` ( `array_array_of_model` JSON DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `BigCat` generated from model 'BigCat' +-- + +CREATE TABLE IF NOT EXISTS `BigCat` ( + `className` TEXT NOT NULL, + `color` TEXT, + `declawed` TINYINT(1) DEFAULT NULL, + `kind` ENUM('lions', 'tigers', 'leopards', 'jaguars') DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `BigCat_allOf` generated from model 'BigCatUnderscoreallOf' +-- + +CREATE TABLE IF NOT EXISTS `BigCat_allOf` ( + `kind` ENUM('lions', 'tigers', 'leopards', 'jaguars') DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `Capitalization` generated from model 'Capitalization' -- diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..10e898679c91 --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,113 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String text) { + for (KindEnum b : KindEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @ApiModelProperty(value = "") + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..ca787eb1f21a --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String text) { + for (KindEnum b : KindEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @ApiModelProperty(value = "") + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java new file mode 100644 index 000000000000..0d6ca05971f1 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java @@ -0,0 +1,112 @@ +package apimodels; + +import apimodels.BigCatAllOf; +import apimodels.Cat; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * BigCat + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private final String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java new file mode 100644 index 000000000000..b0efcc1fc709 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java @@ -0,0 +1,109 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * BigCatAllOf + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private final String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index d3100df48a17..a41ef03feb1b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -1934,6 +1934,13 @@ "$ref" : "#/components/schemas/Cat_allOf" } ] }, + "BigCat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Cat" + }, { + "$ref" : "#/components/schemas/BigCat_allOf" + } ] + }, "Animal" : { "discriminator" : { "propertyName" : "className" @@ -2828,6 +2835,14 @@ "type" : "boolean" } } + }, + "BigCat_allOf" : { + "properties" : { + "kind" : { + "enum" : [ "lions", "tigers", "leopards", "jaguars" ], + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Animal.java index cac03555be3d..1e9de17e4429 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Animal.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..b325b3016b13 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,97 @@ +package org.openapitools.model; + +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class BigCat extends Cat { + +@XmlType(name="KindEnum") +@XmlEnum(String.class) +public enum KindEnum { + +@XmlEnumValue("lions") LIONS(String.valueOf("lions")), @XmlEnumValue("tigers") TIGERS(String.valueOf("tigers")), @XmlEnumValue("leopards") LEOPARDS(String.valueOf("leopards")), @XmlEnumValue("jaguars") JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + @ApiModelProperty(value = "") + private KindEnum kind; + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + public String getKind() { + if (kind == null) { + return null; + } + return kind.value(); + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..be03a0209d2c --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,95 @@ +package org.openapitools.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class BigCatAllOf { + +@XmlType(name="KindEnum") +@XmlEnum(String.class) +public enum KindEnum { + +@XmlEnumValue("lions") LIONS(String.valueOf("lions")), @XmlEnumValue("tigers") TIGERS(String.valueOf("tigers")), @XmlEnumValue("leopards") LEOPARDS(String.valueOf("leopards")), @XmlEnumValue("jaguars") JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + @ApiModelProperty(value = "") + private KindEnum kind; + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + public String getKind() { + if (kind == null) { + return null; + } + return kind.value(); + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java index 841c01f67b88..aa2b0ea26b35 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ import javax.validation.Valid; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal implements Serializable { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..45a515a2355a --- /dev/null +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,137 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat implements Serializable { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..adc84d7897a7 --- /dev/null +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf implements Serializable { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Animal.java index 48269bab57d9..43bfbb7fd24d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Animal.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonValue; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..c3c4bfcfb59f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,113 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class BigCat extends Cat implements Serializable { + + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid KindEnum kind; + + /** + **/ + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..d3eb97becef2 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class BigCatAllOf implements Serializable { + + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid KindEnum kind; + + /** + **/ + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index ccb16e949adc..79ba65f66eeb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1557,6 +1557,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2221,6 +2225,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java index 48269bab57d9..43bfbb7fd24d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonValue; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..c3c4bfcfb59f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,113 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class BigCat extends Cat implements Serializable { + + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid KindEnum kind; + + /** + **/ + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..d3eb97becef2 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class BigCatAllOf implements Serializable { + + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid KindEnum kind; + + /** + **/ + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index ccb16e949adc..79ba65f66eeb 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1557,6 +1557,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2221,6 +2225,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java index b92746816fe0..f06a0e2b1352 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ import javax.validation.Valid; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..8316a86f8847 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..e5088ac43df5 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java index b92746816fe0..f06a0e2b1352 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ import javax.validation.Valid; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..8316a86f8847 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..e5088ac43df5 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java index b92746816fe0..f06a0e2b1352 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ import javax.validation.Valid; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..8316a86f8847 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..e5088ac43df5 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java index b92746816fe0..f06a0e2b1352 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ import javax.validation.Valid; @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..8316a86f8847 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..e5088ac43df5 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/php-slim/README.md b/samples/server/petstore/php-slim/README.md index 0d639b32a11c..8e7f235f0e0b 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -173,6 +173,8 @@ Class | Method | HTTP request | Description * OpenAPIServer\Model\ArrayOfArrayOfNumberOnly * OpenAPIServer\Model\ArrayOfNumberOnly * OpenAPIServer\Model\ArrayTest +* OpenAPIServer\Model\BigCat +* OpenAPIServer\Model\BigCatAllOf * OpenAPIServer\Model\Capitalization * OpenAPIServer\Model\Cat * OpenAPIServer\Model\CatAllOf diff --git a/samples/server/petstore/php-slim/lib/Model/BigCat.php b/samples/server/petstore/php-slim/lib/Model/BigCat.php new file mode 100644 index 000000000000..33cb8342e5aa --- /dev/null +++ b/samples/server/petstore/php-slim/lib/Model/BigCat.php @@ -0,0 +1,39 @@ + Date: Fri, 27 Dec 2019 03:37:29 -0500 Subject: [PATCH 21/28] [Kotlin] enumPropertyNaming UPPERCASE should separate words with _ (#4062) * [Kotlin] enumPropertyNaming UPPERCASE should separate words with _ * Add unit cases for issue 4062 Co-authored-by: William Cheng --- bin/kotlin-uppercase-enum.sh | 34 ++++ .../languages/AbstractKotlinCodegen.java | 2 +- .../src/test/resources/3_0/issue-4062.yaml | 33 ++++ .../.openapi-generator-ignore | 23 +++ .../.openapi-generator/VERSION | 1 + .../petstore/kotlin-uppercase-enum/README.md | 50 ++++++ .../kotlin-uppercase-enum/build.gradle | 37 +++++ .../kotlin-uppercase-enum/docs/EnumApi.md | 50 ++++++ .../kotlin-uppercase-enum/docs/PetEnum.md | 12 ++ .../kotlin-uppercase-enum/settings.gradle | 2 + .../org/openapitools/client/apis/EnumApi.kt | 60 +++++++ .../client/infrastructure/ApiAbstractions.kt | 23 +++ .../client/infrastructure/ApiClient.kt | 153 ++++++++++++++++++ .../ApiInfrastructureResponse.kt | 40 +++++ .../infrastructure/ApplicationDelegates.kt | 29 ++++ .../client/infrastructure/ByteArrayAdapter.kt | 12 ++ .../client/infrastructure/Errors.kt | 42 +++++ .../client/infrastructure/LocalDateAdapter.kt | 19 +++ .../infrastructure/LocalDateTimeAdapter.kt | 19 +++ .../client/infrastructure/RequestConfig.kt | 16 ++ .../client/infrastructure/RequestMethod.kt | 8 + .../infrastructure/ResponseExtensions.kt | 23 +++ .../client/infrastructure/Serializer.kt | 18 +++ .../client/infrastructure/UUIDAdapter.kt | 13 ++ .../org/openapitools/client/models/PetEnum.kt | 35 ++++ 25 files changed, 753 insertions(+), 1 deletion(-) create mode 100755 bin/kotlin-uppercase-enum.sh create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue-4062.yaml create mode 100644 samples/client/petstore/kotlin-uppercase-enum/.openapi-generator-ignore create mode 100644 samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION create mode 100644 samples/client/petstore/kotlin-uppercase-enum/README.md create mode 100644 samples/client/petstore/kotlin-uppercase-enum/build.gradle create mode 100644 samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md create mode 100644 samples/client/petstore/kotlin-uppercase-enum/docs/PetEnum.md create mode 100644 samples/client/petstore/kotlin-uppercase-enum/settings.gradle create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt diff --git a/bin/kotlin-uppercase-enum.sh b/bin/kotlin-uppercase-enum.sh new file mode 100755 index 000000000000..49f690283f41 --- /dev/null +++ b/bin/kotlin-uppercase-enum.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/3_0/issue-4062.yaml -g kotlin --artifact-id kotlin-uppercase-enum --additional-properties enumPropertyNaming=UPPERCASE -o samples/client/petstore/kotlin-uppercase-enum $@" + +java ${JAVA_OPTS} -jar ${executable} ${ags} + +cp CI/samples.ci/client/petstore/kotlin-uppercase-enum/pom.xml samples/client/petstore/kotlin-uppercase-enum/pom.xml \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index bed71307d4d2..b0227feae164 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -530,7 +530,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co modified = underscore(modified); break; case UPPERCASE: - modified = modified.toUpperCase(Locale.ROOT); + modified = underscore(modified).toUpperCase(Locale.ROOT); break; } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue-4062.yaml b/modules/openapi-generator/src/test/resources/3_0/issue-4062.yaml new file mode 100644 index 000000000000..2ad7665265c9 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue-4062.yaml @@ -0,0 +1,33 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: Test for issue 4062 + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +paths: + /enum: + get: + tags: + - enum + summary: Get enums + description: '' + operationId: getEnum + responses: + '200': + description: success + content: + application/json: + schema: + $ref: '#/components/schemas/PetEnum' +components: + schemas: + PetEnum: + type: string + description: An enum with complex-ish naming + enum: + - myFirstValue + - MY_SECOND_VALUE \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator-ignore b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION new file mode 100644 index 000000000000..c3a2c7076fa8 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/README.md b/samples/client/petstore/kotlin-uppercase-enum/README.md new file mode 100644 index 000000000000..9d5f9e7e33e0 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/README.md @@ -0,0 +1,50 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*EnumApi* | [**getEnum**](docs/EnumApi.md#getenum) | **GET** /enum | Get enums + + + +## Documentation for Models + + - [org.openapitools.client.models.PetEnum](docs/PetEnum.md) + + + +## Documentation for Authorization + +All endpoints do not require authorization. diff --git a/samples/client/petstore/kotlin-uppercase-enum/build.gradle b/samples/client/petstore/kotlin-uppercase-enum/build.gradle new file mode 100644 index 000000000000..c09f7912cfe1 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/build.gradle @@ -0,0 +1,37 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.41' + + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + compile "com.squareup.moshi:moshi-kotlin:1.8.0" + compile "com.squareup.moshi:moshi-adapters:1.8.0" + compile "com.squareup.okhttp3:okhttp:4.0.1" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md b/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md new file mode 100644 index 000000000000..7eaa182a4a5c --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md @@ -0,0 +1,50 @@ +# EnumApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getEnum**](EnumApi.md#getEnum) | **GET** /enum | Get enums + + + +# **getEnum** +> PetEnum getEnum() + +Get enums + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = EnumApi() +try { + val result : PetEnum = apiInstance.getEnum() + println(result) +} catch (e: ClientException) { + println("4xx response calling EnumApi#getEnum") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling EnumApi#getEnum") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PetEnum**](PetEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-uppercase-enum/docs/PetEnum.md b/samples/client/petstore/kotlin-uppercase-enum/docs/PetEnum.md new file mode 100644 index 000000000000..d970c3dd8625 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/docs/PetEnum.md @@ -0,0 +1,12 @@ + +# PetEnum + +## Enum + + + * `MY_FIRST_VALUE` (value: `"myFirstValue"`) + + * `MY_SECOND_VALUE` (value: `"MY_SECOND_VALUE"`) + + + diff --git a/samples/client/petstore/kotlin-uppercase-enum/settings.gradle b/samples/client/petstore/kotlin-uppercase-enum/settings.gradle new file mode 100644 index 000000000000..cc08df3bfdcf --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-uppercase-enum' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt new file mode 100644 index 000000000000..dcd526a91c3a --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -0,0 +1,60 @@ +/** +* OpenAPI Petstore +* Test for issue 4062 +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.PetEnum + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class EnumApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Get enums + * + * @return PetEnum + */ + @Suppress("UNCHECKED_CAST") + fun getEnum() : PetEnum { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/enum", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as PetEnum + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 000000000000..f97cb88d2338 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = Map> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipes" -> "|" + "ssv" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..4ba5be35baaf --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,153 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.asRequestBody +import okhttp3.RequestBody.Companion.toRequestBody +import okhttp3.FormBody +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull +import okhttp3.ResponseBody +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.Request +import java.io.File + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val Authorization = "Authorization" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + val apiKey: MutableMap = mutableMapOf() + val apiKeyPrefix: MutableMap = mutableMapOf() + var username: String? = null + var password: String? = null + var accessToken: String? = null + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> content.asRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, value) + } + }.build() + } + mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") + } + + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + return when(mediaType) { + JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + + protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { + val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() + + // TODO: handle specific mapping types. e.g. Map> + when { + response.isRedirect -> return Redirection( + response.code, + response.headers.toMultimap() + ) + response.isInformational -> return Informational( + response.message, + response.code, + response.headers.toMultimap() + ) + response.isSuccessful -> return Success( + responseBody(response.body, accept), + response.code, + response.headers.toMultimap() + ) + response.isClientError -> return ClientError( + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + else -> return ServerError( + null, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + } + } +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt new file mode 100644 index 000000000000..f1a8aecc914b --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -0,0 +1,40 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +abstract class ApiInfrastructureResponse(val responseType: ResponseType) { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiInfrastructureResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Redirection) + +class ClientError( + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt new file mode 100644 index 000000000000..dd34bd48b2c0 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt @@ -0,0 +1,29 @@ +package org.openapitools.client.infrastructure + +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +object ApplicationDelegates { + /** + * Provides a property delegate, allowing the property to be set once and only once. + * + * If unset (no default value), a get on the property will throw [IllegalStateException]. + */ + fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) + + private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { + private var isSet = false + private var value: T? = defaultValue + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return value ?: throw IllegalStateException("${property.name} not initialized") + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { + if (!isSet) { + this.value = value + isSet = true + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..617ac3fe9069 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson + +class ByteArrayAdapter { + @ToJson + fun toJson(data: ByteArray): String = String(data) + + @FromJson + fun fromJson(data: String): ByteArray = data.toByteArray() +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 000000000000..2f3b0157ba70 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,42 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException : RuntimeException { + + /** + * Constructs an [ClientException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ClientException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException : RuntimeException { + + /** + * Constructs an [ServerException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ServerException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..b2e1654479a0 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter { + @ToJson + fun toJson(value: LocalDate): String { + return DateTimeFormatter.ISO_LOCAL_DATE.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDate { + return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) + } + +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..e082db94811d --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter { + @ToJson + fun toJson(value: LocalDateTime): String { + return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDateTime { + return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 000000000000..53e689237d71 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: Map> = mapOf() +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 000000000000..931b12b8bd7a --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 000000000000..934962ec6b50 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +val Response.isRedirect : Boolean get() = this.code in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code in 500..999 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..7c5a353e0f7f --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory +import java.util.Date + +object Serializer { + @JvmStatic + val moshi: Moshi = Moshi.Builder() + .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(KotlinJsonAdapterFactory()) + .build() +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 000000000000..a4a44cc18b73 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.util.UUID + +class UUIDAdapter { + @ToJson + fun toJson(uuid: UUID) = uuid.toString() + + @FromJson + fun fromJson(s: String) = UUID.fromString(s) +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt new file mode 100644 index 000000000000..14d9c16c408b --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt @@ -0,0 +1,35 @@ +/** +* OpenAPI Petstore +* Test for issue 4062 +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json + +/** +* An enum with complex-ish naming +* Values: MY_FIRST_VALUE,MY_SECOND_VALUE +*/ + +enum class PetEnum(val value: kotlin.String){ + + + @Json(name = "myFirstValue") + MY_FIRST_VALUE("myFirstValue"), + + + @Json(name = "MY_SECOND_VALUE") + MY_SECOND_VALUE("MY_SECOND_VALUE"); + + + +} + From 24155b31e985f43e6946c7e9ea7915af60b376e1 Mon Sep 17 00:00:00 2001 From: benjaminSchilling33 Date: Fri, 27 Dec 2019 09:45:07 +0100 Subject: [PATCH 22/28] Added Dart config parameters to fulfill pubspec requirements for publishing to pub (#3911) * Added three configuration values for Dart 2 to be able to publish the generated code to pub without changes: pubAuthor - contains the name of the author pubAuthorEmail - contains the email address of the author pubHomepage - contain the homepage of the project Changed the name of the output directory from docs to doc as this is the path required by pub * Added three configuration values for Dart 2 to be able to publish the generated code to pub without changes: pubAuthor - contains the name of the author pubAuthorEmail - contains the email address of the author pubHomepage - contain the homepage of the project Changed the name of the output directory from docs to doc as this is the path required by pub --- .../codegen/languages/DartClientCodegen.java | 46 ++++++++++++++++++- .../src/main/resources/dart2/pubspec.mustache | 3 ++ .../codegen/dart/DartClientOptionsTest.java | 6 +++ .../options/DartClientOptionsProvider.java | 6 +++ 4 files changed, 59 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index 8930d2d6b537..34d906a9212a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -74,16 +74,22 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String PUB_NAME = "pubName"; public static final String PUB_VERSION = "pubVersion"; public static final String PUB_DESCRIPTION = "pubDescription"; + public static final String PUB_AUTHOR = "pubAuthor"; + public static final String PUB_AUTHOR_EMAIL = "pubAuthorEmail"; + public static final String PUB_HOMEPAGE = "pubHomepage"; public static final String USE_ENUM_EXTENSION = "useEnumExtension"; public static final String SUPPORT_DART2 = "supportDart2"; protected boolean browserClient = true; protected String pubName = "openapi"; protected String pubVersion = "1.0.0"; protected String pubDescription = "OpenAPI API client"; + protected String pubAuthor = "Author"; + protected String pubAuthorEmail = "author@homepage"; + protected String pubHomepage = "homepage"; protected boolean useEnumExtension = false; protected String sourceFolder = ""; - protected String apiDocPath = "docs" + File.separator; - protected String modelDocPath = "docs" + File.separator; + protected String apiDocPath = "doc" + File.separator; + protected String modelDocPath = "doc" + File.separator; protected String apiTestPath = "test" + File.separator; protected String modelTestPath = "test" + File.separator; @@ -153,6 +159,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec")); cliOptions.add(new CliOption(PUB_VERSION, "Version in generated pubspec")); cliOptions.add(new CliOption(PUB_DESCRIPTION, "Description in generated pubspec")); + cliOptions.add(new CliOption(PUB_AUTHOR, "Author name in generated pubspec")); + cliOptions.add(new CliOption(PUB_AUTHOR_EMAIL, "Email address of the author in generated pubspec")); + cliOptions.add(new CliOption(PUB_HOMEPAGE, "Homepage in generated pubspec")); cliOptions.add(new CliOption(USE_ENUM_EXTENSION, "Allow the 'x-enum-values' extension for enums")); cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, "Source folder for generated code")); cliOptions.add(CliOption.newBoolean(SUPPORT_DART2, "Support Dart 2.x (Dart 1.x support has been deprecated)").defaultValue(Boolean.TRUE.toString())); @@ -214,6 +223,27 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { additionalProperties.put(PUB_DESCRIPTION, pubDescription); } + if (additionalProperties.containsKey(PUB_AUTHOR)) { + this.setPubAuthor((String) additionalProperties.get(PUB_AUTHOR)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_AUTHOR, pubAuthor); + } + + if (additionalProperties.containsKey(PUB_AUTHOR_EMAIL)) { + this.setPubAuthorEmail((String) additionalProperties.get(PUB_AUTHOR_EMAIL)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_AUTHOR_EMAIL, pubAuthorEmail); + } + + if (additionalProperties.containsKey(PUB_HOMEPAGE)) { + this.setPubHomepage((String) additionalProperties.get(PUB_HOMEPAGE)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_HOMEPAGE, pubHomepage); + } + if (additionalProperties.containsKey(USE_ENUM_EXTENSION)) { this.setUseEnumExtension(convertPropertyToBooleanAndWriteBack(USE_ENUM_EXTENSION)); } else { @@ -551,6 +581,18 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { this.pubDescription = pubDescription; } + public void setPubAuthor(String pubAuthor) { + this.pubAuthor = pubAuthor; + } + + public void setPubAuthorEmail(String pubAuthorEmail) { + this.pubAuthorEmail = pubAuthorEmail; + } + + public void setPubHomepage(String pubHomepage) { + this.pubHomepage = pubHomepage; + } + public void setUseEnumExtension(boolean useEnumExtension) { this.useEnumExtension = useEnumExtension; } diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index 59801210034b..6f1bd2bb4a03 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -1,6 +1,9 @@ name: {{pubName}} version: {{pubVersion}} description: {{pubDescription}} +authors: + - {{pubAuthor}} <{{pubAuthorEmail}}> +homepage: {{pubHomepage}} environment: sdk: '>=2.0.0 <3.0.0' dependencies: diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java index e9e32475553c..902a0ebad300 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java @@ -52,6 +52,12 @@ public class DartClientOptionsTest extends AbstractOptionsTest { times = 1; clientCodegen.setPubDescription(DartClientOptionsProvider.PUB_DESCRIPTION_VALUE); times = 1; + clientCodegen.setPubAuthor(DartClientOptionsProvider.PUB_AUTHOR_VALUE); + times = 1; + clientCodegen.setPubAuthorEmail(DartClientOptionsProvider.PUB_AUTHOR_EMAIL_VALUE); + times = 1; + clientCodegen.setPubHomepage(DartClientOptionsProvider.PUB_HOMEPAGE_VALUE); + times = 1; clientCodegen.setSourceFolder(DartClientOptionsProvider.SOURCE_FOLDER_VALUE); times = 1; clientCodegen.setUseEnumExtension(Boolean.valueOf(DartClientOptionsProvider.USE_ENUM_EXTENSION)); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java index 0ed8360cd611..c79592d1d7fa 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java @@ -31,6 +31,9 @@ public class DartClientOptionsProvider implements OptionsProvider { public static final String PUB_NAME_VALUE = "swagger"; public static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String PUB_DESCRIPTION_VALUE = "Swagger API client dart"; + public static final String PUB_AUTHOR_VALUE = "Author"; + public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage"; + public static final String PUB_HOMEPAGE_VALUE = "Homepage"; public static final String SOURCE_FOLDER_VALUE = "src"; public static final String USE_ENUM_EXTENSION = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; @@ -51,6 +54,9 @@ public class DartClientOptionsProvider implements OptionsProvider { .put(DartClientCodegen.PUB_NAME, PUB_NAME_VALUE) .put(DartClientCodegen.PUB_VERSION, PUB_VERSION_VALUE) .put(DartClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE) + .put(DartClientCodegen.PUB_AUTHOR, PUB_AUTHOR_VALUE) + .put(DartClientCodegen.PUB_AUTHOR_EMAIL, PUB_AUTHOR_EMAIL_VALUE) + .put(DartClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) .put(DartClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) From ca6fb2c4f2a16c85958b920df8a5caca52128de2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 27 Dec 2019 16:49:02 +0800 Subject: [PATCH 23/28] update dart samples --- .../dart-dio/.openapi-generator/VERSION | 2 +- samples/client/petstore/dart-dio/README.md | 53 +- samples/client/petstore/dart-dio/lib/api.dart | 51 +- .../petstore/dart-dio/lib/api/pet_api.dart | 589 ++++++++---------- .../petstore/dart-dio/lib/api/user_api.dart | 530 ++++++++-------- .../dart-dio/lib/model/api_response.dart | 32 +- .../petstore/dart-dio/lib/model/category.dart | 26 +- .../petstore/dart-dio/lib/model/order.dart | 61 +- .../petstore/dart-dio/lib/model/pet.dart | 66 +- .../petstore/dart-dio/lib/model/tag.dart | 26 +- .../petstore/dart-dio/lib/model/user.dart | 74 +-- .../petstore/dart-dio/lib/serializers.dart | 57 +- samples/client/petstore/dart-dio/pubspec.yaml | 4 +- .../flutter_petstore/openapi/README.md | 52 +- .../flutter_proto_petstore/openapi/README.md | 52 +- .../petstore/dart-jaguar/openapi/README.md | 52 +- .../dart-jaguar/openapi_proto/README.md | 52 +- .../dart/flutter_petstore/openapi/README.md | 52 +- .../dart/openapi-browser-client/README.md | 52 +- .../client/petstore/dart/openapi/README.md | 52 +- .../dart2/petstore_client_lib/README.md | 52 +- .../dart2/petstore_client_lib/pubspec.yaml | 3 + 22 files changed, 967 insertions(+), 1023 deletions(-) diff --git a/samples/client/petstore/dart-dio/.openapi-generator/VERSION b/samples/client/petstore/dart-dio/.openapi-generator/VERSION index c3a2c7076fa8..58592f031f65 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-dio/README.md b/samples/client/petstore/dart-dio/README.md index 824ea71074dc..ceda34066bc0 100644 --- a/samples/client/petstore/dart-dio/README.md +++ b/samples/client/petstore/dart-dio/README.md @@ -4,7 +4,6 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Build date: 2019-10-30T08:32:55.947+13:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartDioClientCodegen ## Requirements @@ -58,36 +57,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **delete** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **get** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **post** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **post** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **delete** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **get** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **delete** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **get** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **put** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **delete** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **get** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **post** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **post** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **delete** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **get** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **delete** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **get** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **put** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart-dio/lib/api.dart b/samples/client/petstore/dart-dio/lib/api.dart index b2575064fbf3..8fc03c1fec90 100644 --- a/samples/client/petstore/dart-dio/lib/api.dart +++ b/samples/client/petstore/dart-dio/lib/api.dart @@ -8,45 +8,52 @@ import 'package:openapi/api/pet_api.dart'; import 'package:openapi/api/store_api.dart'; import 'package:openapi/api/user_api.dart'; -class Openapi { - Dio dio; - Serializers serializers; - String basePath = "http://petstore.swagger.io/v2"; - Openapi({this.dio, Serializers serializers}) { +class Openapi { + + Dio dio; + Serializers serializers; + String basePath = "http://petstore.swagger.io/v2"; + + Openapi({this.dio, Serializers serializers}) { if (dio == null) { - BaseOptions options = new BaseOptions( - baseUrl: basePath, - connectTimeout: 5000, - receiveTimeout: 3000, - ); - this.dio = new Dio(options); + BaseOptions options = new BaseOptions( + baseUrl: basePath, + connectTimeout: 5000, + receiveTimeout: 3000, + ); + this.dio = new Dio(options); } this.serializers = serializers ?? standardSerializers; - } +} - /** + + /** * Get PetApi instance, base route and serializer can be overridden by a given but be careful, * by doing that all interceptors will not be executed */ - PetApi getPetApi() { + PetApi getPetApi() { return PetApi(dio, serializers); - } + } - /** + + /** * Get StoreApi instance, base route and serializer can be overridden by a given but be careful, * by doing that all interceptors will not be executed */ - StoreApi getStoreApi() { + StoreApi getStoreApi() { return StoreApi(dio, serializers); - } + } - /** + + /** * Get UserApi instance, base route and serializer can be overridden by a given but be careful, * by doing that all interceptors will not be executed */ - UserApi getUserApi() { + UserApi getUserApi() { return UserApi(dio, serializers); - } -} + } + + +} \ No newline at end of file diff --git a/samples/client/petstore/dart-dio/lib/api/pet_api.dart b/samples/client/petstore/dart-dio/lib/api/pet_api.dart index e65520ad76cd..4b182c95f3ea 100644 --- a/samples/client/petstore/dart-dio/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/pet_api.dart @@ -10,367 +10,322 @@ import 'package:openapi/model/api_response.dart'; import 'dart:typed_data'; class PetApi { - final Dio _dio; - Serializers _serializers; + final Dio _dio; + Serializers _serializers; - PetApi(this._dio, this._serializers); + PetApi(this._dio, this._serializers); - /// Add a new pet to the store - /// - /// - Future addPet( - Pet body, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/pet"; + /// Add a new pet to the store + /// + /// + FutureaddPet(Pet body,{ CancelToken cancelToken, Map headers,}) async { - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + String path = "/pet"; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - List contentTypes = ["application/json", "application/xml"]; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - var serializedBody = _serializers.serialize(body); - var jsonbody = json.encode(serializedBody); + List contentTypes = [ + "application/json", + "application/xml"]; - return _dio.request( - path, - queryParameters: queryParams, - data: jsonbody, - options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + var serializedBody = _serializers.serialize(body); + var jsonbody = json.encode(serializedBody); - /// Deletes a pet - /// - /// - Future deletePet( - int petId, { - String apiKey, - CancelToken cancelToken, - Map headers, - }) async { - String path = - "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); + return _dio.request( + path, + queryParameters: queryParams, + data: jsonbody, + options: Options( + method: 'post'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// Deletes a pet + /// + /// + FuturedeletePet(int petId,{ String apiKey,CancelToken cancelToken, Map headers,}) async { - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + String path = "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); - headerParams["api_key"] = apiKey; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - List contentTypes = []; + headerParams["api_key"] = apiKey; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - return _dio.request( - path, - queryParameters: queryParams, - options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + List contentTypes = []; - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - Future>> findPetsByStatus( - List status, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/pet/findByStatus"; - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'delete'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + Future>>findPetsByStatus(List status,{ CancelToken cancelToken, Map headers,}) async { - queryParams["status"] = status; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + String path = "/pet/findByStatus"; - List contentTypes = []; + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - return _dio - .request( - path, - queryParameters: queryParams, - options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ) - .then((response) { - final FullType type = - const FullType(BuiltList, const [const FullType(Pet)]); - BuiltList dataList = - _serializers.deserialize(response.data, specifiedType: type); - var data = dataList.toList(); + queryParams["status"] = status; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - return Response>( - data: data, - headers: response.headers, - request: response.request, - redirects: response.redirects, - statusCode: response.statusCode, - statusMessage: response.statusMessage, - extra: response.extra, - ); - }); - } + List contentTypes = []; - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future>> findPetsByTags( - List tags, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/pet/findByTags"; - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'get'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ).then((response) { - queryParams["tags"] = tags; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + final FullType type = const FullType(BuiltList, const [const FullType(Pet)]); + BuiltList dataList = _serializers.deserialize(response.data, specifiedType: type); + var data = dataList.toList(); - List contentTypes = []; + return Response>( + data: data, + headers: response.headers, + request: response.request, + redirects: response.redirects, + statusCode: response.statusCode, + statusMessage: response.statusMessage, + extra: response.extra, + ); + }); + } + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + Future>>findPetsByTags(List tags,{ CancelToken cancelToken, Map headers,}) async { - return _dio - .request( - path, - queryParameters: queryParams, - options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ) - .then((response) { - final FullType type = - const FullType(BuiltList, const [const FullType(Pet)]); - BuiltList dataList = - _serializers.deserialize(response.data, specifiedType: type); - var data = dataList.toList(); + String path = "/pet/findByTags"; - return Response>( - data: data, - headers: response.headers, - request: response.request, - redirects: response.redirects, - statusCode: response.statusCode, - statusMessage: response.statusMessage, - extra: response.extra, - ); - }); - } + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - /// Find pet by ID - /// - /// Returns a single pet - Future> getPetById( - int petId, { - CancelToken cancelToken, - Map headers, - }) async { - String path = - "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); + queryParams["tags"] = tags; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + List contentTypes = []; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); - List contentTypes = []; + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'get'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ).then((response) { - return _dio - .request( - path, - queryParameters: queryParams, - options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ) - .then((response) { - var serializer = _serializers.serializerForType(Pet); - var data = _serializers.deserializeWith(serializer, response.data); + final FullType type = const FullType(BuiltList, const [const FullType(Pet)]); + BuiltList dataList = _serializers.deserialize(response.data, specifiedType: type); + var data = dataList.toList(); - return Response( - data: data, - headers: response.headers, - request: response.request, - redirects: response.redirects, - statusCode: response.statusCode, - statusMessage: response.statusMessage, - extra: response.extra, - ); - }); - } + return Response>( + data: data, + headers: response.headers, + request: response.request, + redirects: response.redirects, + statusCode: response.statusCode, + statusMessage: response.statusMessage, + extra: response.extra, + ); + }); + } + /// Find pet by ID + /// + /// Returns a single pet + Future>getPetById(int petId,{ CancelToken cancelToken, Map headers,}) async { - /// Update an existing pet - /// - /// - Future updatePet( - Pet body, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/pet"; + String path = "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - List contentTypes = ["application/json", "application/xml"]; + List contentTypes = []; - var serializedBody = _serializers.serialize(body); - var jsonbody = json.encode(serializedBody); - return _dio.request( - path, - queryParameters: queryParams, - data: jsonbody, - options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'get'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ).then((response) { - /// Updates a pet in the store with form data - /// - /// - Future updatePetWithForm( - int petId, { - String name, - String status, - CancelToken cancelToken, - Map headers, - }) async { - String path = - "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); + var serializer = _serializers.serializerForType(Pet); + var data = _serializers.deserializeWith(serializer, response.data); - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + return Response( + data: data, + headers: response.headers, + request: response.request, + redirects: response.redirects, + statusCode: response.statusCode, + statusMessage: response.statusMessage, + extra: response.extra, + ); + }); + } + /// Update an existing pet + /// + /// + FutureupdatePet(Pet body,{ CancelToken cancelToken, Map headers,}) async { - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + String path = "/pet"; - List contentTypes = ["application/x-www-form-urlencoded"]; + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - return _dio.request( - path, - queryParameters: queryParams, - options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - /// uploads an image - /// - /// - Future> uploadFile( - int petId, { - String additionalMetadata, - Uint8List file, - CancelToken cancelToken, - Map headers, - }) async { - String path = "/pet/{petId}/uploadImage" - .replaceAll("{" + "petId" + "}", petId.toString()); + List contentTypes = [ + "application/json", + "application/xml"]; - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + var serializedBody = _serializers.serialize(body); + var jsonbody = json.encode(serializedBody); - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + return _dio.request( + path, + queryParameters: queryParams, + data: jsonbody, + options: Options( + method: 'put'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// Updates a pet in the store with form data + /// + /// + FutureupdatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map headers,}) async { - List contentTypes = ["multipart/form-data"]; + String path = "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); - return _dio - .request( - path, - queryParameters: queryParams, - options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ) - .then((response) { - var serializer = _serializers.serializerForType(ApiResponse); - var data = - _serializers.deserializeWith(serializer, response.data); + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - return Response( - data: data, - headers: response.headers, - request: response.request, - redirects: response.redirects, - statusCode: response.statusCode, - statusMessage: response.statusMessage, - extra: response.extra, - ); - }); - } -} + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); + + List contentTypes = [ + "application/x-www-form-urlencoded"]; + + + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'post'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// uploads an image + /// + /// + Future>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map headers,}) async { + + String path = "/pet/{petId}/uploadImage".replaceAll("{" + "petId" + "}", petId.toString()); + + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; + + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); + + List contentTypes = [ + "multipart/form-data"]; + + + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'post'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ).then((response) { + + var serializer = _serializers.serializerForType(ApiResponse); + var data = _serializers.deserializeWith(serializer, response.data); + + return Response( + data: data, + headers: response.headers, + request: response.request, + redirects: response.redirects, + statusCode: response.statusCode, + statusMessage: response.statusMessage, + extra: response.extra, + ); + }); + } + } diff --git a/samples/client/petstore/dart-dio/lib/api/user_api.dart b/samples/client/petstore/dart-dio/lib/api/user_api.dart index d10f5fea5932..521be8729347 100644 --- a/samples/client/petstore/dart-dio/lib/api/user_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/user_api.dart @@ -8,337 +8,293 @@ import 'package:built_value/serializer.dart'; import 'package:openapi/model/user.dart'; class UserApi { - final Dio _dio; - Serializers _serializers; + final Dio _dio; + Serializers _serializers; - UserApi(this._dio, this._serializers); + UserApi(this._dio, this._serializers); - /// Create user - /// - /// This can only be done by the logged in user. - Future createUser( - User body, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/user"; + /// Create user + /// + /// This can only be done by the logged in user. + FuturecreateUser(User body,{ CancelToken cancelToken, Map headers,}) async { - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + String path = "/user"; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - List contentTypes = []; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - var serializedBody = _serializers.serialize(body); - var jsonbody = json.encode(serializedBody); + List contentTypes = []; - return _dio.request( - path, - queryParameters: queryParams, - data: jsonbody, - options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + var serializedBody = _serializers.serialize(body); + var jsonbody = json.encode(serializedBody); - /// Creates list of users with given input array - /// - /// - Future createUsersWithArrayInput( - List body, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/user/createWithArray"; + return _dio.request( + path, + queryParameters: queryParams, + data: jsonbody, + options: Options( + method: 'post'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// Creates list of users with given input array + /// + /// + FuturecreateUsersWithArrayInput(List body,{ CancelToken cancelToken, Map headers,}) async { - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + String path = "/user/createWithArray"; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - List contentTypes = []; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - final type = const FullType(BuiltList, const [const FullType(User)]); - var serializedBody = - _serializers.serialize(BuiltList.from(body), specifiedType: type); - var jsonbody = json.encode(serializedBody); + List contentTypes = []; - return _dio.request( - path, - queryParameters: queryParams, - data: jsonbody, - options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + final type = const FullType(BuiltList, const [const FullType(User)]); + var serializedBody = _serializers.serialize(BuiltList.from(body), specifiedType: type); + var jsonbody = json.encode(serializedBody); - /// Creates list of users with given input array - /// - /// - Future createUsersWithListInput( - List body, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/user/createWithList"; + return _dio.request( + path, + queryParameters: queryParams, + data: jsonbody, + options: Options( + method: 'post'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// Creates list of users with given input array + /// + /// + FuturecreateUsersWithListInput(List body,{ CancelToken cancelToken, Map headers,}) async { - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + String path = "/user/createWithList"; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - List contentTypes = []; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - final type = const FullType(BuiltList, const [const FullType(User)]); - var serializedBody = - _serializers.serialize(BuiltList.from(body), specifiedType: type); - var jsonbody = json.encode(serializedBody); + List contentTypes = []; - return _dio.request( - path, - queryParameters: queryParams, - data: jsonbody, - options: Options( - method: 'post'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + final type = const FullType(BuiltList, const [const FullType(User)]); + var serializedBody = _serializers.serialize(BuiltList.from(body), specifiedType: type); + var jsonbody = json.encode(serializedBody); - /// Delete user - /// - /// This can only be done by the logged in user. - Future deleteUser( - String username, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/user/{username}" - .replaceAll("{" + "username" + "}", username.toString()); + return _dio.request( + path, + queryParameters: queryParams, + data: jsonbody, + options: Options( + method: 'post'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// Delete user + /// + /// This can only be done by the logged in user. + FuturedeleteUser(String username,{ CancelToken cancelToken, Map headers,}) async { - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + String path = "/user/{username}".replaceAll("{" + "username" + "}", username.toString()); - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - List contentTypes = []; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - return _dio.request( - path, - queryParameters: queryParams, - options: Options( - method: 'delete'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + List contentTypes = []; - /// Get user by user name - /// - /// - Future> getUserByName( - String username, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/user/{username}" - .replaceAll("{" + "username" + "}", username.toString()); - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'delete'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// Get user by user name + /// + /// + Future>getUserByName(String username,{ CancelToken cancelToken, Map headers,}) async { - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + String path = "/user/{username}".replaceAll("{" + "username" + "}", username.toString()); - List contentTypes = []; + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - return _dio - .request( - path, - queryParameters: queryParams, - options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ) - .then((response) { - var serializer = _serializers.serializerForType(User); - var data = _serializers.deserializeWith(serializer, response.data); + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - return Response( - data: data, - headers: response.headers, - request: response.request, - redirects: response.redirects, - statusCode: response.statusCode, - statusMessage: response.statusMessage, - extra: response.extra, - ); - }); - } + List contentTypes = []; - /// Logs user into the system - /// - /// - Future> loginUser( - String username, - String password, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/user/login"; - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'get'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ).then((response) { - queryParams["username"] = username; - queryParams["password"] = password; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + var serializer = _serializers.serializerForType(User); + var data = _serializers.deserializeWith(serializer, response.data); - List contentTypes = []; + return Response( + data: data, + headers: response.headers, + request: response.request, + redirects: response.redirects, + statusCode: response.statusCode, + statusMessage: response.statusMessage, + extra: response.extra, + ); + }); + } + /// Logs user into the system + /// + /// + Future>loginUser(String username,String password,{ CancelToken cancelToken, Map headers,}) async { - return _dio - .request( - path, - queryParameters: queryParams, - options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ) - .then((response) { - var serializer = _serializers.serializerForType(String); - var data = - _serializers.deserializeWith(serializer, response.data); + String path = "/user/login"; - return Response( - data: data, - headers: response.headers, - request: response.request, - redirects: response.redirects, - statusCode: response.statusCode, - statusMessage: response.statusMessage, - extra: response.extra, - ); - }); - } + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - /// Logs out current logged in user session - /// - /// - Future logoutUser({ - CancelToken cancelToken, - Map headers, - }) async { - String path = "/user/logout"; + queryParams["username"] = username; + queryParams["password"] = password; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + List contentTypes = []; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); - List contentTypes = []; + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'get'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ).then((response) { - return _dio.request( - path, - queryParameters: queryParams, - options: Options( - method: 'get'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } + var serializer = _serializers.serializerForType(String); + var data = _serializers.deserializeWith(serializer, response.data); - /// Updated user - /// - /// This can only be done by the logged in user. - Future updateUser( - String username, - User body, { - CancelToken cancelToken, - Map headers, - }) async { - String path = "/user/{username}" - .replaceAll("{" + "username" + "}", username.toString()); + return Response( + data: data, + headers: response.headers, + request: response.request, + redirects: response.redirects, + statusCode: response.statusCode, + statusMessage: response.statusMessage, + extra: response.extra, + ); + }); + } + /// Logs out current logged in user session + /// + /// + FuturelogoutUser({ CancelToken cancelToken, Map headers,}) async { - // query params - Map queryParams = {}; - Map headerParams = Map.from(headers ?? {}); - Map formParams = {}; + String path = "/user/logout"; - queryParams.removeWhere((key, value) => value == null); - headerParams.removeWhere((key, value) => value == null); - formParams.removeWhere((key, value) => value == null); + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; - List contentTypes = []; + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); - var serializedBody = _serializers.serialize(body); - var jsonbody = json.encode(serializedBody); + List contentTypes = []; - return _dio.request( - path, - queryParameters: queryParams, - data: jsonbody, - options: Options( - method: 'put'.toUpperCase(), - headers: headerParams, - contentType: - contentTypes.isNotEmpty ? contentTypes[0] : "application/json", - ), - cancelToken: cancelToken, - ); - } -} + + return _dio.request( + path, + queryParameters: queryParams, + options: Options( + method: 'get'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + /// Updated user + /// + /// This can only be done by the logged in user. + FutureupdateUser(String username,User body,{ CancelToken cancelToken, Map headers,}) async { + + String path = "/user/{username}".replaceAll("{" + "username" + "}", username.toString()); + + // query params + Map queryParams = {}; + Map headerParams = Map.from(headers ?? {}); + Map formParams = {}; + + queryParams.removeWhere((key, value) => value == null); + headerParams.removeWhere((key, value) => value == null); + formParams.removeWhere((key, value) => value == null); + + List contentTypes = []; + + var serializedBody = _serializers.serialize(body); + var jsonbody = json.encode(serializedBody); + + return _dio.request( + path, + queryParameters: queryParams, + data: jsonbody, + options: Options( + method: 'put'.toUpperCase(), + headers: headerParams, + contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", + ), + cancelToken: cancelToken, + ); + } + } diff --git a/samples/client/petstore/dart-dio/lib/model/api_response.dart b/samples/client/petstore/dart-dio/lib/model/api_response.dart index 0feebafb0051..1463d222b91e 100644 --- a/samples/client/petstore/dart-dio/lib/model/api_response.dart +++ b/samples/client/petstore/dart-dio/lib/model/api_response.dart @@ -1,24 +1,28 @@ -import 'package:built_value/built_value.dart'; + import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; part 'api_response.g.dart'; abstract class ApiResponse implements Built { - @nullable - @BuiltValueField(wireName: 'code') - int get code; - @nullable - @BuiltValueField(wireName: 'type') - String get type; + + @nullable + @BuiltValueField(wireName: 'code') + int get code; + + @nullable + @BuiltValueField(wireName: 'type') + String get type; + + @nullable + @BuiltValueField(wireName: 'message') + String get message; - @nullable - @BuiltValueField(wireName: 'message') - String get message; + // Boilerplate code needed to wire-up generated code + ApiResponse._(); - // Boilerplate code needed to wire-up generated code - ApiResponse._(); + factory ApiResponse([updates(ApiResponseBuilder b)]) = _$ApiResponse; + static Serializer get serializer => _$apiResponseSerializer; - factory ApiResponse([updates(ApiResponseBuilder b)]) = _$ApiResponse; - static Serializer get serializer => _$apiResponseSerializer; } + diff --git a/samples/client/petstore/dart-dio/lib/model/category.dart b/samples/client/petstore/dart-dio/lib/model/category.dart index 5d80fb503667..725c0a5c618f 100644 --- a/samples/client/petstore/dart-dio/lib/model/category.dart +++ b/samples/client/petstore/dart-dio/lib/model/category.dart @@ -1,20 +1,24 @@ -import 'package:built_value/built_value.dart'; + import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; part 'category.g.dart'; abstract class Category implements Built { - @nullable - @BuiltValueField(wireName: 'id') - int get id; - @nullable - @BuiltValueField(wireName: 'name') - String get name; + + @nullable + @BuiltValueField(wireName: 'id') + int get id; + + @nullable + @BuiltValueField(wireName: 'name') + String get name; - // Boilerplate code needed to wire-up generated code - Category._(); + // Boilerplate code needed to wire-up generated code + Category._(); + + factory Category([updates(CategoryBuilder b)]) = _$Category; + static Serializer get serializer => _$categorySerializer; - factory Category([updates(CategoryBuilder b)]) = _$Category; - static Serializer get serializer => _$categorySerializer; } + diff --git a/samples/client/petstore/dart-dio/lib/model/order.dart b/samples/client/petstore/dart-dio/lib/model/order.dart index c04e3032ce86..01f93031072e 100644 --- a/samples/client/petstore/dart-dio/lib/model/order.dart +++ b/samples/client/petstore/dart-dio/lib/model/order.dart @@ -1,39 +1,42 @@ -import 'package:built_value/built_value.dart'; + import 'DateTime'; + import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; part 'order.g.dart'; abstract class Order implements Built { - @nullable - @BuiltValueField(wireName: 'id') - int get id; - @nullable - @BuiltValueField(wireName: 'petId') - int get petId; + + @nullable + @BuiltValueField(wireName: 'id') + int get id; + + @nullable + @BuiltValueField(wireName: 'petId') + int get petId; + + @nullable + @BuiltValueField(wireName: 'quantity') + int get quantity; + + @nullable + @BuiltValueField(wireName: 'shipDate') + DateTime get shipDate; + /* Order Status */ + @nullable + @BuiltValueField(wireName: 'status') + String get status; + //enum statusEnum { placed, approved, delivered, }; + + @nullable + @BuiltValueField(wireName: 'complete') + bool get complete; - @nullable - @BuiltValueField(wireName: 'quantity') - int get quantity; + // Boilerplate code needed to wire-up generated code + Order._(); - @nullable - @BuiltValueField(wireName: 'shipDate') - DateTime get shipDate; - /* Order Status */ - @nullable + factory Order([updates(OrderBuilder b)]) = _$Order; + static Serializer get serializer => _$orderSerializer; - /* Order Status */ - @BuiltValueField(wireName: 'status') - String get status; - //enum statusEnum { placed, approved, delivered, }; - - @nullable - @BuiltValueField(wireName: 'complete') - bool get complete; - - // Boilerplate code needed to wire-up generated code - Order._(); - - factory Order([updates(OrderBuilder b)]) = _$Order; - static Serializer get serializer => _$orderSerializer; } + diff --git a/samples/client/petstore/dart-dio/lib/model/pet.dart b/samples/client/petstore/dart-dio/lib/model/pet.dart index 81441c4f6274..e8810fa2e9c3 100644 --- a/samples/client/petstore/dart-dio/lib/model/pet.dart +++ b/samples/client/petstore/dart-dio/lib/model/pet.dart @@ -1,42 +1,44 @@ -import 'package:openapi/model/tag.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/model/category.dart'; -import 'package:built_value/built_value.dart'; + import 'package:openapi/model/tag.dart'; + import 'package:built_collection/built_collection.dart'; + import 'package:openapi/model/category.dart'; + import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; part 'pet.g.dart'; abstract class Pet implements Built { - @nullable - @BuiltValueField(wireName: 'id') - int get id; - @nullable - @BuiltValueField(wireName: 'category') - Category get category; + + @nullable + @BuiltValueField(wireName: 'id') + int get id; + + @nullable + @BuiltValueField(wireName: 'category') + Category get category; + + @nullable + @BuiltValueField(wireName: 'name') + String get name; + + @nullable + @BuiltValueField(wireName: 'photoUrls') + BuiltList get photoUrls; + + @nullable + @BuiltValueField(wireName: 'tags') + BuiltList get tags; + /* pet status in the store */ + @nullable + @BuiltValueField(wireName: 'status') + String get status; + //enum statusEnum { available, pending, sold, }; - @nullable - @BuiltValueField(wireName: 'name') - String get name; + // Boilerplate code needed to wire-up generated code + Pet._(); - @nullable - @BuiltValueField(wireName: 'photoUrls') - BuiltList get photoUrls; + factory Pet([updates(PetBuilder b)]) = _$Pet; + static Serializer get serializer => _$petSerializer; - @nullable - @BuiltValueField(wireName: 'tags') - BuiltList get tags; - /* pet status in the store */ - @nullable - - /* pet status in the store */ - @BuiltValueField(wireName: 'status') - String get status; - //enum statusEnum { available, pending, sold, }; - - // Boilerplate code needed to wire-up generated code - Pet._(); - - factory Pet([updates(PetBuilder b)]) = _$Pet; - static Serializer get serializer => _$petSerializer; } + diff --git a/samples/client/petstore/dart-dio/lib/model/tag.dart b/samples/client/petstore/dart-dio/lib/model/tag.dart index 9d304767721b..ba86002670e3 100644 --- a/samples/client/petstore/dart-dio/lib/model/tag.dart +++ b/samples/client/petstore/dart-dio/lib/model/tag.dart @@ -1,20 +1,24 @@ -import 'package:built_value/built_value.dart'; + import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; part 'tag.g.dart'; abstract class Tag implements Built { - @nullable - @BuiltValueField(wireName: 'id') - int get id; - @nullable - @BuiltValueField(wireName: 'name') - String get name; + + @nullable + @BuiltValueField(wireName: 'id') + int get id; + + @nullable + @BuiltValueField(wireName: 'name') + String get name; - // Boilerplate code needed to wire-up generated code - Tag._(); + // Boilerplate code needed to wire-up generated code + Tag._(); + + factory Tag([updates(TagBuilder b)]) = _$Tag; + static Serializer get serializer => _$tagSerializer; - factory Tag([updates(TagBuilder b)]) = _$Tag; - static Serializer get serializer => _$tagSerializer; } + diff --git a/samples/client/petstore/dart-dio/lib/model/user.dart b/samples/client/petstore/dart-dio/lib/model/user.dart index da351b55d898..d6595d4a9d84 100644 --- a/samples/client/petstore/dart-dio/lib/model/user.dart +++ b/samples/client/petstore/dart-dio/lib/model/user.dart @@ -1,46 +1,48 @@ -import 'package:built_value/built_value.dart'; + import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; part 'user.g.dart'; abstract class User implements Built { - @nullable - @BuiltValueField(wireName: 'id') - int get id; - @nullable - @BuiltValueField(wireName: 'username') - String get username; + + @nullable + @BuiltValueField(wireName: 'id') + int get id; + + @nullable + @BuiltValueField(wireName: 'username') + String get username; + + @nullable + @BuiltValueField(wireName: 'firstName') + String get firstName; + + @nullable + @BuiltValueField(wireName: 'lastName') + String get lastName; + + @nullable + @BuiltValueField(wireName: 'email') + String get email; + + @nullable + @BuiltValueField(wireName: 'password') + String get password; + + @nullable + @BuiltValueField(wireName: 'phone') + String get phone; + /* User Status */ + @nullable + @BuiltValueField(wireName: 'userStatus') + int get userStatus; - @nullable - @BuiltValueField(wireName: 'firstName') - String get firstName; + // Boilerplate code needed to wire-up generated code + User._(); - @nullable - @BuiltValueField(wireName: 'lastName') - String get lastName; + factory User([updates(UserBuilder b)]) = _$User; + static Serializer get serializer => _$userSerializer; - @nullable - @BuiltValueField(wireName: 'email') - String get email; - - @nullable - @BuiltValueField(wireName: 'password') - String get password; - - @nullable - @BuiltValueField(wireName: 'phone') - String get phone; - /* User Status */ - @nullable - - /* User Status */ - @BuiltValueField(wireName: 'userStatus') - int get userStatus; - - // Boilerplate code needed to wire-up generated code - User._(); - - factory User([updates(UserBuilder b)]) = _$User; - static Serializer get serializer => _$userSerializer; } + diff --git a/samples/client/petstore/dart-dio/lib/serializers.dart b/samples/client/petstore/dart-dio/lib/serializers.dart index 88a06193f3ca..155e4069d2e1 100644 --- a/samples/client/petstore/dart-dio/lib/serializers.dart +++ b/samples/client/petstore/dart-dio/lib/serializers.dart @@ -2,6 +2,7 @@ library serializers; import 'package:built_value/serializer.dart'; import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:openapi/model/api_response.dart'; @@ -11,38 +12,42 @@ import 'package:openapi/model/pet.dart'; import 'package:openapi/model/tag.dart'; import 'package:openapi/model/user.dart'; + part 'serializers.g.dart'; @SerializersFor(const [ - ApiResponse, - Category, - Order, - Pet, - Tag, - User, +ApiResponse, +Category, +Order, +Pet, +Tag, +User, + ]) //allow all models to be serialized within a list Serializers serializers = (_$serializers.toBuilder() - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(ApiResponse)]), - () => new ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Category)]), - () => new ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Order)]), - () => new ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Pet)]), - () => new ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Tag)]), - () => new ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(User)]), - () => new ListBuilder())) - .build(); +..addBuilderFactory( +const FullType(BuiltList, const [const FullType(ApiResponse)]), +() => new ListBuilder()) +..addBuilderFactory( +const FullType(BuiltList, const [const FullType(Category)]), +() => new ListBuilder()) +..addBuilderFactory( +const FullType(BuiltList, const [const FullType(Order)]), +() => new ListBuilder()) +..addBuilderFactory( +const FullType(BuiltList, const [const FullType(Pet)]), +() => new ListBuilder()) +..addBuilderFactory( +const FullType(BuiltList, const [const FullType(Tag)]), +() => new ListBuilder()) +..addBuilderFactory( +const FullType(BuiltList, const [const FullType(User)]), +() => new ListBuilder()) + +).build(); Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); +(serializers.toBuilder() +..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/client/petstore/dart-dio/pubspec.yaml b/samples/client/petstore/dart-dio/pubspec.yaml index 2f3bd0e12556..2b2b55e1f948 100644 --- a/samples/client/petstore/dart-dio/pubspec.yaml +++ b/samples/client/petstore/dart-dio/pubspec.yaml @@ -4,10 +4,10 @@ description: OpenAPI API client environment: sdk: ">=2.3.0 <3.0.0" dependencies: - dio: ^3.0.3 + dio: ^3.0.4 built_value: ^6.8.2 built_collection: ^4.2.2 dev_dependencies: built_value_generator: ^6.8.2 build_runner: ^1.7.1 - test: 1.6.5 \ No newline at end of file + test: 1.6.5 diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md index 693df464eb0c..2568cebe9c75 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md @@ -72,36 +72,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **Put** /user/:username | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md index 693df464eb0c..2568cebe9c75 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md @@ -72,36 +72,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **Put** /user/:username | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart-jaguar/openapi/README.md b/samples/client/petstore/dart-jaguar/openapi/README.md index 693df464eb0c..2568cebe9c75 100644 --- a/samples/client/petstore/dart-jaguar/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/openapi/README.md @@ -72,36 +72,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **Put** /user/:username | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/README.md b/samples/client/petstore/dart-jaguar/openapi_proto/README.md index 693df464eb0c..2568cebe9c75 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/README.md +++ b/samples/client/petstore/dart-jaguar/openapi_proto/README.md @@ -72,36 +72,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **Put** /user/:username | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **Put** /user/:username | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md index 8520a219f887..79b7a9edc28b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/README.md @@ -63,36 +63,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/openapi-browser-client/README.md b/samples/client/petstore/dart/openapi-browser-client/README.md index 8520a219f887..79b7a9edc28b 100644 --- a/samples/client/petstore/dart/openapi-browser-client/README.md +++ b/samples/client/petstore/dart/openapi-browser-client/README.md @@ -63,36 +63,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart/openapi/README.md b/samples/client/petstore/dart/openapi/README.md index 8520a219f887..79b7a9edc28b 100644 --- a/samples/client/petstore/dart/openapi/README.md +++ b/samples/client/petstore/dart/openapi/README.md @@ -63,36 +63,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart2/petstore_client_lib/README.md b/samples/client/petstore/dart2/petstore_client_lib/README.md index a32c667b4ee4..1cf4ca28f0a8 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/README.md +++ b/samples/client/petstore/dart2/petstore_client_lib/README.md @@ -59,36 +59,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart2/petstore_client_lib/pubspec.yaml b/samples/client/petstore/dart2/petstore_client_lib/pubspec.yaml index be7bf663b8fd..58c44ac9eb57 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/pubspec.yaml +++ b/samples/client/petstore/dart2/petstore_client_lib/pubspec.yaml @@ -1,6 +1,9 @@ name: openapi version: 1.0.0 description: OpenAPI API client +authors: + - Author +homepage: homepage environment: sdk: '>=2.0.0 <3.0.0' dependencies: From adf9c12f73d9ff959b5130a18a82323ed2e98b73 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 27 Dec 2019 22:57:35 +0800 Subject: [PATCH 24/28] [Dart] fix option tests (#4874) * fix dart dio option tests * minor format change * fix dart option provider * minor change to tests * rearrange test order * update test value * comment out set author test * commet out tests --- .../codegen/languages/DartClientCodegen.java | 4 +++- .../languages/DartDioClientCodegen.java | 6 ++++-- .../dartdio/DartDioClientOptionsTest.java | 8 ++++++-- .../options/DartClientOptionsProvider.java | 4 ++-- .../options/DartDioClientOptionsProvider.java | 18 ++++++++++++------ 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index 34d906a9212a..4f6d03b4cabb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -114,7 +114,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { List reservedWordsList = new ArrayList(); try { BufferedReader reader = new BufferedReader(new InputStreamReader(DartClientCodegen.class.getResourceAsStream("/dart/dart-keywords.txt"), Charset.forName("UTF-8"))); - while(reader.ready()) { reservedWordsList.add(reader.readLine()); } + while (reader.ready()) { + reservedWordsList.add(reader.readLine()); + } reader.close(); } catch (Exception e) { LOGGER.error("Error reading dart keywords. Exception: {}", e.getMessage()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 66fc2a468fd2..f5e82b6c2b89 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.languages; import java.util.HashMap; + import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; @@ -121,8 +122,9 @@ public class DartDioClientCodegen extends DartClientCodegen { return "Generates a Dart Dio client library."; } - @Override public void setBrowserClient(boolean browserClient) { - super.browserClient = browserClient; + @Override + public void setBrowserClient(boolean browserClient) { + super.browserClient = browserClient; } @Override diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioClientOptionsTest.java index f59c02ddf487..3f53525a52a2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioClientOptionsTest.java @@ -21,10 +21,8 @@ import mockit.Expectations; import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.DartClientCodegen; import org.openapitools.codegen.languages.DartDioClientCodegen; import org.openapitools.codegen.options.DartDioClientOptionsProvider; -import org.openapitools.codegen.options.DartDioClientOptionsProvider; public class DartDioClientOptionsTest extends AbstractOptionsTest { @@ -54,6 +52,12 @@ public class DartDioClientOptionsTest extends AbstractOptionsTest { times = 1; clientCodegen.setPubDescription(DartDioClientOptionsProvider.PUB_DESCRIPTION_VALUE); times = 1; + //clientCodegen.setPubAuthor(DartDioClientOptionsProvider.PUB_AUTHOR_VALUE); + //times = 1; + //clientCodegen.setPubAuthorEmail(DartDioClientOptionsProvider.PUB_AUTHOR_EMAIL_VALUE); + //times = 1; + //clientCodegen.setPubHomepage(DartDioClientOptionsProvider.PUB_HOMEPAGE_VALUE); + //times = 1; clientCodegen.setSourceFolder(DartDioClientOptionsProvider.SOURCE_FOLDER_VALUE); times = 1; clientCodegen.setUseEnumExtension(Boolean.valueOf(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java index c79592d1d7fa..4bd72b19ca39 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java @@ -28,9 +28,9 @@ public class DartClientOptionsProvider implements OptionsProvider { public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String BROWSER_CLIENT_VALUE = "true"; - public static final String PUB_NAME_VALUE = "swagger"; + public static final String PUB_NAME_VALUE = "openapi"; public static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT"; - public static final String PUB_DESCRIPTION_VALUE = "Swagger API client dart"; + public static final String PUB_DESCRIPTION_VALUE = "OpenAPI API client dart"; public static final String PUB_AUTHOR_VALUE = "Author"; public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage"; public static final String PUB_HOMEPAGE_VALUE = "Homepage"; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java index 067d0cc43422..981a8ef6684a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java @@ -18,29 +18,33 @@ package org.openapitools.codegen.options; import com.google.common.collect.ImmutableMap; + import java.util.Map; + import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.languages.DartDioClientCodegen; -import org.openapitools.codegen.languages.DartDioClientCodegen; public class DartDioClientOptionsProvider implements OptionsProvider { public static final String SORT_PARAMS_VALUE = "true"; public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String BROWSER_CLIENT_VALUE = "true"; - public static final String PUB_NAME_VALUE = "swagger"; + public static final String PUB_NAME_VALUE = "openapi"; public static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT"; - public static final String PUB_DESCRIPTION_VALUE = "Swagger API client dart"; + public static final String PUB_DESCRIPTION_VALUE = "OpenAPI API client dart"; public static final String SOURCE_FOLDER_VALUE = "src"; public static final String USE_ENUM_EXTENSION = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String DATE_LIBRARY = "core"; public static final String NULLABLE_FIELDS = "true"; + public static final String PUB_AUTHOR_VALUE = "Author"; + public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage"; + public static final String PUB_HOMEPAGE_VALUE = "Homepage"; @Override public String getLanguage() { - return "dart"; + return "dart-dio"; } @Override @@ -53,6 +57,9 @@ public class DartDioClientOptionsProvider implements OptionsProvider { .put(DartDioClientCodegen.PUB_NAME, PUB_NAME_VALUE) .put(DartDioClientCodegen.PUB_VERSION, PUB_VERSION_VALUE) .put(DartDioClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE) + .put(DartDioClientCodegen.PUB_AUTHOR, PUB_AUTHOR_VALUE) + .put(DartDioClientCodegen.PUB_AUTHOR_EMAIL, PUB_AUTHOR_EMAIL_VALUE) + .put(DartDioClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) .put(DartDioClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) @@ -60,8 +67,7 @@ public class DartDioClientOptionsProvider implements OptionsProvider { .put(DartDioClientCodegen.SUPPORT_DART2, "false") .put(DartDioClientCodegen.DATE_LIBRARY, DATE_LIBRARY) .put(DartDioClientCodegen.NULLABLE_FIELDS, NULLABLE_FIELDS) - - .build(); + .build(); } @Override From 90cbf711341f119da4035180a3d322ccb1b0cc12 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 28 Dec 2019 00:13:02 +0800 Subject: [PATCH 25/28] update dart petstore samples --- .../petstore/dart-dio/doc/ApiResponse.md | 17 + .../client/petstore/dart-dio/doc/Category.md | 16 + samples/client/petstore/dart-dio/doc/Order.md | 20 + samples/client/petstore/dart-dio/doc/Pet.md | 20 + .../client/petstore/dart-dio/doc/PetApi.md | 379 ++++++++++++++++++ .../client/petstore/dart-dio/doc/StoreApi.md | 186 +++++++++ samples/client/petstore/dart-dio/doc/Tag.md | 16 + samples/client/petstore/dart-dio/doc/User.md | 22 + .../client/petstore/dart-dio/doc/UserApi.md | 349 ++++++++++++++++ .../openapi/doc/ApiResponse.md | 17 + .../flutter_petstore/openapi/doc/Category.md | 16 + .../flutter_petstore/openapi/doc/Order.md | 20 + .../flutter_petstore/openapi/doc/Pet.md | 20 + .../flutter_petstore/openapi/doc/PetApi.md | 379 ++++++++++++++++++ .../flutter_petstore/openapi/doc/StoreApi.md | 186 +++++++++ .../flutter_petstore/openapi/doc/Tag.md | 16 + .../flutter_petstore/openapi/doc/User.md | 22 + .../flutter_petstore/openapi/doc/UserApi.md | 349 ++++++++++++++++ .../openapi/doc/ApiResponse.md | 17 + .../openapi/doc/Category.md | 16 + .../openapi/doc/Order.md | 20 + .../flutter_proto_petstore/openapi/doc/Pet.md | 20 + .../openapi/doc/PetApi.md | 379 ++++++++++++++++++ .../openapi/doc/StoreApi.md | 186 +++++++++ .../flutter_proto_petstore/openapi/doc/Tag.md | 16 + .../openapi/doc/User.md | 22 + .../openapi/doc/UserApi.md | 349 ++++++++++++++++ .../dart-jaguar/openapi/doc/ApiResponse.md | 17 + .../dart-jaguar/openapi/doc/Category.md | 16 + .../petstore/dart-jaguar/openapi/doc/Order.md | 20 + .../petstore/dart-jaguar/openapi/doc/Pet.md | 20 + .../dart-jaguar/openapi/doc/PetApi.md | 379 ++++++++++++++++++ .../dart-jaguar/openapi/doc/StoreApi.md | 186 +++++++++ .../petstore/dart-jaguar/openapi/doc/Tag.md | 16 + .../petstore/dart-jaguar/openapi/doc/User.md | 22 + .../dart-jaguar/openapi/doc/UserApi.md | 349 ++++++++++++++++ .../openapi_proto/doc/ApiResponse.md | 17 + .../dart-jaguar/openapi_proto/doc/Category.md | 16 + .../dart-jaguar/openapi_proto/doc/Order.md | 20 + .../dart-jaguar/openapi_proto/doc/Pet.md | 20 + .../dart-jaguar/openapi_proto/doc/PetApi.md | 379 ++++++++++++++++++ .../dart-jaguar/openapi_proto/doc/StoreApi.md | 186 +++++++++ .../dart-jaguar/openapi_proto/doc/Tag.md | 16 + .../dart-jaguar/openapi_proto/doc/User.md | 22 + .../dart-jaguar/openapi_proto/doc/UserApi.md | 349 ++++++++++++++++ .../openapi/doc/ApiResponse.md | 17 + .../flutter_petstore/openapi/doc/Category.md | 16 + .../flutter_petstore/openapi/doc/Order.md | 20 + .../dart/flutter_petstore/openapi/doc/Pet.md | 20 + .../flutter_petstore/openapi/doc/PetApi.md | 379 ++++++++++++++++++ .../flutter_petstore/openapi/doc/StoreApi.md | 186 +++++++++ .../dart/flutter_petstore/openapi/doc/Tag.md | 16 + .../dart/flutter_petstore/openapi/doc/User.md | 22 + .../flutter_petstore/openapi/doc/UserApi.md | 349 ++++++++++++++++ .../openapi-browser-client/doc/ApiResponse.md | 17 + .../openapi-browser-client/doc/Category.md | 16 + .../dart/openapi-browser-client/doc/Order.md | 20 + .../dart/openapi-browser-client/doc/Pet.md | 20 + .../dart/openapi-browser-client/doc/PetApi.md | 379 ++++++++++++++++++ .../openapi-browser-client/doc/StoreApi.md | 186 +++++++++ .../dart/openapi-browser-client/doc/Tag.md | 16 + .../dart/openapi-browser-client/doc/User.md | 22 + .../openapi-browser-client/doc/UserApi.md | 349 ++++++++++++++++ .../petstore/dart/openapi/doc/ApiResponse.md | 17 + .../petstore/dart/openapi/doc/Category.md | 16 + .../client/petstore/dart/openapi/doc/Order.md | 20 + .../client/petstore/dart/openapi/doc/Pet.md | 20 + .../petstore/dart/openapi/doc/PetApi.md | 379 ++++++++++++++++++ .../petstore/dart/openapi/doc/StoreApi.md | 186 +++++++++ .../client/petstore/dart/openapi/doc/Tag.md | 16 + .../client/petstore/dart/openapi/doc/User.md | 22 + .../petstore/dart/openapi/doc/UserApi.md | 349 ++++++++++++++++ .../petstore_client_lib/doc/ApiResponse.md | 17 + .../dart2/petstore_client_lib/doc/Category.md | 16 + .../dart2/petstore_client_lib/doc/Order.md | 20 + .../dart2/petstore_client_lib/doc/Pet.md | 20 + .../dart2/petstore_client_lib/doc/PetApi.md | 379 ++++++++++++++++++ .../dart2/petstore_client_lib/doc/StoreApi.md | 186 +++++++++ .../dart2/petstore_client_lib/doc/Tag.md | 16 + .../dart2/petstore_client_lib/doc/User.md | 22 + .../dart2/petstore_client_lib/doc/UserApi.md | 349 ++++++++++++++++ 81 files changed, 9225 insertions(+) create mode 100644 samples/client/petstore/dart-dio/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart-dio/doc/Category.md create mode 100644 samples/client/petstore/dart-dio/doc/Order.md create mode 100644 samples/client/petstore/dart-dio/doc/Pet.md create mode 100644 samples/client/petstore/dart-dio/doc/PetApi.md create mode 100644 samples/client/petstore/dart-dio/doc/StoreApi.md create mode 100644 samples/client/petstore/dart-dio/doc/Tag.md create mode 100644 samples/client/petstore/dart-dio/doc/User.md create mode 100644 samples/client/petstore/dart-dio/doc/UserApi.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Category.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Order.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Pet.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/PetApi.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/StoreApi.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Tag.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/User.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/UserApi.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Category.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Order.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Pet.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/PetApi.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/StoreApi.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Tag.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/User.md create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/UserApi.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/Category.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/Order.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/Pet.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/PetApi.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/StoreApi.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/Tag.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/User.md create mode 100644 samples/client/petstore/dart-jaguar/openapi/doc/UserApi.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/Category.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/Order.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/Pet.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/PetApi.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/StoreApi.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/Tag.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/User.md create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/doc/UserApi.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/Category.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/Order.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/Pet.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/Tag.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/User.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/Category.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/Order.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/Pet.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/Tag.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/User.md create mode 100644 samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md create mode 100644 samples/client/petstore/dart/openapi/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart/openapi/doc/Category.md create mode 100644 samples/client/petstore/dart/openapi/doc/Order.md create mode 100644 samples/client/petstore/dart/openapi/doc/Pet.md create mode 100644 samples/client/petstore/dart/openapi/doc/PetApi.md create mode 100644 samples/client/petstore/dart/openapi/doc/StoreApi.md create mode 100644 samples/client/petstore/dart/openapi/doc/Tag.md create mode 100644 samples/client/petstore/dart/openapi/doc/User.md create mode 100644 samples/client/petstore/dart/openapi/doc/UserApi.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/ApiResponse.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/Category.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/Order.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/Pet.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/PetApi.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/Tag.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/User.md create mode 100644 samples/client/petstore/dart2/petstore_client_lib/doc/UserApi.md diff --git a/samples/client/petstore/dart-dio/doc/ApiResponse.md b/samples/client/petstore/dart-dio/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-dio/doc/Category.md b/samples/client/petstore/dart-dio/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-dio/doc/Order.md b/samples/client/petstore/dart-dio/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-dio/doc/Pet.md b/samples/client/petstore/dart-dio/doc/Pet.md new file mode 100644 index 000000000000..619e45d18483 --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **BuiltList<String>** | | [default to const []] +**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-dio/doc/PetApi.md b/samples/client/petstore/dart-dio/doc/PetApi.md new file mode 100644 index 000000000000..e781974607c8 --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **post** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **delete** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **get** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **get** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **get** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **put** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **post** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **post** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // Uint8List | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **Uint8List**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-dio/doc/StoreApi.md b/samples/client/petstore/dart-dio/doc/StoreApi.md new file mode 100644 index 000000000000..33896baac9bf --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **delete** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **get** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **get** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **post** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +var api_instance = new StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-dio/doc/Tag.md b/samples/client/petstore/dart-dio/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-dio/doc/User.md b/samples/client/petstore/dart-dio/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-dio/doc/UserApi.md b/samples/client/petstore/dart-dio/doc/UserApi.md new file mode 100644 index 000000000000..052dc20aef76 --- /dev/null +++ b/samples/client/petstore/dart-dio/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **post** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **post** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **post** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **delete** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **get** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **get** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **get** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **put** /user/{username} | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = new User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | name that need to be deleted +var body = new User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/ApiResponse.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Category.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Order.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Pet.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Pet.md new file mode 100644 index 000000000000..ce5708cc134f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **List<String>** | | [default to const []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/PetApi.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/PetApi.md new file mode 100644 index 000000000000..3e4ef1cedb28 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **Post** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **Delete** /pet/:petId | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **Get** /pet/:petId | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **Put** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **Post** /pet/:petId | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **Post** /pet/:petId/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile****MultipartFile**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/StoreApi.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/StoreApi.md new file mode 100644 index 000000000000..c40c0eff43fc --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **Delete** /store/order/:orderId | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **Get** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **Get** /store/order/:orderId | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **Post** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Tag.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/User.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/UserApi.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/UserApi.md new file mode 100644 index 000000000000..24494bd8757a --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **Post** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **Delete** /user/:username | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **Get** /user/:username | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **Get** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **Get** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **Put** /user/:username | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = new User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | name that need to be deleted +var body = new User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/ApiResponse.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Category.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Order.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Pet.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Pet.md new file mode 100644 index 000000000000..ce5708cc134f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **List<String>** | | [default to const []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/PetApi.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/PetApi.md new file mode 100644 index 000000000000..3e4ef1cedb28 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **Post** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **Delete** /pet/:petId | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **Get** /pet/:petId | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **Put** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **Post** /pet/:petId | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **Post** /pet/:petId/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile****MultipartFile**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/StoreApi.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/StoreApi.md new file mode 100644 index 000000000000..d6e8ed693435 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **Delete** /store/order/:orderId | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **Get** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **Get** /store/order/:orderId | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **Post** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Tag.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/User.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/UserApi.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/UserApi.md new file mode 100644 index 000000000000..91cad43d7a11 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **Post** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **Delete** /user/:username | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **Get** /user/:username | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **Get** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **Get** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **Put** /user/:username | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = new User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | name that need to be deleted +var body = new User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/ApiResponse.md b/samples/client/petstore/dart-jaguar/openapi/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/Category.md b/samples/client/petstore/dart-jaguar/openapi/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/Order.md b/samples/client/petstore/dart-jaguar/openapi/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/Pet.md b/samples/client/petstore/dart-jaguar/openapi/doc/Pet.md new file mode 100644 index 000000000000..ce5708cc134f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **List<String>** | | [default to const []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/PetApi.md b/samples/client/petstore/dart-jaguar/openapi/doc/PetApi.md new file mode 100644 index 000000000000..3e4ef1cedb28 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **Post** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **Delete** /pet/:petId | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **Get** /pet/:petId | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **Put** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **Post** /pet/:petId | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **Post** /pet/:petId/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile****MultipartFile**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/StoreApi.md b/samples/client/petstore/dart-jaguar/openapi/doc/StoreApi.md new file mode 100644 index 000000000000..c40c0eff43fc --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **Delete** /store/order/:orderId | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **Get** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **Get** /store/order/:orderId | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **Post** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/Tag.md b/samples/client/petstore/dart-jaguar/openapi/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/User.md b/samples/client/petstore/dart-jaguar/openapi/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi/doc/UserApi.md b/samples/client/petstore/dart-jaguar/openapi/doc/UserApi.md new file mode 100644 index 000000000000..24494bd8757a --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **Post** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **Delete** /user/:username | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **Get** /user/:username | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **Get** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **Get** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **Put** /user/:username | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = new User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | name that need to be deleted +var body = new User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/ApiResponse.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/Category.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/Order.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/Pet.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/Pet.md new file mode 100644 index 000000000000..ce5708cc134f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **List<String>** | | [default to const []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/PetApi.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/PetApi.md new file mode 100644 index 000000000000..3e4ef1cedb28 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **Post** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **Delete** /pet/:petId | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **Get** /pet/:petId | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **Put** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **Post** /pet/:petId | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **Post** /pet/:petId/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile****MultipartFile**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/StoreApi.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/StoreApi.md new file mode 100644 index 000000000000..d6e8ed693435 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **Delete** /store/order/:orderId | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **Get** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **Get** /store/order/:orderId | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **Post** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/Tag.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/User.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/doc/UserApi.md b/samples/client/petstore/dart-jaguar/openapi_proto/doc/UserApi.md new file mode 100644 index 000000000000..91cad43d7a11 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **Post** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **Delete** /user/:username | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **Get** /user/:username | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **Get** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **Get** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **Put** /user/:username | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = new User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | name that need to be deleted +var body = new User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/ApiResponse.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Category.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Order.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Pet.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Pet.md new file mode 100644 index 000000000000..191e1fc66a95 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **List<String>** | | [default to []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md new file mode 100644 index 000000000000..5780e7f38022 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md new file mode 100644 index 000000000000..df76647f11ae --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Tag.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/User.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md new file mode 100644 index 000000000000..d3bb61265e9a --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = new User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | name that need to be deleted +var body = new User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/ApiResponse.md b/samples/client/petstore/dart/openapi-browser-client/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/Category.md b/samples/client/petstore/dart/openapi-browser-client/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/Order.md b/samples/client/petstore/dart/openapi-browser-client/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/Pet.md b/samples/client/petstore/dart/openapi-browser-client/doc/Pet.md new file mode 100644 index 000000000000..191e1fc66a95 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **List<String>** | | [default to []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md new file mode 100644 index 000000000000..5780e7f38022 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md new file mode 100644 index 000000000000..df76647f11ae --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/Tag.md b/samples/client/petstore/dart/openapi-browser-client/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/User.md b/samples/client/petstore/dart/openapi-browser-client/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md new file mode 100644 index 000000000000..d3bb61265e9a --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = new User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | name that need to be deleted +var body = new User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/openapi/doc/ApiResponse.md b/samples/client/petstore/dart/openapi/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi/doc/Category.md b/samples/client/petstore/dart/openapi/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi/doc/Order.md b/samples/client/petstore/dart/openapi/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi/doc/Pet.md b/samples/client/petstore/dart/openapi/doc/Pet.md new file mode 100644 index 000000000000..191e1fc66a95 --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **List<String>** | | [default to []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi/doc/PetApi.md b/samples/client/petstore/dart/openapi/doc/PetApi.md new file mode 100644 index 000000000000..5780e7f38022 --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = new PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/openapi/doc/StoreApi.md b/samples/client/petstore/dart/openapi/doc/StoreApi.md new file mode 100644 index 000000000000..df76647f11ae --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; + +var api_instance = new StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart/openapi/doc/Tag.md b/samples/client/petstore/dart/openapi/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi/doc/User.md b/samples/client/petstore/dart/openapi/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/openapi/doc/UserApi.md b/samples/client/petstore/dart/openapi/doc/UserApi.md new file mode 100644 index 000000000000..d3bb61265e9a --- /dev/null +++ b/samples/client/petstore/dart/openapi/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = new User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = new UserApi(); +var username = username_example; // String | name that need to be deleted +var body = new User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/ApiResponse.md b/samples/client/petstore/dart2/petstore_client_lib/doc/ApiResponse.md new file mode 100644 index 000000000000..92422f0f446e --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] [default to null] +**type** | **String** | | [optional] [default to null] +**message** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/Category.md b/samples/client/petstore/dart2/petstore_client_lib/doc/Category.md new file mode 100644 index 000000000000..cc0d1633b59c --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/Order.md b/samples/client/petstore/dart2/petstore_client_lib/doc/Order.md new file mode 100644 index 000000000000..310ce6c65be3 --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**petId** | **int** | | [optional] [default to null] +**quantity** | **int** | | [optional] [default to null] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] +**status** | **String** | Order Status | [optional] [default to null] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/Pet.md b/samples/client/petstore/dart2/petstore_client_lib/doc/Pet.md new file mode 100644 index 000000000000..191e1fc66a95 --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **String** | | [default to null] +**photoUrls** | **List<String>** | | [default to []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] +**status** | **String** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/PetApi.md b/samples/client/petstore/dart2/petstore_client_lib/doc/PetApi.md new file mode 100644 index 000000000000..7b5de3894a91 --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/PetApi.md @@ -0,0 +1,379 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.addPet(body); +} catch (e) { + print("Exception when calling PetApi->addPet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = PetApi(); +var petId = 789; // int | Pet id to delete +var apiKey = apiKey_example; // String | + +try { + api_instance.deletePet(petId, apiKey); +} catch (e) { + print("Exception when calling PetApi->deletePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | [default to null] + **apiKey** | **String**| | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = PetApi(); +var status = []; // List | Status values that need to be considered for filter + +try { + var result = api_instance.findPetsByStatus(status); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByStatus: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> List findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = PetApi(); +var tags = []; // List | Tags to filter by + +try { + var result = api_instance.findPetsByTags(tags); + print(result); +} catch (e) { + print("Exception when calling PetApi->findPetsByTags: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +var api_instance = PetApi(); +var petId = 789; // int | ID of pet to return + +try { + var result = api_instance.getPetById(petId); + print(result); +} catch (e) { + print("Exception when calling PetApi->getPetById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | [default to null] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store + +try { + api_instance.updatePet(body); +} catch (e) { + print("Exception when calling PetApi->updatePet: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = PetApi(); +var petId = 789; // int | ID of pet that needs to be updated +var name = name_example; // String | Updated name of the pet +var status = status_example; // String | Updated status of the pet + +try { + api_instance.updatePetWithForm(petId, name, status); +} catch (e) { + print("Exception when calling PetApi->updatePetWithForm: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | [default to null] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +var api_instance = PetApi(); +var petId = 789; // int | ID of pet to update +var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +var file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + var result = api_instance.uploadFile(petId, additionalMetadata, file); + print(result); +} catch (e) { + print("Exception when calling PetApi->uploadFile: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | [default to null] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile**| file to upload | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md b/samples/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md new file mode 100644 index 000000000000..1cc37e2a47ab --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md @@ -0,0 +1,186 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = StoreApi(); +var orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api_instance.deleteOrder(orderId); +} catch (e) { + print("Exception when calling StoreApi->deleteOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +var api_instance = StoreApi(); + +try { + var result = api_instance.getInventory(); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getInventory: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = StoreApi(); +var orderId = 789; // int | ID of pet that needs to be fetched + +try { + var result = api_instance.getOrderById(orderId); + print(result); +} catch (e) { + print("Exception when calling StoreApi->getOrderById: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = StoreApi(); +var body = Order(); // Order | order placed for purchasing the pet + +try { + var result = api_instance.placeOrder(body); + print(result); +} catch (e) { + print("Exception when calling StoreApi->placeOrder: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/Tag.md b/samples/client/petstore/dart2/petstore_client_lib/doc/Tag.md new file mode 100644 index 000000000000..ded7b32ac3d7 --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**name** | **String** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/User.md b/samples/client/petstore/dart2/petstore_client_lib/doc/User.md new file mode 100644 index 000000000000..3761b70cf0b7 --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [default to null] +**username** | **String** | | [optional] [default to null] +**firstName** | **String** | | [optional] [default to null] +**lastName** | **String** | | [optional] [default to null] +**email** | **String** | | [optional] [default to null] +**password** | **String** | | [optional] [default to null] +**phone** | **String** | | [optional] [default to null] +**userStatus** | **int** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/UserApi.md b/samples/client/petstore/dart2/petstore_client_lib/doc/UserApi.md new file mode 100644 index 000000000000..1ee5f6fced69 --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/UserApi.md @@ -0,0 +1,349 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = UserApi(); +var body = User(); // User | Created user object + +try { + api_instance.createUser(body); +} catch (e) { + print("Exception when calling UserApi->createUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithArrayInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object + +try { + api_instance.createUsersWithListInput(body); +} catch (e) { + print("Exception when calling UserApi->createUsersWithListInput: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = UserApi(); +var username = username_example; // String | The name that needs to be deleted + +try { + api_instance.deleteUser(username); +} catch (e) { + print("Exception when calling UserApi->deleteUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | [default to null] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = UserApi(); +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + var result = api_instance.getUserByName(username); + print(result); +} catch (e) { + print("Exception when calling UserApi->getUserByName: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = UserApi(); +var username = username_example; // String | The user name for login +var password = password_example; // String | The password for login in clear text + +try { + var result = api_instance.loginUser(username, password); + print(result); +} catch (e) { + print("Exception when calling UserApi->loginUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | [default to null] + **password** | **String**| The password for login in clear text | [default to null] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = UserApi(); + +try { + api_instance.logoutUser(); +} catch (e) { + print("Exception when calling UserApi->logoutUser: $e\n"); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +var api_instance = UserApi(); +var username = username_example; // String | name that need to be deleted +var body = User(); // User | Updated user object + +try { + api_instance.updateUser(username, body); +} catch (e) { + print("Exception when calling UserApi->updateUser: $e\n"); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | [default to null] + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + From 54cfab84b6498aaba9cd6bd411da8f6675d753b6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 28 Dec 2019 01:12:26 +0800 Subject: [PATCH 26/28] run ensure-up-to-date --- docs/generators/dart-dio.md | 3 + docs/generators/dart-jaguar.md | 3 + docs/generators/dart.md | 3 + .../go-experimental/go-petstore/README.md | 2 + .../go-petstore/api/openapi.yaml | 13 ++ .../go-petstore/docs/BigCat.md | 117 +++++++++++++ .../go-petstore/docs/BigCatAllOf.md | 39 +++++ .../go-petstore/model_big_cat.go | 160 ++++++++++++++++++ .../go-petstore/model_big_cat_all_of.go | 76 +++++++++ .../org/openapitools/client/model/BigCat.java | 1 + .../client/model/BigCatAllOf.java | 1 + .../javascript-promise/src/model/BigCat.js | 2 +- .../src/model/BigCatAllOf.js | 2 +- .../petstore/javascript/src/model/BigCat.js | 2 +- .../javascript/src/model/BigCatAllOf.js | 2 +- .../OpenAPIClient-php/lib/Model/BigCat.php | 2 +- .../lib/Model/BigCatAllOf.php | 2 +- .../test/Model/BigCatAllOfTest.php | 2 +- .../test/Model/BigCatTest.php | 2 +- .../lib/petstore/models/big_cat.rb | 2 +- .../lib/petstore/models/big_cat_all_of.rb | 2 +- .../ruby/lib/petstore/models/big_cat.rb | 2 +- .../lib/petstore/models/big_cat_all_of.rb | 2 +- .../ruby/spec/models/big_cat_all_of_spec.rb | 2 +- .../petstore/ruby/spec/models/big_cat_spec.rb | 2 +- samples/server/petstore/php-slim4/README.md | 2 + .../petstore/php-slim4/lib/Model/BigCat.php | 40 +++++ .../php-slim4/lib/Model/BigCatAllOf.php | 31 ++++ .../php-slim4/test/Model/BigCatAllOfTest.php | 85 ++++++++++ .../php-slim4/test/Model/BigCatTest.php | 106 ++++++++++++ 30 files changed, 696 insertions(+), 14 deletions(-) create mode 100644 samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md create mode 100644 samples/client/petstore/go-experimental/go-petstore/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/go-experimental/go-petstore/model_big_cat.go create mode 100644 samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go create mode 100644 samples/server/petstore/php-slim4/lib/Model/BigCat.php create mode 100644 samples/server/petstore/php-slim4/lib/Model/BigCatAllOf.php create mode 100644 samples/server/petstore/php-slim4/test/Model/BigCatAllOfTest.php create mode 100644 samples/server/petstore/php-slim4/test/Model/BigCatTest.php diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index adb9b30ad59a..045175c038bd 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -14,6 +14,9 @@ sidebar_label: dart-dio |pubName|Name in generated pubspec| |null| |pubVersion|Version in generated pubspec| |null| |pubDescription|Description in generated pubspec| |null| +|pubAuthor|Author name in generated pubspec| |null| +|pubAuthorEmail|Email address of the author in generated pubspec| |null| +|pubHomepage|Homepage in generated pubspec| |null| |useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| |sourceFolder|Source folder for generated code| |null| |supportDart2|Support Dart 2.x (Dart 1.x support has been deprecated)| |true| diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 71eff87bf02b..5a06755bf283 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -14,6 +14,9 @@ sidebar_label: dart-jaguar |pubName|Name in generated pubspec| |null| |pubVersion|Version in generated pubspec| |null| |pubDescription|Description in generated pubspec| |null| +|pubAuthor|Author name in generated pubspec| |null| +|pubAuthorEmail|Email address of the author in generated pubspec| |null| +|pubHomepage|Homepage in generated pubspec| |null| |useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| |sourceFolder|Source folder for generated code| |null| |supportDart2|Support Dart 2.x (Dart 1.x support has been deprecated)| |true| diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 365b2fc35a6e..12c6550b1c20 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -14,6 +14,9 @@ sidebar_label: dart |pubName|Name in generated pubspec| |null| |pubVersion|Version in generated pubspec| |null| |pubDescription|Description in generated pubspec| |null| +|pubAuthor|Author name in generated pubspec| |null| +|pubAuthorEmail|Email address of the author in generated pubspec| |null| +|pubHomepage|Homepage in generated pubspec| |null| |useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| |sourceFolder|Source folder for generated code| |null| |supportDart2|Support Dart 2.x (Dart 1.x support has been deprecated)| |true| diff --git a/samples/client/petstore/go-experimental/go-petstore/README.md b/samples/client/petstore/go-experimental/go-petstore/README.md index a39c8c250756..1c8be349e65b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/client/petstore/go-experimental/go-petstore/README.md @@ -127,6 +127,8 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BigCat](docs/BigCat.md) + - [BigCatAllOf](docs/BigCatAllOf.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml index 94c46a5bb5db..be5513053398 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -1422,6 +1422,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2086,6 +2090,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md b/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md new file mode 100644 index 000000000000..dd23b6193424 --- /dev/null +++ b/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md @@ -0,0 +1,117 @@ +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | Pointer to **string** | | +**Color** | Pointer to **string** | | [optional] [default to red] +**Declawed** | Pointer to **bool** | | [optional] +**Kind** | Pointer to **string** | | [optional] + +## Methods + +### GetClassName + +`func (o *BigCat) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *BigCat) GetClassNameOk() (string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClassName + +`func (o *BigCat) HasClassName() bool` + +HasClassName returns a boolean if a field has been set. + +### SetClassName + +`func (o *BigCat) SetClassName(v string)` + +SetClassName gets a reference to the given string and assigns it to the ClassName field. + +### GetColor + +`func (o *BigCat) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *BigCat) GetColorOk() (string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasColor + +`func (o *BigCat) HasColor() bool` + +HasColor returns a boolean if a field has been set. + +### SetColor + +`func (o *BigCat) SetColor(v string)` + +SetColor gets a reference to the given string and assigns it to the Color field. + +### GetDeclawed + +`func (o *BigCat) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *BigCat) GetDeclawedOk() (bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDeclawed + +`func (o *BigCat) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + +### SetDeclawed + +`func (o *BigCat) SetDeclawed(v bool)` + +SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. + +### GetKind + +`func (o *BigCat) GetKind() string` + +GetKind returns the Kind field if non-nil, zero value otherwise. + +### GetKindOk + +`func (o *BigCat) GetKindOk() (string, bool)` + +GetKindOk returns a tuple with the Kind field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasKind + +`func (o *BigCat) HasKind() bool` + +HasKind returns a boolean if a field has been set. + +### SetKind + +`func (o *BigCat) SetKind(v string)` + +SetKind gets a reference to the given string and assigns it to the Kind field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/BigCatAllOf.md b/samples/client/petstore/go-experimental/go-petstore/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c886448d38d9 --- /dev/null +++ b/samples/client/petstore/go-experimental/go-petstore/docs/BigCatAllOf.md @@ -0,0 +1,39 @@ +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | Pointer to **string** | | [optional] + +## Methods + +### GetKind + +`func (o *BigCatAllOf) GetKind() string` + +GetKind returns the Kind field if non-nil, zero value otherwise. + +### GetKindOk + +`func (o *BigCatAllOf) GetKindOk() (string, bool)` + +GetKindOk returns a tuple with the Kind field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasKind + +`func (o *BigCatAllOf) HasKind() bool` + +HasKind returns a boolean if a field has been set. + +### SetKind + +`func (o *BigCatAllOf) SetKind(v string)` + +SetKind gets a reference to the given string and assigns it to the Kind field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go new file mode 100644 index 000000000000..c9a0a1b69780 --- /dev/null +++ b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore + +import ( + "bytes" + "encoding/json" +) + +// BigCat struct for BigCat +type BigCat struct { + ClassName string `json:"className"` + Color *string `json:"color,omitempty"` + Declawed *bool `json:"declawed,omitempty"` + Kind *string `json:"kind,omitempty"` +} + +// GetClassName returns the ClassName field value +func (o *BigCat) GetClassName() string { + if o == nil { + var ret string + return ret + } + + return o.ClassName +} + +// SetClassName sets field value +func (o *BigCat) SetClassName(v string) { + o.ClassName = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *BigCat) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *BigCat) GetColorOk() (string, bool) { + if o == nil || o.Color == nil { + var ret string + return ret, false + } + return *o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *BigCat) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *BigCat) SetColor(v string) { + o.Color = &v +} + +// GetDeclawed returns the Declawed field value if set, zero value otherwise. +func (o *BigCat) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *BigCat) GetDeclawedOk() (bool, bool) { + if o == nil || o.Declawed == nil { + var ret bool + return ret, false + } + return *o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *BigCat) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *BigCat) SetDeclawed(v bool) { + o.Declawed = &v +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *BigCat) GetKind() string { + if o == nil || o.Kind == nil { + var ret string + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *BigCat) GetKindOk() (string, bool) { + if o == nil || o.Kind == nil { + var ret string + return ret, false + } + return *o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *BigCat) HasKind() bool { + if o != nil && o.Kind != nil { + return true + } + + return false +} + +// SetKind gets a reference to the given string and assigns it to the Kind field. +func (o *BigCat) SetKind(v string) { + o.Kind = &v +} + +type NullableBigCat struct { + Value BigCat + ExplicitNull bool +} + +func (v NullableBigCat) MarshalJSON() ([]byte, error) { + switch { + case v.ExplicitNull: + return []byte("null"), nil + default: + return json.Marshal(v.Value) + } +} + +func (v *NullableBigCat) UnmarshalJSON(src []byte) error { + if bytes.Equal(src, []byte("null")) { + v.ExplicitNull = true + return nil + } + + return json.Unmarshal(src, &v.Value) +} diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go new file mode 100644 index 000000000000..2b1c83d77393 --- /dev/null +++ b/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore + +import ( + "bytes" + "encoding/json" +) + +// BigCatAllOf struct for BigCatAllOf +type BigCatAllOf struct { + Kind *string `json:"kind,omitempty"` +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *BigCatAllOf) GetKind() string { + if o == nil || o.Kind == nil { + var ret string + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *BigCatAllOf) GetKindOk() (string, bool) { + if o == nil || o.Kind == nil { + var ret string + return ret, false + } + return *o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *BigCatAllOf) HasKind() bool { + if o != nil && o.Kind != nil { + return true + } + + return false +} + +// SetKind gets a reference to the given string and assigns it to the Kind field. +func (o *BigCatAllOf) SetKind(v string) { + o.Kind = &v +} + +type NullableBigCatAllOf struct { + Value BigCatAllOf + ExplicitNull bool +} + +func (v NullableBigCatAllOf) MarshalJSON() ([]byte, error) { + switch { + case v.ExplicitNull: + return []byte("null"), nil + default: + return json.Marshal(v.Value) + } +} + +func (v *NullableBigCatAllOf) UnmarshalJSON(src []byte) error { + if bytes.Equal(src, []byte("null")) { + v.ExplicitNull = true + return nil + } + + return json.Unmarshal(src, &v.Value) +} diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java index 84b3f05703b2..26058804c757 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java @@ -31,6 +31,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@javax.annotation.concurrent.Immutable public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 7ce0ddb21f5a..d430edae189e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@javax.annotation.concurrent.Immutable public class BigCatAllOf { /** diff --git a/samples/client/petstore/javascript-promise/src/model/BigCat.js b/samples/client/petstore/javascript-promise/src/model/BigCat.js index e567df251ca3..160d712bd605 100644 --- a/samples/client/petstore/javascript-promise/src/model/BigCat.js +++ b/samples/client/petstore/javascript-promise/src/model/BigCat.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.2.2-SNAPSHOT + * OpenAPI Generator version: 4.2.3-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js b/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js index 719ff31ec624..3d22270bf17c 100644 --- a/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.2.2-SNAPSHOT + * OpenAPI Generator version: 4.2.3-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/BigCat.js b/samples/client/petstore/javascript/src/model/BigCat.js index e567df251ca3..160d712bd605 100644 --- a/samples/client/petstore/javascript/src/model/BigCat.js +++ b/samples/client/petstore/javascript/src/model/BigCat.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.2.2-SNAPSHOT + * OpenAPI Generator version: 4.2.3-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/BigCatAllOf.js b/samples/client/petstore/javascript/src/model/BigCatAllOf.js index 719ff31ec624..3d22270bf17c 100644 --- a/samples/client/petstore/javascript/src/model/BigCatAllOf.js +++ b/samples/client/petstore/javascript/src/model/BigCatAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.2.2-SNAPSHOT + * OpenAPI Generator version: 4.2.3-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php index 8dc2e88283da..3ea2a571c5fb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.2.2-SNAPSHOT + * OpenAPI Generator version: 4.2.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php index 44fa1674e57a..20bed1d23626 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.2.2-SNAPSHOT + * OpenAPI Generator version: 4.2.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php index 0dffa0380dbf..791dcecd5d49 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.2.2-SNAPSHOT + * OpenAPI Generator version: 4.2.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatTest.php index 17b186ebeebf..c186dfd55103 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.2.2-SNAPSHOT + * OpenAPI Generator version: 4.2.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat.rb index 46bcc0afa7c4..0c82b9159506 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.2-SNAPSHOT +OpenAPI Generator version: 4.2.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb index d2649d0e4534..0e136ae86601 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.2-SNAPSHOT +OpenAPI Generator version: 4.2.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb b/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb index 46bcc0afa7c4..0c82b9159506 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.2-SNAPSHOT +OpenAPI Generator version: 4.2.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb index d2649d0e4534..0e136ae86601 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.2-SNAPSHOT +OpenAPI Generator version: 4.2.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb index 4a547a5ac504..54caa8c1626f 100644 --- a/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb +++ b/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.2-SNAPSHOT +OpenAPI Generator version: 4.2.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/big_cat_spec.rb b/samples/client/petstore/ruby/spec/models/big_cat_spec.rb index c6e0cfbce688..b1869d3e5cf3 100644 --- a/samples/client/petstore/ruby/spec/models/big_cat_spec.rb +++ b/samples/client/petstore/ruby/spec/models/big_cat_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.2.2-SNAPSHOT +OpenAPI Generator version: 4.2.3-SNAPSHOT =end diff --git a/samples/server/petstore/php-slim4/README.md b/samples/server/petstore/php-slim4/README.md index cda41d8c57ea..53314ac7c153 100644 --- a/samples/server/petstore/php-slim4/README.md +++ b/samples/server/petstore/php-slim4/README.md @@ -181,6 +181,8 @@ Class | Method | HTTP request | Description * OpenAPIServer\Model\ArrayOfArrayOfNumberOnly * OpenAPIServer\Model\ArrayOfNumberOnly * OpenAPIServer\Model\ArrayTest +* OpenAPIServer\Model\BigCat +* OpenAPIServer\Model\BigCatAllOf * OpenAPIServer\Model\Capitalization * OpenAPIServer\Model\Cat * OpenAPIServer\Model\CatAllOf diff --git a/samples/server/petstore/php-slim4/lib/Model/BigCat.php b/samples/server/petstore/php-slim4/lib/Model/BigCat.php new file mode 100644 index 000000000000..39eec7cbfa19 --- /dev/null +++ b/samples/server/petstore/php-slim4/lib/Model/BigCat.php @@ -0,0 +1,40 @@ + Date: Fri, 27 Dec 2019 23:32:21 +0000 Subject: [PATCH 27/28] [Rust Server] Rust 1.39 compatibility (#4864) - Fix warnings present in Rust 1.39 resolving missing dyn markers - Upgrade to lazy_static - fixes #4271 - Update samples --- .../main/resources/rust-server/Cargo.mustache | 2 +- .../resources/rust-server/client-mod.mustache | 24 +- .../rust-server/example-client.mustache | 2 +- .../example-server_server.mustache | 2 +- .../main/resources/rust-server/lib.mustache | 6 +- .../resources/rust-server/server-mod.mustache | 18 +- .../output/multipart-v3/Cargo.toml | 2 +- .../output/multipart-v3/examples/client.rs | 2 +- .../examples/server_lib/server.rs | 2 +- .../output/multipart-v3/src/client/mod.rs | 18 +- .../output/multipart-v3/src/lib.rs | 6 +- .../output/multipart-v3/src/server/mod.rs | 10 +- .../rust-server/output/openapi-v3/Cargo.toml | 2 +- .../output/openapi-v3/examples/client.rs | 22 +- .../openapi-v3/examples/server_lib/server.rs | 22 +- .../output/openapi-v3/src/client/mod.rs | 132 +++---- .../rust-server/output/openapi-v3/src/lib.rs | 66 ++-- .../output/openapi-v3/src/server/mod.rs | 64 ++-- .../rust-server/output/ops-v3/Cargo.toml | 2 +- .../output/ops-v3/examples/client.rs | 74 ++-- .../ops-v3/examples/server_lib/server.rs | 74 ++-- .../output/ops-v3/src/client/mod.rs | 306 ++++++++-------- .../rust-server/output/ops-v3/src/lib.rs | 222 ++++++------ .../output/ops-v3/src/server/mod.rs | 152 ++++---- .../Cargo.toml | 2 +- .../examples/client.rs | 64 ++-- .../examples/server_lib/server.rs | 64 ++-- .../src/client/mod.rs | 326 +++++++++--------- .../src/lib.rs | 192 +++++------ .../src/server/mod.rs | 188 +++++----- .../output/rust-server-test/Cargo.toml | 2 +- .../rust-server-test/examples/client.rs | 10 +- .../examples/server_lib/server.rs | 10 +- .../output/rust-server-test/src/client/mod.rs | 50 +-- .../output/rust-server-test/src/lib.rs | 30 +- .../output/rust-server-test/src/server/mod.rs | 28 +- 36 files changed, 1099 insertions(+), 1099 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache index 8dd7eea26eb5..cd5ba4fab6e5 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache @@ -18,7 +18,7 @@ conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk- chrono = { version = "0.4", features = ["serde"] } futures = "0.1" swagger = "2" -lazy_static = "0.2" +lazy_static = "1.4" log = "0.3.0" mime = "0.2.6" multipart = "0.13.3" diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache index ab4173052de4..bd0f3af3e01f 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache @@ -86,7 +86,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result where F: Future + 'static { - client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, base_path: String, } @@ -197,7 +197,7 @@ impl Client { handle: Handle, base_path: &str, protocol: Option<&'static str>, - connector_fn: Box C + Send + Sync>, + connector_fn: Box C + Send + Sync>, ) -> Result, ClientInitError> where C: hyper::client::Connect + hyper::client::Service, @@ -224,7 +224,7 @@ impl Client { /// should be mentioned here. #[deprecated(note="Use try_new_with_client_service instead")] pub fn try_new_with_hyper_client( - hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, handle: Handle, base_path: &str ) -> Result, ClientInitError> @@ -242,7 +242,7 @@ impl Client where /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. /// /// This allows adding custom wrappers around the underlying transport, for example for logging. - pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, handle: Handle, base_path: &str) -> Result, ClientInitError> @@ -258,7 +258,7 @@ impl Api for Client where F: Future + 'static, C: Has {{#hasAuthMethods}}+ Has>{{/hasAuthMethods}}{ {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} - fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, param_{{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box> { + fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, param_{{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box> { let mut uri = format!( "{}{{{basePathWithoutHost}}}{{path}}", self.base_path{{#pathParams}}, {{{baseName}}}=utf8_percent_encode(¶m_{{{paramName}}}.to_string(), ID_ENCODE_SET){{/pathParams}} @@ -269,7 +269,7 @@ impl Api for Client where {{^required}} if let Some({{{paramName}}}) = param_{{{paramName}}} { query_string.append_pair("{{{baseName}}}", &{{{paramName}}}{{#isListContainer}}.join(","){{/isListContainer}}{{^isListContainer}}.to_string(){{/isListContainer}}); }{{/required}}{{/queryParams}} -{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} if let Some(auth_data) = (context as &Has>).get().as_ref() { +{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} if let Some(auth_data) = (context as &dyn Has>).get().as_ref() { if let AuthData::ApiKey(ref api_key) = *auth_data { query_string.append_pair("{{keyParamName}}", api_key); } @@ -416,10 +416,10 @@ impl Api for Client where {{/consumesMultipart}} {{/vendorExtensions}} - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); {{#vendorExtensions.hasHeaderAuthMethods}} - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { {{#authMethods}} @@ -480,7 +480,7 @@ impl Api for Client where {{#headers}} header! { (Response{{{nameInCamelCase}}}, "{{{baseName}}}") => [{{{datatype}}}] } let response_{{{name}}} = match response.headers().get::() { Some(response_{{{name}}}) => response_{{{name}}}.0.clone(), - None => return Box::new(future::err(ApiError(String::from("Required response header {{{baseName}}} for response {{{code}}} was not found.")))) as Box>, + None => return Box::new(future::err(ApiError(String::from("Required response header {{{baseName}}} for response {{{code}}} was not found.")))) as Box>, }; {{/headers}} let body = response.body(); @@ -532,7 +532,7 @@ impl Api for Client where {{/headers}} ) {{/dataType}} - ) as Box> + ) as Box> }, {{/responses}} code => { @@ -552,7 +552,7 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) @@ -583,7 +583,7 @@ impl From for ClientInitError { impl fmt::Display for ClientInitError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - (self as &fmt::Debug).fmt(f) + (self as &dyn fmt::Debug).fmt(f) } } diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-client.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-client.mustache index 4657024c6256..3d90017d84e6 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-client.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-client.mustache @@ -72,7 +72,7 @@ fn main() { {{#vendorExtensions}}{{#noClientExample}}// Disabled because there's no example. // {{/noClientExample}}Some("{{{operationId}}}") => { {{#noClientExample}}// {{/noClientExample}} let result = core.run(client.{{{operation_id}}}{{/vendorExtensions}}({{#allParams}}{{^-first}}, {{/-first}}{{#vendorExtensions}}{{{example}}}{{/vendorExtensions}}{{/allParams}})); - {{#vendorExtensions}}{{#noClientExample}}// {{/noClientExample}}{{/vendorExtensions}} println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + {{#vendorExtensions}}{{#noClientExample}}// {{/noClientExample}}{{/vendorExtensions}} println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); {{#vendorExtensions}}{{#noClientExample}}// {{/noClientExample}}{{/vendorExtensions}} }, {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} _ => { diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server_server.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server_server.mustache index 89bf5d89224a..f0b72b52b912 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-server_server.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server_server.mustache @@ -31,7 +31,7 @@ impl Server { impl Api for Server where C: Has{ {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} {{#summary}} /// {{{summary}}}{{/summary}} - fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box> { + fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box> { let context = context.clone(); println!("{{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}({{#allParams}}{{#vendorExtensions}}{{{formatString}}}{{/vendorExtensions}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) - X-Span-ID: {:?}"{{#allParams}}, {{{paramName}}}{{/allParams}}, context.get().0.clone());{{#allParams}}{{/allParams}} Box::new(futures::failed("Generic failure".into())) diff --git a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache index 218f2b0579fe..e505b843fbf3 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache @@ -92,7 +92,7 @@ pub enum {{{operationId}}}Response { pub trait Api { {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} {{#summary}} /// {{{summary}}}{{/summary}} - fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box>; + fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}, context: &C) -> Box>; {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} } @@ -100,7 +100,7 @@ pub trait Api { pub trait ApiNoContext { {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} {{#summary}} /// {{{summary}}}{{/summary}} - fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}) -> Box>; + fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}) -> Box>; {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} } @@ -119,7 +119,7 @@ impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} {{#summary}} /// {{{summary}}}{{/summary}} - fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}) -> Box> { + fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}(&self{{#allParams}}, {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}{{/allParams}}) -> Box> { self.api().{{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}({{#allParams}}{{{paramName}}}, {{/allParams}}&self.context()) } {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache index 40579a07a4b2..060b64422b79 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache @@ -128,7 +128,7 @@ where type Request = (Request, C); type Response = Response; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, (req, mut context): Self::Request) -> Self::Future { let api_impl = self.api_impl.clone(); @@ -143,7 +143,7 @@ where &hyper::Method::{{vendorExtensions.HttpMethod}} if path.matched(paths::ID_{{vendorExtensions.PATH_ID}}) => { {{#hasAuthMethods}} { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -257,7 +257,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { {{#vendorExtensions}} @@ -313,7 +313,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { // Read Form Parameters from body @@ -404,7 +404,7 @@ where Box::new(api_impl.{{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}({{#allParams}}param_{{{paramName}}}{{#isListContainer}}.as_ref(){{/isListContainer}}, {{/allParams}}&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); {{#bodyParams}}{{#vendorExtensions}}{{^consumesPlainText}} if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -486,7 +486,7 @@ where {{^consumesMultipart}} {{^bodyParams}} }} - }) as Box> + }) as Box> {{/bodyParams}} {{/consumesMultipart}} {{/vendorExtensions}} @@ -496,13 +496,13 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter {{{baseName}}}: {}", e)))), } }) - ) as Box> + ) as Box> {{/-first}} {{/bodyParams}} {{#vendorExtensions}} {{#consumesMultipart}} {{^bodyParams}} - as Box> + as Box> }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read multipart body")))), } @@ -513,7 +513,7 @@ where {{/vendorExtensions}} }, {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } } diff --git a/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml index 742d7fd21f85..7243310bec2e 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml @@ -16,7 +16,7 @@ conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk- chrono = { version = "0.4", features = ["serde"] } futures = "0.1" swagger = "2" -lazy_static = "0.2" +lazy_static = "1.4" log = "0.3.0" mime = "0.2.6" multipart = "0.13.3" diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/client.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/client.rs index c4dcae3ed8c5..ba8396ab9396 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/examples/client.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/client.rs @@ -71,7 +71,7 @@ fn main() { Some("MultipartRequestPost") => { let result = core.run(client.multipart_request_post("string_field_example".to_string(), swagger::ByteArray(Vec::from("BYTE_ARRAY_DATA_HERE")), Some("optional_string_field_example".to_string()), None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, _ => { diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/server.rs index 82b6ee7938af..504a702bd607 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/server.rs @@ -28,7 +28,7 @@ impl Server { impl Api for Server where C: Has{ - fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option, context: &C) -> Box> { + fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option, context: &C) -> Box> { let context = context.clone(); println!("multipart_request_post(\"{}\", {:?}, {:?}, {:?}) - X-Span-ID: {:?}", string_field, binary_field, optional_string_field, object_field, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/client/mod.rs index 42e60bdf2007..22d89d8542b3 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/client/mod.rs @@ -73,7 +73,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result where F: Future + 'static { - client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, base_path: String, } @@ -184,7 +184,7 @@ impl Client { handle: Handle, base_path: &str, protocol: Option<&'static str>, - connector_fn: Box C + Send + Sync>, + connector_fn: Box C + Send + Sync>, ) -> Result, ClientInitError> where C: hyper::client::Connect + hyper::client::Service, @@ -211,7 +211,7 @@ impl Client { /// should be mentioned here. #[deprecated(note="Use try_new_with_client_service instead")] pub fn try_new_with_hyper_client( - hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, handle: Handle, base_path: &str ) -> Result, ClientInitError> @@ -229,7 +229,7 @@ impl Client where /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. /// /// This allows adding custom wrappers around the underlying transport, for example for logging. - pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, handle: Handle, base_path: &str) -> Result, ClientInitError> @@ -245,7 +245,7 @@ impl Api for Client where F: Future + 'static, C: Has { - fn multipart_request_post(&self, param_string_field: String, param_binary_field: swagger::ByteArray, param_optional_string_field: Option, param_object_field: Option, context: &C) -> Box> { + fn multipart_request_post(&self, param_string_field: String, param_binary_field: swagger::ByteArray, param_optional_string_field: Option, param_object_field: Option, context: &C) -> Box> { let mut uri = format!( "{}/multipart_request", self.base_path @@ -344,7 +344,7 @@ impl Api for Client where request.headers_mut().set(ContentType(multipart_header)); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -356,7 +356,7 @@ impl Api for Client where future::ok( MultipartRequestPostResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -375,7 +375,7 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) @@ -406,7 +406,7 @@ impl From for ClientInitError { impl fmt::Display for ClientInitError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - (self as &fmt::Debug).fmt(f) + (self as &dyn fmt::Debug).fmt(f) } } diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs index 7b6384ed1125..64a79fbb83ce 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs @@ -61,7 +61,7 @@ pub enum MultipartRequestPostResponse { pub trait Api { - fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option, context: &C) -> Box>; + fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option, context: &C) -> Box>; } @@ -69,7 +69,7 @@ pub trait Api { pub trait ApiNoContext { - fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option) -> Box>; + fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option) -> Box>; } @@ -88,7 +88,7 @@ impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { - fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option) -> Box> { + fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option) -> Box> { self.api().multipart_request_post(string_field, binary_field, optional_string_field, object_field, &self.context()) } diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs index ddd86a025add..4bd030b24d2a 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs @@ -109,7 +109,7 @@ where type Request = (Request, C); type Response = Response; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, (req, mut context): Self::Request) -> Self::Future { let api_impl = self.api_impl.clone(); @@ -130,7 +130,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { // Read Form Parameters from body @@ -203,7 +203,7 @@ where Box::new(api_impl.multipart_request_post(param_string_field, param_binary_field, param_optional_string_field, param_object_field, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -226,7 +226,7 @@ where future::ok(response) } )) - as Box> + as Box> }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read multipart body")))), } @@ -234,7 +234,7 @@ where ) }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml index a402ec1472c7..846d7d087e1f 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml @@ -16,7 +16,7 @@ conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk- chrono = { version = "0.4", features = ["serde"] } futures = "0.1" swagger = "2" -lazy_static = "0.2" +lazy_static = "1.4" log = "0.3.0" mime = "0.2.6" multipart = "0.13.3" diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs index a6de3fc9bc27..f03022c8129b 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs @@ -91,57 +91,57 @@ fn main() { Some("MultigetGet") => { let result = core.run(client.multiget_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("MultipleAuthSchemeGet") => { let result = core.run(client.multiple_auth_scheme_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("ReadonlyAuthSchemeGet") => { let result = core.run(client.readonly_auth_scheme_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("RequiredOctetStreamPut") => { let result = core.run(client.required_octet_stream_put(swagger::ByteArray(Vec::from("BYTE_ARRAY_DATA_HERE")))); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("ResponsesWithHeadersGet") => { let result = core.run(client.responses_with_headers_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("UuidGet") => { let result = core.run(client.uuid_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("XmlExtraPost") => { let result = core.run(client.xml_extra_post(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("XmlOtherPost") => { let result = core.run(client.xml_other_post(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("XmlOtherPut") => { let result = core.run(client.xml_other_put(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("XmlPost") => { let result = core.run(client.xml_post(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("XmlPut") => { let result = core.run(client.xml_put(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, _ => { diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs index 9d845aaeed2d..c2a10af6c243 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs @@ -39,77 +39,77 @@ impl Server { impl Api for Server where C: Has{ /// Get some stuff. - fn multiget_get(&self, context: &C) -> Box> { + fn multiget_get(&self, context: &C) -> Box> { let context = context.clone(); println!("multiget_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn multiple_auth_scheme_get(&self, context: &C) -> Box> { + fn multiple_auth_scheme_get(&self, context: &C) -> Box> { let context = context.clone(); println!("multiple_auth_scheme_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn readonly_auth_scheme_get(&self, context: &C) -> Box> { + fn readonly_auth_scheme_get(&self, context: &C) -> Box> { let context = context.clone(); println!("readonly_auth_scheme_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box> { + fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box> { let context = context.clone(); println!("required_octet_stream_put({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn responses_with_headers_get(&self, context: &C) -> Box> { + fn responses_with_headers_get(&self, context: &C) -> Box> { let context = context.clone(); println!("responses_with_headers_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn uuid_get(&self, context: &C) -> Box> { + fn uuid_get(&self, context: &C) -> Box> { let context = context.clone(); println!("uuid_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn xml_extra_post(&self, duplicate_xml_object: Option, context: &C) -> Box> { + fn xml_extra_post(&self, duplicate_xml_object: Option, context: &C) -> Box> { let context = context.clone(); println!("xml_extra_post({:?}) - X-Span-ID: {:?}", duplicate_xml_object, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn xml_other_post(&self, another_xml_object: Option, context: &C) -> Box> { + fn xml_other_post(&self, another_xml_object: Option, context: &C) -> Box> { let context = context.clone(); println!("xml_other_post({:?}) - X-Span-ID: {:?}", another_xml_object, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn xml_other_put(&self, string: Option, context: &C) -> Box> { + fn xml_other_put(&self, string: Option, context: &C) -> Box> { let context = context.clone(); println!("xml_other_put({:?}) - X-Span-ID: {:?}", string, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Post an array - fn xml_post(&self, string: Option, context: &C) -> Box> { + fn xml_post(&self, string: Option, context: &C) -> Box> { let context = context.clone(); println!("xml_post({:?}) - X-Span-ID: {:?}", string, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn xml_put(&self, xml_object: Option, context: &C) -> Box> { + fn xml_put(&self, xml_object: Option, context: &C) -> Box> { let context = context.clone(); println!("xml_put({:?}) - X-Span-ID: {:?}", xml_object, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs index 98d7205ada51..1fce126e4bac 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs @@ -81,7 +81,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result where F: Future + 'static { - client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, base_path: String, } @@ -192,7 +192,7 @@ impl Client { handle: Handle, base_path: &str, protocol: Option<&'static str>, - connector_fn: Box C + Send + Sync>, + connector_fn: Box C + Send + Sync>, ) -> Result, ClientInitError> where C: hyper::client::Connect + hyper::client::Service, @@ -219,7 +219,7 @@ impl Client { /// should be mentioned here. #[deprecated(note="Use try_new_with_client_service instead")] pub fn try_new_with_hyper_client( - hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, handle: Handle, base_path: &str ) -> Result, ClientInitError> @@ -237,7 +237,7 @@ impl Client where /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. /// /// This allows adding custom wrappers around the underlying transport, for example for logging. - pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, handle: Handle, base_path: &str) -> Result, ClientInitError> @@ -253,7 +253,7 @@ impl Api for Client where F: Future + 'static, C: Has + Has>{ - fn multiget_get(&self, context: &C) -> Box> { + fn multiget_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/multiget", self.base_path @@ -276,7 +276,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -298,7 +298,7 @@ impl Api for Client where .map(move |body| { MultigetGetResponse::JSONRsp(body) }) - ) as Box> + ) as Box> }, 201 => { let body = response.body(); @@ -319,7 +319,7 @@ impl Api for Client where .map(move |body| { MultigetGetResponse::XMLRsp(body) }) - ) as Box> + ) as Box> }, 202 => { let body = response.body(); @@ -333,7 +333,7 @@ impl Api for Client where .map(move |body| { MultigetGetResponse::OctetRsp(body) }) - ) as Box> + ) as Box> }, 203 => { let body = response.body(); @@ -351,7 +351,7 @@ impl Api for Client where .map(move |body| { MultigetGetResponse::StringRsp(body) }) - ) as Box> + ) as Box> }, 204 => { let body = response.body(); @@ -370,7 +370,7 @@ impl Api for Client where .map(move |body| { MultigetGetResponse::DuplicateResponseLongText(body) }) - ) as Box> + ) as Box> }, 205 => { let body = response.body(); @@ -389,7 +389,7 @@ impl Api for Client where .map(move |body| { MultigetGetResponse::DuplicateResponseLongText_2(body) }) - ) as Box> + ) as Box> }, 206 => { let body = response.body(); @@ -408,7 +408,7 @@ impl Api for Client where .map(move |body| { MultigetGetResponse::DuplicateResponseLongText_3(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -427,14 +427,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn multiple_auth_scheme_get(&self, context: &C) -> Box> { + fn multiple_auth_scheme_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/multiple_auth_scheme", self.base_path @@ -457,9 +457,9 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -481,7 +481,7 @@ impl Api for Client where future::ok( MultipleAuthSchemeGetResponse::CheckThatLimitingToMultipleRequiredAuthSchemesWorks ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -500,14 +500,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn readonly_auth_scheme_get(&self, context: &C) -> Box> { + fn readonly_auth_scheme_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/readonly_auth_scheme", self.base_path @@ -530,9 +530,9 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -554,7 +554,7 @@ impl Api for Client where future::ok( ReadonlyAuthSchemeGetResponse::CheckThatLimitingToASingleRequiredAuthSchemeWorks ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -573,14 +573,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn required_octet_stream_put(&self, param_body: swagger::ByteArray, context: &C) -> Box> { + fn required_octet_stream_put(&self, param_body: swagger::ByteArray, context: &C) -> Box> { let mut uri = format!( "{}/required_octet_stream", self.base_path @@ -607,7 +607,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::REQUIRED_OCTET_STREAM_PUT.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -619,7 +619,7 @@ impl Api for Client where future::ok( RequiredOctetStreamPutResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -638,14 +638,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn responses_with_headers_get(&self, context: &C) -> Box> { + fn responses_with_headers_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/responses_with_headers", self.base_path @@ -668,7 +668,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -677,7 +677,7 @@ impl Api for Client where header! { (ResponseSuccessInfo, "Success-Info") => [String] } let response_success_info = match response.headers().get::() { Some(response_success_info) => response_success_info.0.clone(), - None => return Box::new(future::err(ApiError(String::from("Required response header Success-Info for response 200 was not found.")))) as Box>, + None => return Box::new(future::err(ApiError(String::from("Required response header Success-Info for response 200 was not found.")))) as Box>, }; let body = response.body(); Box::new( @@ -695,18 +695,18 @@ impl Api for Client where .map(move |body| { ResponsesWithHeadersGetResponse::Success{ body: body, success_info: response_success_info } }) - ) as Box> + ) as Box> }, 412 => { header! { (ResponseFurtherInfo, "Further-Info") => [String] } let response_further_info = match response.headers().get::() { Some(response_further_info) => response_further_info.0.clone(), - None => return Box::new(future::err(ApiError(String::from("Required response header Further-Info for response 412 was not found.")))) as Box>, + None => return Box::new(future::err(ApiError(String::from("Required response header Further-Info for response 412 was not found.")))) as Box>, }; header! { (ResponseFailureInfo, "Failure-Info") => [String] } let response_failure_info = match response.headers().get::() { Some(response_failure_info) => response_failure_info.0.clone(), - None => return Box::new(future::err(ApiError(String::from("Required response header Failure-Info for response 412 was not found.")))) as Box>, + None => return Box::new(future::err(ApiError(String::from("Required response header Failure-Info for response 412 was not found.")))) as Box>, }; let body = response.body(); Box::new( @@ -718,7 +718,7 @@ impl Api for Client where failure_info: response_failure_info, } ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -737,14 +737,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn uuid_get(&self, context: &C) -> Box> { + fn uuid_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/uuid", self.base_path @@ -767,7 +767,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -789,7 +789,7 @@ impl Api for Client where .map(move |body| { UuidGetResponse::DuplicateResponseLongText(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -808,14 +808,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn xml_extra_post(&self, param_duplicate_xml_object: Option, context: &C) -> Box> { + fn xml_extra_post(&self, param_duplicate_xml_object: Option, context: &C) -> Box> { let mut uri = format!( "{}/xml_extra", self.base_path @@ -847,7 +847,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::XML_EXTRA_POST.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -859,7 +859,7 @@ impl Api for Client where future::ok( XmlExtraPostResponse::OK ) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -868,7 +868,7 @@ impl Api for Client where future::ok( XmlExtraPostResponse::BadRequest ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -887,14 +887,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn xml_other_post(&self, param_another_xml_object: Option, context: &C) -> Box> { + fn xml_other_post(&self, param_another_xml_object: Option, context: &C) -> Box> { let mut uri = format!( "{}/xml_other", self.base_path @@ -926,7 +926,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::XML_OTHER_POST.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -938,7 +938,7 @@ impl Api for Client where future::ok( XmlOtherPostResponse::OK ) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -947,7 +947,7 @@ impl Api for Client where future::ok( XmlOtherPostResponse::BadRequest ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -966,14 +966,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn xml_other_put(&self, param_string: Option, context: &C) -> Box> { + fn xml_other_put(&self, param_string: Option, context: &C) -> Box> { let mut uri = format!( "{}/xml_other", self.base_path @@ -1005,7 +1005,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::XML_OTHER_PUT.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1017,7 +1017,7 @@ impl Api for Client where future::ok( XmlOtherPutResponse::OK ) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -1026,7 +1026,7 @@ impl Api for Client where future::ok( XmlOtherPutResponse::BadRequest ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1045,14 +1045,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn xml_post(&self, param_string: Option, context: &C) -> Box> { + fn xml_post(&self, param_string: Option, context: &C) -> Box> { let mut uri = format!( "{}/xml", self.base_path @@ -1084,7 +1084,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::XML_POST.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1096,7 +1096,7 @@ impl Api for Client where future::ok( XmlPostResponse::OK ) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -1105,7 +1105,7 @@ impl Api for Client where future::ok( XmlPostResponse::BadRequest ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1124,14 +1124,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn xml_put(&self, param_xml_object: Option, context: &C) -> Box> { + fn xml_put(&self, param_xml_object: Option, context: &C) -> Box> { let mut uri = format!( "{}/xml", self.base_path @@ -1163,7 +1163,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::XML_PUT.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1175,7 +1175,7 @@ impl Api for Client where future::ok( XmlPutResponse::OK ) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -1184,7 +1184,7 @@ impl Api for Client where future::ok( XmlPutResponse::BadRequest ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1203,7 +1203,7 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) @@ -1234,7 +1234,7 @@ impl From for ClientInitError { impl fmt::Display for ClientInitError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - (self as &fmt::Debug).fmt(f) + (self as &dyn fmt::Debug).fmt(f) } } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs index ea2d2b92a1ef..17fe5ad46943 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs @@ -174,37 +174,37 @@ pub enum XmlPutResponse { pub trait Api { /// Get some stuff. - fn multiget_get(&self, context: &C) -> Box>; + fn multiget_get(&self, context: &C) -> Box>; - fn multiple_auth_scheme_get(&self, context: &C) -> Box>; + fn multiple_auth_scheme_get(&self, context: &C) -> Box>; - fn readonly_auth_scheme_get(&self, context: &C) -> Box>; + fn readonly_auth_scheme_get(&self, context: &C) -> Box>; - fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box>; + fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box>; - fn responses_with_headers_get(&self, context: &C) -> Box>; + fn responses_with_headers_get(&self, context: &C) -> Box>; - fn uuid_get(&self, context: &C) -> Box>; + fn uuid_get(&self, context: &C) -> Box>; - fn xml_extra_post(&self, duplicate_xml_object: Option, context: &C) -> Box>; + fn xml_extra_post(&self, duplicate_xml_object: Option, context: &C) -> Box>; - fn xml_other_post(&self, another_xml_object: Option, context: &C) -> Box>; + fn xml_other_post(&self, another_xml_object: Option, context: &C) -> Box>; - fn xml_other_put(&self, string: Option, context: &C) -> Box>; + fn xml_other_put(&self, string: Option, context: &C) -> Box>; /// Post an array - fn xml_post(&self, string: Option, context: &C) -> Box>; + fn xml_post(&self, string: Option, context: &C) -> Box>; - fn xml_put(&self, xml_object: Option, context: &C) -> Box>; + fn xml_put(&self, xml_object: Option, context: &C) -> Box>; } @@ -212,37 +212,37 @@ pub trait Api { pub trait ApiNoContext { /// Get some stuff. - fn multiget_get(&self) -> Box>; + fn multiget_get(&self) -> Box>; - fn multiple_auth_scheme_get(&self) -> Box>; + fn multiple_auth_scheme_get(&self) -> Box>; - fn readonly_auth_scheme_get(&self) -> Box>; + fn readonly_auth_scheme_get(&self) -> Box>; - fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box>; + fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box>; - fn responses_with_headers_get(&self) -> Box>; + fn responses_with_headers_get(&self) -> Box>; - fn uuid_get(&self) -> Box>; + fn uuid_get(&self) -> Box>; - fn xml_extra_post(&self, duplicate_xml_object: Option) -> Box>; + fn xml_extra_post(&self, duplicate_xml_object: Option) -> Box>; - fn xml_other_post(&self, another_xml_object: Option) -> Box>; + fn xml_other_post(&self, another_xml_object: Option) -> Box>; - fn xml_other_put(&self, string: Option) -> Box>; + fn xml_other_put(&self, string: Option) -> Box>; /// Post an array - fn xml_post(&self, string: Option) -> Box>; + fn xml_post(&self, string: Option) -> Box>; - fn xml_put(&self, xml_object: Option) -> Box>; + fn xml_put(&self, xml_object: Option) -> Box>; } @@ -261,57 +261,57 @@ impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { /// Get some stuff. - fn multiget_get(&self) -> Box> { + fn multiget_get(&self) -> Box> { self.api().multiget_get(&self.context()) } - fn multiple_auth_scheme_get(&self) -> Box> { + fn multiple_auth_scheme_get(&self) -> Box> { self.api().multiple_auth_scheme_get(&self.context()) } - fn readonly_auth_scheme_get(&self) -> Box> { + fn readonly_auth_scheme_get(&self) -> Box> { self.api().readonly_auth_scheme_get(&self.context()) } - fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box> { + fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box> { self.api().required_octet_stream_put(body, &self.context()) } - fn responses_with_headers_get(&self) -> Box> { + fn responses_with_headers_get(&self) -> Box> { self.api().responses_with_headers_get(&self.context()) } - fn uuid_get(&self) -> Box> { + fn uuid_get(&self) -> Box> { self.api().uuid_get(&self.context()) } - fn xml_extra_post(&self, duplicate_xml_object: Option) -> Box> { + fn xml_extra_post(&self, duplicate_xml_object: Option) -> Box> { self.api().xml_extra_post(duplicate_xml_object, &self.context()) } - fn xml_other_post(&self, another_xml_object: Option) -> Box> { + fn xml_other_post(&self, another_xml_object: Option) -> Box> { self.api().xml_other_post(another_xml_object, &self.context()) } - fn xml_other_put(&self, string: Option) -> Box> { + fn xml_other_put(&self, string: Option) -> Box> { self.api().xml_other_put(string, &self.context()) } /// Post an array - fn xml_post(&self, string: Option) -> Box> { + fn xml_post(&self, string: Option) -> Box> { self.api().xml_post(string, &self.context()) } - fn xml_put(&self, xml_object: Option) -> Box> { + fn xml_put(&self, xml_object: Option) -> Box> { self.api().xml_put(xml_object, &self.context()) } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs index 61a5361fc093..4800083b061e 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs @@ -133,7 +133,7 @@ where type Request = (Request, C); type Response = Response; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, (req, mut context): Self::Request) -> Self::Future { let api_impl = self.api_impl.clone(); @@ -151,7 +151,7 @@ where Box::new(api_impl.multiget_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -259,13 +259,13 @@ where } )) }} - }) as Box> + }) as Box> }, // MultipleAuthSchemeGet - GET /multiple_auth_scheme &hyper::Method::Get if path.matched(paths::ID_MULTIPLE_AUTH_SCHEME) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -296,7 +296,7 @@ where Box::new(api_impl.multiple_auth_scheme_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -320,13 +320,13 @@ where } )) }} - }) as Box> + }) as Box> }, // ReadonlyAuthSchemeGet - GET /readonly_auth_scheme &hyper::Method::Get if path.matched(paths::ID_READONLY_AUTH_SCHEME) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -356,7 +356,7 @@ where Box::new(api_impl.readonly_auth_scheme_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -380,7 +380,7 @@ where } )) }} - }) as Box> + }) as Box> }, // RequiredOctetStreamPut - PUT /required_octet_stream @@ -389,7 +389,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let param_body: Option = if !body.is_empty() { @@ -404,7 +404,7 @@ where Box::new(api_impl.required_octet_stream_put(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -431,7 +431,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // ResponsesWithHeadersGet - GET /responses_with_headers @@ -441,7 +441,7 @@ where Box::new(api_impl.responses_with_headers_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -492,7 +492,7 @@ where } )) }} - }) as Box> + }) as Box> }, // UuidGet - GET /uuid @@ -502,7 +502,7 @@ where Box::new(api_impl.uuid_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -532,7 +532,7 @@ where } )) }} - }) as Box> + }) as Box> }, // XmlExtraPost - POST /xml_extra @@ -541,7 +541,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -560,7 +560,7 @@ where Box::new(api_impl.xml_extra_post(param_duplicate_xml_object, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -598,7 +598,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter DuplicateXmlObject: {}", e)))), } }) - ) as Box> + ) as Box> }, // XmlOtherPost - POST /xml_other @@ -607,7 +607,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -626,7 +626,7 @@ where Box::new(api_impl.xml_other_post(param_another_xml_object, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -664,7 +664,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter AnotherXmlObject: {}", e)))), } }) - ) as Box> + ) as Box> }, // XmlOtherPut - PUT /xml_other @@ -673,7 +673,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -692,7 +692,7 @@ where Box::new(api_impl.xml_other_put(param_string, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -730,7 +730,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter string: {}", e)))), } }) - ) as Box> + ) as Box> }, // XmlPost - POST /xml @@ -739,7 +739,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -758,7 +758,7 @@ where Box::new(api_impl.xml_post(param_string, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -796,7 +796,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter string: {}", e)))), } }) - ) as Box> + ) as Box> }, // XmlPut - PUT /xml @@ -805,7 +805,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -824,7 +824,7 @@ where Box::new(api_impl.xml_put(param_xml_object, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -862,10 +862,10 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter XmlObject: {}", e)))), } }) - ) as Box> + ) as Box> }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } } diff --git a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml index aa2e7ac6abe7..088555ff7ea6 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml @@ -16,7 +16,7 @@ conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk- chrono = { version = "0.4", features = ["serde"] } futures = "0.1" swagger = "2" -lazy_static = "0.2" +lazy_static = "1.4" log = "0.3.0" mime = "0.2.6" multipart = "0.13.3" diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs index 2cfb02dad288..30d05713a7f5 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs @@ -143,187 +143,187 @@ fn main() { Some("Op10Get") => { let result = core.run(client.op10_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op11Get") => { let result = core.run(client.op11_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op12Get") => { let result = core.run(client.op12_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op13Get") => { let result = core.run(client.op13_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op14Get") => { let result = core.run(client.op14_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op15Get") => { let result = core.run(client.op15_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op16Get") => { let result = core.run(client.op16_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op17Get") => { let result = core.run(client.op17_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op18Get") => { let result = core.run(client.op18_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op19Get") => { let result = core.run(client.op19_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op1Get") => { let result = core.run(client.op1_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op20Get") => { let result = core.run(client.op20_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op21Get") => { let result = core.run(client.op21_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op22Get") => { let result = core.run(client.op22_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op23Get") => { let result = core.run(client.op23_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op24Get") => { let result = core.run(client.op24_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op25Get") => { let result = core.run(client.op25_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op26Get") => { let result = core.run(client.op26_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op27Get") => { let result = core.run(client.op27_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op28Get") => { let result = core.run(client.op28_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op29Get") => { let result = core.run(client.op29_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op2Get") => { let result = core.run(client.op2_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op30Get") => { let result = core.run(client.op30_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op31Get") => { let result = core.run(client.op31_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op32Get") => { let result = core.run(client.op32_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op33Get") => { let result = core.run(client.op33_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op34Get") => { let result = core.run(client.op34_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op35Get") => { let result = core.run(client.op35_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op36Get") => { let result = core.run(client.op36_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op37Get") => { let result = core.run(client.op37_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op3Get") => { let result = core.run(client.op3_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op4Get") => { let result = core.run(client.op4_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op5Get") => { let result = core.run(client.op5_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op6Get") => { let result = core.run(client.op6_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op7Get") => { let result = core.run(client.op7_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op8Get") => { let result = core.run(client.op8_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("Op9Get") => { let result = core.run(client.op9_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, _ => { diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs index 1d493838629d..19e55248dec5 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs @@ -64,259 +64,259 @@ impl Server { impl Api for Server where C: Has{ - fn op10_get(&self, context: &C) -> Box> { + fn op10_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op10_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op11_get(&self, context: &C) -> Box> { + fn op11_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op11_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op12_get(&self, context: &C) -> Box> { + fn op12_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op12_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op13_get(&self, context: &C) -> Box> { + fn op13_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op13_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op14_get(&self, context: &C) -> Box> { + fn op14_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op14_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op15_get(&self, context: &C) -> Box> { + fn op15_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op15_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op16_get(&self, context: &C) -> Box> { + fn op16_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op16_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op17_get(&self, context: &C) -> Box> { + fn op17_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op17_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op18_get(&self, context: &C) -> Box> { + fn op18_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op18_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op19_get(&self, context: &C) -> Box> { + fn op19_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op19_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op1_get(&self, context: &C) -> Box> { + fn op1_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op1_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op20_get(&self, context: &C) -> Box> { + fn op20_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op20_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op21_get(&self, context: &C) -> Box> { + fn op21_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op21_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op22_get(&self, context: &C) -> Box> { + fn op22_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op22_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op23_get(&self, context: &C) -> Box> { + fn op23_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op23_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op24_get(&self, context: &C) -> Box> { + fn op24_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op24_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op25_get(&self, context: &C) -> Box> { + fn op25_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op25_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op26_get(&self, context: &C) -> Box> { + fn op26_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op26_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op27_get(&self, context: &C) -> Box> { + fn op27_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op27_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op28_get(&self, context: &C) -> Box> { + fn op28_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op28_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op29_get(&self, context: &C) -> Box> { + fn op29_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op29_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op2_get(&self, context: &C) -> Box> { + fn op2_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op2_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op30_get(&self, context: &C) -> Box> { + fn op30_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op30_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op31_get(&self, context: &C) -> Box> { + fn op31_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op31_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op32_get(&self, context: &C) -> Box> { + fn op32_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op32_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op33_get(&self, context: &C) -> Box> { + fn op33_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op33_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op34_get(&self, context: &C) -> Box> { + fn op34_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op34_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op35_get(&self, context: &C) -> Box> { + fn op35_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op35_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op36_get(&self, context: &C) -> Box> { + fn op36_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op36_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op37_get(&self, context: &C) -> Box> { + fn op37_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op37_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op3_get(&self, context: &C) -> Box> { + fn op3_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op3_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op4_get(&self, context: &C) -> Box> { + fn op4_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op4_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op5_get(&self, context: &C) -> Box> { + fn op5_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op5_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op6_get(&self, context: &C) -> Box> { + fn op6_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op6_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op7_get(&self, context: &C) -> Box> { + fn op7_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op7_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op8_get(&self, context: &C) -> Box> { + fn op8_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op8_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn op9_get(&self, context: &C) -> Box> { + fn op9_get(&self, context: &C) -> Box> { let context = context.clone(); println!("op9_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs index 983e15ea2b4d..ecb62ede32f4 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs @@ -105,7 +105,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result where F: Future + 'static { - client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, base_path: String, } @@ -216,7 +216,7 @@ impl Client { handle: Handle, base_path: &str, protocol: Option<&'static str>, - connector_fn: Box C + Send + Sync>, + connector_fn: Box C + Send + Sync>, ) -> Result, ClientInitError> where C: hyper::client::Connect + hyper::client::Service, @@ -243,7 +243,7 @@ impl Client { /// should be mentioned here. #[deprecated(note="Use try_new_with_client_service instead")] pub fn try_new_with_hyper_client( - hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, handle: Handle, base_path: &str ) -> Result, ClientInitError> @@ -261,7 +261,7 @@ impl Client where /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. /// /// This allows adding custom wrappers around the underlying transport, for example for logging. - pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, handle: Handle, base_path: &str) -> Result, ClientInitError> @@ -277,7 +277,7 @@ impl Api for Client where F: Future + 'static, C: Has { - fn op10_get(&self, context: &C) -> Box> { + fn op10_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op10", self.base_path @@ -300,7 +300,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -312,7 +312,7 @@ impl Api for Client where future::ok( Op10GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -331,14 +331,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op11_get(&self, context: &C) -> Box> { + fn op11_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op11", self.base_path @@ -361,7 +361,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -373,7 +373,7 @@ impl Api for Client where future::ok( Op11GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -392,14 +392,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op12_get(&self, context: &C) -> Box> { + fn op12_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op12", self.base_path @@ -422,7 +422,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -434,7 +434,7 @@ impl Api for Client where future::ok( Op12GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -453,14 +453,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op13_get(&self, context: &C) -> Box> { + fn op13_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op13", self.base_path @@ -483,7 +483,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -495,7 +495,7 @@ impl Api for Client where future::ok( Op13GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -514,14 +514,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op14_get(&self, context: &C) -> Box> { + fn op14_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op14", self.base_path @@ -544,7 +544,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -556,7 +556,7 @@ impl Api for Client where future::ok( Op14GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -575,14 +575,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op15_get(&self, context: &C) -> Box> { + fn op15_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op15", self.base_path @@ -605,7 +605,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -617,7 +617,7 @@ impl Api for Client where future::ok( Op15GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -636,14 +636,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op16_get(&self, context: &C) -> Box> { + fn op16_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op16", self.base_path @@ -666,7 +666,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -678,7 +678,7 @@ impl Api for Client where future::ok( Op16GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -697,14 +697,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op17_get(&self, context: &C) -> Box> { + fn op17_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op17", self.base_path @@ -727,7 +727,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -739,7 +739,7 @@ impl Api for Client where future::ok( Op17GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -758,14 +758,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op18_get(&self, context: &C) -> Box> { + fn op18_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op18", self.base_path @@ -788,7 +788,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -800,7 +800,7 @@ impl Api for Client where future::ok( Op18GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -819,14 +819,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op19_get(&self, context: &C) -> Box> { + fn op19_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op19", self.base_path @@ -849,7 +849,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -861,7 +861,7 @@ impl Api for Client where future::ok( Op19GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -880,14 +880,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op1_get(&self, context: &C) -> Box> { + fn op1_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op1", self.base_path @@ -910,7 +910,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -922,7 +922,7 @@ impl Api for Client where future::ok( Op1GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -941,14 +941,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op20_get(&self, context: &C) -> Box> { + fn op20_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op20", self.base_path @@ -971,7 +971,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -983,7 +983,7 @@ impl Api for Client where future::ok( Op20GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1002,14 +1002,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op21_get(&self, context: &C) -> Box> { + fn op21_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op21", self.base_path @@ -1032,7 +1032,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1044,7 +1044,7 @@ impl Api for Client where future::ok( Op21GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1063,14 +1063,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op22_get(&self, context: &C) -> Box> { + fn op22_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op22", self.base_path @@ -1093,7 +1093,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1105,7 +1105,7 @@ impl Api for Client where future::ok( Op22GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1124,14 +1124,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op23_get(&self, context: &C) -> Box> { + fn op23_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op23", self.base_path @@ -1154,7 +1154,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1166,7 +1166,7 @@ impl Api for Client where future::ok( Op23GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1185,14 +1185,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op24_get(&self, context: &C) -> Box> { + fn op24_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op24", self.base_path @@ -1215,7 +1215,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1227,7 +1227,7 @@ impl Api for Client where future::ok( Op24GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1246,14 +1246,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op25_get(&self, context: &C) -> Box> { + fn op25_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op25", self.base_path @@ -1276,7 +1276,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1288,7 +1288,7 @@ impl Api for Client where future::ok( Op25GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1307,14 +1307,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op26_get(&self, context: &C) -> Box> { + fn op26_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op26", self.base_path @@ -1337,7 +1337,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1349,7 +1349,7 @@ impl Api for Client where future::ok( Op26GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1368,14 +1368,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op27_get(&self, context: &C) -> Box> { + fn op27_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op27", self.base_path @@ -1398,7 +1398,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1410,7 +1410,7 @@ impl Api for Client where future::ok( Op27GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1429,14 +1429,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op28_get(&self, context: &C) -> Box> { + fn op28_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op28", self.base_path @@ -1459,7 +1459,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1471,7 +1471,7 @@ impl Api for Client where future::ok( Op28GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1490,14 +1490,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op29_get(&self, context: &C) -> Box> { + fn op29_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op29", self.base_path @@ -1520,7 +1520,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1532,7 +1532,7 @@ impl Api for Client where future::ok( Op29GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1551,14 +1551,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op2_get(&self, context: &C) -> Box> { + fn op2_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op2", self.base_path @@ -1581,7 +1581,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1593,7 +1593,7 @@ impl Api for Client where future::ok( Op2GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1612,14 +1612,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op30_get(&self, context: &C) -> Box> { + fn op30_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op30", self.base_path @@ -1642,7 +1642,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1654,7 +1654,7 @@ impl Api for Client where future::ok( Op30GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1673,14 +1673,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op31_get(&self, context: &C) -> Box> { + fn op31_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op31", self.base_path @@ -1703,7 +1703,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1715,7 +1715,7 @@ impl Api for Client where future::ok( Op31GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1734,14 +1734,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op32_get(&self, context: &C) -> Box> { + fn op32_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op32", self.base_path @@ -1764,7 +1764,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1776,7 +1776,7 @@ impl Api for Client where future::ok( Op32GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1795,14 +1795,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op33_get(&self, context: &C) -> Box> { + fn op33_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op33", self.base_path @@ -1825,7 +1825,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1837,7 +1837,7 @@ impl Api for Client where future::ok( Op33GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1856,14 +1856,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op34_get(&self, context: &C) -> Box> { + fn op34_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op34", self.base_path @@ -1886,7 +1886,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1898,7 +1898,7 @@ impl Api for Client where future::ok( Op34GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1917,14 +1917,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op35_get(&self, context: &C) -> Box> { + fn op35_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op35", self.base_path @@ -1947,7 +1947,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1959,7 +1959,7 @@ impl Api for Client where future::ok( Op35GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1978,14 +1978,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op36_get(&self, context: &C) -> Box> { + fn op36_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op36", self.base_path @@ -2008,7 +2008,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2020,7 +2020,7 @@ impl Api for Client where future::ok( Op36GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2039,14 +2039,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op37_get(&self, context: &C) -> Box> { + fn op37_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op37", self.base_path @@ -2069,7 +2069,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2081,7 +2081,7 @@ impl Api for Client where future::ok( Op37GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2100,14 +2100,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op3_get(&self, context: &C) -> Box> { + fn op3_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op3", self.base_path @@ -2130,7 +2130,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2142,7 +2142,7 @@ impl Api for Client where future::ok( Op3GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2161,14 +2161,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op4_get(&self, context: &C) -> Box> { + fn op4_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op4", self.base_path @@ -2191,7 +2191,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2203,7 +2203,7 @@ impl Api for Client where future::ok( Op4GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2222,14 +2222,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op5_get(&self, context: &C) -> Box> { + fn op5_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op5", self.base_path @@ -2252,7 +2252,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2264,7 +2264,7 @@ impl Api for Client where future::ok( Op5GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2283,14 +2283,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op6_get(&self, context: &C) -> Box> { + fn op6_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op6", self.base_path @@ -2313,7 +2313,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2325,7 +2325,7 @@ impl Api for Client where future::ok( Op6GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2344,14 +2344,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op7_get(&self, context: &C) -> Box> { + fn op7_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op7", self.base_path @@ -2374,7 +2374,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2386,7 +2386,7 @@ impl Api for Client where future::ok( Op7GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2405,14 +2405,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op8_get(&self, context: &C) -> Box> { + fn op8_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op8", self.base_path @@ -2435,7 +2435,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2447,7 +2447,7 @@ impl Api for Client where future::ok( Op8GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2466,14 +2466,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn op9_get(&self, context: &C) -> Box> { + fn op9_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/op9", self.base_path @@ -2496,7 +2496,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2508,7 +2508,7 @@ impl Api for Client where future::ok( Op9GetResponse::OK ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2527,7 +2527,7 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) @@ -2558,7 +2558,7 @@ impl From for ClientInitError { impl fmt::Display for ClientInitError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - (self as &fmt::Debug).fmt(f) + (self as &dyn fmt::Debug).fmt(f) } } diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs index 8ec590c42ab1..7f73c8047460 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs @@ -277,115 +277,115 @@ pub enum Op9GetResponse { pub trait Api { - fn op10_get(&self, context: &C) -> Box>; + fn op10_get(&self, context: &C) -> Box>; - fn op11_get(&self, context: &C) -> Box>; + fn op11_get(&self, context: &C) -> Box>; - fn op12_get(&self, context: &C) -> Box>; + fn op12_get(&self, context: &C) -> Box>; - fn op13_get(&self, context: &C) -> Box>; + fn op13_get(&self, context: &C) -> Box>; - fn op14_get(&self, context: &C) -> Box>; + fn op14_get(&self, context: &C) -> Box>; - fn op15_get(&self, context: &C) -> Box>; + fn op15_get(&self, context: &C) -> Box>; - fn op16_get(&self, context: &C) -> Box>; + fn op16_get(&self, context: &C) -> Box>; - fn op17_get(&self, context: &C) -> Box>; + fn op17_get(&self, context: &C) -> Box>; - fn op18_get(&self, context: &C) -> Box>; + fn op18_get(&self, context: &C) -> Box>; - fn op19_get(&self, context: &C) -> Box>; + fn op19_get(&self, context: &C) -> Box>; - fn op1_get(&self, context: &C) -> Box>; + fn op1_get(&self, context: &C) -> Box>; - fn op20_get(&self, context: &C) -> Box>; + fn op20_get(&self, context: &C) -> Box>; - fn op21_get(&self, context: &C) -> Box>; + fn op21_get(&self, context: &C) -> Box>; - fn op22_get(&self, context: &C) -> Box>; + fn op22_get(&self, context: &C) -> Box>; - fn op23_get(&self, context: &C) -> Box>; + fn op23_get(&self, context: &C) -> Box>; - fn op24_get(&self, context: &C) -> Box>; + fn op24_get(&self, context: &C) -> Box>; - fn op25_get(&self, context: &C) -> Box>; + fn op25_get(&self, context: &C) -> Box>; - fn op26_get(&self, context: &C) -> Box>; + fn op26_get(&self, context: &C) -> Box>; - fn op27_get(&self, context: &C) -> Box>; + fn op27_get(&self, context: &C) -> Box>; - fn op28_get(&self, context: &C) -> Box>; + fn op28_get(&self, context: &C) -> Box>; - fn op29_get(&self, context: &C) -> Box>; + fn op29_get(&self, context: &C) -> Box>; - fn op2_get(&self, context: &C) -> Box>; + fn op2_get(&self, context: &C) -> Box>; - fn op30_get(&self, context: &C) -> Box>; + fn op30_get(&self, context: &C) -> Box>; - fn op31_get(&self, context: &C) -> Box>; + fn op31_get(&self, context: &C) -> Box>; - fn op32_get(&self, context: &C) -> Box>; + fn op32_get(&self, context: &C) -> Box>; - fn op33_get(&self, context: &C) -> Box>; + fn op33_get(&self, context: &C) -> Box>; - fn op34_get(&self, context: &C) -> Box>; + fn op34_get(&self, context: &C) -> Box>; - fn op35_get(&self, context: &C) -> Box>; + fn op35_get(&self, context: &C) -> Box>; - fn op36_get(&self, context: &C) -> Box>; + fn op36_get(&self, context: &C) -> Box>; - fn op37_get(&self, context: &C) -> Box>; + fn op37_get(&self, context: &C) -> Box>; - fn op3_get(&self, context: &C) -> Box>; + fn op3_get(&self, context: &C) -> Box>; - fn op4_get(&self, context: &C) -> Box>; + fn op4_get(&self, context: &C) -> Box>; - fn op5_get(&self, context: &C) -> Box>; + fn op5_get(&self, context: &C) -> Box>; - fn op6_get(&self, context: &C) -> Box>; + fn op6_get(&self, context: &C) -> Box>; - fn op7_get(&self, context: &C) -> Box>; + fn op7_get(&self, context: &C) -> Box>; - fn op8_get(&self, context: &C) -> Box>; + fn op8_get(&self, context: &C) -> Box>; - fn op9_get(&self, context: &C) -> Box>; + fn op9_get(&self, context: &C) -> Box>; } @@ -393,115 +393,115 @@ pub trait Api { pub trait ApiNoContext { - fn op10_get(&self) -> Box>; + fn op10_get(&self) -> Box>; - fn op11_get(&self) -> Box>; + fn op11_get(&self) -> Box>; - fn op12_get(&self) -> Box>; + fn op12_get(&self) -> Box>; - fn op13_get(&self) -> Box>; + fn op13_get(&self) -> Box>; - fn op14_get(&self) -> Box>; + fn op14_get(&self) -> Box>; - fn op15_get(&self) -> Box>; + fn op15_get(&self) -> Box>; - fn op16_get(&self) -> Box>; + fn op16_get(&self) -> Box>; - fn op17_get(&self) -> Box>; + fn op17_get(&self) -> Box>; - fn op18_get(&self) -> Box>; + fn op18_get(&self) -> Box>; - fn op19_get(&self) -> Box>; + fn op19_get(&self) -> Box>; - fn op1_get(&self) -> Box>; + fn op1_get(&self) -> Box>; - fn op20_get(&self) -> Box>; + fn op20_get(&self) -> Box>; - fn op21_get(&self) -> Box>; + fn op21_get(&self) -> Box>; - fn op22_get(&self) -> Box>; + fn op22_get(&self) -> Box>; - fn op23_get(&self) -> Box>; + fn op23_get(&self) -> Box>; - fn op24_get(&self) -> Box>; + fn op24_get(&self) -> Box>; - fn op25_get(&self) -> Box>; + fn op25_get(&self) -> Box>; - fn op26_get(&self) -> Box>; + fn op26_get(&self) -> Box>; - fn op27_get(&self) -> Box>; + fn op27_get(&self) -> Box>; - fn op28_get(&self) -> Box>; + fn op28_get(&self) -> Box>; - fn op29_get(&self) -> Box>; + fn op29_get(&self) -> Box>; - fn op2_get(&self) -> Box>; + fn op2_get(&self) -> Box>; - fn op30_get(&self) -> Box>; + fn op30_get(&self) -> Box>; - fn op31_get(&self) -> Box>; + fn op31_get(&self) -> Box>; - fn op32_get(&self) -> Box>; + fn op32_get(&self) -> Box>; - fn op33_get(&self) -> Box>; + fn op33_get(&self) -> Box>; - fn op34_get(&self) -> Box>; + fn op34_get(&self) -> Box>; - fn op35_get(&self) -> Box>; + fn op35_get(&self) -> Box>; - fn op36_get(&self) -> Box>; + fn op36_get(&self) -> Box>; - fn op37_get(&self) -> Box>; + fn op37_get(&self) -> Box>; - fn op3_get(&self) -> Box>; + fn op3_get(&self) -> Box>; - fn op4_get(&self) -> Box>; + fn op4_get(&self) -> Box>; - fn op5_get(&self) -> Box>; + fn op5_get(&self) -> Box>; - fn op6_get(&self) -> Box>; + fn op6_get(&self) -> Box>; - fn op7_get(&self) -> Box>; + fn op7_get(&self) -> Box>; - fn op8_get(&self) -> Box>; + fn op8_get(&self) -> Box>; - fn op9_get(&self) -> Box>; + fn op9_get(&self) -> Box>; } @@ -520,187 +520,187 @@ impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { - fn op10_get(&self) -> Box> { + fn op10_get(&self) -> Box> { self.api().op10_get(&self.context()) } - fn op11_get(&self) -> Box> { + fn op11_get(&self) -> Box> { self.api().op11_get(&self.context()) } - fn op12_get(&self) -> Box> { + fn op12_get(&self) -> Box> { self.api().op12_get(&self.context()) } - fn op13_get(&self) -> Box> { + fn op13_get(&self) -> Box> { self.api().op13_get(&self.context()) } - fn op14_get(&self) -> Box> { + fn op14_get(&self) -> Box> { self.api().op14_get(&self.context()) } - fn op15_get(&self) -> Box> { + fn op15_get(&self) -> Box> { self.api().op15_get(&self.context()) } - fn op16_get(&self) -> Box> { + fn op16_get(&self) -> Box> { self.api().op16_get(&self.context()) } - fn op17_get(&self) -> Box> { + fn op17_get(&self) -> Box> { self.api().op17_get(&self.context()) } - fn op18_get(&self) -> Box> { + fn op18_get(&self) -> Box> { self.api().op18_get(&self.context()) } - fn op19_get(&self) -> Box> { + fn op19_get(&self) -> Box> { self.api().op19_get(&self.context()) } - fn op1_get(&self) -> Box> { + fn op1_get(&self) -> Box> { self.api().op1_get(&self.context()) } - fn op20_get(&self) -> Box> { + fn op20_get(&self) -> Box> { self.api().op20_get(&self.context()) } - fn op21_get(&self) -> Box> { + fn op21_get(&self) -> Box> { self.api().op21_get(&self.context()) } - fn op22_get(&self) -> Box> { + fn op22_get(&self) -> Box> { self.api().op22_get(&self.context()) } - fn op23_get(&self) -> Box> { + fn op23_get(&self) -> Box> { self.api().op23_get(&self.context()) } - fn op24_get(&self) -> Box> { + fn op24_get(&self) -> Box> { self.api().op24_get(&self.context()) } - fn op25_get(&self) -> Box> { + fn op25_get(&self) -> Box> { self.api().op25_get(&self.context()) } - fn op26_get(&self) -> Box> { + fn op26_get(&self) -> Box> { self.api().op26_get(&self.context()) } - fn op27_get(&self) -> Box> { + fn op27_get(&self) -> Box> { self.api().op27_get(&self.context()) } - fn op28_get(&self) -> Box> { + fn op28_get(&self) -> Box> { self.api().op28_get(&self.context()) } - fn op29_get(&self) -> Box> { + fn op29_get(&self) -> Box> { self.api().op29_get(&self.context()) } - fn op2_get(&self) -> Box> { + fn op2_get(&self) -> Box> { self.api().op2_get(&self.context()) } - fn op30_get(&self) -> Box> { + fn op30_get(&self) -> Box> { self.api().op30_get(&self.context()) } - fn op31_get(&self) -> Box> { + fn op31_get(&self) -> Box> { self.api().op31_get(&self.context()) } - fn op32_get(&self) -> Box> { + fn op32_get(&self) -> Box> { self.api().op32_get(&self.context()) } - fn op33_get(&self) -> Box> { + fn op33_get(&self) -> Box> { self.api().op33_get(&self.context()) } - fn op34_get(&self) -> Box> { + fn op34_get(&self) -> Box> { self.api().op34_get(&self.context()) } - fn op35_get(&self) -> Box> { + fn op35_get(&self) -> Box> { self.api().op35_get(&self.context()) } - fn op36_get(&self) -> Box> { + fn op36_get(&self) -> Box> { self.api().op36_get(&self.context()) } - fn op37_get(&self) -> Box> { + fn op37_get(&self) -> Box> { self.api().op37_get(&self.context()) } - fn op3_get(&self) -> Box> { + fn op3_get(&self) -> Box> { self.api().op3_get(&self.context()) } - fn op4_get(&self) -> Box> { + fn op4_get(&self) -> Box> { self.api().op4_get(&self.context()) } - fn op5_get(&self) -> Box> { + fn op5_get(&self) -> Box> { self.api().op5_get(&self.context()) } - fn op6_get(&self) -> Box> { + fn op6_get(&self) -> Box> { self.api().op6_get(&self.context()) } - fn op7_get(&self) -> Box> { + fn op7_get(&self) -> Box> { self.api().op7_get(&self.context()) } - fn op8_get(&self) -> Box> { + fn op8_get(&self) -> Box> { self.api().op8_get(&self.context()) } - fn op9_get(&self) -> Box> { + fn op9_get(&self) -> Box> { self.api().op9_get(&self.context()) } diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs index 267efa7a2172..7714591e7ca6 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs @@ -213,7 +213,7 @@ where type Request = (Request, C); type Response = Response; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, (req, mut context): Self::Request) -> Self::Future { let api_impl = self.api_impl.clone(); @@ -231,7 +231,7 @@ where Box::new(api_impl.op10_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -255,7 +255,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op11Get - GET /op11 @@ -265,7 +265,7 @@ where Box::new(api_impl.op11_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -289,7 +289,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op12Get - GET /op12 @@ -299,7 +299,7 @@ where Box::new(api_impl.op12_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -323,7 +323,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op13Get - GET /op13 @@ -333,7 +333,7 @@ where Box::new(api_impl.op13_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -357,7 +357,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op14Get - GET /op14 @@ -367,7 +367,7 @@ where Box::new(api_impl.op14_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -391,7 +391,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op15Get - GET /op15 @@ -401,7 +401,7 @@ where Box::new(api_impl.op15_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -425,7 +425,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op16Get - GET /op16 @@ -435,7 +435,7 @@ where Box::new(api_impl.op16_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -459,7 +459,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op17Get - GET /op17 @@ -469,7 +469,7 @@ where Box::new(api_impl.op17_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -493,7 +493,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op18Get - GET /op18 @@ -503,7 +503,7 @@ where Box::new(api_impl.op18_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -527,7 +527,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op19Get - GET /op19 @@ -537,7 +537,7 @@ where Box::new(api_impl.op19_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -561,7 +561,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op1Get - GET /op1 @@ -571,7 +571,7 @@ where Box::new(api_impl.op1_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -595,7 +595,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op20Get - GET /op20 @@ -605,7 +605,7 @@ where Box::new(api_impl.op20_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -629,7 +629,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op21Get - GET /op21 @@ -639,7 +639,7 @@ where Box::new(api_impl.op21_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -663,7 +663,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op22Get - GET /op22 @@ -673,7 +673,7 @@ where Box::new(api_impl.op22_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -697,7 +697,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op23Get - GET /op23 @@ -707,7 +707,7 @@ where Box::new(api_impl.op23_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -731,7 +731,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op24Get - GET /op24 @@ -741,7 +741,7 @@ where Box::new(api_impl.op24_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -765,7 +765,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op25Get - GET /op25 @@ -775,7 +775,7 @@ where Box::new(api_impl.op25_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -799,7 +799,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op26Get - GET /op26 @@ -809,7 +809,7 @@ where Box::new(api_impl.op26_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -833,7 +833,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op27Get - GET /op27 @@ -843,7 +843,7 @@ where Box::new(api_impl.op27_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -867,7 +867,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op28Get - GET /op28 @@ -877,7 +877,7 @@ where Box::new(api_impl.op28_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -901,7 +901,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op29Get - GET /op29 @@ -911,7 +911,7 @@ where Box::new(api_impl.op29_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -935,7 +935,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op2Get - GET /op2 @@ -945,7 +945,7 @@ where Box::new(api_impl.op2_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -969,7 +969,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op30Get - GET /op30 @@ -979,7 +979,7 @@ where Box::new(api_impl.op30_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1003,7 +1003,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op31Get - GET /op31 @@ -1013,7 +1013,7 @@ where Box::new(api_impl.op31_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1037,7 +1037,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op32Get - GET /op32 @@ -1047,7 +1047,7 @@ where Box::new(api_impl.op32_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1071,7 +1071,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op33Get - GET /op33 @@ -1081,7 +1081,7 @@ where Box::new(api_impl.op33_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1105,7 +1105,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op34Get - GET /op34 @@ -1115,7 +1115,7 @@ where Box::new(api_impl.op34_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1139,7 +1139,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op35Get - GET /op35 @@ -1149,7 +1149,7 @@ where Box::new(api_impl.op35_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1173,7 +1173,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op36Get - GET /op36 @@ -1183,7 +1183,7 @@ where Box::new(api_impl.op36_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1207,7 +1207,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op37Get - GET /op37 @@ -1217,7 +1217,7 @@ where Box::new(api_impl.op37_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1241,7 +1241,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op3Get - GET /op3 @@ -1251,7 +1251,7 @@ where Box::new(api_impl.op3_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1275,7 +1275,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op4Get - GET /op4 @@ -1285,7 +1285,7 @@ where Box::new(api_impl.op4_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1309,7 +1309,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op5Get - GET /op5 @@ -1319,7 +1319,7 @@ where Box::new(api_impl.op5_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1343,7 +1343,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op6Get - GET /op6 @@ -1353,7 +1353,7 @@ where Box::new(api_impl.op6_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1377,7 +1377,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op7Get - GET /op7 @@ -1387,7 +1387,7 @@ where Box::new(api_impl.op7_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1411,7 +1411,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op8Get - GET /op8 @@ -1421,7 +1421,7 @@ where Box::new(api_impl.op8_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1445,7 +1445,7 @@ where } )) }} - }) as Box> + }) as Box> }, // Op9Get - GET /op9 @@ -1455,7 +1455,7 @@ where Box::new(api_impl.op9_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1479,10 +1479,10 @@ where } )) }} - }) as Box> + }) as Box> }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml index eacf8e96ff48..45332e7a07fb 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -16,7 +16,7 @@ conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk- chrono = { version = "0.4", features = ["serde"] } futures = "0.1" swagger = "2" -lazy_static = "0.2" +lazy_static = "1.4" log = "0.3.0" mime = "0.2.6" multipart = "0.13.3" diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs index bcf3e0d67d3c..a55c070e0c36 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs @@ -124,171 +124,171 @@ fn main() { // Disabled because there's no example. // Some("TestSpecialTags") => { // let result = core.run(client.test_special_tags(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, Some("FakeOuterBooleanSerialize") => { let result = core.run(client.fake_outer_boolean_serialize(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("FakeOuterCompositeSerialize") => { let result = core.run(client.fake_outer_composite_serialize(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("FakeOuterNumberSerialize") => { let result = core.run(client.fake_outer_number_serialize(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("FakeOuterStringSerialize") => { let result = core.run(client.fake_outer_string_serialize(None)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, // Disabled because there's no example. // Some("TestBodyWithQueryParams") => { // let result = core.run(client.test_body_with_query_params("query_example".to_string(), ???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, // Disabled because there's no example. // Some("TestClientModel") => { // let result = core.run(client.test_client_model(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, Some("TestEndpointParameters") => { let result = core.run(client.test_endpoint_parameters(8.14, 1.2, "pattern_without_delimiter_example".to_string(), swagger::ByteArray(Vec::from("BYTE_ARRAY_DATA_HERE")), Some(56), Some(56), Some(789), Some(3.4), Some("string_example".to_string()), Some(swagger::ByteArray(Vec::from("BINARY_DATA_HERE"))), None, None, Some("password_example".to_string()), Some("callback_example".to_string()))); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("TestEnumParameters") => { let result = core.run(client.test_enum_parameters(Some(&Vec::new()), Some("enum_header_string_example".to_string()), Some(&Vec::new()), Some("enum_query_string_example".to_string()), Some(56), Some(1.2), Some("enum_form_string_example".to_string()))); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, // Disabled because there's no example. // Some("TestInlineAdditionalProperties") => { // let result = core.run(client.test_inline_additional_properties(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, Some("TestJsonFormData") => { let result = core.run(client.test_json_form_data("param_example".to_string(), "param2_example".to_string())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, // Disabled because there's no example. // Some("TestClassname") => { // let result = core.run(client.test_classname(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, // Disabled because there's no example. // Some("AddPet") => { // let result = core.run(client.add_pet(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, Some("DeletePet") => { let result = core.run(client.delete_pet(789, Some("api_key_example".to_string()))); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("FindPetsByStatus") => { let result = core.run(client.find_pets_by_status(&Vec::new())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("FindPetsByTags") => { let result = core.run(client.find_pets_by_tags(&Vec::new())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("GetPetById") => { let result = core.run(client.get_pet_by_id(789)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, // Disabled because there's no example. // Some("UpdatePet") => { // let result = core.run(client.update_pet(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, Some("UpdatePetWithForm") => { let result = core.run(client.update_pet_with_form(789, Some("name_example".to_string()), Some("status_example".to_string()))); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("UploadFile") => { let result = core.run(client.upload_file(789, Some("additional_metadata_example".to_string()), Some(swagger::ByteArray(Vec::from("BINARY_DATA_HERE"))))); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("DeleteOrder") => { let result = core.run(client.delete_order("order_id_example".to_string())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("GetInventory") => { let result = core.run(client.get_inventory()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("GetOrderById") => { let result = core.run(client.get_order_by_id(789)); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, // Disabled because there's no example. // Some("PlaceOrder") => { // let result = core.run(client.place_order(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, // Disabled because there's no example. // Some("CreateUser") => { // let result = core.run(client.create_user(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, Some("CreateUsersWithArrayInput") => { let result = core.run(client.create_users_with_array_input(&Vec::new())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("CreateUsersWithListInput") => { let result = core.run(client.create_users_with_list_input(&Vec::new())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("DeleteUser") => { let result = core.run(client.delete_user("username_example".to_string())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("GetUserByName") => { let result = core.run(client.get_user_by_name("username_example".to_string())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("LoginUser") => { let result = core.run(client.login_user("username_example".to_string(), "password_example".to_string())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("LogoutUser") => { let result = core.run(client.logout_user()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, // Disabled because there's no example. // Some("UpdateUser") => { // let result = core.run(client.update_user("username_example".to_string(), ???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, _ => { diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs index f76a7dfa8759..2602397dc423 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs @@ -60,224 +60,224 @@ impl Server { impl Api for Server where C: Has{ /// To test special tags - fn test_special_tags(&self, body: models::Client, context: &C) -> Box> { + fn test_special_tags(&self, body: models::Client, context: &C) -> Box> { let context = context.clone(); println!("test_special_tags({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn fake_outer_boolean_serialize(&self, body: Option, context: &C) -> Box> { + fn fake_outer_boolean_serialize(&self, body: Option, context: &C) -> Box> { let context = context.clone(); println!("fake_outer_boolean_serialize({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn fake_outer_composite_serialize(&self, body: Option, context: &C) -> Box> { + fn fake_outer_composite_serialize(&self, body: Option, context: &C) -> Box> { let context = context.clone(); println!("fake_outer_composite_serialize({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn fake_outer_number_serialize(&self, body: Option, context: &C) -> Box> { + fn fake_outer_number_serialize(&self, body: Option, context: &C) -> Box> { let context = context.clone(); println!("fake_outer_number_serialize({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn fake_outer_string_serialize(&self, body: Option, context: &C) -> Box> { + fn fake_outer_string_serialize(&self, body: Option, context: &C) -> Box> { let context = context.clone(); println!("fake_outer_string_serialize({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn test_body_with_query_params(&self, query: String, body: models::User, context: &C) -> Box> { + fn test_body_with_query_params(&self, query: String, body: models::User, context: &C) -> Box> { let context = context.clone(); println!("test_body_with_query_params(\"{}\", {:?}) - X-Span-ID: {:?}", query, body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// To test \"client\" model - fn test_client_model(&self, body: models::Client, context: &C) -> Box> { + fn test_client_model(&self, body: models::Client, context: &C) -> Box> { let context = context.clone(); println!("test_client_model({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option, context: &C) -> Box> { + fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option, context: &C) -> Box> { let context = context.clone(); println!("test_endpoint_parameters({}, {}, \"{}\", {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// To test enum parameters - fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option, context: &C) -> Box> { + fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option, context: &C) -> Box> { let context = context.clone(); println!("test_enum_parameters({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, enum_form_string, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// test inline additionalProperties - fn test_inline_additional_properties(&self, param: HashMap, context: &C) -> Box> { + fn test_inline_additional_properties(&self, param: HashMap, context: &C) -> Box> { let context = context.clone(); println!("test_inline_additional_properties({:?}) - X-Span-ID: {:?}", param, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// test json serialization of form data - fn test_json_form_data(&self, param: String, param2: String, context: &C) -> Box> { + fn test_json_form_data(&self, param: String, param2: String, context: &C) -> Box> { let context = context.clone(); println!("test_json_form_data(\"{}\", \"{}\") - X-Span-ID: {:?}", param, param2, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// To test class name in snake case - fn test_classname(&self, body: models::Client, context: &C) -> Box> { + fn test_classname(&self, body: models::Client, context: &C) -> Box> { let context = context.clone(); println!("test_classname({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Add a new pet to the store - fn add_pet(&self, body: models::Pet, context: &C) -> Box> { + fn add_pet(&self, body: models::Pet, context: &C) -> Box> { let context = context.clone(); println!("add_pet({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Deletes a pet - fn delete_pet(&self, pet_id: i64, api_key: Option, context: &C) -> Box> { + fn delete_pet(&self, pet_id: i64, api_key: Option, context: &C) -> Box> { let context = context.clone(); println!("delete_pet({}, {:?}) - X-Span-ID: {:?}", pet_id, api_key, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Finds Pets by status - fn find_pets_by_status(&self, status: &Vec, context: &C) -> Box> { + fn find_pets_by_status(&self, status: &Vec, context: &C) -> Box> { let context = context.clone(); println!("find_pets_by_status({:?}) - X-Span-ID: {:?}", status, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Finds Pets by tags - fn find_pets_by_tags(&self, tags: &Vec, context: &C) -> Box> { + fn find_pets_by_tags(&self, tags: &Vec, context: &C) -> Box> { let context = context.clone(); println!("find_pets_by_tags({:?}) - X-Span-ID: {:?}", tags, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Find pet by ID - fn get_pet_by_id(&self, pet_id: i64, context: &C) -> Box> { + fn get_pet_by_id(&self, pet_id: i64, context: &C) -> Box> { let context = context.clone(); println!("get_pet_by_id({}) - X-Span-ID: {:?}", pet_id, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Update an existing pet - fn update_pet(&self, body: models::Pet, context: &C) -> Box> { + fn update_pet(&self, body: models::Pet, context: &C) -> Box> { let context = context.clone(); println!("update_pet({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Updates a pet in the store with form data - fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option, context: &C) -> Box> { + fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option, context: &C) -> Box> { let context = context.clone(); println!("update_pet_with_form({}, {:?}, {:?}) - X-Span-ID: {:?}", pet_id, name, status, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// uploads an image - fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option, context: &C) -> Box> { + fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option, context: &C) -> Box> { let context = context.clone(); println!("upload_file({}, {:?}, {:?}) - X-Span-ID: {:?}", pet_id, additional_metadata, file, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Delete purchase order by ID - fn delete_order(&self, order_id: String, context: &C) -> Box> { + fn delete_order(&self, order_id: String, context: &C) -> Box> { let context = context.clone(); println!("delete_order(\"{}\") - X-Span-ID: {:?}", order_id, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Returns pet inventories by status - fn get_inventory(&self, context: &C) -> Box> { + fn get_inventory(&self, context: &C) -> Box> { let context = context.clone(); println!("get_inventory() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Find purchase order by ID - fn get_order_by_id(&self, order_id: i64, context: &C) -> Box> { + fn get_order_by_id(&self, order_id: i64, context: &C) -> Box> { let context = context.clone(); println!("get_order_by_id({}) - X-Span-ID: {:?}", order_id, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Place an order for a pet - fn place_order(&self, body: models::Order, context: &C) -> Box> { + fn place_order(&self, body: models::Order, context: &C) -> Box> { let context = context.clone(); println!("place_order({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Create user - fn create_user(&self, body: models::User, context: &C) -> Box> { + fn create_user(&self, body: models::User, context: &C) -> Box> { let context = context.clone(); println!("create_user({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Creates list of users with given input array - fn create_users_with_array_input(&self, body: &Vec, context: &C) -> Box> { + fn create_users_with_array_input(&self, body: &Vec, context: &C) -> Box> { let context = context.clone(); println!("create_users_with_array_input({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Creates list of users with given input array - fn create_users_with_list_input(&self, body: &Vec, context: &C) -> Box> { + fn create_users_with_list_input(&self, body: &Vec, context: &C) -> Box> { let context = context.clone(); println!("create_users_with_list_input({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Delete user - fn delete_user(&self, username: String, context: &C) -> Box> { + fn delete_user(&self, username: String, context: &C) -> Box> { let context = context.clone(); println!("delete_user(\"{}\") - X-Span-ID: {:?}", username, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Get user by user name - fn get_user_by_name(&self, username: String, context: &C) -> Box> { + fn get_user_by_name(&self, username: String, context: &C) -> Box> { let context = context.clone(); println!("get_user_by_name(\"{}\") - X-Span-ID: {:?}", username, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Logs user into the system - fn login_user(&self, username: String, password: String, context: &C) -> Box> { + fn login_user(&self, username: String, password: String, context: &C) -> Box> { let context = context.clone(); println!("login_user(\"{}\", \"{}\") - X-Span-ID: {:?}", username, password, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Logs out current logged in user session - fn logout_user(&self, context: &C) -> Box> { + fn logout_user(&self, context: &C) -> Box> { let context = context.clone(); println!("logout_user() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Updated user - fn update_user(&self, username: String, body: models::User, context: &C) -> Box> { + fn update_user(&self, username: String, body: models::User, context: &C) -> Box> { let context = context.clone(); println!("update_user(\"{}\", {:?}) - X-Span-ID: {:?}", username, body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs index 045a7903c625..0684eae45e47 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs @@ -107,7 +107,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result where F: Future + 'static { - client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, base_path: String, } @@ -218,7 +218,7 @@ impl Client { handle: Handle, base_path: &str, protocol: Option<&'static str>, - connector_fn: Box C + Send + Sync>, + connector_fn: Box C + Send + Sync>, ) -> Result, ClientInitError> where C: hyper::client::Connect + hyper::client::Service, @@ -245,7 +245,7 @@ impl Client { /// should be mentioned here. #[deprecated(note="Use try_new_with_client_service instead")] pub fn try_new_with_hyper_client( - hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, handle: Handle, base_path: &str ) -> Result, ClientInitError> @@ -263,7 +263,7 @@ impl Client where /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. /// /// This allows adding custom wrappers around the underlying transport, for example for logging. - pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, handle: Handle, base_path: &str) -> Result, ClientInitError> @@ -279,7 +279,7 @@ impl Api for Client where F: Future + 'static, C: Has + Has>{ - fn test_special_tags(&self, param_body: models::Client, context: &C) -> Box> { + fn test_special_tags(&self, param_body: models::Client, context: &C) -> Box> { let mut uri = format!( "{}/v2/another-fake/dummy", self.base_path @@ -307,7 +307,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::TEST_SPECIAL_TAGS.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -329,7 +329,7 @@ impl Api for Client where .map(move |body| { TestSpecialTagsResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -348,14 +348,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn fake_outer_boolean_serialize(&self, param_body: Option, context: &C) -> Box> { + fn fake_outer_boolean_serialize(&self, param_body: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake/outer/boolean", self.base_path @@ -388,7 +388,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::FAKE_OUTER_BOOLEAN_SERIALIZE.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -410,7 +410,7 @@ impl Api for Client where .map(move |body| { FakeOuterBooleanSerializeResponse::OutputBoolean(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -429,14 +429,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn fake_outer_composite_serialize(&self, param_body: Option, context: &C) -> Box> { + fn fake_outer_composite_serialize(&self, param_body: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake/outer/composite", self.base_path @@ -468,7 +468,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::FAKE_OUTER_COMPOSITE_SERIALIZE.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -490,7 +490,7 @@ impl Api for Client where .map(move |body| { FakeOuterCompositeSerializeResponse::OutputComposite(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -509,14 +509,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn fake_outer_number_serialize(&self, param_body: Option, context: &C) -> Box> { + fn fake_outer_number_serialize(&self, param_body: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake/outer/number", self.base_path @@ -548,7 +548,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::FAKE_OUTER_NUMBER_SERIALIZE.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -570,7 +570,7 @@ impl Api for Client where .map(move |body| { FakeOuterNumberSerializeResponse::OutputNumber(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -589,14 +589,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn fake_outer_string_serialize(&self, param_body: Option, context: &C) -> Box> { + fn fake_outer_string_serialize(&self, param_body: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake/outer/string", self.base_path @@ -628,7 +628,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::FAKE_OUTER_STRING_SERIALIZE.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -650,7 +650,7 @@ impl Api for Client where .map(move |body| { FakeOuterStringSerializeResponse::OutputString(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -669,14 +669,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn test_body_with_query_params(&self, param_query: String, param_body: models::User, context: &C) -> Box> { + fn test_body_with_query_params(&self, param_query: String, param_body: models::User, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake/body-with-query-params", self.base_path @@ -704,7 +704,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::TEST_BODY_WITH_QUERY_PARAMS.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -716,7 +716,7 @@ impl Api for Client where future::ok( TestBodyWithQueryParamsResponse::Success ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -735,14 +735,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn test_client_model(&self, param_body: models::Client, context: &C) -> Box> { + fn test_client_model(&self, param_body: models::Client, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake", self.base_path @@ -769,7 +769,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::TEST_CLIENT_MODEL.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -791,7 +791,7 @@ impl Api for Client where .map(move |body| { TestClientModelResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -810,14 +810,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn test_endpoint_parameters(&self, param_number: f64, param_double: f64, param_pattern_without_delimiter: String, param_byte: swagger::ByteArray, param_integer: Option, param_int32: Option, param_int64: Option, param_float: Option, param_string: Option, param_binary: Option, param_date: Option>, param_date_time: Option>, param_password: Option, param_callback: Option, context: &C) -> Box> { + fn test_endpoint_parameters(&self, param_number: f64, param_double: f64, param_pattern_without_delimiter: String, param_byte: swagger::ByteArray, param_integer: Option, param_int32: Option, param_int64: Option, param_float: Option, param_string: Option, param_binary: Option, param_date: Option>, param_date_time: Option>, param_password: Option, param_callback: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake", self.base_path @@ -860,9 +860,9 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::TEST_ENDPOINT_PARAMETERS.clone())); request.set_body(body.into_bytes()); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Basic(ref basic_header) => { @@ -884,7 +884,7 @@ impl Api for Client where future::ok( TestEndpointParametersResponse::InvalidUsernameSupplied ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -893,7 +893,7 @@ impl Api for Client where future::ok( TestEndpointParametersResponse::UserNotFound ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -912,14 +912,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn test_enum_parameters(&self, param_enum_header_string_array: Option<&Vec>, param_enum_header_string: Option, param_enum_query_string_array: Option<&Vec>, param_enum_query_string: Option, param_enum_query_integer: Option, param_enum_query_double: Option, param_enum_form_string: Option, context: &C) -> Box> { + fn test_enum_parameters(&self, param_enum_header_string_array: Option<&Vec>, param_enum_header_string: Option, param_enum_query_string_array: Option<&Vec>, param_enum_query_string: Option, param_enum_query_integer: Option, param_enum_query_double: Option, param_enum_form_string: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake", self.base_path @@ -961,7 +961,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::TEST_ENUM_PARAMETERS.clone())); request.set_body(body.into_bytes()); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); // Header parameters header! { (RequestEnumHeaderStringArray, "enum_header_string_array") => (String)* } @@ -979,7 +979,7 @@ impl Api for Client where future::ok( TestEnumParametersResponse::InvalidRequest ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -988,7 +988,7 @@ impl Api for Client where future::ok( TestEnumParametersResponse::NotFound ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1007,14 +1007,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn test_inline_additional_properties(&self, param_param: HashMap, context: &C) -> Box> { + fn test_inline_additional_properties(&self, param_param: HashMap, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake/inline-additionalProperties", self.base_path @@ -1041,7 +1041,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::TEST_INLINE_ADDITIONAL_PROPERTIES.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1053,7 +1053,7 @@ impl Api for Client where future::ok( TestInlineAdditionalPropertiesResponse::SuccessfulOperation ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1072,14 +1072,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn test_json_form_data(&self, param_param: String, param_param2: String, context: &C) -> Box> { + fn test_json_form_data(&self, param_param: String, param_param2: String, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake/jsonFormData", self.base_path @@ -1110,7 +1110,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::TEST_JSON_FORM_DATA.clone())); request.set_body(body.into_bytes()); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1122,7 +1122,7 @@ impl Api for Client where future::ok( TestJsonFormDataResponse::SuccessfulOperation ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1141,14 +1141,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn test_classname(&self, param_body: models::Client, context: &C) -> Box> { + fn test_classname(&self, param_body: models::Client, context: &C) -> Box> { let mut uri = format!( "{}/v2/fake_classname_test", self.base_path @@ -1156,7 +1156,7 @@ impl Api for Client where let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); - if let Some(auth_data) = (context as &Has>).get().as_ref() { + if let Some(auth_data) = (context as &dyn Has>).get().as_ref() { if let AuthData::ApiKey(ref api_key) = *auth_data { query_string.append_pair("api_key_query", api_key); } @@ -1180,7 +1180,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::TEST_CLASSNAME.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1202,7 +1202,7 @@ impl Api for Client where .map(move |body| { TestClassnameResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1221,14 +1221,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn add_pet(&self, param_body: models::Pet, context: &C) -> Box> { + fn add_pet(&self, param_body: models::Pet, context: &C) -> Box> { let mut uri = format!( "{}/v2/pet", self.base_path @@ -1256,9 +1256,9 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::ADD_PET.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -1280,7 +1280,7 @@ impl Api for Client where future::ok( AddPetResponse::InvalidInput ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1299,14 +1299,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn delete_pet(&self, param_pet_id: i64, param_api_key: Option, context: &C) -> Box> { + fn delete_pet(&self, param_pet_id: i64, param_api_key: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/pet/{petId}", self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), ID_ENCODE_SET) @@ -1329,9 +1329,9 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Delete, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -1357,7 +1357,7 @@ impl Api for Client where future::ok( DeletePetResponse::InvalidPetValue ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1376,14 +1376,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn find_pets_by_status(&self, param_status: &Vec, context: &C) -> Box> { + fn find_pets_by_status(&self, param_status: &Vec, context: &C) -> Box> { let mut uri = format!( "{}/v2/pet/findByStatus", self.base_path @@ -1407,9 +1407,9 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -1443,7 +1443,7 @@ impl Api for Client where .map(move |body| { FindPetsByStatusResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -1452,7 +1452,7 @@ impl Api for Client where future::ok( FindPetsByStatusResponse::InvalidStatusValue ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1471,14 +1471,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn find_pets_by_tags(&self, param_tags: &Vec, context: &C) -> Box> { + fn find_pets_by_tags(&self, param_tags: &Vec, context: &C) -> Box> { let mut uri = format!( "{}/v2/pet/findByTags", self.base_path @@ -1502,9 +1502,9 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -1538,7 +1538,7 @@ impl Api for Client where .map(move |body| { FindPetsByTagsResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -1547,7 +1547,7 @@ impl Api for Client where future::ok( FindPetsByTagsResponse::InvalidTagValue ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1566,14 +1566,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn get_pet_by_id(&self, param_pet_id: i64, context: &C) -> Box> { + fn get_pet_by_id(&self, param_pet_id: i64, context: &C) -> Box> { let mut uri = format!( "{}/v2/pet/{petId}", self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), ID_ENCODE_SET) @@ -1596,9 +1596,9 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::ApiKey(ref api_key) => { @@ -1633,7 +1633,7 @@ impl Api for Client where .map(move |body| { GetPetByIdResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -1642,7 +1642,7 @@ impl Api for Client where future::ok( GetPetByIdResponse::InvalidIDSupplied ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -1651,7 +1651,7 @@ impl Api for Client where future::ok( GetPetByIdResponse::PetNotFound ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1670,14 +1670,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn update_pet(&self, param_body: models::Pet, context: &C) -> Box> { + fn update_pet(&self, param_body: models::Pet, context: &C) -> Box> { let mut uri = format!( "{}/v2/pet", self.base_path @@ -1704,9 +1704,9 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::UPDATE_PET.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -1728,7 +1728,7 @@ impl Api for Client where future::ok( UpdatePetResponse::InvalidIDSupplied ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -1737,7 +1737,7 @@ impl Api for Client where future::ok( UpdatePetResponse::PetNotFound ) - ) as Box> + ) as Box> }, 405 => { let body = response.body(); @@ -1746,7 +1746,7 @@ impl Api for Client where future::ok( UpdatePetResponse::ValidationException ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1765,14 +1765,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn update_pet_with_form(&self, param_pet_id: i64, param_name: Option, param_status: Option, context: &C) -> Box> { + fn update_pet_with_form(&self, param_pet_id: i64, param_name: Option, param_status: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/pet/{petId}", self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), ID_ENCODE_SET) @@ -1803,9 +1803,9 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::UPDATE_PET_WITH_FORM.clone())); request.set_body(body.into_bytes()); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -1827,7 +1827,7 @@ impl Api for Client where future::ok( UpdatePetWithFormResponse::InvalidInput ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1846,14 +1846,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn upload_file(&self, param_pet_id: i64, param_additional_metadata: Option, param_file: Option, context: &C) -> Box> { + fn upload_file(&self, param_pet_id: i64, param_additional_metadata: Option, param_file: Option, context: &C) -> Box> { let mut uri = format!( "{}/v2/pet/{petId}/uploadImage", self.base_path, petId=utf8_percent_encode(¶m_pet_id.to_string(), ID_ENCODE_SET) @@ -1925,9 +1925,9 @@ impl Api for Client where request.headers_mut().set(ContentType(multipart_header)); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::Bearer(ref bearer_header) => { @@ -1959,7 +1959,7 @@ impl Api for Client where .map(move |body| { UploadFileResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -1978,14 +1978,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn delete_order(&self, param_order_id: String, context: &C) -> Box> { + fn delete_order(&self, param_order_id: String, context: &C) -> Box> { let mut uri = format!( "{}/v2/store/order/{order_id}", self.base_path, order_id=utf8_percent_encode(¶m_order_id.to_string(), ID_ENCODE_SET) @@ -2008,7 +2008,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Delete, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2020,7 +2020,7 @@ impl Api for Client where future::ok( DeleteOrderResponse::InvalidIDSupplied ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -2029,7 +2029,7 @@ impl Api for Client where future::ok( DeleteOrderResponse::OrderNotFound ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2048,14 +2048,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn get_inventory(&self, context: &C) -> Box> { + fn get_inventory(&self, context: &C) -> Box> { let mut uri = format!( "{}/v2/store/inventory", self.base_path @@ -2078,9 +2078,9 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); - (context as &Has>).get().as_ref().map(|auth_data| { + (context as &dyn Has>).get().as_ref().map(|auth_data| { // Currently only authentication with Basic, API Key, and Bearer are supported match auth_data { &AuthData::ApiKey(ref api_key) => { @@ -2113,7 +2113,7 @@ impl Api for Client where .map(move |body| { GetInventoryResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2132,14 +2132,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn get_order_by_id(&self, param_order_id: i64, context: &C) -> Box> { + fn get_order_by_id(&self, param_order_id: i64, context: &C) -> Box> { let mut uri = format!( "{}/v2/store/order/{order_id}", self.base_path, order_id=utf8_percent_encode(¶m_order_id.to_string(), ID_ENCODE_SET) @@ -2162,7 +2162,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2186,7 +2186,7 @@ impl Api for Client where .map(move |body| { GetOrderByIdResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -2195,7 +2195,7 @@ impl Api for Client where future::ok( GetOrderByIdResponse::InvalidIDSupplied ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -2204,7 +2204,7 @@ impl Api for Client where future::ok( GetOrderByIdResponse::OrderNotFound ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2223,14 +2223,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn place_order(&self, param_body: models::Order, context: &C) -> Box> { + fn place_order(&self, param_body: models::Order, context: &C) -> Box> { let mut uri = format!( "{}/v2/store/order", self.base_path @@ -2257,7 +2257,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::PLACE_ORDER.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2281,7 +2281,7 @@ impl Api for Client where .map(move |body| { PlaceOrderResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -2290,7 +2290,7 @@ impl Api for Client where future::ok( PlaceOrderResponse::InvalidOrder ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2309,14 +2309,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn create_user(&self, param_body: models::User, context: &C) -> Box> { + fn create_user(&self, param_body: models::User, context: &C) -> Box> { let mut uri = format!( "{}/v2/user", self.base_path @@ -2344,7 +2344,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::CREATE_USER.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2356,7 +2356,7 @@ impl Api for Client where future::ok( CreateUserResponse::SuccessfulOperation ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2375,14 +2375,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn create_users_with_array_input(&self, param_body: &Vec, context: &C) -> Box> { + fn create_users_with_array_input(&self, param_body: &Vec, context: &C) -> Box> { let mut uri = format!( "{}/v2/user/createWithArray", self.base_path @@ -2409,7 +2409,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::CREATE_USERS_WITH_ARRAY_INPUT.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2421,7 +2421,7 @@ impl Api for Client where future::ok( CreateUsersWithArrayInputResponse::SuccessfulOperation ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2440,14 +2440,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn create_users_with_list_input(&self, param_body: &Vec, context: &C) -> Box> { + fn create_users_with_list_input(&self, param_body: &Vec, context: &C) -> Box> { let mut uri = format!( "{}/v2/user/createWithList", self.base_path @@ -2474,7 +2474,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::CREATE_USERS_WITH_LIST_INPUT.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2486,7 +2486,7 @@ impl Api for Client where future::ok( CreateUsersWithListInputResponse::SuccessfulOperation ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2505,14 +2505,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn delete_user(&self, param_username: String, context: &C) -> Box> { + fn delete_user(&self, param_username: String, context: &C) -> Box> { let mut uri = format!( "{}/v2/user/{username}", self.base_path, username=utf8_percent_encode(¶m_username.to_string(), ID_ENCODE_SET) @@ -2535,7 +2535,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Delete, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2547,7 +2547,7 @@ impl Api for Client where future::ok( DeleteUserResponse::InvalidUsernameSupplied ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -2556,7 +2556,7 @@ impl Api for Client where future::ok( DeleteUserResponse::UserNotFound ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2575,14 +2575,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn get_user_by_name(&self, param_username: String, context: &C) -> Box> { + fn get_user_by_name(&self, param_username: String, context: &C) -> Box> { let mut uri = format!( "{}/v2/user/{username}", self.base_path, username=utf8_percent_encode(¶m_username.to_string(), ID_ENCODE_SET) @@ -2605,7 +2605,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2629,7 +2629,7 @@ impl Api for Client where .map(move |body| { GetUserByNameResponse::SuccessfulOperation(body) }) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -2638,7 +2638,7 @@ impl Api for Client where future::ok( GetUserByNameResponse::InvalidUsernameSupplied ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -2647,7 +2647,7 @@ impl Api for Client where future::ok( GetUserByNameResponse::UserNotFound ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2666,14 +2666,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn login_user(&self, param_username: String, param_password: String, context: &C) -> Box> { + fn login_user(&self, param_username: String, param_password: String, context: &C) -> Box> { let mut uri = format!( "{}/v2/user/login", self.base_path @@ -2698,7 +2698,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2707,12 +2707,12 @@ impl Api for Client where header! { (ResponseXRateLimit, "X-Rate-Limit") => [i32] } let response_x_rate_limit = match response.headers().get::() { Some(response_x_rate_limit) => response_x_rate_limit.0.clone(), - None => return Box::new(future::err(ApiError(String::from("Required response header X-Rate-Limit for response 200 was not found.")))) as Box>, + None => return Box::new(future::err(ApiError(String::from("Required response header X-Rate-Limit for response 200 was not found.")))) as Box>, }; header! { (ResponseXExpiresAfter, "X-Expires-After") => [chrono::DateTime] } let response_x_expires_after = match response.headers().get::() { Some(response_x_expires_after) => response_x_expires_after.0.clone(), - None => return Box::new(future::err(ApiError(String::from("Required response header X-Expires-After for response 200 was not found.")))) as Box>, + None => return Box::new(future::err(ApiError(String::from("Required response header X-Expires-After for response 200 was not found.")))) as Box>, }; let body = response.body(); Box::new( @@ -2732,7 +2732,7 @@ impl Api for Client where .map(move |body| { LoginUserResponse::SuccessfulOperation{ body: body, x_rate_limit: response_x_rate_limit, x_expires_after: response_x_expires_after } }) - ) as Box> + ) as Box> }, 400 => { let body = response.body(); @@ -2741,7 +2741,7 @@ impl Api for Client where future::ok( LoginUserResponse::InvalidUsername ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2760,14 +2760,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn logout_user(&self, context: &C) -> Box> { + fn logout_user(&self, context: &C) -> Box> { let mut uri = format!( "{}/v2/user/logout", self.base_path @@ -2790,7 +2790,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2802,7 +2802,7 @@ impl Api for Client where future::ok( LogoutUserResponse::SuccessfulOperation ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2821,14 +2821,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn update_user(&self, param_username: String, param_body: models::User, context: &C) -> Box> { + fn update_user(&self, param_username: String, param_body: models::User, context: &C) -> Box> { let mut uri = format!( "{}/v2/user/{username}", self.base_path, username=utf8_percent_encode(¶m_username.to_string(), ID_ENCODE_SET) @@ -2855,7 +2855,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::UPDATE_USER.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2867,7 +2867,7 @@ impl Api for Client where future::ok( UpdateUserResponse::InvalidUserSupplied ) - ) as Box> + ) as Box> }, 404 => { let body = response.body(); @@ -2876,7 +2876,7 @@ impl Api for Client where future::ok( UpdateUserResponse::UserNotFound ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -2895,7 +2895,7 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) @@ -2926,7 +2926,7 @@ impl From for ClientInitError { impl fmt::Display for ClientInitError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - (self as &fmt::Debug).fmt(f) + (self as &dyn fmt::Debug).fmt(f) } } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index 301819683582..12aee98b7fee 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -319,100 +319,100 @@ pub enum UpdateUserResponse { pub trait Api { /// To test special tags - fn test_special_tags(&self, body: models::Client, context: &C) -> Box>; + fn test_special_tags(&self, body: models::Client, context: &C) -> Box>; - fn fake_outer_boolean_serialize(&self, body: Option, context: &C) -> Box>; + fn fake_outer_boolean_serialize(&self, body: Option, context: &C) -> Box>; - fn fake_outer_composite_serialize(&self, body: Option, context: &C) -> Box>; + fn fake_outer_composite_serialize(&self, body: Option, context: &C) -> Box>; - fn fake_outer_number_serialize(&self, body: Option, context: &C) -> Box>; + fn fake_outer_number_serialize(&self, body: Option, context: &C) -> Box>; - fn fake_outer_string_serialize(&self, body: Option, context: &C) -> Box>; + fn fake_outer_string_serialize(&self, body: Option, context: &C) -> Box>; - fn test_body_with_query_params(&self, query: String, body: models::User, context: &C) -> Box>; + fn test_body_with_query_params(&self, query: String, body: models::User, context: &C) -> Box>; /// To test \"client\" model - fn test_client_model(&self, body: models::Client, context: &C) -> Box>; + fn test_client_model(&self, body: models::Client, context: &C) -> Box>; /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option, context: &C) -> Box>; + fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option, context: &C) -> Box>; /// To test enum parameters - fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option, context: &C) -> Box>; + fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option, context: &C) -> Box>; /// test inline additionalProperties - fn test_inline_additional_properties(&self, param: HashMap, context: &C) -> Box>; + fn test_inline_additional_properties(&self, param: HashMap, context: &C) -> Box>; /// test json serialization of form data - fn test_json_form_data(&self, param: String, param2: String, context: &C) -> Box>; + fn test_json_form_data(&self, param: String, param2: String, context: &C) -> Box>; /// To test class name in snake case - fn test_classname(&self, body: models::Client, context: &C) -> Box>; + fn test_classname(&self, body: models::Client, context: &C) -> Box>; /// Add a new pet to the store - fn add_pet(&self, body: models::Pet, context: &C) -> Box>; + fn add_pet(&self, body: models::Pet, context: &C) -> Box>; /// Deletes a pet - fn delete_pet(&self, pet_id: i64, api_key: Option, context: &C) -> Box>; + fn delete_pet(&self, pet_id: i64, api_key: Option, context: &C) -> Box>; /// Finds Pets by status - fn find_pets_by_status(&self, status: &Vec, context: &C) -> Box>; + fn find_pets_by_status(&self, status: &Vec, context: &C) -> Box>; /// Finds Pets by tags - fn find_pets_by_tags(&self, tags: &Vec, context: &C) -> Box>; + fn find_pets_by_tags(&self, tags: &Vec, context: &C) -> Box>; /// Find pet by ID - fn get_pet_by_id(&self, pet_id: i64, context: &C) -> Box>; + fn get_pet_by_id(&self, pet_id: i64, context: &C) -> Box>; /// Update an existing pet - fn update_pet(&self, body: models::Pet, context: &C) -> Box>; + fn update_pet(&self, body: models::Pet, context: &C) -> Box>; /// Updates a pet in the store with form data - fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option, context: &C) -> Box>; + fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option, context: &C) -> Box>; /// uploads an image - fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option, context: &C) -> Box>; + fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option, context: &C) -> Box>; /// Delete purchase order by ID - fn delete_order(&self, order_id: String, context: &C) -> Box>; + fn delete_order(&self, order_id: String, context: &C) -> Box>; /// Returns pet inventories by status - fn get_inventory(&self, context: &C) -> Box>; + fn get_inventory(&self, context: &C) -> Box>; /// Find purchase order by ID - fn get_order_by_id(&self, order_id: i64, context: &C) -> Box>; + fn get_order_by_id(&self, order_id: i64, context: &C) -> Box>; /// Place an order for a pet - fn place_order(&self, body: models::Order, context: &C) -> Box>; + fn place_order(&self, body: models::Order, context: &C) -> Box>; /// Create user - fn create_user(&self, body: models::User, context: &C) -> Box>; + fn create_user(&self, body: models::User, context: &C) -> Box>; /// Creates list of users with given input array - fn create_users_with_array_input(&self, body: &Vec, context: &C) -> Box>; + fn create_users_with_array_input(&self, body: &Vec, context: &C) -> Box>; /// Creates list of users with given input array - fn create_users_with_list_input(&self, body: &Vec, context: &C) -> Box>; + fn create_users_with_list_input(&self, body: &Vec, context: &C) -> Box>; /// Delete user - fn delete_user(&self, username: String, context: &C) -> Box>; + fn delete_user(&self, username: String, context: &C) -> Box>; /// Get user by user name - fn get_user_by_name(&self, username: String, context: &C) -> Box>; + fn get_user_by_name(&self, username: String, context: &C) -> Box>; /// Logs user into the system - fn login_user(&self, username: String, password: String, context: &C) -> Box>; + fn login_user(&self, username: String, password: String, context: &C) -> Box>; /// Logs out current logged in user session - fn logout_user(&self, context: &C) -> Box>; + fn logout_user(&self, context: &C) -> Box>; /// Updated user - fn update_user(&self, username: String, body: models::User, context: &C) -> Box>; + fn update_user(&self, username: String, body: models::User, context: &C) -> Box>; } @@ -420,100 +420,100 @@ pub trait Api { pub trait ApiNoContext { /// To test special tags - fn test_special_tags(&self, body: models::Client) -> Box>; + fn test_special_tags(&self, body: models::Client) -> Box>; - fn fake_outer_boolean_serialize(&self, body: Option) -> Box>; + fn fake_outer_boolean_serialize(&self, body: Option) -> Box>; - fn fake_outer_composite_serialize(&self, body: Option) -> Box>; + fn fake_outer_composite_serialize(&self, body: Option) -> Box>; - fn fake_outer_number_serialize(&self, body: Option) -> Box>; + fn fake_outer_number_serialize(&self, body: Option) -> Box>; - fn fake_outer_string_serialize(&self, body: Option) -> Box>; + fn fake_outer_string_serialize(&self, body: Option) -> Box>; - fn test_body_with_query_params(&self, query: String, body: models::User) -> Box>; + fn test_body_with_query_params(&self, query: String, body: models::User) -> Box>; /// To test \"client\" model - fn test_client_model(&self, body: models::Client) -> Box>; + fn test_client_model(&self, body: models::Client) -> Box>; /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option) -> Box>; + fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option) -> Box>; /// To test enum parameters - fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option) -> Box>; + fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option) -> Box>; /// test inline additionalProperties - fn test_inline_additional_properties(&self, param: HashMap) -> Box>; + fn test_inline_additional_properties(&self, param: HashMap) -> Box>; /// test json serialization of form data - fn test_json_form_data(&self, param: String, param2: String) -> Box>; + fn test_json_form_data(&self, param: String, param2: String) -> Box>; /// To test class name in snake case - fn test_classname(&self, body: models::Client) -> Box>; + fn test_classname(&self, body: models::Client) -> Box>; /// Add a new pet to the store - fn add_pet(&self, body: models::Pet) -> Box>; + fn add_pet(&self, body: models::Pet) -> Box>; /// Deletes a pet - fn delete_pet(&self, pet_id: i64, api_key: Option) -> Box>; + fn delete_pet(&self, pet_id: i64, api_key: Option) -> Box>; /// Finds Pets by status - fn find_pets_by_status(&self, status: &Vec) -> Box>; + fn find_pets_by_status(&self, status: &Vec) -> Box>; /// Finds Pets by tags - fn find_pets_by_tags(&self, tags: &Vec) -> Box>; + fn find_pets_by_tags(&self, tags: &Vec) -> Box>; /// Find pet by ID - fn get_pet_by_id(&self, pet_id: i64) -> Box>; + fn get_pet_by_id(&self, pet_id: i64) -> Box>; /// Update an existing pet - fn update_pet(&self, body: models::Pet) -> Box>; + fn update_pet(&self, body: models::Pet) -> Box>; /// Updates a pet in the store with form data - fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option) -> Box>; + fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option) -> Box>; /// uploads an image - fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option) -> Box>; + fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option) -> Box>; /// Delete purchase order by ID - fn delete_order(&self, order_id: String) -> Box>; + fn delete_order(&self, order_id: String) -> Box>; /// Returns pet inventories by status - fn get_inventory(&self) -> Box>; + fn get_inventory(&self) -> Box>; /// Find purchase order by ID - fn get_order_by_id(&self, order_id: i64) -> Box>; + fn get_order_by_id(&self, order_id: i64) -> Box>; /// Place an order for a pet - fn place_order(&self, body: models::Order) -> Box>; + fn place_order(&self, body: models::Order) -> Box>; /// Create user - fn create_user(&self, body: models::User) -> Box>; + fn create_user(&self, body: models::User) -> Box>; /// Creates list of users with given input array - fn create_users_with_array_input(&self, body: &Vec) -> Box>; + fn create_users_with_array_input(&self, body: &Vec) -> Box>; /// Creates list of users with given input array - fn create_users_with_list_input(&self, body: &Vec) -> Box>; + fn create_users_with_list_input(&self, body: &Vec) -> Box>; /// Delete user - fn delete_user(&self, username: String) -> Box>; + fn delete_user(&self, username: String) -> Box>; /// Get user by user name - fn get_user_by_name(&self, username: String) -> Box>; + fn get_user_by_name(&self, username: String) -> Box>; /// Logs user into the system - fn login_user(&self, username: String, password: String) -> Box>; + fn login_user(&self, username: String, password: String) -> Box>; /// Logs out current logged in user session - fn logout_user(&self) -> Box>; + fn logout_user(&self) -> Box>; /// Updated user - fn update_user(&self, username: String, body: models::User) -> Box>; + fn update_user(&self, username: String, body: models::User) -> Box>; } @@ -532,162 +532,162 @@ impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { /// To test special tags - fn test_special_tags(&self, body: models::Client) -> Box> { + fn test_special_tags(&self, body: models::Client) -> Box> { self.api().test_special_tags(body, &self.context()) } - fn fake_outer_boolean_serialize(&self, body: Option) -> Box> { + fn fake_outer_boolean_serialize(&self, body: Option) -> Box> { self.api().fake_outer_boolean_serialize(body, &self.context()) } - fn fake_outer_composite_serialize(&self, body: Option) -> Box> { + fn fake_outer_composite_serialize(&self, body: Option) -> Box> { self.api().fake_outer_composite_serialize(body, &self.context()) } - fn fake_outer_number_serialize(&self, body: Option) -> Box> { + fn fake_outer_number_serialize(&self, body: Option) -> Box> { self.api().fake_outer_number_serialize(body, &self.context()) } - fn fake_outer_string_serialize(&self, body: Option) -> Box> { + fn fake_outer_string_serialize(&self, body: Option) -> Box> { self.api().fake_outer_string_serialize(body, &self.context()) } - fn test_body_with_query_params(&self, query: String, body: models::User) -> Box> { + fn test_body_with_query_params(&self, query: String, body: models::User) -> Box> { self.api().test_body_with_query_params(query, body, &self.context()) } /// To test \"client\" model - fn test_client_model(&self, body: models::Client) -> Box> { + fn test_client_model(&self, body: models::Client) -> Box> { self.api().test_client_model(body, &self.context()) } /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option) -> Box> { + fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option) -> Box> { self.api().test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, &self.context()) } /// To test enum parameters - fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option) -> Box> { + fn test_enum_parameters(&self, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, enum_form_string: Option) -> Box> { self.api().test_enum_parameters(enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, enum_form_string, &self.context()) } /// test inline additionalProperties - fn test_inline_additional_properties(&self, param: HashMap) -> Box> { + fn test_inline_additional_properties(&self, param: HashMap) -> Box> { self.api().test_inline_additional_properties(param, &self.context()) } /// test json serialization of form data - fn test_json_form_data(&self, param: String, param2: String) -> Box> { + fn test_json_form_data(&self, param: String, param2: String) -> Box> { self.api().test_json_form_data(param, param2, &self.context()) } /// To test class name in snake case - fn test_classname(&self, body: models::Client) -> Box> { + fn test_classname(&self, body: models::Client) -> Box> { self.api().test_classname(body, &self.context()) } /// Add a new pet to the store - fn add_pet(&self, body: models::Pet) -> Box> { + fn add_pet(&self, body: models::Pet) -> Box> { self.api().add_pet(body, &self.context()) } /// Deletes a pet - fn delete_pet(&self, pet_id: i64, api_key: Option) -> Box> { + fn delete_pet(&self, pet_id: i64, api_key: Option) -> Box> { self.api().delete_pet(pet_id, api_key, &self.context()) } /// Finds Pets by status - fn find_pets_by_status(&self, status: &Vec) -> Box> { + fn find_pets_by_status(&self, status: &Vec) -> Box> { self.api().find_pets_by_status(status, &self.context()) } /// Finds Pets by tags - fn find_pets_by_tags(&self, tags: &Vec) -> Box> { + fn find_pets_by_tags(&self, tags: &Vec) -> Box> { self.api().find_pets_by_tags(tags, &self.context()) } /// Find pet by ID - fn get_pet_by_id(&self, pet_id: i64) -> Box> { + fn get_pet_by_id(&self, pet_id: i64) -> Box> { self.api().get_pet_by_id(pet_id, &self.context()) } /// Update an existing pet - fn update_pet(&self, body: models::Pet) -> Box> { + fn update_pet(&self, body: models::Pet) -> Box> { self.api().update_pet(body, &self.context()) } /// Updates a pet in the store with form data - fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option) -> Box> { + fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option) -> Box> { self.api().update_pet_with_form(pet_id, name, status, &self.context()) } /// uploads an image - fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option) -> Box> { + fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Option) -> Box> { self.api().upload_file(pet_id, additional_metadata, file, &self.context()) } /// Delete purchase order by ID - fn delete_order(&self, order_id: String) -> Box> { + fn delete_order(&self, order_id: String) -> Box> { self.api().delete_order(order_id, &self.context()) } /// Returns pet inventories by status - fn get_inventory(&self) -> Box> { + fn get_inventory(&self) -> Box> { self.api().get_inventory(&self.context()) } /// Find purchase order by ID - fn get_order_by_id(&self, order_id: i64) -> Box> { + fn get_order_by_id(&self, order_id: i64) -> Box> { self.api().get_order_by_id(order_id, &self.context()) } /// Place an order for a pet - fn place_order(&self, body: models::Order) -> Box> { + fn place_order(&self, body: models::Order) -> Box> { self.api().place_order(body, &self.context()) } /// Create user - fn create_user(&self, body: models::User) -> Box> { + fn create_user(&self, body: models::User) -> Box> { self.api().create_user(body, &self.context()) } /// Creates list of users with given input array - fn create_users_with_array_input(&self, body: &Vec) -> Box> { + fn create_users_with_array_input(&self, body: &Vec) -> Box> { self.api().create_users_with_array_input(body, &self.context()) } /// Creates list of users with given input array - fn create_users_with_list_input(&self, body: &Vec) -> Box> { + fn create_users_with_list_input(&self, body: &Vec) -> Box> { self.api().create_users_with_list_input(body, &self.context()) } /// Delete user - fn delete_user(&self, username: String) -> Box> { + fn delete_user(&self, username: String) -> Box> { self.api().delete_user(username, &self.context()) } /// Get user by user name - fn get_user_by_name(&self, username: String) -> Box> { + fn get_user_by_name(&self, username: String) -> Box> { self.api().get_user_by_name(username, &self.context()) } /// Logs user into the system - fn login_user(&self, username: String, password: String) -> Box> { + fn login_user(&self, username: String, password: String) -> Box> { self.api().login_user(username, password, &self.context()) } /// Logs out current logged in user session - fn logout_user(&self) -> Box> { + fn logout_user(&self) -> Box> { self.api().logout_user(&self.context()) } /// Updated user - fn update_user(&self, username: String, body: models::User) -> Box> { + fn update_user(&self, username: String, body: models::User) -> Box> { self.api().update_user(username, body, &self.context()) } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index abe6c8a8f3c5..3f3c511493e3 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -200,7 +200,7 @@ where type Request = (Request, C); type Response = Response; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, (req, mut context): Self::Request) -> Self::Future { let api_impl = self.api_impl.clone(); @@ -217,7 +217,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -240,7 +240,7 @@ where Box::new(api_impl.test_special_tags(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -277,7 +277,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // FakeOuterBooleanSerialize - POST /fake/outer/boolean @@ -286,7 +286,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -305,7 +305,7 @@ where Box::new(api_impl.fake_outer_boolean_serialize(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -342,7 +342,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // FakeOuterCompositeSerialize - POST /fake/outer/composite @@ -351,7 +351,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -370,7 +370,7 @@ where Box::new(api_impl.fake_outer_composite_serialize(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -407,7 +407,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // FakeOuterNumberSerialize - POST /fake/outer/number @@ -416,7 +416,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -435,7 +435,7 @@ where Box::new(api_impl.fake_outer_number_serialize(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -472,7 +472,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // FakeOuterStringSerialize - POST /fake/outer/string @@ -481,7 +481,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -500,7 +500,7 @@ where Box::new(api_impl.fake_outer_string_serialize(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -537,7 +537,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // TestBodyWithQueryParams - PUT /fake/body-with-query-params @@ -557,7 +557,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -580,7 +580,7 @@ where Box::new(api_impl.test_body_with_query_params(param_query, param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -611,7 +611,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // TestClientModel - PATCH /fake @@ -620,7 +620,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -643,7 +643,7 @@ where Box::new(api_impl.test_client_model(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -680,13 +680,13 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // TestEndpointParameters - POST /fake &hyper::Method::Post if path.matched(paths::ID_FAKE) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -714,7 +714,7 @@ where Box::new(api_impl.test_endpoint_parameters(param_number, param_double, param_pattern_without_delimiter, param_byte, param_integer, param_int32, param_int64, param_float, param_string, param_binary, param_date, param_date_time, param_password, param_callback, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -745,7 +745,7 @@ where } )) }} - }) as Box> + }) as Box> }, // TestEnumParameters - GET /fake @@ -784,7 +784,7 @@ where Box::new(api_impl.test_enum_parameters(param_enum_header_string_array.as_ref(), param_enum_header_string, param_enum_query_string_array.as_ref(), param_enum_query_string, param_enum_query_integer, param_enum_query_double, param_enum_form_string, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -815,7 +815,7 @@ where } )) }} - }) as Box> + }) as Box> }, // TestInlineAdditionalProperties - POST /fake/inline-additionalProperties @@ -824,7 +824,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -847,7 +847,7 @@ where Box::new(api_impl.test_inline_additional_properties(param_param, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -878,7 +878,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter param: {}", e)))), } }) - ) as Box> + ) as Box> }, // TestJsonFormData - GET /fake/jsonFormData @@ -891,7 +891,7 @@ where Box::new(api_impl.test_json_form_data(param_param, param_param2, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -915,13 +915,13 @@ where } )) }} - }) as Box> + }) as Box> }, // TestClassname - PATCH /fake_classname_test &hyper::Method::Patch if path.matched(paths::ID_FAKE_CLASSNAME_TEST) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -933,7 +933,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -956,7 +956,7 @@ where Box::new(api_impl.test_classname(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -993,13 +993,13 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // AddPet - POST /pet &hyper::Method::Post if path.matched(paths::ID_PET) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1029,7 +1029,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -1052,7 +1052,7 @@ where Box::new(api_impl.add_pet(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -1083,13 +1083,13 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // DeletePet - DELETE /pet/{petId} &hyper::Method::Delete if path.matched(paths::ID_PET_PETID) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1138,7 +1138,7 @@ where Box::new(api_impl.delete_pet(param_pet_id, param_api_key, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1162,13 +1162,13 @@ where } )) }} - }) as Box> + }) as Box> }, // FindPetsByStatus - GET /pet/findByStatus &hyper::Method::Get if path.matched(paths::ID_PET_FINDBYSTATUS) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1204,7 +1204,7 @@ where Box::new(api_impl.find_pets_by_status(param_status.as_ref(), &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1241,13 +1241,13 @@ where } )) }} - }) as Box> + }) as Box> }, // FindPetsByTags - GET /pet/findByTags &hyper::Method::Get if path.matched(paths::ID_PET_FINDBYTAGS) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1283,7 +1283,7 @@ where Box::new(api_impl.find_pets_by_tags(param_tags.as_ref(), &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1320,13 +1320,13 @@ where } )) }} - }) as Box> + }) as Box> }, // GetPetById - GET /pet/{petId} &hyper::Method::Get if path.matched(paths::ID_PET_PETID) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1354,7 +1354,7 @@ where Box::new(api_impl.get_pet_by_id(param_pet_id, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1398,13 +1398,13 @@ where } )) }} - }) as Box> + }) as Box> }, // UpdatePet - PUT /pet &hyper::Method::Put if path.matched(paths::ID_PET) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1434,7 +1434,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -1457,7 +1457,7 @@ where Box::new(api_impl.update_pet(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -1502,13 +1502,13 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // UpdatePetWithForm - POST /pet/{petId} &hyper::Method::Post if path.matched(paths::ID_PET_PETID) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1557,7 +1557,7 @@ where Box::new(api_impl.update_pet_with_form(param_pet_id, param_name, param_status, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1581,13 +1581,13 @@ where } )) }} - }) as Box> + }) as Box> }, // UploadFile - POST /pet/{petId}/uploadImage &hyper::Method::Post if path.matched(paths::ID_PET_PETID_UPLOADIMAGE) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1636,7 +1636,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { // Read Form Parameters from body @@ -1677,7 +1677,7 @@ where Box::new(api_impl.upload_file(param_pet_id, param_additional_metadata, param_file, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1706,7 +1706,7 @@ where future::ok(response) } )) - as Box> + as Box> }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read multipart body")))), } @@ -1736,7 +1736,7 @@ where Box::new(api_impl.delete_order(param_order_id, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1767,13 +1767,13 @@ where } )) }} - }) as Box> + }) as Box> }, // GetInventory - GET /store/inventory &hyper::Method::Get if path.matched(paths::ID_STORE_INVENTORY) => { { - let authorization = match (&context as &Has>).get() { + let authorization = match (&context as &dyn Has>).get() { &Some(ref authorization) => authorization, &None => return Box::new(future::ok(Response::new() .with_status(StatusCode::Forbidden) @@ -1786,7 +1786,7 @@ where Box::new(api_impl.get_inventory(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1816,7 +1816,7 @@ where } )) }} - }) as Box> + }) as Box> }, // GetOrderById - GET /store/order/{order_id} @@ -1841,7 +1841,7 @@ where Box::new(api_impl.get_order_by_id(param_order_id, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -1885,7 +1885,7 @@ where } )) }} - }) as Box> + }) as Box> }, // PlaceOrder - POST /store/order @@ -1894,7 +1894,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -1917,7 +1917,7 @@ where Box::new(api_impl.place_order(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -1961,7 +1961,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // CreateUser - POST /user @@ -1970,7 +1970,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -1993,7 +1993,7 @@ where Box::new(api_impl.create_user(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -2024,7 +2024,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // CreateUsersWithArrayInput - POST /user/createWithArray @@ -2033,7 +2033,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -2056,7 +2056,7 @@ where Box::new(api_impl.create_users_with_array_input(param_body.as_ref(), &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -2087,7 +2087,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // CreateUsersWithListInput - POST /user/createWithList @@ -2096,7 +2096,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -2119,7 +2119,7 @@ where Box::new(api_impl.create_users_with_list_input(param_body.as_ref(), &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -2150,7 +2150,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // DeleteUser - DELETE /user/{username} @@ -2175,7 +2175,7 @@ where Box::new(api_impl.delete_user(param_username, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -2206,7 +2206,7 @@ where } )) }} - }) as Box> + }) as Box> }, // GetUserByName - GET /user/{username} @@ -2231,7 +2231,7 @@ where Box::new(api_impl.get_user_by_name(param_username, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -2275,7 +2275,7 @@ where } )) }} - }) as Box> + }) as Box> }, // LoginUser - GET /user/login @@ -2305,7 +2305,7 @@ where Box::new(api_impl.login_user(param_username, param_password, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -2351,7 +2351,7 @@ where } )) }} - }) as Box> + }) as Box> }, // LogoutUser - GET /user/logout @@ -2361,7 +2361,7 @@ where Box::new(api_impl.logout_user(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -2385,7 +2385,7 @@ where } )) }} - }) as Box> + }) as Box> }, // UpdateUser - PUT /user/{username} @@ -2409,7 +2409,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -2432,7 +2432,7 @@ where Box::new(api_impl.update_user(param_username, param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -2470,10 +2470,10 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml index ebdcacacf1b6..789fbdc0e161 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml +++ b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml @@ -16,7 +16,7 @@ conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk- chrono = { version = "0.4", features = ["serde"] } futures = "0.1" swagger = "2" -lazy_static = "0.2" +lazy_static = "1.4" log = "0.3.0" mime = "0.2.6" multipart = "0.13.3" diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs index 8df0e5e5ebe4..afe7fce011e2 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs @@ -78,28 +78,28 @@ fn main() { Some("DummyGet") => { let result = core.run(client.dummy_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, // Disabled because there's no example. // Some("DummyPut") => { // let result = core.run(client.dummy_put(???)); - // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + // println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); // }, Some("FileResponseGet") => { let result = core.run(client.file_response_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("HtmlPost") => { let result = core.run(client.html_post("body_example".to_string())); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, Some("RawJsonGet") => { let result = core.run(client.raw_json_get()); - println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, _ => { diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs index 4e7c5e59254f..771315a1a7f3 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs @@ -32,35 +32,35 @@ impl Server { impl Api for Server where C: Has{ /// A dummy endpoint to make the spec valid. - fn dummy_get(&self, context: &C) -> Box> { + fn dummy_get(&self, context: &C) -> Box> { let context = context.clone(); println!("dummy_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } - fn dummy_put(&self, nested_response: models::InlineObject, context: &C) -> Box> { + fn dummy_put(&self, nested_response: models::InlineObject, context: &C) -> Box> { let context = context.clone(); println!("dummy_put({:?}) - X-Span-ID: {:?}", nested_response, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Get a file - fn file_response_get(&self, context: &C) -> Box> { + fn file_response_get(&self, context: &C) -> Box> { let context = context.clone(); println!("file_response_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Test HTML handling - fn html_post(&self, body: String, context: &C) -> Box> { + fn html_post(&self, body: String, context: &C) -> Box> { let context = context.clone(); println!("html_post(\"{}\") - X-Span-ID: {:?}", body, context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) } /// Get an arbitrary JSON blob. - fn raw_json_get(&self, context: &C) -> Box> { + fn raw_json_get(&self, context: &C) -> Box> { let context = context.clone(); println!("raw_json_get() - X-Span-ID: {:?}", context.get().0.clone()); Box::new(futures::failed("Generic failure".into())) diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs index c273afb2df3b..762cd4e49116 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs @@ -73,7 +73,7 @@ fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result where F: Future + 'static { - client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, base_path: String, } @@ -184,7 +184,7 @@ impl Client { handle: Handle, base_path: &str, protocol: Option<&'static str>, - connector_fn: Box C + Send + Sync>, + connector_fn: Box C + Send + Sync>, ) -> Result, ClientInitError> where C: hyper::client::Connect + hyper::client::Service, @@ -211,7 +211,7 @@ impl Client { /// should be mentioned here. #[deprecated(note="Use try_new_with_client_service instead")] pub fn try_new_with_hyper_client( - hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, handle: Handle, base_path: &str ) -> Result, ClientInitError> @@ -229,7 +229,7 @@ impl Client where /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. /// /// This allows adding custom wrappers around the underlying transport, for example for logging. - pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, handle: Handle, base_path: &str) -> Result, ClientInitError> @@ -245,7 +245,7 @@ impl Api for Client where F: Future + 'static, C: Has { - fn dummy_get(&self, context: &C) -> Box> { + fn dummy_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/dummy", self.base_path @@ -268,7 +268,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -280,7 +280,7 @@ impl Api for Client where future::ok( DummyGetResponse::Success ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -299,14 +299,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn dummy_put(&self, param_nested_response: models::InlineObject, context: &C) -> Box> { + fn dummy_put(&self, param_nested_response: models::InlineObject, context: &C) -> Box> { let mut uri = format!( "{}/dummy", self.base_path @@ -333,7 +333,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::DUMMY_PUT.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -345,7 +345,7 @@ impl Api for Client where future::ok( DummyPutResponse::Success ) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -364,14 +364,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn file_response_get(&self, context: &C) -> Box> { + fn file_response_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/file_response", self.base_path @@ -394,7 +394,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -416,7 +416,7 @@ impl Api for Client where .map(move |body| { FileResponseGetResponse::Success(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -435,14 +435,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn html_post(&self, param_body: String, context: &C) -> Box> { + fn html_post(&self, param_body: String, context: &C) -> Box> { let mut uri = format!( "{}/html", self.base_path @@ -469,7 +469,7 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::HTML_POST.clone())); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -490,7 +490,7 @@ impl Api for Client where .map(move |body| { HtmlPostResponse::Success(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -509,14 +509,14 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) } - fn raw_json_get(&self, context: &C) -> Box> { + fn raw_json_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/raw_json", self.base_path @@ -539,7 +539,7 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Get, uri); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &dyn Has).get().0.clone())); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -561,7 +561,7 @@ impl Api for Client where .map(move |body| { RawJsonGetResponse::Success(body) }) - ) as Box> + ) as Box> }, code => { let headers = response.headers().clone(); @@ -580,7 +580,7 @@ impl Api for Client where Err(e) => Cow::from(format!("", e)), }))) ) - ) as Box> + ) as Box> } } })) @@ -611,7 +611,7 @@ impl From for ClientInitError { impl fmt::Display for ClientInitError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - (self as &fmt::Debug).fmt(f) + (self as &dyn fmt::Debug).fmt(f) } } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs index d6e3acc1da78..86f6b38debaa 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs @@ -88,19 +88,19 @@ pub enum RawJsonGetResponse { pub trait Api { /// A dummy endpoint to make the spec valid. - fn dummy_get(&self, context: &C) -> Box>; + fn dummy_get(&self, context: &C) -> Box>; - fn dummy_put(&self, nested_response: models::InlineObject, context: &C) -> Box>; + fn dummy_put(&self, nested_response: models::InlineObject, context: &C) -> Box>; /// Get a file - fn file_response_get(&self, context: &C) -> Box>; + fn file_response_get(&self, context: &C) -> Box>; /// Test HTML handling - fn html_post(&self, body: String, context: &C) -> Box>; + fn html_post(&self, body: String, context: &C) -> Box>; /// Get an arbitrary JSON blob. - fn raw_json_get(&self, context: &C) -> Box>; + fn raw_json_get(&self, context: &C) -> Box>; } @@ -108,19 +108,19 @@ pub trait Api { pub trait ApiNoContext { /// A dummy endpoint to make the spec valid. - fn dummy_get(&self) -> Box>; + fn dummy_get(&self) -> Box>; - fn dummy_put(&self, nested_response: models::InlineObject) -> Box>; + fn dummy_put(&self, nested_response: models::InlineObject) -> Box>; /// Get a file - fn file_response_get(&self) -> Box>; + fn file_response_get(&self) -> Box>; /// Test HTML handling - fn html_post(&self, body: String) -> Box>; + fn html_post(&self, body: String) -> Box>; /// Get an arbitrary JSON blob. - fn raw_json_get(&self) -> Box>; + fn raw_json_get(&self) -> Box>; } @@ -139,27 +139,27 @@ impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { /// A dummy endpoint to make the spec valid. - fn dummy_get(&self) -> Box> { + fn dummy_get(&self) -> Box> { self.api().dummy_get(&self.context()) } - fn dummy_put(&self, nested_response: models::InlineObject) -> Box> { + fn dummy_put(&self, nested_response: models::InlineObject) -> Box> { self.api().dummy_put(nested_response, &self.context()) } /// Get a file - fn file_response_get(&self) -> Box> { + fn file_response_get(&self) -> Box> { self.api().file_response_get(&self.context()) } /// Test HTML handling - fn html_post(&self, body: String) -> Box> { + fn html_post(&self, body: String) -> Box> { self.api().html_post(body, &self.context()) } /// Get an arbitrary JSON blob. - fn raw_json_get(&self) -> Box> { + fn raw_json_get(&self) -> Box> { self.api().raw_json_get(&self.context()) } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs index addb74304039..93d212812843 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -115,7 +115,7 @@ where type Request = (Request, C); type Response = Response; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, (req, mut context): Self::Request) -> Self::Future { let api_impl = self.api_impl.clone(); @@ -133,7 +133,7 @@ where Box::new(api_impl.dummy_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -157,7 +157,7 @@ where } )) }} - }) as Box> + }) as Box> }, // DummyPut - PUT /dummy @@ -166,7 +166,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let mut unused_elements = Vec::new(); @@ -189,7 +189,7 @@ where Box::new(api_impl.dummy_put(param_nested_response, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); if !unused_elements.is_empty() { response.headers_mut().set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); @@ -220,7 +220,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter nested_response: {}", e)))), } }) - ) as Box> + ) as Box> }, // FileResponseGet - GET /file_response @@ -230,7 +230,7 @@ where Box::new(api_impl.file_response_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -260,7 +260,7 @@ where } )) }} - }) as Box> + }) as Box> }, // HtmlPost - POST /html @@ -269,7 +269,7 @@ where // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. Box::new(body.concat2() - .then(move |result| -> Box> { + .then(move |result| -> Box> { match result { Ok(body) => { let param_body: Option = if !body.is_empty() { @@ -284,7 +284,7 @@ where Box::new(api_impl.html_post(param_body, &context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -317,7 +317,7 @@ where Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) - ) as Box> + ) as Box> }, // RawJsonGet - GET /raw_json @@ -327,7 +327,7 @@ where Box::new(api_impl.raw_json_get(&context) .then(move |result| { let mut response = Response::new(); - response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + response.headers_mut().set(XSpanId((&context as &dyn Has).get().0.to_string())); match result { Ok(rsp) => match rsp { @@ -357,10 +357,10 @@ where } )) }} - }) as Box> + }) as Box> }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } } From 3100f8c4e42d3e19081603377743a74c9a1b726c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 28 Dec 2019 08:59:29 +0800 Subject: [PATCH 28/28] fix kotlin client uppercase enum script --- ...num.sh => kotlin-client-uppercase-enum.sh} | 2 +- .../.openapi-generator/VERSION | 2 +- .../kotlin-uppercase-enum/build.gradle | 10 +++---- .../org/openapitools/client/apis/EnumApi.kt | 22 +++++++++++---- .../client/infrastructure/ApiAbstractions.kt | 6 ++-- .../client/infrastructure/ApiClient.kt | 7 ++++- .../client/infrastructure/ByteArrayAdapter.kt | 2 +- .../client/infrastructure/Errors.kt | 28 ++----------------- .../infrastructure/OffsetDateTimeAdapter.kt | 19 +++++++++++++ .../client/infrastructure/RequestConfig.kt | 2 +- .../infrastructure/ResponseExtensions.kt | 2 +- .../client/infrastructure/Serializer.kt | 9 ++++-- 12 files changed, 63 insertions(+), 48 deletions(-) rename bin/{kotlin-uppercase-enum.sh => kotlin-client-uppercase-enum.sh} (89%) create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt diff --git a/bin/kotlin-uppercase-enum.sh b/bin/kotlin-client-uppercase-enum.sh similarity index 89% rename from bin/kotlin-uppercase-enum.sh rename to bin/kotlin-client-uppercase-enum.sh index 49f690283f41..7f456fc3a068 100755 --- a/bin/kotlin-uppercase-enum.sh +++ b/bin/kotlin-client-uppercase-enum.sh @@ -31,4 +31,4 @@ ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i m java ${JAVA_OPTS} -jar ${executable} ${ags} -cp CI/samples.ci/client/petstore/kotlin-uppercase-enum/pom.xml samples/client/petstore/kotlin-uppercase-enum/pom.xml \ No newline at end of file +#cp CI/samples.ci/client/petstore/kotlin-uppercase-enum/pom.xml samples/client/petstore/kotlin-uppercase-enum/pom.xml diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION index c3a2c7076fa8..58592f031f65 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/build.gradle b/samples/client/petstore/kotlin-uppercase-enum/build.gradle index c09f7912cfe1..ed72aa19d9ef 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/build.gradle +++ b/samples/client/petstore/kotlin-uppercase-enum/build.gradle @@ -7,7 +7,7 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.61' repositories { mavenCentral() @@ -30,8 +30,8 @@ test { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - compile "com.squareup.moshi:moshi-kotlin:1.8.0" - compile "com.squareup.moshi:moshi-adapters:1.8.0" - compile "com.squareup.okhttp3:okhttp:4.0.1" - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + compile "com.squareup.moshi:moshi-kotlin:1.9.2" + compile "com.squareup.moshi:moshi-adapters:1.9.2" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index dcd526a91c3a..8ed4de2768fe 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -31,11 +31,15 @@ class EnumApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl * Get enums * * @return PetEnum + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getEnum() : PetEnum { val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() + val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, @@ -43,17 +47,23 @@ class EnumApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as PetEnum + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as PetEnum ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode) + } } } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index f97cb88d2338..ef7a8f1e1a62 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -1,12 +1,12 @@ package org.openapitools.client.infrastructure -typealias MultiValueMap = Map> +typealias MultiValueMap = MutableMap> fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4ba5be35baaf..d1d58ffd0e96 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,5 +1,6 @@ package org.openapitools.client.infrastructure +import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody @@ -107,7 +108,7 @@ open class ApiClient(val baseUrl: String) { val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) RequestMethod.GET -> Request.Builder().url(url) RequestMethod.HEAD -> Request.Builder().url(url).head() RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) @@ -150,4 +151,8 @@ open class ApiClient(val baseUrl: String) { ) } } + + protected inline fun parseDateToQueryString(value : T): String { + return value.toString() + } } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt index 617ac3fe9069..ff5e2a81ee8c 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -9,4 +9,4 @@ class ByteArrayAdapter { @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt index 2f3b0157ba70..41f529a5f36b 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure import java.lang.RuntimeException -open class ClientException : RuntimeException { - - /** - * Constructs an [ClientException] with no detail message. - */ - constructor() : super() - - /** - * Constructs an [ClientException] with the specified detail message. - - * @param message the detail message. - */ - constructor(message: kotlin.String) : super(message) +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 123L } } -open class ServerException : RuntimeException { - - /** - * Constructs an [ServerException] with no detail message. - */ - constructor() : super() - - /** - * Constructs an [ServerException] with the specified detail message. - - * @param message the detail message. - */ - constructor(message: kotlin.String) : super(message) +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 456L diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 000000000000..87437871a31e --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter { + @ToJson + fun toJson(value: OffsetDateTime): String { + return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): OffsetDateTime { + return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 53e689237d71..9c22257e223a 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -12,5 +12,5 @@ data class RequestConfig( val method: RequestMethod, val path: String, val headers: MutableMap = mutableMapOf(), - val query: Map> = mapOf() + val query: MutableMap> = mutableMapOf() ) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt index 934962ec6b50..69b562becb07 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -20,4 +20,4 @@ val Response.isClientError : Boolean get() = this.code in 400..499 /** * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code */ -val Response.isServerError : Boolean get() = this.code in 500..999 \ No newline at end of file +val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 7c5a353e0f7f..697559b2ec16 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -7,12 +7,17 @@ import java.util.Date object Serializer { @JvmStatic - val moshi: Moshi = Moshi.Builder() + val moshiBuilder: Moshi.Builder = Moshi.Builder() .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) .add(KotlinJsonAdapterFactory()) - .build() + + @JvmStatic + val moshi: Moshi by lazy { + moshiBuilder.build() + } }