mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-07 09:56:09 +00:00
Compare commits
672 Commits
swagger-co
...
v2.0.13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e95362542 | ||
|
|
e92d4e6258 | ||
|
|
641aada8a8 | ||
|
|
c8c59fe93a | ||
|
|
450746f94d | ||
|
|
827f03f272 | ||
|
|
de6f949c64 | ||
|
|
82cdec7197 | ||
|
|
ab7e152877 | ||
|
|
0ec694940e | ||
|
|
5a4af29f0e | ||
|
|
d72578e492 | ||
|
|
405e8b1786 | ||
|
|
8909bd4ba1 | ||
|
|
e9af56eb87 | ||
|
|
ee361e9ae2 | ||
|
|
a580c38fed | ||
|
|
668059a2c4 | ||
|
|
31a53d5842 | ||
|
|
e4e768062a | ||
|
|
3192240dc0 | ||
|
|
2d9a011f82 | ||
|
|
476aed7f5b | ||
|
|
09580c2d87 | ||
|
|
48a07d031e | ||
|
|
7414a9d56a | ||
|
|
91e08b5524 | ||
|
|
8abb6521b4 | ||
|
|
6394e5448c | ||
|
|
2f5651d988 | ||
|
|
a7afbd106f | ||
|
|
d67774d90f | ||
|
|
07f36d3500 | ||
|
|
cc1bcf7989 | ||
|
|
096653daf7 | ||
|
|
773a6b50eb | ||
|
|
bb3bd0d357 | ||
|
|
16eb944d2f | ||
|
|
74df3ab4f7 | ||
|
|
d18e75bbf1 | ||
|
|
b7cffe4121 | ||
|
|
5180b09acb | ||
|
|
6fad954147 | ||
|
|
3b1eac0e50 | ||
|
|
7715dbf0f2 | ||
|
|
bbb682c13d | ||
|
|
42a8514c22 | ||
|
|
ffca1e2969 | ||
|
|
1aa65bc14b | ||
|
|
1f46819b61 | ||
|
|
5892fdb2bb | ||
|
|
32d792de01 | ||
|
|
82646f34ca | ||
|
|
4f25ea7e6b | ||
|
|
146f5c4c2a | ||
|
|
6b9cba1411 | ||
|
|
a413efc3ca | ||
|
|
6c8aed5dcc | ||
|
|
52905fd6de | ||
|
|
f8807c7440 | ||
|
|
755591f9e5 | ||
|
|
896d0d4b54 | ||
|
|
cf95d4e59e | ||
|
|
b503994577 | ||
|
|
569f77b512 | ||
|
|
773fb89acb | ||
|
|
890b1ee3c2 | ||
|
|
bfb5b721c5 | ||
|
|
9b6995f28c | ||
|
|
1b8bb4a0a6 | ||
|
|
7f35b875a4 | ||
|
|
b5d2ed0322 | ||
|
|
a7b78a6210 | ||
|
|
90c14fd116 | ||
|
|
830ad87fcb | ||
|
|
3a8928f869 | ||
|
|
f883c5e77c | ||
|
|
8cc83d180d | ||
|
|
65cc529ec6 | ||
|
|
9686ceed2d | ||
|
|
2c73efa536 | ||
|
|
800312361f | ||
|
|
59897c19a9 | ||
|
|
08a3e9e881 | ||
|
|
1e2f7cb1f8 | ||
|
|
17c38115e6 | ||
|
|
0ee6531fcd | ||
|
|
87c12c155d | ||
|
|
b373e4312e | ||
|
|
0d40a53e06 | ||
|
|
c779905163 | ||
|
|
59da358eb5 | ||
|
|
b815ffa403 | ||
|
|
27a8be2381 | ||
|
|
d5b53a1778 | ||
|
|
01b745c366 | ||
|
|
af96f33e6f | ||
|
|
2dda926cb6 | ||
|
|
8fb6fc847c | ||
|
|
11d1b8fcd4 | ||
|
|
5076d76a74 | ||
|
|
044621b325 | ||
|
|
5a3426dee6 | ||
|
|
b6b28bb1a2 | ||
|
|
189569518d | ||
|
|
731fddbc30 | ||
|
|
c4990b773d | ||
|
|
d56c5e3b44 | ||
|
|
6f1a4a2f82 | ||
|
|
a96d49f045 | ||
|
|
ee19dfadf1 | ||
|
|
2c5524476e | ||
|
|
7bde2ffd6e | ||
|
|
f17654cd96 | ||
|
|
0a47fc23a3 | ||
|
|
13eb435138 | ||
|
|
329f2817c2 | ||
|
|
609cef0b65 | ||
|
|
cfa1f1a3c1 | ||
|
|
e851262875 | ||
|
|
7956ccc979 | ||
|
|
13bc111bd6 | ||
|
|
cc0a30edf8 | ||
|
|
0ffc6cb7a0 | ||
|
|
6a2f53f07d | ||
|
|
930b1ea0ea | ||
|
|
8e8e5308b6 | ||
|
|
8f71d3fc50 | ||
|
|
a123d8f066 | ||
|
|
ea15cad8d5 | ||
|
|
e4a4f25f22 | ||
|
|
93677742d3 | ||
|
|
389765c113 | ||
|
|
5ef5fa7296 | ||
|
|
4e408e6d80 | ||
|
|
a140ea2b9d | ||
|
|
b920881490 | ||
|
|
56d5167a27 | ||
|
|
ddf81948a8 | ||
|
|
6652028d71 | ||
|
|
c9fccc5c75 | ||
|
|
f766937ac7 | ||
|
|
54f0823ec4 | ||
|
|
5f61d20610 | ||
|
|
7ed2df2722 | ||
|
|
a8a2a41315 | ||
|
|
676283875b | ||
|
|
4f95550977 | ||
|
|
7056081605 | ||
|
|
c90083855f | ||
|
|
2f997e6b29 | ||
|
|
8ad07d069c | ||
|
|
51e29cdfaf | ||
|
|
811425a15f | ||
|
|
9ee361df5b | ||
|
|
c1df192f09 | ||
|
|
7d6660d56c | ||
|
|
450b3c7ed5 | ||
|
|
e1e95fc1d2 | ||
|
|
8365270134 | ||
|
|
33163cd253 | ||
|
|
2b04a5a127 | ||
|
|
baa0a45537 | ||
|
|
6747e3eb0b | ||
|
|
bad8d7c4b3 | ||
|
|
2610ac7fc3 | ||
|
|
e2730ae34e | ||
|
|
beeeb133e6 | ||
|
|
01dc29d789 | ||
|
|
21085b472a | ||
|
|
5483ba5ae7 | ||
|
|
4a50bb3183 | ||
|
|
daeb964bfc | ||
|
|
ad4bf57535 | ||
|
|
83ff341e5e | ||
|
|
701d4c15a9 | ||
|
|
01ff7be020 | ||
|
|
a7bf8b6314 | ||
|
|
c386edb2e4 | ||
|
|
9e12191a64 | ||
|
|
feb6c188d3 | ||
|
|
1e245583c9 | ||
|
|
0e03509cbc | ||
|
|
3bf486e49d | ||
|
|
2497e3a8cf | ||
|
|
d798725d9e | ||
|
|
f0517880e7 | ||
|
|
dd68c31fb4 | ||
|
|
f6622fbb59 | ||
|
|
aa1fbb680b | ||
|
|
93067a0ce0 | ||
|
|
5a064d6bad | ||
|
|
feb5a2ff3b | ||
|
|
73a70a65ff | ||
|
|
3b81d81143 | ||
|
|
74543f75f9 | ||
|
|
d9d6cc1e76 | ||
|
|
a3f5c0c688 | ||
|
|
17b63b2be8 | ||
|
|
558a9cbf64 | ||
|
|
021f269d9d | ||
|
|
7f73007ec4 | ||
|
|
1a1bfd2c7c | ||
|
|
90b34333f5 | ||
|
|
fa59f168a7 | ||
|
|
9102a333e3 | ||
|
|
43bc3f5be2 | ||
|
|
fbc09aa77b | ||
|
|
03619b19a1 | ||
|
|
422e79dd01 | ||
|
|
b9a60649a8 | ||
|
|
a06dd72989 | ||
|
|
932dc843f9 | ||
|
|
c45c8d251a | ||
|
|
ea6a9305be | ||
|
|
c82a5c8aaa | ||
|
|
8135cd65dc | ||
|
|
db68a3acbd | ||
|
|
0628c63b15 | ||
|
|
4d05b5d81f | ||
|
|
24af6a00c6 | ||
|
|
fd72c1b9f1 | ||
|
|
885cd36165 | ||
|
|
a31780e08f | ||
|
|
dc3a4b4eb5 | ||
|
|
c1e018947d | ||
|
|
4a3321f253 | ||
|
|
c9614ab795 | ||
|
|
500262bd03 | ||
|
|
4467fe66c6 | ||
|
|
981ce3d990 | ||
|
|
936387d1df | ||
|
|
d14f74b82c | ||
|
|
85b1fb71c2 | ||
|
|
9e8f817a6b | ||
|
|
697f6dc7c7 | ||
|
|
d038ef4799 | ||
|
|
3a2d7adc35 | ||
|
|
0e8274ff3b | ||
|
|
a335fe008d | ||
|
|
251384bb47 | ||
|
|
54ec7f2bb2 | ||
|
|
2199d08e72 | ||
|
|
e9fa4434f2 | ||
|
|
154b2fdeca | ||
|
|
cf05602924 | ||
|
|
9a73eb8994 | ||
|
|
181e7a8b55 | ||
|
|
6635616826 | ||
|
|
71426e58a3 | ||
|
|
00d279ccd5 | ||
|
|
a4cd839c1e | ||
|
|
4354002bce | ||
|
|
106e2b7cb9 | ||
|
|
8443e7a749 | ||
|
|
3f3471997e | ||
|
|
90fbbec405 | ||
|
|
384ac98295 | ||
|
|
53f1394c25 | ||
|
|
5eff3fd976 | ||
|
|
f4c859aede | ||
|
|
65f2ec1f79 | ||
|
|
c3cb548fb3 | ||
|
|
996e605008 | ||
|
|
92ac02e6c6 | ||
|
|
ffc6a2fc9e | ||
|
|
36bf178947 | ||
|
|
a757416a0e | ||
|
|
f167959a38 | ||
|
|
e8e8c18c8f | ||
|
|
e91df944cc | ||
|
|
cc4fecb217 | ||
|
|
2443d3d91b | ||
|
|
f2f33b98f7 | ||
|
|
184a9d0d5c | ||
|
|
90aa2ab4eb | ||
|
|
2fab0b46c8 | ||
|
|
bff8736889 | ||
|
|
37e5571965 | ||
|
|
6c3935f7ea | ||
|
|
dbf42de407 | ||
|
|
900fbe6e75 | ||
|
|
fe4af50fb0 | ||
|
|
81c103b12d | ||
|
|
023013b6fe | ||
|
|
dfdd8cac94 | ||
|
|
d30441dd27 | ||
|
|
bd565be660 | ||
|
|
ad81434310 | ||
|
|
965df0bc2a | ||
|
|
cb1c36721c | ||
|
|
fede9e97e4 | ||
|
|
617baa29cd | ||
|
|
645109111e | ||
|
|
24aa603230 | ||
|
|
8b8a956155 | ||
|
|
5e801dd1d7 | ||
|
|
98200e6b39 | ||
|
|
f3405bcf29 | ||
|
|
1724c9328e | ||
|
|
025502efad | ||
|
|
397ebd4bdb | ||
|
|
6adf368c08 | ||
|
|
871e0e30f1 | ||
|
|
07ab7d98a6 | ||
|
|
69d4c2a27b | ||
|
|
0b4fa11486 | ||
|
|
7929dbfee1 | ||
|
|
73b234fd23 | ||
|
|
df333fdfb5 | ||
|
|
99c292a7ad | ||
|
|
8cd540e2e1 | ||
|
|
9bef2a8ac6 | ||
|
|
e3ac63da93 | ||
|
|
958206c469 | ||
|
|
98f1941b30 | ||
|
|
812dc0f528 | ||
|
|
9fa5737f54 | ||
|
|
0188c719d0 | ||
|
|
45ac101779 | ||
|
|
a75a406e05 | ||
|
|
80b031710e | ||
|
|
87b1d71f72 | ||
|
|
9a86b1df8b | ||
|
|
b86eb53256 | ||
|
|
9f5be1cf5a | ||
|
|
a1da95c9a5 | ||
|
|
cb422950f8 | ||
|
|
af5f8909a6 | ||
|
|
0a7e606650 | ||
|
|
c47e553425 | ||
|
|
7659ab5a47 | ||
|
|
a31ae97ea0 | ||
|
|
3cbf2abc5c | ||
|
|
d92294695d | ||
|
|
d7e93cbda9 | ||
|
|
a9e0635d31 | ||
|
|
f22dbc510d | ||
|
|
16aa731867 | ||
|
|
e1f295398e | ||
|
|
d00c5d0ad8 | ||
|
|
29a132496e | ||
|
|
c032b3c2d4 | ||
|
|
68ce5d78f9 | ||
|
|
70fef15f81 | ||
|
|
7b651dedcd | ||
|
|
a6af380833 | ||
|
|
b0993379ee | ||
|
|
7e7005abe2 | ||
|
|
55cf01d9f7 | ||
|
|
7354d6722f | ||
|
|
8e7c3b7164 | ||
|
|
c33358d48f | ||
|
|
ea541a6cf7 | ||
|
|
9a067c7821 | ||
|
|
67d48e4e35 | ||
|
|
1b89879a47 | ||
|
|
79c4a09181 | ||
|
|
ea35f2cf0e | ||
|
|
828607c67b | ||
|
|
64ffd7be36 | ||
|
|
4003a0d61c | ||
|
|
631b44fee2 | ||
|
|
c2c1bbc417 | ||
|
|
10c5a8346f | ||
|
|
c0c2f0bebc | ||
|
|
85e8ead0cf | ||
|
|
2e0ac79f0c | ||
|
|
b7dae2a846 | ||
|
|
cf470009ba | ||
|
|
434102550f | ||
|
|
00ac23c462 | ||
|
|
402266e65b | ||
|
|
852eb0bf49 | ||
|
|
84e17c7707 | ||
|
|
fb4a6c968c | ||
|
|
b3076d95b2 | ||
|
|
a2bff39427 | ||
|
|
0d82786715 | ||
|
|
17a433fb59 | ||
|
|
55ce19a233 | ||
|
|
59d74a83af | ||
|
|
dea4b746b7 | ||
|
|
61f5031f8a | ||
|
|
5d60632aa6 | ||
|
|
fe30ed3580 | ||
|
|
7370354535 | ||
|
|
b2890a00a3 | ||
|
|
f329b94625 | ||
|
|
62352a126e | ||
|
|
16be3a7f54 | ||
|
|
1de97d204d | ||
|
|
2bc8cc01a5 | ||
|
|
6266a94857 | ||
|
|
bd19ef489c | ||
|
|
a7b9a930e5 | ||
|
|
39659d8c36 | ||
|
|
22ebb85c35 | ||
|
|
30109204d9 | ||
|
|
3cd48e17d2 | ||
|
|
da5c7a77c3 | ||
|
|
43708f6395 | ||
|
|
29cec989b2 | ||
|
|
93c0134da9 | ||
|
|
5840120124 | ||
|
|
9d014e89bc | ||
|
|
15a3e15f2f | ||
|
|
95d77807c2 | ||
|
|
28221b5f5a | ||
|
|
c9397ce1e7 | ||
|
|
a1f8bcd0ae | ||
|
|
f1f466b69f | ||
|
|
df48f4d8a9 | ||
|
|
4c6cea87f1 | ||
|
|
828cc5d1bf | ||
|
|
59328ae65a | ||
|
|
6d76738427 | ||
|
|
0f3087cbd6 | ||
|
|
4c19ff30ed | ||
|
|
a38fbe8d21 | ||
|
|
8c1539ab24 | ||
|
|
af3b3eb323 | ||
|
|
c8f6d8a7f2 | ||
|
|
cf52e7d788 | ||
|
|
8eb34c5141 | ||
|
|
2a9cf7c06d | ||
|
|
f4cd02283b | ||
|
|
99cca5d249 | ||
|
|
5d8877a679 | ||
|
|
d18cc2d3e4 | ||
|
|
0ae00dc79c | ||
|
|
e1bfdfbc5e | ||
|
|
c2d332ce20 | ||
|
|
35a4039955 | ||
|
|
b7368654f1 | ||
|
|
87bad7b36d | ||
|
|
25837e3367 | ||
|
|
61a9cc6e6a | ||
|
|
8b5e638409 | ||
|
|
69fe17380c | ||
|
|
98ca711e44 | ||
|
|
b9ec912698 | ||
|
|
bc0fd47522 | ||
|
|
3e527e3141 | ||
|
|
ed423a4a8e | ||
|
|
f88b500ee8 | ||
|
|
32d645572c | ||
|
|
4a6ab18b73 | ||
|
|
8ec999089a | ||
|
|
1a07c0796f | ||
|
|
d4baff8d90 | ||
|
|
8aa414360e | ||
|
|
3b7de86b99 | ||
|
|
feb6c5928f | ||
|
|
d9c3277f9e | ||
|
|
1d33b33f28 | ||
|
|
e51179ed0f | ||
|
|
3a8db77200 | ||
|
|
55bb1f2a76 | ||
|
|
cb534047ee | ||
|
|
735f5c61b3 | ||
|
|
73a2fc216e | ||
|
|
46323fae7c | ||
|
|
7fde848680 | ||
|
|
aef4190624 | ||
|
|
4be326152f | ||
|
|
51437245e4 | ||
|
|
36f4239c93 | ||
|
|
87ebc8a7f3 | ||
|
|
a4afa9bac2 | ||
|
|
7af8b0de18 | ||
|
|
66dd67597c | ||
|
|
f5fae2df48 | ||
|
|
adbadfe500 | ||
|
|
f7b1e25453 | ||
|
|
a0b0e7bcb7 | ||
|
|
6aa5b8f089 | ||
|
|
e9ef124f59 | ||
|
|
5d2ae3d353 | ||
|
|
031dd20072 | ||
|
|
67ce62c622 | ||
|
|
b4efa892a1 | ||
|
|
ddc94bcb7c | ||
|
|
bee14e82b2 | ||
|
|
4765c56b2a | ||
|
|
0b7db0ce2d | ||
|
|
68436f6cbe | ||
|
|
444de037bc | ||
|
|
ce1b4ec347 | ||
|
|
b65de5466c | ||
|
|
58cfacc4cf | ||
|
|
cbb61b1002 | ||
|
|
62c3a70843 | ||
|
|
e0d8a75441 | ||
|
|
687eff49a5 | ||
|
|
9f2a90722b | ||
|
|
90b5490f00 | ||
|
|
0bdf466e32 | ||
|
|
a8109930ed | ||
|
|
a3f08e87fd | ||
|
|
e65e5a730d | ||
|
|
8d4afdf5ad | ||
|
|
0a7f8f1055 | ||
|
|
93b11410a9 | ||
|
|
667b1cf7a5 | ||
|
|
93d81b84dc | ||
|
|
3f55736f33 | ||
|
|
91c2af2a98 | ||
|
|
548b86aef1 | ||
|
|
7baae391eb | ||
|
|
22783f8f0a | ||
|
|
55d60aca50 | ||
|
|
dd88a6b0ac | ||
|
|
b0c15d1c9b | ||
|
|
7a379a7b40 | ||
|
|
674fdff35b | ||
|
|
94919895bc | ||
|
|
c4e2515c8f | ||
|
|
85a0a728de | ||
|
|
89ec4010e2 | ||
|
|
b3d5b49e90 | ||
|
|
dbfeb59820 | ||
|
|
3ce7dbd960 | ||
|
|
cef535f380 | ||
|
|
3d1678a087 | ||
|
|
ac9cff08d4 | ||
|
|
5671bcf746 | ||
|
|
31fa05599e | ||
|
|
f20748f0d5 | ||
|
|
155251951b | ||
|
|
e2dbe61adf | ||
|
|
236a9697ad | ||
|
|
2f93e37645 | ||
|
|
56abce3fbd | ||
|
|
b6b80474b7 | ||
|
|
bab5973dd0 | ||
|
|
a29c580205 | ||
|
|
dec7bdfb82 | ||
|
|
b6a85a4b2e | ||
|
|
611cc6075b | ||
|
|
1e8c4668b7 | ||
|
|
84fb24ada5 | ||
|
|
1077e48e7e | ||
|
|
ad5d44769b | ||
|
|
e2c383bd80 | ||
|
|
44d018b642 | ||
|
|
cec3fa5810 | ||
|
|
d6cf7fc9aa | ||
|
|
256e746364 | ||
|
|
0504f68b41 | ||
|
|
21265454ab | ||
|
|
cdc1bbc133 | ||
|
|
2579ed311a | ||
|
|
cdfbedb0ea | ||
|
|
46249530a3 | ||
|
|
7881786fe8 | ||
|
|
5a9979633c | ||
|
|
3d379c82d1 | ||
|
|
77141cd55a | ||
|
|
26bcc80ae3 | ||
|
|
59cd5380aa | ||
|
|
c3b36c6944 | ||
|
|
f85c06628b | ||
|
|
7c55dddf43 | ||
|
|
374c68d8da | ||
|
|
de1ef1dde3 | ||
|
|
f5a69a5a3b | ||
|
|
5afd4b260a | ||
|
|
b648f84980 | ||
|
|
bc28ee97da | ||
|
|
a647576c97 | ||
|
|
45e4c1a53d | ||
|
|
6e4e375589 | ||
|
|
3e5e85509d | ||
|
|
92c0fc5afb | ||
|
|
5e90e2a24a | ||
|
|
53c612c13b | ||
|
|
2a1b1817c5 | ||
|
|
e9a8a8d755 | ||
|
|
9a6392a758 | ||
|
|
0fbae2736d | ||
|
|
85a4aacefa | ||
|
|
5189a85966 | ||
|
|
4d15674803 | ||
|
|
274b9e7c43 | ||
|
|
cf53a24271 | ||
|
|
4c0cd15a40 | ||
|
|
6829014393 | ||
|
|
2647f96c81 | ||
|
|
bbcdee8b28 | ||
|
|
8d79437c8d | ||
|
|
a4c9e26018 | ||
|
|
a38fc6eb06 | ||
|
|
b6a070e604 | ||
|
|
e9146234c7 | ||
|
|
1e73944722 | ||
|
|
f37f284605 | ||
|
|
a7156e6f00 | ||
|
|
7c812c2426 | ||
|
|
2dcfebea98 | ||
|
|
812213164f | ||
|
|
4b43e70555 | ||
|
|
5662891d62 | ||
|
|
a7f38e40c4 | ||
|
|
66f98ebaa8 | ||
|
|
3c53c13685 | ||
|
|
ae271fb57a | ||
|
|
53721239f4 | ||
|
|
6636acf2d3 | ||
|
|
b7ed61b8f9 | ||
|
|
02b5a929ac | ||
|
|
5482cb7822 | ||
|
|
6113826180 | ||
|
|
de1a4059b1 | ||
|
|
267ecec8f2 | ||
|
|
07addb366e | ||
|
|
21848c3cf3 | ||
|
|
45745f6f14 | ||
|
|
f7a929bd02 | ||
|
|
cb55d38a38 | ||
|
|
5eb1372e08 | ||
|
|
73b15dce53 | ||
|
|
9227d7b046 | ||
|
|
de0dffe83f | ||
|
|
3550309544 | ||
|
|
153de3077e | ||
|
|
bbb7e7138c | ||
|
|
c777640f04 | ||
|
|
6df5008310 | ||
|
|
37efc32374 | ||
|
|
275098a8ef | ||
|
|
52a9195411 | ||
|
|
5f81594f03 | ||
|
|
f295fe698a | ||
|
|
8805a7acbb | ||
|
|
b4485b1196 | ||
|
|
a929fce3a0 | ||
|
|
f4c8dd9dec | ||
|
|
79f2be422b | ||
|
|
b92a84eed8 | ||
|
|
a50f0627f9 | ||
|
|
d6f5231e93 | ||
|
|
6a9ba75640 | ||
|
|
95f6b00704 | ||
|
|
00fce59737 | ||
|
|
384a549807 | ||
|
|
af41b43c56 | ||
|
|
b146310c1a | ||
|
|
7138a3f8c2 | ||
|
|
038402abb3 | ||
|
|
52587de715 | ||
|
|
5773626d53 | ||
|
|
2d45c80415 | ||
|
|
432965fa0e | ||
|
|
63f2075410 | ||
|
|
f1c9e6c64e | ||
|
|
05ccb75ebf | ||
|
|
58ce2a1298 | ||
|
|
7e823f879e | ||
|
|
9e3fc6603f | ||
|
|
aa162b9393 | ||
|
|
a33df3ac33 | ||
|
|
c0aecff3dc | ||
|
|
43d15d4d00 | ||
|
|
2633eb77e2 | ||
|
|
094a1f2040 | ||
|
|
fc7c8c6a8f | ||
|
|
404c5ab8c3 | ||
|
|
6db5c15037 | ||
|
|
94ab81c1a2 | ||
|
|
e2d8f97e13 | ||
|
|
9be7a3f53c |
17
.gitignore
vendored
17
.gitignore
vendored
@@ -9,5 +9,22 @@ version.properties
|
||||
lib/*
|
||||
build/*
|
||||
generated-files/*
|
||||
generated-code/*
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
/target
|
||||
/generated-files
|
||||
/nbactions.xml
|
||||
*.pyc
|
||||
__pycache__
|
||||
samples/server-generator/scalatra/output
|
||||
samples/server-generator/node/output/node_modules
|
||||
samples/server-generator/scalatra/target
|
||||
samples/server-generator/scalatra/output/.history
|
||||
|
||||
target
|
||||
.idea
|
||||
.lib
|
||||
atlassian-ide-plugin.xml
|
||||
.DS_Store
|
||||
|
||||
3
.travis.yml
Normal file
3
.travis.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
language: scala
|
||||
scala:
|
||||
- 2.10.2
|
||||
389
README.md
389
README.md
@@ -1,190 +1,237 @@
|
||||
# Swagger Client Code-Generator
|
||||
# Swagger Code Generator
|
||||
|
||||
[](https://travis-ci.org/wordnik/swagger-codegen)
|
||||
|
||||
## Overview
|
||||
This is a project to build the Swagger code-gen library which can be used to automatically
|
||||
generate client libraries from a Swagger-compliant server. It also contains a testing
|
||||
framework which allows the client library to query an API server and validate expected results
|
||||
You can find out more about both the spec and the framework at http://swagger.wordnik.com. For
|
||||
more information about Wordnik's APIs, please visit http://developer.wordnik.com.
|
||||
This is the swagger codegen project, which allows generation of client libraries automatically from a
|
||||
Swagger-compliant server. You can find out more about both the spec and the framework at
|
||||
http://swagger.wordnik.com. For more information about Wordnik's APIs, please visit http://developer.wordnik.com.
|
||||
|
||||
### Prerequisites
|
||||
You need the following installed and available in your $PATH:
|
||||
|
||||
<li>- Java 1.6 or greater (http://java.oracle.com)
|
||||
* [Java 1.7](http://java.oracle.com)
|
||||
|
||||
<li>- Apache ant 1.7 or greater (http://ant.apache.org/)
|
||||
Note! Some folks have had issues with OOM errors with java version "1.6.0_51". It's strongly suggested that you upgrade to 1.7!
|
||||
|
||||
<li>- Scala 2.x or greater (http://www.scala-lang.org/downloads)
|
||||
* [Apache maven 3.0.3 or greater](http://maven.apache.org/)
|
||||
|
||||
You also need to set an environment variable for SCALA_HOME:
|
||||
* [Scala 2.9.1](http://www.scala-lang.org)
|
||||
|
||||
* [sbt (only download if you're building on Windows)](http://www.scala-sbt.org/)
|
||||
|
||||
You also need to add the scala binary to your PATH.
|
||||
|
||||
After cloning the project, you need to build it from source with this command:
|
||||
|
||||
```
|
||||
./sbt assembly
|
||||
```
|
||||
|
||||
or for Windows...
|
||||
|
||||
```
|
||||
sbt assembly
|
||||
```
|
||||
|
||||
|
||||
### To generate a sample client library
|
||||
You can build a client against Wordnik's [petstore](http://petstore.swagger.wordnik.com) API as follows:
|
||||
|
||||
```
|
||||
./bin/scala-petstore.sh
|
||||
```
|
||||
|
||||
This will run the script in [samples/client/petstore/ScalaPetstoreCodegen.scala](https://github.com/wordnik/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) and create the client. You can then
|
||||
compile and run the client, as well as unit tests against it:
|
||||
|
||||
```
|
||||
cd samples/client/petstore/scala
|
||||
mvn package
|
||||
```
|
||||
|
||||
Other languages have petstore samples, too:
|
||||
```
|
||||
./bin/flash-petstore.sh
|
||||
./bin/java-petstore.sh
|
||||
./bin/objc-petstore.sh
|
||||
./bin/php-petstore.sh
|
||||
./bin/python-petstore.sh
|
||||
./bin/python3-petstore.sh
|
||||
./bin/ruby-petstore.sh
|
||||
```
|
||||
|
||||
### Generating libraries from your server
|
||||
It's just as easy--you can either run the default generators:
|
||||
|
||||
```
|
||||
./bin/runscala.sh com.wordnik.swagger.codegen.BasicScalaGenerator http://petstore.swagger.wordnik.com/api/api-docs special-key
|
||||
```
|
||||
|
||||
Replace `Scala` with `Flash`, `Java`, `Objc`, `PHP`, `Python`, `Python3`, `Ruby`.
|
||||
|
||||
You will probably want to override some of the defaults--like packages, etc. For doing this, just create a scala
|
||||
script with the overrides you want. Follow [ScalaPetstoreCodegen](https://github.com/wordnik/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) as an example:
|
||||
|
||||
For example, create `src/main/scala/MyCodegen.scala` with these contents:
|
||||
|
||||
```scala
|
||||
import com.wordnik.swagger.codegen.BasicScalaGenerator
|
||||
|
||||
object MyCodegen extends BasicScalaGenerator {
|
||||
def main(args: Array[String]) = generateClient(args)
|
||||
|
||||
// location of templates
|
||||
override def templateDir = "scala"
|
||||
|
||||
// where to write generated code
|
||||
override def destinationDir = "client/scala/src/main/scala"
|
||||
|
||||
// api invoker package
|
||||
override def invokerPackage = "com.myapi.client"
|
||||
|
||||
// package for models
|
||||
override def modelPackage = Some("com.myapi.client.model")
|
||||
|
||||
// package for api classes
|
||||
override def apiPackage = Some("com.myapi.client.api")
|
||||
|
||||
// supporting classes
|
||||
override def supportingFiles = List(
|
||||
("apiInvoker.mustache", destinationDir + java.io.File.separator + packageName.replaceAll("\\.", java.io.File.separator), "ApiInvoker.scala"),
|
||||
("pom.mustache", destinationDir, "pom.xml")
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
Now you can generate your client like this:
|
||||
|
||||
```
|
||||
./bin/runscala.sh src/main/scala/MyCodegen.scala http://my.api.com/resources.json super-secret-key
|
||||
```
|
||||
|
||||
w00t! Thanks to the scala interpretor, you didn't even need to recompile.
|
||||
|
||||
### Modifying the client library format
|
||||
Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen
|
||||
processes mustache templates with the [scalate](http://scalate.fusesource.org/) engine. You can modify our templates or
|
||||
make your own.
|
||||
|
||||
You can look at `src/main/resources/${your-language}` for examples. To make your own templates, create your own files
|
||||
and override the `templateDir` in your script to point to the right place. It actually is that easy.
|
||||
|
||||
### Where is Javascript???
|
||||
See our [javascript library](http://github.com/wordnik/swagger.js)--it's completely dynamic and doesn't require
|
||||
static code generation.
|
||||
|
||||
#### Generating a client from flat files (i.e. no remote server calls)
|
||||
If you don't want to call your server, you can save the swagger spec files into a directory and pass an argument
|
||||
to the code generator like this:
|
||||
|
||||
```
|
||||
-DfileMap=/path/to/files
|
||||
```
|
||||
|
||||
Or for example:
|
||||
```
|
||||
./bin/java-petstore-filemap.sh
|
||||
```
|
||||
|
||||
Which simple passes `-DfileMap=src/test/resources/petstore` as an argument. Great for creating libraries on your
|
||||
ci server... or while coding on an airplane.
|
||||
|
||||
### Validating your swagger spec
|
||||
You can use the validation tool to see that your server is creating a proper spec file. If you want to learn
|
||||
more about the spec file and format, please see [swagger-core](https://github.com/wordnik/swagger-core/wiki). This
|
||||
tool will read the server and generate a report of any violations of the spec. If there are violations, the
|
||||
client codegen and ui may not work correctly.
|
||||
|
||||
To validate an api and write output to ./swagger-errors.html:
|
||||
|
||||
```
|
||||
./bin/validate.sh http://petstore.swagger.wordnik.com/api/api-docs "specia-key" ./swagger-errors.html
|
||||
```
|
||||
|
||||
### Generating static api documentation
|
||||
If you need to make static pages or don't want the sandbox of the swagger-ui, you can use the codegen to build them. Remember, the engine is just using mustache templates--the output format is your call.
|
||||
|
||||
```
|
||||
./bin/static-docs.sh
|
||||
```
|
||||
|
||||
Will produce the output here:
|
||||
|
||||
```
|
||||
https://github.com/wordnik/swagger-codegen/tree/master/samples/docs/swagger-static-docs
|
||||
```
|
||||
|
||||
which is based on these templates:
|
||||
|
||||
```
|
||||
https://github.com/wordnik/swagger-codegen/tree/master/src/main/resources/swagger-static
|
||||
```
|
||||
|
||||
and looks like this
|
||||
|
||||

|
||||
|
||||
### To build a server stub
|
||||
|
||||
You can also use the codegen to generate a server for a couple different frameworks. Take a look here:
|
||||
|
||||
* [javascript node.js Server generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/node)
|
||||
|
||||
* [ruby sinatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/sinatra)
|
||||
|
||||
* [scala scalatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/scalatra)
|
||||
|
||||
* [java jax-rs generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/java-jaxrs)
|
||||
|
||||
|
||||
### Migrating from Swagger 1.1 to 1.2 format
|
||||
|
||||
If you've spent time hand-crafting your swagger spec files, you can use the [SpecConverter](https://github.com/wordnik/swagger-codegen/blob/master/src/main/scala/com/wordnik/swagger/codegen/SpecConverter.scala) to do the dirty work. For example:
|
||||
|
||||
```bash
|
||||
$ ./bin/update-spec.sh http://developer.wordnik.com/v4/resources.json wordnik-developer
|
||||
writing file wordnik-developer/api-docs
|
||||
calling: http://developer.wordnik.com/v4/account.json
|
||||
calling: http://developer.wordnik.com/v4/word.json
|
||||
calling: http://developer.wordnik.com/v4/words.json
|
||||
calling: http://developer.wordnik.com/v4/wordList.json
|
||||
calling: http://developer.wordnik.com/v4/wordLists.json
|
||||
writing file wordnik-developer/account
|
||||
writing file wordnik-developer/word
|
||||
writing file wordnik-developer/words
|
||||
writing file wordnik-developer/wordList
|
||||
writing file wordnik-developer/wordLists
|
||||
```
|
||||
|
||||
Will read the 1.1 spec from wordnik developer and write it into the folder called `wordnik-developer`.
|
||||
|
||||
<pre>
|
||||
export SCALA_HOME={PATH_TO_YOUR_SCALA_DEPLOYMENT}
|
||||
</pre>
|
||||
|
||||
### To build the codegen library
|
||||
|
||||
You can build the client with the following:
|
||||
This will create the swagger-codegen library from source.
|
||||
|
||||
````
|
||||
mvn package
|
||||
````
|
||||
```
|
||||
./sbt assembly
|
||||
```
|
||||
|
||||
### Other languages
|
||||
#### scala
|
||||
<pre>
|
||||
./bin/generate-scala-lib.sh http://petstore.swagger.wordnik.com/api "" "client" "generated-files"
|
||||
</pre>
|
||||
Note! The templates are included in the library generated. If you want to modify the templates, you'll need to
|
||||
either repackage the library OR modify your codegen script to use a file path!
|
||||
|
||||
#### javascript
|
||||
<pre>
|
||||
./bin/generate-js-lib.sh http://petstore.swagger.wordnik.com/api "" "" "generated-files"
|
||||
</pre>
|
||||
License
|
||||
-------
|
||||
|
||||
#### actionscript
|
||||
<pre>
|
||||
./bin/generate-as3-lib.sh http://petstore.swagger.wordnik.com/api "" "client" "generated-files"
|
||||
</pre>
|
||||
Copyright 2013 Wordnik, Inc.
|
||||
|
||||
#### PHP
|
||||
<pre>
|
||||
./bin/generate-php-lib.sh http://petstore.swagger.wordnik.com/api "" "client" "generated-files"
|
||||
</pre>
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
||||
|
||||
#### Python
|
||||
<pre>
|
||||
./bin/generate-python-lib.sh http://petstore.swagger.wordnik.com/api "" "client" "generated-files"
|
||||
</pre>
|
||||
|
||||
The main class for the generator is at src/main/java/com/wordnik/swagger/codegen/config/java/JavaLibCodeGen.java
|
||||
|
||||
The code-gen uses the antlr string template library for generating the output files, please look at
|
||||
http://www.stringtemplate.org for details on the antlr framework.
|
||||
|
||||
The Wordnik team is working on generating libraries for Ruby, ActionScript 3, Android, PHP and JavaScript, which will be open-sourced in the coming weeks
|
||||
|
||||
### The Swagger client test framework
|
||||
|
||||
The testing framework helps you to test Swagger generated client libraries using declarative test scripts. The same
|
||||
scripts can be used to test client libraries in different languages. The framework can be used for client and server
|
||||
regression testing.
|
||||
|
||||
For Example, first build the client library from the sample app:
|
||||
<pre>
|
||||
./bin/generate-java-lib.sh http://petstore.swagger.wordnik.com/api/ special-key com.foo.mydriver generated-files
|
||||
</pre>
|
||||
|
||||
Use the sample build script to build a jar from the client files:
|
||||
<pre>
|
||||
cp conf/java/sample/*.xml ./generated-files
|
||||
|
||||
cd generated-files
|
||||
|
||||
ant
|
||||
</pre>
|
||||
|
||||
This creates a complete client library jar. You can now run the tests:
|
||||
|
||||
<pre>
|
||||
./bin/test-java-lib.sh http://petstore.swagger.wordnik.com/api/ special-key conf/java/sample/lib-test-script.json \
|
||||
conf/java/sample/lib-test-data.json com.foo.mydriver.model.TestData com.foo.mydriver.api \
|
||||
generated-files/build/swagger-sample-java-lib-1.0.jar
|
||||
|
||||
Summary --> Total Test Cases: 9 Failed Test Cases: 0
|
||||
Details:
|
||||
1.1 : Create User : passed
|
||||
|
||||
1.2 : Login User : passed
|
||||
|
||||
1.3 : Find user by name : passed
|
||||
|
||||
1.4 : Delete user by name : passed
|
||||
|
||||
2.1 : Add pet : passed
|
||||
|
||||
2.2 : Find pet by id : passed
|
||||
|
||||
2.3 : Find pet by status : passed
|
||||
|
||||
3.1 : Find order by id : passed
|
||||
|
||||
3.2 : Place order : passed
|
||||
</pre>
|
||||
|
||||
In detail, there are two components in the test framework:
|
||||
|
||||
<li>- Test Script
|
||||
|
||||
<li>- Test Data
|
||||
|
||||
|
||||
#### Test script details
|
||||
|
||||
Test script is written in JSON structure. The JSON consists of following elements:
|
||||
|
||||
##### Resources. This is a list of resources considered in the test. Each resource object consists of following properties:
|
||||
|
||||
<li>- id: a unique test script ID
|
||||
|
||||
<li>- name: name of the resource, used in displaying the test result
|
||||
|
||||
<li>- httpMethod: HTTP method used in invoking this resource
|
||||
|
||||
<li>- path: path of the resource
|
||||
|
||||
<li>- suggested method name: By default this refers to method name of the API in resource classes
|
||||
|
||||
##### Test suites. This is a logical way of grouping related test cases. Each test suite consists of following properties:
|
||||
|
||||
<li>- id: unique id of the test script, displayed in the test report
|
||||
|
||||
<li>- name: name of the test suite. Used in test report
|
||||
|
||||
<li>- test cases: List of test cases with in each suite. Each test case consists of following properties:
|
||||
|
||||
<li>- id: unique with in the test suite. Used for reporting and tracking output data
|
||||
|
||||
<li>- name: Name of the test case
|
||||
|
||||
<li>- resource id: references the resource id in the resources section
|
||||
|
||||
<li>- input: Input is a JSON object with each property in the object map to query, path or post parameters.
|
||||
For POST data, the name of the property should be supplied as postData. The value for each property can refer
|
||||
to input file or output from previous test cases or actual values.
|
||||
|
||||
<li>- assertions: list of assertions that needs to be evaluated after test case is executed.
|
||||
|
||||
Each assertion contains
|
||||
|
||||
<li>- actual output, specified with reference to output of the current test case using syntax similar to object graph navigation language
|
||||
<li>- condition , support values are equal (==), not equal (!=), less than (<), lesser than or equal (<=), greater than (>), greater than or equal (>=)
|
||||
<li>- expected output. Specified using actual values or values referring previous outputs or input data file
|
||||
|
||||
Test data file is documented using a Test Data Object which is generated as part of Java client library code-gen. This
|
||||
class provides list getters and setters for each model object available in the resource description. It is called "TestData"
|
||||
and it is available in model package of the java library code generation output.
|
||||
|
||||
Chaining results of test cases:
|
||||
|
||||
<li>- Reference to data in input file is done with prefix <pre>${input.</pre>, followed by object graph navigation syntax.
|
||||
Example: to refer a first user object in test data file use the syntax <pre>${input.userList[0]}</pre>
|
||||
|
||||
<li>- To refer a individual property of user object use the syntax <pre>${input.userList[0].username}</pre>
|
||||
|
||||
<li>- Reference to output of test cases is done using combination test case path and OGNL. Reference to test cases output
|
||||
is prefixed with <pre>${output.</pre>
|
||||
|
||||
<li>- To refer an output of test case 1 in test suite 2, the syntax will be <pre>${output(1.2)}</pre>. Individual attributes can
|
||||
be accessed using OGNL syntax. Example: <pre>${output(1.1).username}</pre>
|
||||
|
||||
#### Reporting Test Results
|
||||
|
||||
A Summary will be reported with each test run. For instance:
|
||||
|
||||
<pre>
|
||||
Sample: "Summary --> Total Test Cases: 9 Failed Test Cases: 0"
|
||||
</pre>
|
||||
|
||||
In detail section each test case and its status (passed/failed) are reported. Failures include an exception trace. Test case path is
|
||||
combination of test suite id and test case id separated by "."
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
7
bin/Version.scala
Normal file
7
bin/Version.scala
Normal file
@@ -0,0 +1,7 @@
|
||||
val version = scala.util.Properties.scalaPropOrElse("version.number", "unknown").toString match {
|
||||
case "2.10.0" => "2.10"
|
||||
case "2.10.2" => "2.10"
|
||||
case "2.10.3" => "2.10"
|
||||
case e: String => e
|
||||
}
|
||||
println(version)
|
||||
37
bin/all-petstore.sh
Executable file
37
bin/all-petstore.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
./bin/java-wordnik-api.sh
|
||||
./bin/php-wordnik-api.sh
|
||||
./bin/python3-wordnik-api.sh
|
||||
./bin/objc-wordnik-api.sh
|
||||
./bin/python-wordnik-api.sh
|
||||
./bin/scala-wordnik-api.sh
|
||||
|
||||
./bin/android-java-petstore.sh
|
||||
./bin/csharp-petstore.sh
|
||||
./bin/flash-petstore.sh
|
||||
./bin/java-petstore.sh
|
||||
./bin/objc-petstore.sh
|
||||
./bin/php-petstore.sh
|
||||
./bin/python-petstore.sh
|
||||
./bin/python3-petstore.sh
|
||||
./bin/ruby-petstore.sh
|
||||
./bin/scala-petstore.sh
|
||||
32
bin/android-java-petstore.sh
Executable file
32
bin/android-java-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/android-java/AndroidJavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/android-java-wordnik-api.sh
Executable file
32
bin/android-java-wordnik-api.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/android-java/AndroidJavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/csharp-petstore.sh
Executable file
32
bin/csharp-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/csharp/CsharpPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/flash-petstore.sh
Executable file
32
bin/flash-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties "
|
||||
ags="$@ samples/client/petstore/flash/FlashPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $# -ne 4 ]
|
||||
then
|
||||
echo "Error in $0 - Invalid Argument Count "
|
||||
echo "Syntax: $0 location_of_service api_key package_name library_root"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dproperty=Xmx2g"
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH com.wordnik.swagger.codegen.config.as3.As3LibCodeGen "$@"
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $# -ne 4 ]
|
||||
then
|
||||
echo "Error in $0 - Invalid Argument Count"
|
||||
echo "Syntax: $0 location_of_service api_key package_name library_root"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dproperty=Xmx2g"
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH com.wordnik.swagger.codegen.config.java.JavaLibCodeGen "$@"
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $# -ne 3 ]
|
||||
then
|
||||
echo "Error in $0 - Invalid Argument Count "
|
||||
echo "Syntax: $0 location_of_service api_key library_root"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dproperty=Xmx2g"
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH com.wordnik.swagger.codegen.config.js.JSLibCodeGen "$@"
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $# -ne 4 ]
|
||||
then
|
||||
echo "Error in $0 - Invalid Argument Count"
|
||||
echo "Syntax: $0 location_of_service api_key package_name library_root"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dproperty=Xmx2g"
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH com.wordnik.swagger.codegen.config.php.PHPLibCodeGen "$@"
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $# -ne 4 ]
|
||||
then
|
||||
echo "Error in $0 - Invalid Argument Count"
|
||||
echo "Syntax: $0 location_of_service api_key package_name library_root"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dproperty=Xmx2g"
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH com.wordnik.swagger.codegen.config.python.PythonLibCodeGen "$@"
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $# -ne 4 ]
|
||||
then
|
||||
echo "Error in $0 - Invalid Argument Count"
|
||||
echo "Syntax: $0 location_of_service api_key package_name library_root"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dproperty=Xmx2g"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH com.wordnik.swagger.codegen.config.scala.ScalaLibCodeGen "$@"
|
||||
32
bin/java-petstore-filemap.sh
Executable file
32
bin/java-petstore-filemap.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DfileMap=src/test/resources/petstore-1.1/resources.json -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/java-petstore.sh
Executable file
32
bin/java-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/java-wordnik-api.sh
Executable file
32
bin/java-wordnik-api.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files/resources.json"
|
||||
ags="$@ samples/client/wordnik-api/java/JavaWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
34
bin/objc-petstore.sh
Executable file
34
bin/objc-petstore.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
version="$(scala ./bin/Version.scala)"
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/objc/ObjcPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/objc-wordnik-api.sh
Executable file
32
bin/objc-wordnik-api.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
ags="$@ samples/client/wordnik-api/objc/ObjcWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/php-petstore.sh
Executable file
32
bin/php-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/php/PHPPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/php-wordnik-api.sh
Executable file
32
bin/php-wordnik-api.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files/resources.json"
|
||||
ags="$@ samples/client/wordnik-api/php/PHPWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/python-petstore.sh
Executable file
32
bin/python-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/python/PythonPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/python-wordnik-api.sh
Executable file
32
bin/python-wordnik-api.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files/resources.json"
|
||||
ags="$@ samples/client/wordnik-api/python/PythonWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/python3-petstore.sh
Executable file
32
bin/python3-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/python3/Python3PetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/python3-wordnik-api.sh
Executable file
32
bin/python3-wordnik-api.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files/resources.json"
|
||||
ags="$@ samples/client/wordnik-api/python3/Python3WordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/ruby-petstore.sh
Executable file
32
bin/ruby-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/ruby/RubyPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
echo -n 'build/main/java' >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
#first argument to the command line script give location of the library jar file
|
||||
export CLASSPATH=$(cat classpath.txt)$2
|
||||
export JAVA_OPTS="${JAVA_OPTS} -DrulePath=data -Dproperty=Xmx2g -DloggerPath=$BUILD_COMMON/test-config/log4j.properties"
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH "$@" com.wordnik.swagger.api ../swagger-sample-app/sdk-libs/bin/AirExecutorApp-app.xml "/Applications/Adobe Flash Builder 4/sdks/4.1.0"
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
echo "" > classpath.txt
|
||||
for file in `ls lib`;
|
||||
do echo -n 'lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls build`;
|
||||
do echo -n 'build/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
export JAVA_OPTS="${JAVA_OPTS} -DrulePath=data -Dproperty=Xmx2g -DloggerPath=$BUILD_COMMON/test-config/log4j.properties"
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH "$@"
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
echo "" > classpath.txt
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
#first argument to the command line script give location of the library jar file
|
||||
export CLASSPATH=$(cat classpath.txt)$2
|
||||
export JAVA_OPTS="${JAVA_OPTS} -DrulePath=data -Dproperty=Xmx2g -DloggerPath=$BUILD_COMMON/test-config/log4j.properties"
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH "$@"
|
||||
|
||||
@@ -1,17 +1,32 @@
|
||||
#!/bin/bash
|
||||
echo "" > classpath.txt
|
||||
for file in `ls lib`;
|
||||
do echo -n 'lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls build`;
|
||||
do echo -n 'build/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
export JAVA_OPTS="${JAVA_OPTS} -DrulePath=data -Dproperty=Xmx2g -DloggerPath=$BUILD_COMMON/test-config/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH "$@"
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
31
bin/scala-async.sh
Executable file
31
bin/scala-async.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
ags="com.wordnik.swagger.codegen.ScalaAsyncClientGenerator $@"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/scala-petstore.sh
Executable file
32
bin/scala-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ samples/client/petstore/scala/ScalaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/scala-wordnik-api.sh
Executable file
32
bin/scala-wordnik-api.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files/resources.json"
|
||||
ags="$@ samples/client/wordnik-api/scala/ScalaWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
32
bin/static-docs.sh
Executable file
32
bin/static-docs.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
ags="$@ SwaggerDocGenerator http://developer.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $# -ne 7 ]
|
||||
then
|
||||
echo "Error in $0 - Invalid Argument Count - expected 7 but has "
|
||||
echo "$#"
|
||||
echo "Syntax: $0 location_of_service api_key test_script_location test_data_location test_data_class_name api_classes_package_name location_of_client_library"
|
||||
exit
|
||||
fi
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
export CLASSPATH=$(cat classpath.txt)$7
|
||||
echo $CLASSPATH
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dproperty=Xmx2g "
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH com.wordnik.swagger.testframework.APITestRunner "$@" AS3
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ $# -ne 7 ]
|
||||
then
|
||||
echo "Error in $0 - Invalid Argument Count"
|
||||
echo "Syntax: $0 location_of_client_library location_of_service api_key test_script_location test_data_location test_data_class_name api_classes_package_name"
|
||||
exit
|
||||
fi
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
export CLASSPATH=$(cat classpath.txt)$7
|
||||
echo $CLASSPATH
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Dproperty=Xmx2g "
|
||||
java $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS $JAVA_OPTS -cp $CLASSPATH com.wordnik.swagger.testframework.APITestRunner "$@" JAVA
|
||||
31
bin/update-spec.sh
Executable file
31
bin/update-spec.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
ags="com.wordnik.swagger.codegen.SpecConverter $@"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
31
bin/validate.sh
Executable file
31
bin/validate.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
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
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
ags="com.wordnik.swagger.codegen.spec.Validator $@"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
56
bin/yml2swagger.js
Normal file
56
bin/yml2swagger.js
Normal file
@@ -0,0 +1,56 @@
|
||||
fs = require('fs')
|
||||
yaml = require('js-yaml')
|
||||
|
||||
var args = process.argv.splice(2);
|
||||
|
||||
if(args.length == 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var arg0 = args[0];
|
||||
var outputdir = ".";
|
||||
|
||||
if(args.length > 1) {
|
||||
outputdir = args[1];
|
||||
}
|
||||
|
||||
var file = fs.lstatSync(arg0);
|
||||
|
||||
if(file.isFile()) {
|
||||
convert(arg0, outputdir);
|
||||
}
|
||||
else if (file.isDirectory()) {
|
||||
var files = fs.readdirSync(arg0);
|
||||
files.map(function(item) {
|
||||
var filename = arg0 + "/" + item;
|
||||
var file = fs.lstatSync(filename);
|
||||
if(file.isFile()) {
|
||||
convert(filename, outputdir);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function convert(filename, outputdir) {
|
||||
console.log("converting " + filename);
|
||||
fs.readFile(filename, "utf8", function (err, data) {
|
||||
if(err) {
|
||||
console.log(err);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
var js = yaml.load(data);
|
||||
var prettyJs = JSON.stringify(js, undefined, 2);
|
||||
var outputFilename = outputdir + "/" + filename.split("/").pop().replace(".yml", "") + ".json";
|
||||
console.log("writing to " + outputFilename);
|
||||
fs.writeFile(outputFilename, prettyJs, function(err) {
|
||||
if(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
133
build.sbt
Normal file
133
build.sbt
Normal file
@@ -0,0 +1,133 @@
|
||||
import xml.Group
|
||||
import AssemblyKeys._
|
||||
|
||||
organization := "com.wordnik"
|
||||
|
||||
name := "swagger-codegen"
|
||||
|
||||
version := "2.0.13"
|
||||
|
||||
scalaVersion := "2.10.1"
|
||||
|
||||
crossVersion := CrossVersion.full
|
||||
|
||||
javacOptions ++= Seq("-target", "1.6", "-source", "1.6", "-Xlint:unchecked", "-Xlint:deprecation")
|
||||
|
||||
scalacOptions ++= Seq("-optimize", "-unchecked", "-deprecation", "-Xcheckinit", "-encoding", "utf8")
|
||||
|
||||
crossScalaVersions := Seq("2.9.0", "2.9.0-1", "2.9.1", "2.9.1-1", "2.9.2", "2.9.3", "2.10.0", "2.10.1", "2.10.2")
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"org.json4s" %% "json4s-jackson" % "3.2.5",
|
||||
"io.backchat.inflector" %% "scala-inflector" % "1.3.5",
|
||||
"commons-io" % "commons-io" % "2.3",
|
||||
"ch.qos.logback" % "logback-classic" % "1.0.13" % "provided",
|
||||
"org.rogach" %% "scallop" % "0.8.1",
|
||||
"junit" % "junit" % "4.11" % "test",
|
||||
"org.scalatest" %% "scalatest" % "1.9.1" % "test"
|
||||
)
|
||||
|
||||
libraryDependencies <+= scalaVersion {
|
||||
case v if v.startsWith("2.9") =>
|
||||
"org.fusesource.scalate" % "scalate-core_2.9" % "1.6.1"
|
||||
case v if v.startsWith("2.10") => {
|
||||
"org.fusesource.scalate" %% "scalate-core" % "1.6.1"
|
||||
}
|
||||
}
|
||||
|
||||
libraryDependencies ++= {
|
||||
scalaVersion.toString match {
|
||||
case v if v.startsWith("2.10") => Seq("org.scala-lang" % "scala-reflect" % v)
|
||||
case _ => Seq()
|
||||
}
|
||||
}
|
||||
|
||||
packageOptions <+= (name, version, organization) map {
|
||||
(title, version, vendor) =>
|
||||
Package.ManifestAttributes(
|
||||
"Created-By" -> "Simple Build Tool",
|
||||
"Built-By" -> System.getProperty("user.name"),
|
||||
"Build-Jdk" -> System.getProperty("java.version"),
|
||||
"Specification-Title" -> title,
|
||||
"Specification-Version" -> version,
|
||||
"Specification-Vendor" -> vendor,
|
||||
"Implementation-Title" -> title,
|
||||
"Implementation-Version" -> version,
|
||||
"Implementation-Vendor-Id" -> vendor,
|
||||
"Implementation-Vendor" -> vendor
|
||||
)
|
||||
}
|
||||
|
||||
publishTo <<= (version) { version: String =>
|
||||
if (version.trim.endsWith("SNAPSHOT"))
|
||||
Some("Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
|
||||
else
|
||||
Some("Sonatype Nexus Releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
|
||||
}
|
||||
|
||||
//publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))
|
||||
|
||||
artifact in (Compile, assembly) ~= { art =>
|
||||
art.copy(`classifier` = Some("assembly"))
|
||||
}
|
||||
|
||||
addArtifact(artifact in (Compile, assembly), assembly)
|
||||
|
||||
publishMavenStyle := true
|
||||
|
||||
publishArtifact in Test := false
|
||||
|
||||
pomIncludeRepository := { x => false }
|
||||
|
||||
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
|
||||
|
||||
homepage := Some(new URL("https://github.com/wordnik/swagger-codegen"))
|
||||
|
||||
parallelExecution in Test := false
|
||||
|
||||
startYear := Some(2009)
|
||||
|
||||
licenses := Seq(("Apache License 2.0", new URL("http://www.apache.org/licenses/LICENSE-2.0.html")))
|
||||
|
||||
pomExtra <<= (pomExtra, name, description) {(pom, name, desc) => pom ++ Group(
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:wordnik/swagger-codegen.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:wordnik/swagger-codegen.git</developerConnection>
|
||||
<url>https://github.com/wordnik/swagger-codegen</url>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<system>github</system>
|
||||
<url>https://github.com/wordnik/swagger-codegen/issues</url>
|
||||
</issueManagement>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>rpidikiti</id>
|
||||
<name>Ramesh Pidikiti</name>
|
||||
<email>ramesh@wordnik.com</email>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>ayush</id>
|
||||
<name>Ayush Gupta</name>
|
||||
<email>ayush@glugbot.com</email>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>fehguy</id>
|
||||
<name>Tony Tam</name>
|
||||
<email>fehguy@gmail.com</email>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>casualjim</id>
|
||||
<name>Ivan Porto Carrero</name>
|
||||
<url>http://flanders.co.nz/</url>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>radius314</id>
|
||||
<name>Danny Gershman</name>
|
||||
<email>danny.gershman@gmail.com</email>
|
||||
</developer>
|
||||
</developers>
|
||||
)}
|
||||
|
||||
assemblySettings
|
||||
|
||||
jarName in assembly := "swagger-codegen.jar"
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"apiUrl":"http://localhost:8002/api/",
|
||||
|
||||
"apiKey":"special-key",
|
||||
|
||||
"defaultServiceBaseClass":"SwaggerApi",
|
||||
|
||||
"defaultModelBaseClass":"Object",
|
||||
|
||||
"serviceBaseClasses":{},
|
||||
|
||||
"defaultModelImports":[],
|
||||
|
||||
"defaultServiceImports":[],
|
||||
|
||||
"modelPackageName":"com.wordnik.swagger.model",
|
||||
|
||||
"apiPackageName":"com.wordnik.swagger.api",
|
||||
|
||||
"ignoreMethods":[],
|
||||
|
||||
"ignoreModels":[],
|
||||
|
||||
"outputDirectory":"../swagger-sample-app/sdk-libs/src/main/as3/com/wordnik/swagger/",
|
||||
|
||||
"libraryHome":"../swagger-sample-app/sdk-libs"
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"userList":[
|
||||
{
|
||||
"username":"testuser1",
|
||||
"password":"password1",
|
||||
"email":"test1@dummy.com"
|
||||
},
|
||||
{
|
||||
"username":"testuser2",
|
||||
"password":"password2",
|
||||
"email":"test2@dummy.com"
|
||||
}
|
||||
],
|
||||
"petList":[
|
||||
{
|
||||
"id":101,
|
||||
"name":"pet1",
|
||||
"photoUrls":["url1","url2"],
|
||||
"tags":[
|
||||
{
|
||||
"id":1,
|
||||
"name":"tag1"
|
||||
},
|
||||
{
|
||||
"id":2,
|
||||
"name":"tag2"
|
||||
}
|
||||
],
|
||||
"status":"available",
|
||||
"category":{"id":1,"name":"cat1"}
|
||||
}
|
||||
],
|
||||
"orderList":[
|
||||
{
|
||||
"id":101,
|
||||
"petId":1,
|
||||
"quantity":1,
|
||||
"status":"placed",
|
||||
"shipDate":13456789
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,265 +0,0 @@
|
||||
{
|
||||
"resources" : [
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "Find Per by Id",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/{petId}",
|
||||
"suggestedMethodName" : "getPetById"
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"name" : "Find pets by status",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/findByStatus",
|
||||
"suggestedMethodName" : "findPetsByStatus"
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"name" : "Find pets by tags",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/findByTags",
|
||||
"suggestedMethodName" : "findPetsByTags"
|
||||
},
|
||||
{
|
||||
"id" : 4,
|
||||
"name" : "Add a pet",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/pet.{format}",
|
||||
"suggestedMethodName" : "addPet"
|
||||
},
|
||||
{
|
||||
"id" : 5,
|
||||
"name" : "Update a pet",
|
||||
"httpMethod" : "PUT",
|
||||
"path" : "/pet.{format}",
|
||||
"suggestedMethodName" : "updatePet"
|
||||
},
|
||||
{
|
||||
"id" : 6,
|
||||
"name" : "Create user",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/user.{format}",
|
||||
"suggestedMethodName" : "createUser"
|
||||
},
|
||||
{
|
||||
"id" : 7,
|
||||
"name" : "Update user",
|
||||
"httpMethod" : "PUT",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "updateUser"
|
||||
},
|
||||
{
|
||||
"id" : 8,
|
||||
"name" : "Delete user",
|
||||
"httpMethod" : "DELETE",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "deleteUser"
|
||||
},
|
||||
{
|
||||
"id" : 9,
|
||||
"name" : "Get user by user name",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "getUserByName"
|
||||
},
|
||||
{
|
||||
"id" : 10,
|
||||
"name" : "Login",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/login",
|
||||
"suggestedMethodName" : "loginUser"
|
||||
},
|
||||
{
|
||||
"id" : 11,
|
||||
"name" : "Logout",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/logout",
|
||||
"suggestedMethodName" : "logoutUser"
|
||||
},
|
||||
{
|
||||
"id" : 12,
|
||||
"name" : "Find order by id",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/store.{format}/order/{orderId}",
|
||||
"suggestedMethodName" : "getOrderById"
|
||||
},
|
||||
{
|
||||
"id" : 13,
|
||||
"name" : "Delete order by id",
|
||||
"httpMethod" : "DELETE",
|
||||
"path" : "/store.{format}/order/{orderId}",
|
||||
"suggestedMethodName" : "deleteOrder"
|
||||
},
|
||||
{
|
||||
"id" : 14,
|
||||
"name" : "Create order",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/store.{format}/order",
|
||||
"suggestedMethodName" : "placeOrder"
|
||||
}
|
||||
],
|
||||
"testSuites" : [
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "Test User service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Create User",
|
||||
"id" : 1,
|
||||
"resourceId" : 6,
|
||||
"input" : {
|
||||
"postData":"${input.userList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Login User",
|
||||
"id" : 2,
|
||||
"resourceId" : 10,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}",
|
||||
"password":"${input.userList[0].password}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find user by name",
|
||||
"id" : 3,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.3).username}",
|
||||
"condition" : "==",
|
||||
"expectedOutput" : "${input.userList[0].username}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Delete user by name",
|
||||
"id" : 4,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.4)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"name" : "Test Pet service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Add pet",
|
||||
"id" : 1,
|
||||
"resourceId" : 4,
|
||||
"input" : {
|
||||
"postData":"${input.petList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find pet by id",
|
||||
"id" : 2,
|
||||
"resourceId" : 1,
|
||||
"input" : {
|
||||
"petId":"1"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "NULL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find pet by status",
|
||||
"id" : 3,
|
||||
"resourceId" : 2,
|
||||
"input" : {
|
||||
"status":"available,sold,pending"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.3).size}",
|
||||
"condition" : ">",
|
||||
"expectedOutput" : "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"name" : "Test Store service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Find order by id",
|
||||
"id" : 1,
|
||||
"resourceId" : 12,
|
||||
"input" : {
|
||||
"orderId":"1"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(3.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "NULL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Place order",
|
||||
"id" : 2,
|
||||
"resourceId" : 14,
|
||||
"input" : {
|
||||
"postData":"${input.orderList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,241 +0,0 @@
|
||||
package com.wordnik.swagger.common
|
||||
{
|
||||
import asaxb.xml.bind.ASAXBContext;
|
||||
import asaxb.xml.bind.Unmarshaller;
|
||||
|
||||
import com.wordnik.swagger.event.ApiClientEvent;
|
||||
import com.wordnik.swagger.event.Response;
|
||||
import com.wordnik.swagger.common.ApiUserCredentials;
|
||||
import com.wordnik.swagger.model.LibraryReferences;
|
||||
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.describeType;
|
||||
import flash.xml.XMLDocument;
|
||||
import flash.xml.XMLNode;
|
||||
|
||||
import mx.messaging.ChannelSet;
|
||||
import mx.messaging.channels.HTTPChannel;
|
||||
import mx.messaging.messages.HTTPRequestMessage;
|
||||
import mx.rpc.AsyncToken;
|
||||
import mx.rpc.events.FaultEvent;
|
||||
import mx.rpc.events.ResultEvent;
|
||||
import mx.rpc.http.HTTPService;
|
||||
import mx.rpc.xml.SimpleXMLEncoder;
|
||||
import mx.utils.ObjectUtil;
|
||||
|
||||
|
||||
public class ApiInvoker extends EventDispatcher
|
||||
{
|
||||
|
||||
private var _apiUsageCredentials:ApiUserCredentials;
|
||||
internal var _apiProxyServerUrl:String = "";
|
||||
private var _baseUrl: String = "";
|
||||
internal var _useProxyServer: Boolean = true;
|
||||
private var _proxyHostName:String = "";
|
||||
private var _apiPath: String = "";
|
||||
|
||||
public var _apiEventNotifier:EventDispatcher;
|
||||
public var _apiLibraryReferences:LibraryReferences;
|
||||
|
||||
private static const DELETE_DATA_DUMMY:String = "dummyDataRequiredForDeleteOverride";
|
||||
private static const X_HTTP_OVERRIDE_KEY:String = "X-HTTP-Method-Override";
|
||||
private static const CONTENT_TYPE_HEADER_KEY:String = "Content-Type";
|
||||
|
||||
public function ApiInvoker(apiUsageCredentials: ApiUserCredentials, eventNotifier: EventDispatcher, useProxy: Boolean = true) {
|
||||
_apiUsageCredentials = apiUsageCredentials;
|
||||
_useProxyServer = useProxy;
|
||||
if(_apiUsageCredentials.hostName != null){
|
||||
_proxyHostName = _apiUsageCredentials.hostName;
|
||||
}
|
||||
_apiPath = _apiUsageCredentials.apiPath;
|
||||
_apiProxyServerUrl = _apiUsageCredentials.apiProxyServerUrl;
|
||||
_apiEventNotifier = eventNotifier;
|
||||
}
|
||||
|
||||
public function invokeAPI(resourceURL: String, method: String, queryParams: Dictionary, postObject: Object, headerParams: Dictionary): AsyncToken {
|
||||
//make the communication
|
||||
if(_useProxyServer) {
|
||||
resourceURL = resourceURL = _apiProxyServerUrl + resourceURL;
|
||||
}
|
||||
else{
|
||||
resourceURL = resourceURL = "http://"+ _proxyHostName + _apiPath + resourceURL;
|
||||
}
|
||||
|
||||
var counter: int = 0;
|
||||
var symbol: String = "&";
|
||||
var paramValue: Object;
|
||||
for (var paramName:String in queryParams) {
|
||||
paramValue = queryParams[paramName];
|
||||
//var key:String = paramName;
|
||||
// do stuff
|
||||
symbol = "&";
|
||||
if(counter == 0){
|
||||
symbol = "?";
|
||||
}
|
||||
resourceURL = resourceURL + symbol + paramName + "=" + paramValue.toString();
|
||||
counter++;
|
||||
|
||||
}
|
||||
//create a httpservice and invoke the rest url waiting for response
|
||||
var requestHeader:Object = new Object();
|
||||
resourceURL = ApiUrlHelper.appendTokenInfo(resourceURL, requestHeader, _apiUsageCredentials);
|
||||
var bodyData:String = marshal( postObject);//restRequest.postData;
|
||||
|
||||
return doRestCall(resourceURL, onApiRequestResult, onApiRequestFault, method, bodyData, requestHeader, "application/xml");
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function doRestCall( url : String, resultFunction : Function, faultFunction : Function = null,
|
||||
restMethod : String = "GET",
|
||||
bodyData : Object = null, headers: Object = null, contentType:String = "application/xml" ) : AsyncToken
|
||||
{
|
||||
var httpService : HTTPService = new HTTPService( );
|
||||
|
||||
if(headers == null){
|
||||
headers = new Object();
|
||||
}
|
||||
httpService.method = restMethod;
|
||||
|
||||
if ( restMethod.toUpperCase() != HTTPRequestMessage.GET_METHOD )
|
||||
{
|
||||
//httpService.method = HTTPRequestMessage.POST_METHOD; - not required as we're using the proxy
|
||||
if( bodyData == null )
|
||||
{
|
||||
bodyData = new Object();
|
||||
}
|
||||
|
||||
if(restMethod == HTTPRequestMessage.DELETE_METHOD){
|
||||
headers[X_HTTP_OVERRIDE_KEY]= HTTPRequestMessage.DELETE_METHOD;
|
||||
bodyData = DELETE_DATA_DUMMY;
|
||||
}
|
||||
else{
|
||||
headers[CONTENT_TYPE_HEADER_KEY]= contentType;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//if the request type is GET and content type is xml then the Flex HTTPService converts it to a POST ... yeah
|
||||
contentType = null;
|
||||
}
|
||||
|
||||
httpService.url = url;
|
||||
httpService.contentType = contentType;
|
||||
httpService.resultFormat = "e4x";
|
||||
httpService.headers = headers;
|
||||
httpService.addEventListener( ResultEvent.RESULT, resultFunction );
|
||||
if( faultFunction != null )
|
||||
{
|
||||
httpService.addEventListener( FaultEvent.FAULT, faultFunction );
|
||||
}
|
||||
if(_useProxyServer){
|
||||
httpService.useProxy = true;
|
||||
|
||||
var channelSet: ChannelSet = new ChannelSet();
|
||||
var httpChannel: HTTPChannel = new HTTPChannel();
|
||||
httpChannel.uri = ApiUrlHelper.getProxyUrl(_proxyHostName);
|
||||
channelSet.addChannel(httpChannel);
|
||||
httpService.channelSet = channelSet;
|
||||
}
|
||||
return httpService.send( bodyData );
|
||||
}
|
||||
|
||||
private function onApiRequestResult(event:ResultEvent):void
|
||||
{
|
||||
var completionListener: Function = event.token.completionListener;
|
||||
var result: Object = event.result;
|
||||
var resultType: Class = event.token.returnType;
|
||||
var resultObject:Object;
|
||||
if(resultType != null) {
|
||||
var context:ASAXBContext = ASAXBContext.newInstance(resultType);
|
||||
var unmarshaller:Unmarshaller = context.createUnmarshaller();
|
||||
var resultXML: XML = new XML(event.result);
|
||||
try{
|
||||
resultObject = unmarshaller.unmarshal(resultXML);
|
||||
}
|
||||
catch(error: TypeError){
|
||||
var errorResponse: Response = new Response(false, null, "Could not unmarshall response");
|
||||
if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher
|
||||
var failureEvent: ApiClientEvent = new ApiClientEvent(event.token.completionEventType);
|
||||
failureEvent.response = errorResponse;
|
||||
_apiEventNotifier.dispatchEvent(failureEvent);
|
||||
}
|
||||
}
|
||||
|
||||
if(resultObject is ListWrapper){
|
||||
resultObject = ListWrapper(resultObject).getList();
|
||||
}
|
||||
|
||||
}
|
||||
var response : Response = new Response(true, resultObject);
|
||||
response.requestId = event.token.requestId;
|
||||
var successEventType: String = event.token.completionEventType != null ? event.token.completionEventType : ApiClientEvent.SUCCESS_EVENT;
|
||||
|
||||
if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher
|
||||
var successEvent: ApiClientEvent = new ApiClientEvent(successEventType);
|
||||
successEvent.response = response;
|
||||
_apiEventNotifier.dispatchEvent(successEvent);
|
||||
}
|
||||
}
|
||||
|
||||
private function onApiRequestFault(event:FaultEvent):void
|
||||
{
|
||||
var completionListener: Function = event.token.completionListener;
|
||||
if(completionListener != null){
|
||||
completionListener.call( null, new Response( false, null, event.fault.faultString) );
|
||||
}
|
||||
|
||||
var failureEventType: String = event.token.completionEventType != null ? event.token.completionEventType : ApiClientEvent.FAILURE_EVENT;
|
||||
|
||||
if (_apiEventNotifier != null) { //dispatch event via assigned dispatcher
|
||||
var failureEvent: ApiClientEvent = new ApiClientEvent(failureEventType);
|
||||
failureEvent.response = new Response( false, null, event.fault.faultString);
|
||||
_apiEventNotifier.dispatchEvent(failureEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function marshal(source:Object):XML
|
||||
{
|
||||
var writer:XMLWriter=new XMLWriter();
|
||||
var objDescriptor:XML=describeType(source);
|
||||
var property:XML;
|
||||
var propertyType:String;
|
||||
var propertyValue:Object;
|
||||
|
||||
var qualifiedClassName:String=objDescriptor.@name;
|
||||
qualifiedClassName=qualifiedClassName.replace("::",".");
|
||||
var className: String = qualifiedClassName.substring(qualifiedClassName.lastIndexOf(".") + 1);
|
||||
className = className.charAt().toLowerCase() + className.substring(1);
|
||||
writer.xml.setName(className);
|
||||
|
||||
for each(property in objDescriptor.elements("variable")){
|
||||
propertyValue=source[property.@name];
|
||||
if (propertyValue!=null){
|
||||
if (ObjectUtil.isSimple(propertyValue)){
|
||||
writer.addProperty(property.@name, propertyValue.toString());
|
||||
}
|
||||
else {
|
||||
writer.addProperty(property.@name, marshal(propertyValue).toXMLString());
|
||||
}
|
||||
}
|
||||
}
|
||||
for each(property in objDescriptor.elements("accessor")){
|
||||
if (property.@access=="readonly"){
|
||||
continue;
|
||||
}
|
||||
propertyValue=source[property.@name];
|
||||
if (source[property.@name]!=null){
|
||||
if (ObjectUtil.isSimple(propertyValue)){
|
||||
writer.addProperty(property.@name, propertyValue.toString());
|
||||
}
|
||||
else {
|
||||
writer.addProperty(property.@name, marshal(propertyValue).toXMLString());
|
||||
}
|
||||
}
|
||||
}
|
||||
return writer.xml;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
|
||||
xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="runMe()" invoke="onInvoke(event)">
|
||||
<fx:Declarations>
|
||||
<!-- Place non-visual elements (e.g., services, value objects) here -->
|
||||
</fx:Declarations>
|
||||
<fx:Script>
|
||||
<![CDATA[
|
||||
import org.flexunit.listeners.AirCIListener;
|
||||
import org.flexunit.runner.FlexUnitCore;
|
||||
|
||||
import test.TestExecutor;
|
||||
|
||||
private var core: FlexUnitCore;
|
||||
|
||||
public function runMe(): void{
|
||||
core = new FlexUnitCore();
|
||||
core.addListener(new AirCIListener());
|
||||
core.run(test.TestExecutor);
|
||||
}
|
||||
|
||||
public function onInvoke(event: InvokeEvent): void{
|
||||
var arguments: Array = event.arguments;
|
||||
trace(arguments.toString());
|
||||
}
|
||||
]]>
|
||||
</fx:Script>
|
||||
</s:WindowedApplication>
|
||||
@@ -1,432 +0,0 @@
|
||||
package test
|
||||
{
|
||||
import com.adobe.serialization.json.JSON;
|
||||
import com.adobe.utils.DateUtil;
|
||||
import com.wordnik.swagger.common.ApiInvoker;
|
||||
import com.wordnik.swagger.common.ApiUserCredentials;
|
||||
import com.wordnik.swagger.common.SwaggerApi;
|
||||
import com.wordnik.swagger.event.ApiClientEvent;
|
||||
import com.wordnik.swagger.event.Response;
|
||||
|
||||
import flash.desktop.NativeApplication;
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.events.IEventDispatcher;
|
||||
import flash.events.IOErrorEvent;
|
||||
import flash.filesystem.File;
|
||||
import flash.filesystem.FileMode;
|
||||
import flash.filesystem.FileStream;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
import flash.system.System;
|
||||
import flash.utils.describeType;
|
||||
import flash.utils.getDefinitionByName;
|
||||
|
||||
import flexunit.framework.TestCase;
|
||||
|
||||
import mx.core.ClassFactory;
|
||||
import mx.rpc.events.FaultEvent;
|
||||
import mx.utils.StringUtil;
|
||||
|
||||
public class TestExecutor extends TestCase
|
||||
{
|
||||
private var urlReq:URLRequest;
|
||||
private var urlLdr:URLLoader;
|
||||
|
||||
private var apiInvoker: ApiInvoker;
|
||||
|
||||
private const MODEL_INFO_URL:String ="testData.json";
|
||||
private const TIME_OUT:int = 5000;
|
||||
|
||||
private var testData: Object;
|
||||
|
||||
|
||||
public function testApiMethod():void{
|
||||
initializeRequest();
|
||||
urlLdr.addEventListener(Event.COMPLETE, addAsync(executeTest, TIME_OUT));
|
||||
urlLdr.addEventListener(IOErrorEvent.IO_ERROR, executeTest);
|
||||
urlLdr.load(urlReq);
|
||||
}
|
||||
|
||||
private function initializeRequest():void {
|
||||
/* Initialize the URLRequest object with the URL to the file of name/value pairs. */
|
||||
urlReq = new URLRequest(MODEL_INFO_URL);
|
||||
/* Initialize the URLLoader object, assign the various event listeners, and load the specified URLRequest object. */
|
||||
urlLdr = new URLLoader();
|
||||
}
|
||||
|
||||
private function checkAndLoadModelXml(event:Event):Object {
|
||||
var ldr:URLLoader = urlLdr;//event.currentTarget as URLLoader;
|
||||
assertTrue("Test data info not found ", ldr.data != null);
|
||||
|
||||
var testData:Object = JSON.decode(ldr.data);
|
||||
//var classList:XML = new XML(ldr.data);
|
||||
assertTrue("Test data could not be loaded as xml ", testData != null);
|
||||
return testData;
|
||||
}
|
||||
|
||||
private function executeTest(event:Event):void {
|
||||
testData = checkAndLoadModelXml(event);
|
||||
//figure out class and method to execute
|
||||
var className: String = getServiceName(testData.resource);
|
||||
var methodName: String = testData.methodName;
|
||||
var servicePackageName: String = testData.apiPackageName;
|
||||
var fullClassName: String = servicePackageName + "." + className;
|
||||
|
||||
var apiUrl: String = testData.apiUrl;
|
||||
var apiHostName : String = apiUrl.substring(apiUrl.indexOf("//")+2,
|
||||
apiUrl.indexOf("/",apiUrl.indexOf("//")+2) );
|
||||
var apiPath: String = apiUrl.substring(apiUrl.indexOf(apiHostName)+ apiHostName.length,
|
||||
apiUrl.indexOf("/", apiUrl.indexOf(apiHostName)+ apiHostName.length + 1));
|
||||
var useProxyServer: Boolean = false;
|
||||
if(testData.useProxyServer != null){
|
||||
useProxyServer = testData.useProxyServer == "true" ? true : false;
|
||||
}
|
||||
var params: Array;
|
||||
//execute the test
|
||||
|
||||
var classRef:Class;
|
||||
try{
|
||||
classRef = getDefinitionByName(fullClassName) as Class;
|
||||
}
|
||||
catch(error: ReferenceError){
|
||||
var classFailure: Response = new Response(false, null, "Api Class not found");
|
||||
writeToFile( JSON.encode(classFailure) );
|
||||
}
|
||||
|
||||
var apiCredentials: ApiUserCredentials = new ApiUserCredentials(testData.apiKey,
|
||||
testData.authToken, apiHostName, -1, apiPath, testData.proxyServerUrl);
|
||||
|
||||
var apiInstance : * = new classRef(apiCredentials);
|
||||
apiInstance.useProxyServer(useProxyServer);
|
||||
apiInstance.addEventListener(methodName, addAsync(onApiCallResponse, TIME_OUT, {} , apiTimeOutHandler) );
|
||||
apiInstance.addEventListener(ApiClientEvent.FAILURE_EVENT, onApiCallFault );
|
||||
|
||||
var queryAndPathParams: Object = new Object();
|
||||
|
||||
queryAndPathParams = testData.queryAndPathParams;
|
||||
|
||||
params = getArgumentsForTestCaseExecution(methodName, apiInstance,
|
||||
queryAndPathParams, testData.postData, className, testData.resource);
|
||||
if(apiInstance.hasOwnProperty(methodName)){
|
||||
var method:Function = apiInstance[methodName];
|
||||
var returnValue:* = method.apply(apiInstance, params);
|
||||
}
|
||||
else{
|
||||
//write out error
|
||||
var failureResponse: Response = new Response(false, null, "Method not found");
|
||||
writeToFile( JSON.encode(failureResponse) );
|
||||
}
|
||||
|
||||
//write out test data result to json file
|
||||
}
|
||||
|
||||
private function onApiCallResponse(event: ApiClientEvent, tokenObject: Object = null): void{
|
||||
var result: Response = event.response;
|
||||
trace("writing to file");
|
||||
|
||||
writeToFile( JSON.encode(result) );
|
||||
}
|
||||
|
||||
private function onApiCallFault(event:FaultEvent):void {
|
||||
var failureResponse: Response = new Response(false, null, "Method invocation failure");
|
||||
writeToFile( JSON.encode(failureResponse) );
|
||||
}
|
||||
|
||||
private function writeToFile(data: String) : void {
|
||||
var localFile: File = File.documentsDirectory.resolvePath("testOutput.json");
|
||||
var localFileStream:FileStream = new FileStream();
|
||||
|
||||
localFileStream.open(localFile, FileMode.WRITE);
|
||||
|
||||
localFileStream.writeMultiByte( data, "utf-8");
|
||||
localFileStream.close();
|
||||
trace(data);
|
||||
applicationExit();
|
||||
}
|
||||
|
||||
private function apiTimeOutHandler(o: Object):void {
|
||||
//fail("test timed out");
|
||||
trace("Execution timed out");
|
||||
var failureResponse: Response = new Response(false, null, "Method Execution timed out");
|
||||
writeToFile( JSON.encode(failureResponse) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate name of the service from resource path.
|
||||
*
|
||||
* Example: if input is /user.json the generated name for this path will be UserAPI
|
||||
* If the input is /user.json/{userId}, the service name will still be generated as UserAPI
|
||||
*
|
||||
* @param resourcePath
|
||||
* @return
|
||||
*/
|
||||
private function getServiceName(resourcePath: String): String {
|
||||
var className:String = null;
|
||||
var index: int = resourcePath.indexOf(".");
|
||||
if(index >= 0) {
|
||||
var resourceName: String = resourcePath.substring(1,index);
|
||||
className = applyClassNamingPolicy(resourceName);
|
||||
}else{
|
||||
var paths: Array = resourcePath.split("/");
|
||||
for each(var path: String in paths) {
|
||||
if(path != null && path.length > 0) {
|
||||
className = applyClassNamingPolicy(path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return className+ "API";
|
||||
}
|
||||
|
||||
private function getArgumentsForTestCaseExecution(methodName: String, apiObject: Object, queryAndPathParameters: Object,
|
||||
postData: String, className: String, resourcePath: String): Array{
|
||||
|
||||
var result: Array;
|
||||
//get the xml data for the type
|
||||
var classAsXML: XML = describeType(apiObject);
|
||||
//get the parameters for the method
|
||||
|
||||
var argNamesArray: Array = [];
|
||||
var argTypesArray: Array = [];
|
||||
|
||||
var list: XMLList = classAsXML.method;
|
||||
var methodXml: XML;
|
||||
var paramDefn: XML
|
||||
var currentMethodName: String;
|
||||
var methodParams: XMLList;
|
||||
var methodArgumentNames: XMLList;
|
||||
var argumentNames: String;
|
||||
|
||||
for each (methodXml in list) {
|
||||
//get the names and types for the parameters
|
||||
currentMethodName = methodXml.@name.toString();
|
||||
if(methodName == currentMethodName){
|
||||
methodParams = methodXml.parameter;
|
||||
for each(paramDefn in methodParams){
|
||||
argTypesArray.push(paramDefn.@type.toString());
|
||||
}
|
||||
methodArgumentNames = methodXml.metadata.(@name == "MethodArgumentNames");
|
||||
if(methodArgumentNames.length() > 0){
|
||||
argumentNames = methodArgumentNames.arg[0].@value.toString();
|
||||
argNamesArray = argNamesArray.concat(argumentNames.split(","));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(argNamesArray != null && argNamesArray.length > 0){
|
||||
result = [];
|
||||
//get the value of the input type parameter
|
||||
var inputClassName: String = getInputObjectName(className, resourcePath);
|
||||
var argName: String;
|
||||
var argType: String;
|
||||
var argumentValue: Object;
|
||||
for (var i: Number=0 ; i< argNamesArray.length ; i++){
|
||||
argName = StringUtil.trim( argNamesArray[i].toString() );
|
||||
argType = argTypesArray[i].toString();
|
||||
//if the parameter type is of collated input type
|
||||
if(argType == inputClassName){
|
||||
//create an object of type input model and populate it
|
||||
argumentValue = populateInputModelObject(argTypesArray[i], queryAndPathParameters);
|
||||
}
|
||||
//if it is a primitive type then
|
||||
else if( isPrimitiveType(argType) ){
|
||||
//get the value from the queryAndPathParameters
|
||||
argumentValue = queryAndPathParameters[argName] ;
|
||||
}
|
||||
//if it is a POST param
|
||||
else if( argName == "postData"){
|
||||
//convert from JSON to object ? of type ?
|
||||
if(postData.charAt(0) == "\"" && postData.charAt(postData.length - 1) == "\""){
|
||||
postData = postData.slice(1, postData.length);
|
||||
}
|
||||
argumentValue = JSON.decode( postData.toString() );
|
||||
argumentValue = mapToFlexObjects(argumentValue, argType);
|
||||
}
|
||||
else if(true){
|
||||
//???some times input can be list of primitives for supporting multivalued values. however test case sends the input as comma separated values
|
||||
//???so we need to convert comma separated string into JSON list format
|
||||
argumentValue = queryAndPathParameters[argName].toString().split(",");
|
||||
}
|
||||
result.push(argumentValue);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an instance of type 'Object' to a type of 'argType'
|
||||
*/
|
||||
private function mapToFlexObjects(obj:Object, argType: String):Object {
|
||||
var fullClassName: String = argType.replace("::",".");
|
||||
var classRef:Class;
|
||||
try{
|
||||
classRef = getDefinitionByName(fullClassName) as Class;
|
||||
}
|
||||
catch(error: ReferenceError){
|
||||
var classFailure: Response = new Response(false, null, "Api Class not found");
|
||||
writeToFile( JSON.encode(classFailure) );
|
||||
}
|
||||
var returnObject : * = new classRef();
|
||||
|
||||
var propertyMap:XML = describeType(returnObject);
|
||||
var propertyTypeClass:Class;
|
||||
|
||||
for each (var property:XML in propertyMap.variable) {
|
||||
if ((obj as Object).hasOwnProperty(property.@name)) {
|
||||
propertyTypeClass = getDefinitionByName(property.@type) as Class;
|
||||
if (obj[property.@name] is (propertyTypeClass)) {
|
||||
returnObject[property.@name] = obj[property.@name];
|
||||
}
|
||||
|
||||
if(property.@type == "Date"){
|
||||
var dateValue:Date = DateUtil.parseW3CDTF( obj[property.@name] );
|
||||
returnObject[property.@name] = dateValue;
|
||||
}
|
||||
|
||||
if( !isPrimitiveType( property.@type )){
|
||||
try{
|
||||
var complexTypeObject: Object = mapToFlexObjects( obj[property.@name], property.@type );
|
||||
returnObject[property.@name] = complexTypeObject;
|
||||
}
|
||||
catch(error: Error){
|
||||
var mapToFlexFailure: Response = new Response(false, null, "Post data object could not be created");
|
||||
writeToFile( JSON.encode(mapToFlexFailure) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnObject;
|
||||
}
|
||||
|
||||
private function isPrimitiveType(type: String): Boolean {
|
||||
if(type == "String" || type == "int" || type == "integer" || type == "double" ||
|
||||
type == "boolean" || type == "float" || type == "long" || type == "Number" ){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the first character of the input into upper case .
|
||||
* Example: If the input is word, the return value will be Word
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
private function applyClassNamingPolicy(input: String): String {
|
||||
if(input != null && input.length > 0) {
|
||||
return input.substring(0,1).toUpperCase() + input.substring(1);
|
||||
}else{
|
||||
throw new Error("Error converting input to first letter caps becuase of null or empty input");
|
||||
}
|
||||
}
|
||||
|
||||
private function getInputObjectName(serviceName: String, resourcePath: String): String {
|
||||
//Since service name has API at the end remove that format he name
|
||||
var inputobjectName: String = serviceName.substring(0, serviceName.length - 3);
|
||||
|
||||
var pathElements: Array = resourcePath.split("/");
|
||||
var urlPath: String = "";
|
||||
if(pathElements != null){
|
||||
for each(var pathElement: String in pathElements){
|
||||
if(pathElement != null && pathElement.length > 0) {
|
||||
var position: int = pathElement.indexOf("{");
|
||||
if(position < 0) {
|
||||
inputobjectName = inputobjectName + applyClassNamingPolicy( pathElement ) + "Input";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return inputobjectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the swagger input model object.
|
||||
*
|
||||
* Input model is created when number of inputs to a method exceed certain limit.
|
||||
* @param inputDefinitions
|
||||
* @return
|
||||
*/
|
||||
private function populateInputModelObject(swaggerInputClassName: String, inputDefinitions: Object): Object {
|
||||
var inputModelObjectClass: Class = getDefinitionByName(swaggerInputClassName) as Class;
|
||||
var inputObject: Object = new inputModelObjectClass();
|
||||
|
||||
for(var attributeName: String in inputDefinitions){
|
||||
if(inputObject.hasOwnProperty(attributeName)){
|
||||
inputObject[attributeName] = inputDefinitions[attributeName];
|
||||
}
|
||||
}
|
||||
|
||||
return inputObject;
|
||||
}
|
||||
|
||||
public function applicationExit():void {
|
||||
var exitingEvent:Event = new Event(Event.EXITING, false, true);
|
||||
NativeApplication.nativeApplication.dispatchEvent(exitingEvent);
|
||||
if (!exitingEvent.isDefaultPrevented()) {
|
||||
NativeApplication.nativeApplication.exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * Gets the list of input query and path parameters and post data vlues and covenrt them to arguments that
|
||||
// * can be used for calling the method. This logic will be different in each driver language depends on how method
|
||||
// * input arguments are created.
|
||||
// */
|
||||
// private function populateArgumentsForTestCaseExecution(methodToExecute: Function, queryAndPathParameters: Object,
|
||||
// postData: String, serviceName: String, resourcePath: String): Array {
|
||||
// MethodArgumentNames argNames = methodToExecute.getAnnotation(MethodArgumentNames.class);
|
||||
// String[] argNamesArray = null;
|
||||
// if(argNames != null && argNames.value().length() > 0) {
|
||||
// argNamesArray = argNames.value().split(",");
|
||||
// }
|
||||
// Class[] argTypesArray = methodToExecute.getParameterTypes();
|
||||
// Object output = null;
|
||||
// String inputClassName = namingPolicyProvider.getInputObjectName(serviceName, resourcePath);
|
||||
//
|
||||
// if(argNamesArray != null && argNamesArray.length > 0){
|
||||
// Object[] arguments = new Object[argNamesArray.length];
|
||||
//
|
||||
// for(int i=0; i < argNamesArray.length; i++){
|
||||
// Object argument = null;
|
||||
// //if the method takes input model instead of individual arguments, convert individual arguments into input model object
|
||||
// if(argTypesArray[i].getName().equalsIgnoreCase(inputClassName)){
|
||||
// argument = populateInputModelObject(argTypesArray[i], queryAndPathParameters);
|
||||
// }else if(datatypeMppingProvider.isPrimitiveType(argTypesArray[i].getName())){
|
||||
// argument = queryAndPathParameters.get(argNamesArray[i].trim());
|
||||
// }else if (argNamesArray[i].trim().equals(APITestRunner.POST_PARAM_NAME)){
|
||||
// argument = APITestRunner.convertJSONStringToObject(postData, argTypesArray[i]);
|
||||
// }else{
|
||||
// //some times input can be list of primitives for supporting multivalued values. however test case sends the input as comma separated values
|
||||
// //so we need to convert comma separated string into JSON list format
|
||||
// if(List.class.isAssignableFrom(argTypesArray[i]) && !queryAndPathParameters.get(argNamesArray[i].trim()).startsWith("[")){
|
||||
// String listInput= "[";
|
||||
// int x = 0;
|
||||
// String[] values = queryAndPathParameters.get(argNamesArray[i].trim()).split(",");
|
||||
// for(String value : values){
|
||||
// if(x > 0){listInput = listInput + ",";}
|
||||
// listInput = listInput + "\""+ value + "\"";
|
||||
// x++;
|
||||
// }
|
||||
// listInput = listInput + "]";
|
||||
// argument = APITestRunner.convertJSONStringToObject(listInput, argTypesArray[i]);
|
||||
// }else{
|
||||
// argument = APITestRunner.convertJSONStringToObject(queryAndPathParameters.get(argNamesArray[i].trim()), argTypesArray[i]);
|
||||
// }
|
||||
// }
|
||||
// arguments[i] = argument;
|
||||
// }
|
||||
// return arguments;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package $packageName$;
|
||||
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* $enum.description$
|
||||
* NOTE: This class is auto generated by the drive code generator program so please do not edit the class manually.
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
public enum $className$ {
|
||||
|
||||
$values: { value | $value.name$($value.value$)};separator=", "$;
|
||||
|
||||
final $enumValueType$ value;
|
||||
|
||||
$className$($enumValueType$ value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public $enumValueType$ getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return String.valueOf(this.getValue());
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
package $packageName$ {
|
||||
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* $model.description$
|
||||
* NOTE: This class is auto generated by the drive code generator program so please do not edit the class manually.
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
[XmlRootNode(name="$model.name$")]
|
||||
public class $className$ extends $extends$ {
|
||||
|
||||
$fields:{ field |
|
||||
|
||||
/**
|
||||
* $field.description$
|
||||
* $if(field.required)$@Required$endif$
|
||||
* $if(field.allowableValues)$[AllowableValues(value="$field.allowedValuesString$"]$endif$
|
||||
*/
|
||||
$if(!field.fieldDefinition.collectionItemType)$
|
||||
[XmlElement(name="$field.fieldDefinition.name$")]$endif$
|
||||
$if(field.fieldDefinition.collectionItemType)$
|
||||
[XmlElements(name="$field.fieldDefinition.name$", type="$field.fieldDefinition.collectionItemType$")]$endif$
|
||||
public var $field.fieldDefinition.name$: $field.fieldDefinition.returnType$ $field.fieldDefinition.initialization$;$\r$}$
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package $packageName$ {
|
||||
|
||||
import com.wordnik.swagger.api.*;
|
||||
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* This class contains references for any classes that might not be directly referenced by the Api classes.
|
||||
* The AS3 compiler will exclude any class that is not referenced directly somewhere in your code.
|
||||
* This is an optimization that the compiler applies by design.
|
||||
* This convenience class prevents the user from having to iclude an import and variable declaration for such classes.
|
||||
*
|
||||
* NOTE: This class is auto generated by the drive code generator program so please do not edit the class manually.
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
public class LibraryReferences {
|
||||
|
||||
$fields:{ field |
|
||||
private var $field.name$: $field.paramType$;$\r$}$
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
package $packageName$ {
|
||||
|
||||
|
||||
import $exceptionPackageName$.ApiErrorCodes;
|
||||
import $exceptionPackageName$.ApiError;
|
||||
import $modelPackageName$.*;
|
||||
import com.wordnik.swagger.common.ApiUserCredentials;
|
||||
import com.wordnik.swagger.event.Response;
|
||||
import com.wordnik.swagger.common.SwaggerApi;
|
||||
|
||||
import mx.rpc.AsyncToken;
|
||||
import mx.utils.UIDUtil;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.events.EventDispatcher;
|
||||
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the drive code generator program so please do not edit the class manually.
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
public class $resource$ extends $extends$ {
|
||||
|
||||
$methods:{ method |
|
||||
public var event_$method.name$: String = "$method.name$";$\r$}$
|
||||
|
||||
/**
|
||||
* Constructor for the $resource$ api client
|
||||
* @param apiCredentials Wrapper object for tokens and hostName required towards authentication
|
||||
* @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response
|
||||
*/
|
||||
public function $resource$(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) {
|
||||
super(apiCredentials, eventDispatcher);
|
||||
}
|
||||
|
||||
|
||||
$methods:{ method |
|
||||
/**
|
||||
* $method.description$
|
||||
$method.arguments:{ argument |
|
||||
* @param $argument.name$ $argument.description$
|
||||
$if(argument.allowedValues)$
|
||||
* Allowed values are - $argument.allowedValues$
|
||||
$endif$}$
|
||||
*
|
||||
$if(!method.responseVoid)$
|
||||
* @return $method.returnValue$ {@link $method.returnClassName$} $endif$
|
||||
*/
|
||||
$if(method.hasArguments)$
|
||||
[MethodArgumentNames(value="$method.argumentNames; separator=", "$")]$endif$
|
||||
public function $method.name$($method.argumentDefinitions; separator=", "$): String {
|
||||
|
||||
$if(method.authToken)$
|
||||
if(_apiUsageCredentials == null || _apiUsageCredentials.authToken == null || _apiUsageCredentials.authToken.length == 0) {
|
||||
throw new ApiError(ApiErrorCodes.AUTH_TOKEN_NOT_VALID);
|
||||
}$endif$
|
||||
var requestId: String = getUniqueId();
|
||||
//parse inputs
|
||||
var resourcePath: String = "$method.resourcePath$";
|
||||
resourcePath = resourcePath.replace("{format}","xml");
|
||||
var method: String = "$method.methodType$";
|
||||
var queryParams:Dictionary = new Dictionary();
|
||||
var headerParams:Dictionary = new Dictionary();
|
||||
$if(!method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if( $argument.name$ != null) {
|
||||
queryParams["$argument.name$"] = toPathValue($argument.name$);
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if( $argument.name$ != null) {
|
||||
resourcePath = resourcePath.replace("{$argument.name$}", $argument.name$);
|
||||
}
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if( $argument.name$ != null) {
|
||||
headerParams["$argument.name$"] = toPathValue($argument.name$);
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
$if(method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if( $argument.inputModelClassArgument$ != null && $argument.methodNameFromModelClass$ != null) {
|
||||
queryParams["$argument.name$"] = $argument.methodNameFromModelClass$;
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if( $argument.inputModelClassArgument$ != null && $argument.methodNameFromModelClass$ != null) {
|
||||
resourcePath = resourcePath.replace("{$argument.name$}", $argument.methodNameFromModelClass$);
|
||||
}
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if( $argument.inputModelClassArgument$ != null && $argument.methodNameFromModelClass$ != null) {
|
||||
headerParams["$argument.name$"] = $argument.methodNameFromModelClass$;
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
//make the API Call
|
||||
$if(method.postObject)$
|
||||
$if(method.authToken)$
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(resourcePath, method, queryParams, postData, headerParams);
|
||||
$endif$
|
||||
$if(!method.authToken)$
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(resourcePath, method, queryParams, postData, headerParams);
|
||||
$endif$
|
||||
$endif$
|
||||
|
||||
$if(!method.postObject)$
|
||||
$if(method.authToken)$
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(resourcePath, method, queryParams, null, headerParams);
|
||||
$endif$
|
||||
$if(!method.authToken)$
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(resourcePath, method, queryParams, null, headerParams);
|
||||
$endif$
|
||||
$endif$
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "$method.name$";
|
||||
|
||||
//create output objects if the response has more than one object
|
||||
$if(!method.responseVoid)$
|
||||
token.returnType = $method.returnClassName$;
|
||||
|
||||
$endif$
|
||||
return requestId;
|
||||
}
|
||||
}$
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package $packageName$ {
|
||||
|
||||
/**
|
||||
* Maintains the compatible server version against which the drive is written
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
public class VersionChecker {
|
||||
|
||||
private var compatibleVersion: String = "$apiVersion$";
|
||||
|
||||
/**
|
||||
* Gets the version against which the driver code was written
|
||||
*/
|
||||
public function getCompatibleVersion(): String {
|
||||
return compatibleVersion;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package $packageName$ {
|
||||
|
||||
import com.wordnik.swagger.common.ListWrapper;
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* $model.description$
|
||||
* NOTE: This class is auto generated by the drive code generator program so please do not edit the class manually.
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
public class $className$ extends $extends$ implements ListWrapper{
|
||||
|
||||
$fields:{ field |
|
||||
/**
|
||||
* $field.description$
|
||||
* $if(field.required)$@Required$endif$
|
||||
* $if(field.allowableValues)$[AllowableValues(value="$field.allowedValuesString$"]$endif$
|
||||
*/
|
||||
$if(!field.fieldDefinition.collectionItemType)$
|
||||
[XmlElement(name="$field.fieldDefinition.name$")]$endif$
|
||||
$if(field.fieldDefinition.collectionItemType)$
|
||||
[XmlElements(name="$field.fieldDefinition.collectionItemName$", type="$field.fieldDefinition.collectionItemType$")]$endif$
|
||||
public var $field.fieldDefinition.name$: $field.fieldDefinition.returnType$ $field.fieldDefinition.initialization$;}$
|
||||
|
||||
$fields:{ field |
|
||||
/**
|
||||
* Returns the list being wrapped by this wrapper class. There will be a single list item attribute in this class.
|
||||
*/
|
||||
$if(field.fieldDefinition.collectionItemType)$
|
||||
public function getList(): $field.fieldDefinition.returnType${
|
||||
return $field.fieldDefinition.name$;
|
||||
}$endif$}$
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="swagger-sample-java-lib" xmlns:ivy="antlib:org.apache.ivy.ant" default="build.all" basedir=".">
|
||||
<property environment="env" />
|
||||
<property name="version.identifier" value="1.0" />
|
||||
<property name="artifact.ext" value="jar" />
|
||||
<property name="organization" value="wordnik" />
|
||||
<property name="module" value="${ant.project.name}" />
|
||||
|
||||
<!-- default dirs for the build -->
|
||||
<mkdir dir="lib"/>
|
||||
<mkdir dir="lib/ext"/>
|
||||
|
||||
<condition property="scala.home" value="${env.SCALA_HOME}">
|
||||
<isset property="env.SCALA_HOME" />
|
||||
</condition>
|
||||
|
||||
<path id="scala.classpath">
|
||||
<fileset dir="${scala.home}/lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<ivy:settings file="ivysettings.xml" />
|
||||
|
||||
<taskdef resource="scala/tools/ant/antlib.xml">
|
||||
<classpath>
|
||||
<fileset dir="lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${scala.home}/lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
|
||||
<!-- this is the output module -->
|
||||
<property name="module" value="${ant.project.name}" />
|
||||
|
||||
<target name="build.all" depends="clean, resolve, fastcompile" description="builds the module (default target)" />
|
||||
|
||||
<target name="clean" description="cleans the project folder">
|
||||
<mkdir dir="build" />
|
||||
<echo message="deleting build files" />
|
||||
<delete quiet="true">
|
||||
<fileset dir="build">
|
||||
<include name="*.jar" />
|
||||
<include name="*.xml" />
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<delete dir="build/main" quiet="true" />
|
||||
|
||||
<delete dir="dist" quiet="true" />
|
||||
|
||||
<!-- libraries handled by ivy -->
|
||||
<echo message="deleting libs handled by ivy" />
|
||||
<delete>
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
<include name="*.zip" />
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- copies ONLY the swagger-sample jar to dist-->
|
||||
<target name="fastdist" depends="fastcompile">
|
||||
<copy todir="dist/lib">
|
||||
<fileset dir="build">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!-- copies all dependencies into the lib folder -->
|
||||
<target name="resolve" description="retreive dependencies with ivy">
|
||||
<ivy:retrieve pattern="${basedir}/lib/[artifact]-[revision].[ext]" conf="build" />
|
||||
</target>
|
||||
|
||||
<target name="fastcompile" description="builds the module without artifact resolution or cleaning">
|
||||
<delete quiet="true" file="build/${organization}-${artifact}-*.${artifact.ext}" />
|
||||
<mkdir dir="build" />
|
||||
<mkdir dir="build/main" />
|
||||
<mkdir dir="build/main/java" />
|
||||
|
||||
<javac srcdir="src/main/java" debug="true" destdir="build/main/java">
|
||||
<classpath>
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="lib/ext">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<pathelement location="build/main/java" />
|
||||
</classpath>
|
||||
</javac>
|
||||
<jar jarfile="build/${module}-${version.identifier}.${artifact.ext}">
|
||||
<fileset dir="build/main/java" />
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<!-- cleans up the dist -->
|
||||
<target name="dist.clean" description="cleans the distribution folder">
|
||||
<delete quiet="true" dir="dist" />
|
||||
<delete quiet="true" file="dist.zip" />
|
||||
</target>
|
||||
|
||||
<target name="dependency.tree" description="builds a graphml dependency diagram for viewing with yEd">
|
||||
<ivy:report conf="build" graph="true" todir="." outputpattern="[artifact]-[revision].[ext]" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -1,31 +0,0 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="wordnik" module="sample-java-lib"/>
|
||||
<configurations>
|
||||
<conf name="build" description="build wordnik-java"/>
|
||||
<conf name="test" visibility="public"/>
|
||||
<conf name="source" visibility="public"/>
|
||||
<conf name="pom" visibility="public"/>
|
||||
</configurations>
|
||||
|
||||
<dependencies>
|
||||
<!-- jersey dependencies -->
|
||||
<dependency org="junit" name="junit" rev="4.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-json" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-client" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-server" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-core" rev="1.4" conf="build->default"/>
|
||||
<dependency org="asm" name="asm-parent" rev="3.1" conf="build->default"/>
|
||||
<dependency org="commons-beanutils" name="commons-beanutils" rev="1.8.0" conf="build->default"/>
|
||||
<dependency org="org.antlr" name="stringtemplate" rev="3.2" conf="build->default"/>
|
||||
<!-- jackson jars -->
|
||||
<dependency org="org.codehaus.jackson" name="jackson-jaxrs" rev="1.7.1" conf="build->default"/>
|
||||
<dependency org="org.codehaus.jackson" name="jackson-xc" rev="1.7.1" conf="build->default"/>
|
||||
<dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.7.1" conf="build->default"/>
|
||||
|
||||
|
||||
<dependency org="net.sourceforge.cobertura" name="cobertura" rev="1.9.2" conf="test->default">
|
||||
<exclude org="asm" name="asm-tree"/>
|
||||
<exclude org="asm" name="asm"/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ivysettings>
|
||||
<settings defaultResolver="chained" />
|
||||
<property name="ivy.checksums" value=""/>
|
||||
<property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local"
|
||||
override="false" />
|
||||
<property name="ivy.local.default.ivy.pattern"
|
||||
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
|
||||
override="false" />
|
||||
<property name="ivy.local.default.artifact.pattern"
|
||||
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
|
||||
override="false" />
|
||||
<resolvers>
|
||||
<chain name="chained" returnFirst="true">
|
||||
<filesystem name="local">
|
||||
<ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
|
||||
<artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />
|
||||
</filesystem>
|
||||
<ibiblio name="ibiblio" m2compatible="true" />
|
||||
<ibiblio name="javanet" root="http://download.java.net/maven/2/" m2compatible="true" />
|
||||
</chain>
|
||||
</resolvers>
|
||||
</ivysettings>
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"apiUrl":"http://localhost:8002/api/",
|
||||
|
||||
"apiKey":"special-key",
|
||||
|
||||
"defaultServiceBaseClass":"Object",
|
||||
|
||||
"defaultModelBaseClass":"Object",
|
||||
|
||||
"serviceBaseClasses":{},
|
||||
|
||||
"defaultModelImports":[],
|
||||
|
||||
"defaultServiceImports":[],
|
||||
|
||||
"modelPackageName":"com.wordnik.swagger.sample.sdk.java.model",
|
||||
|
||||
"apiPackageName":"com.wordnik.swagger.sample.sdk.java.api",
|
||||
|
||||
"ignoreMethods":[],
|
||||
|
||||
"ignoreModels":[],
|
||||
|
||||
"outputDirectory":"../swagger-sample-app/sdk-libs/src/main/java/com/wordnik/swagger/sample/sdk/java",
|
||||
|
||||
"libraryHome":"../swagger-sample-app/sdk-libs"
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
{
|
||||
"userList":[
|
||||
{
|
||||
"username":"testuser1",
|
||||
"password":"password1",
|
||||
"email":"test1@dummy.com"
|
||||
},
|
||||
{
|
||||
"username":"testuser2",
|
||||
"password":"password2",
|
||||
"email":"test2@dummy.com"
|
||||
},
|
||||
{
|
||||
"username":"user?10",
|
||||
"password":"password2",
|
||||
"email":"test2@dummy.com"
|
||||
}
|
||||
],
|
||||
"petList":[
|
||||
{
|
||||
"id":101,
|
||||
"name":"pet1",
|
||||
"photoUrls":["url1","url2"],
|
||||
"tags":[
|
||||
{
|
||||
"id":1,
|
||||
"name":"tag1"
|
||||
},
|
||||
{
|
||||
"id":2,
|
||||
"name":"tag2"
|
||||
}
|
||||
],
|
||||
"status":"available",
|
||||
"category":{"id":1,"name":"cat1"}
|
||||
}
|
||||
],
|
||||
"orderList":[
|
||||
{
|
||||
"id":101,
|
||||
"petId":1,
|
||||
"quantity":1,
|
||||
"status":"placed",
|
||||
"shipDate":13456789
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,325 +0,0 @@
|
||||
{
|
||||
"resources" : [
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "Find Per by Id",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/{petId}",
|
||||
"suggestedMethodName" : "getPetById"
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"name" : "Find pets by status",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/findByStatus",
|
||||
"suggestedMethodName" : "findPetsByStatus"
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"name" : "Find pets by tags",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/findByTags",
|
||||
"suggestedMethodName" : "findPetsByTags"
|
||||
},
|
||||
{
|
||||
"id" : 4,
|
||||
"name" : "Add a pet",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/pet.{format}",
|
||||
"suggestedMethodName" : "addPet"
|
||||
},
|
||||
{
|
||||
"id" : 5,
|
||||
"name" : "Update a pet",
|
||||
"httpMethod" : "PUT",
|
||||
"path" : "/pet.{format}",
|
||||
"suggestedMethodName" : "updatePet"
|
||||
},
|
||||
{
|
||||
"id" : 6,
|
||||
"name" : "Create user",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/user.{format}",
|
||||
"suggestedMethodName" : "createUser"
|
||||
},
|
||||
{
|
||||
"id" : 7,
|
||||
"name" : "Update user",
|
||||
"httpMethod" : "PUT",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "updateUser"
|
||||
},
|
||||
{
|
||||
"id" : 8,
|
||||
"name" : "Delete user",
|
||||
"httpMethod" : "DELETE",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "deleteUser"
|
||||
},
|
||||
{
|
||||
"id" : 9,
|
||||
"name" : "Get user by user name",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "getUserByName"
|
||||
},
|
||||
{
|
||||
"id" : 10,
|
||||
"name" : "Login",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/login",
|
||||
"suggestedMethodName" : "loginUser"
|
||||
},
|
||||
{
|
||||
"id" : 11,
|
||||
"name" : "Logout",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/logout",
|
||||
"suggestedMethodName" : "logoutUser"
|
||||
},
|
||||
{
|
||||
"id" : 12,
|
||||
"name" : "Find order by id",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/store.{format}/order/{orderId}",
|
||||
"suggestedMethodName" : "getOrderById"
|
||||
},
|
||||
{
|
||||
"id" : 13,
|
||||
"name" : "Delete order by id",
|
||||
"httpMethod" : "DELETE",
|
||||
"path" : "/store.{format}/order/{orderId}",
|
||||
"suggestedMethodName" : "deleteOrder"
|
||||
},
|
||||
{
|
||||
"id" : 14,
|
||||
"name" : "Create order",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/store.{format}/order",
|
||||
"suggestedMethodName" : "placeOrder"
|
||||
},
|
||||
{
|
||||
"id" : 15,
|
||||
"name" : "Get users with array input",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/user.{format}/usersWithArray",
|
||||
"suggestedMethodName" : "getUserByNamesArray"
|
||||
},
|
||||
{
|
||||
"id" : 16,
|
||||
"name" : "get users with list",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/user.{format}/usersWithList",
|
||||
"suggestedMethodName" : "getUserByNamesList"
|
||||
}
|
||||
],
|
||||
"testSuites" : [
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "Test User service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Create User",
|
||||
"id" : 1,
|
||||
"resourceId" : 6,
|
||||
"input" : {
|
||||
"postData":"${input.userList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Login User",
|
||||
"id" : 2,
|
||||
"resourceId" : 10,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}",
|
||||
"password":"${input.userList[0].password}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find user by name",
|
||||
"id" : 3,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.3).username}",
|
||||
"condition" : "==",
|
||||
"expectedOutput" : "${input.userList[0].username}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Delete user by name",
|
||||
"id" : 4,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.4)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find user by name with special characters",
|
||||
"id" : 5,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[2].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.5).username}",
|
||||
"condition" : "==",
|
||||
"expectedOutput" : "${input.userList[2].username}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find users with array of user names",
|
||||
"id" : 6,
|
||||
"resourceId" : 15,
|
||||
"input" : {
|
||||
"postData":"[\"testuser1\", \"testuser2\"]"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.6).size}",
|
||||
"condition" : "==",
|
||||
"expectedOutput" : "2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find users with list of user names",
|
||||
"id" : 7,
|
||||
"resourceId" : 16,
|
||||
"input" : {
|
||||
"postData":"[\"testuser1\", \"testuser2\"]"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.7).size}",
|
||||
"condition" : "==",
|
||||
"expectedOutput" : "2"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"name" : "Test Pet service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Add pet",
|
||||
"id" : 1,
|
||||
"resourceId" : 4,
|
||||
"input" : {
|
||||
"postData":"${input.petList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find pet by id",
|
||||
"id" : 2,
|
||||
"resourceId" : 1,
|
||||
"input" : {
|
||||
"petId":"1"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "NULL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find pet by status",
|
||||
"id" : 3,
|
||||
"resourceId" : 2,
|
||||
"input" : {
|
||||
"status":"available,sold,pending"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.3).size}",
|
||||
"condition" : ">",
|
||||
"expectedOutput" : "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"name" : "Test Store service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Find order by id",
|
||||
"id" : 1,
|
||||
"resourceId" : 12,
|
||||
"input" : {
|
||||
"orderId":"3"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(3.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "NULL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Place order",
|
||||
"id" : 2,
|
||||
"resourceId" : 14,
|
||||
"input" : {
|
||||
"postData":"${input.orderList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
* Copyright 2011 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package $packageName$;
|
||||
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* $enum.description$
|
||||
* NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
public enum $className$ {
|
||||
|
||||
$values: { value | $value.name$($value.value$)};separator=", "$;
|
||||
|
||||
private $enumValueType$ value;
|
||||
|
||||
$className$($enumValueType$ value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public $enumValueType$ getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return String.valueOf(this.getValue());
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/**
|
||||
* Copyright 2011 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package $packageName$;
|
||||
|
||||
import com.wordnik.swagger.runtime.annotations.*;
|
||||
import java.util.List;
|
||||
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* $model.description$
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
*
|
||||
* @author ramesh
|
||||
*
|
||||
*/
|
||||
public class $className$ extends $extends$ {
|
||||
|
||||
$fields:{ field |
|
||||
|
||||
/**
|
||||
* $field.description$
|
||||
*/
|
||||
private $field.fieldDefinition.returnType$ $field.fieldDefinition.name$ $field.fieldDefinition.initialization$;$\r$}$
|
||||
|
||||
$fields:{ field |
|
||||
/**
|
||||
* $field.description$
|
||||
* $if(field.required)$@Required$endif$
|
||||
* $if(field.allowableValues)$@AllowableValues(value="$field.allowedValuesString$")$endif$
|
||||
*/
|
||||
public $field.fieldDefinition.returnType$ get$field.fieldDefinition.NameForMethod$() {
|
||||
return $field.fieldDefinition.name$;
|
||||
}
|
||||
|
||||
public void set$field.fieldDefinition.NameForMethod$($field.fieldDefinition.returnType$ $field.fieldDefinition.name$) {
|
||||
this.$field.fieldDefinition.name$ = $field.fieldDefinition.name$;
|
||||
}
|
||||
|
||||
}$
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
/**
|
||||
* Copyright 2011 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package $packageName$;
|
||||
|
||||
|
||||
import $modelPackageName$.*;
|
||||
|
||||
import org.codehaus.jackson.map.DeserializationConfig.Feature;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.codehaus.jackson.type.TypeReference;
|
||||
import com.wordnik.swagger.runtime.annotations.*;
|
||||
import com.wordnik.swagger.runtime.common.*;
|
||||
import com.wordnik.swagger.runtime.exception.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.lang.Long;
|
||||
import java.io.IOException;
|
||||
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
* @author ramesh
|
||||
*
|
||||
*/
|
||||
public class $resource$ extends $extends$ {
|
||||
|
||||
private static APIInvoker apiInvoker = null;
|
||||
|
||||
$methods:{ method |
|
||||
/**
|
||||
* $method.title$
|
||||
*
|
||||
$if(method.description)$
|
||||
* $method.description$
|
||||
* $endif$
|
||||
* $method.arguments:{ argument |@param $argument.name$ $argument.description$
|
||||
* $if(argument.allowedValues)$
|
||||
* Allowed values are - $argument.allowedValues$ $endif$ }$
|
||||
$if(!method.responseVoid)$
|
||||
* @return $method.returnValue$ {@link $method.returnClassName$} $endif$
|
||||
* @throws APIException $method.exceptionDescription$
|
||||
*/
|
||||
$if(method.hasArguments)$
|
||||
@MethodArgumentNames(value="$method.argumentNames; separator=", "$")
|
||||
$endif$
|
||||
|
||||
public static $method.returnValue$ $method.name$($method.argumentDefinitions; separator=", "$) throws APIException {
|
||||
|
||||
//parse inputs
|
||||
String resourcePath = "$method.resourcePath$";
|
||||
resourcePath = resourcePath.replace("{format}","json");
|
||||
String method = "$method.methodType$";
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
$if(!method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if( $argument.name$ != null) {
|
||||
queryParams.put("$argument.name$", APIInvoker.toPathValue($argument.name$));
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if( $argument.name$ != null) {
|
||||
resourcePath = resourcePath.replace("{$argument.name$}", APIInvoker.toPathValue($argument.name$));
|
||||
}
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if( $argument.name$ != null) {
|
||||
headerParams.put("$argument.name$", APIInvoker.toPathValue($argument.name$));
|
||||
}
|
||||
}$
|
||||
|
||||
$endif$
|
||||
$if(method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if( $argument.inputModelClassArgument$ != null && $argument.methodNameFromModelClass$ != null) {
|
||||
queryParams.put("$argument.name$", APIInvoker.toPathValue($argument.methodNameFromModelClass$));
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if( $argument.inputModelClassArgument$ != null && $argument.methodNameFromModelClass$ != null) {
|
||||
resourcePath = resourcePath.replace("{$argument.name$}", APIInvoker.toPathValue($argument.methodNameFromModelClass$));
|
||||
}
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if( $argument.inputModelClassArgument$ != null && $argument.methodNameFromModelClass$ != null) {
|
||||
headerParams.put("$argument.name$", APIInvoker.toPathValue($argument.methodNameFromModelClass$));
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
//make the API Call
|
||||
$if(method.postObject)$
|
||||
String response = getApiInvoker().invokeAPI(resourcePath, method, queryParams, postData, headerParams);
|
||||
$endif$
|
||||
|
||||
$if(!method.postObject)$
|
||||
String response = getApiInvoker().invokeAPI(resourcePath, method, queryParams, null, headerParams);
|
||||
$endif$
|
||||
|
||||
$if(!method.responseVoid)$
|
||||
if(response == null || response.length() == 0){
|
||||
return null;
|
||||
}
|
||||
$if(!method.returnValueList)$
|
||||
//create output objects if the response has more than one object
|
||||
$method.returnValue$ responseObject = ($method.returnValue$) getApiInvoker().deserialize(response, $method.returnClassName$.class);
|
||||
return responseObject;
|
||||
$endif$
|
||||
$if(method.returnValueList)$
|
||||
TypeReference<ArrayList<$method.returnClassName$>> typeRef = new TypeReference<ArrayList<$method.returnClassName$>>() {};
|
||||
try {
|
||||
List<$method.returnClassName$> responseObject = (List<$method.returnClassName$>) getApiInvoker().mapper.readValue(response, typeRef);
|
||||
return responseObject;
|
||||
} catch (IOException ioe) {
|
||||
String[] args = new String[]{response, typeRef.toString()};
|
||||
throw new APIException(APIExceptionCodes.ERROR_CONVERTING_JSON_TO_JAVA, args, "Error in converting response json value to java object : " + ioe.getMessage(), ioe);
|
||||
}
|
||||
$endif$
|
||||
$endif$
|
||||
}
|
||||
|
||||
}$
|
||||
|
||||
public static APIInvoker getApiInvoker() {
|
||||
if(apiInvoker == null){
|
||||
apiInvoker = APIInvoker.getApiInvoker();
|
||||
}
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
public static void setApiInvoker(APIInvoker invoker) {
|
||||
apiInvoker = invoker;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"apiUrl":"http://localhost:8002/api/",
|
||||
|
||||
"apiKey":"special-key",
|
||||
|
||||
"defaultServiceBaseClass":"SwaggerApi",
|
||||
|
||||
"defaultModelBaseClass":"Object",
|
||||
|
||||
"serviceBaseClasses":{},
|
||||
|
||||
"defaultModelImports":[],
|
||||
|
||||
"defaultServiceImports":[],
|
||||
|
||||
"modelPackageName":"",
|
||||
|
||||
"apiPackageName":"",
|
||||
|
||||
"ignoreMethods":[],
|
||||
|
||||
"ignoreModels":[],
|
||||
|
||||
"outputDirectory":"../swagger-sample-app/sdk-libs/src/main/js/",
|
||||
|
||||
"libraryHome":"../swagger-sample-app/sdk-libs"
|
||||
}
|
||||
4
conf/js/structure/lib/jquery-1.6.4.min.js
vendored
4
conf/js/structure/lib/jquery-1.6.4.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,73 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Swagger Javascript Lib Sandbox</title>
|
||||
<script src="lib/jquery-1.6.4.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="api-lib.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
function log(s) {
|
||||
if(window.console) console.log(s);
|
||||
}
|
||||
|
||||
function logResponse(event) {
|
||||
log("-----------------------------");
|
||||
log(event.type);
|
||||
log(event);
|
||||
}
|
||||
|
||||
function onUserCreated(event) {
|
||||
logResponse(event);
|
||||
|
||||
// update the created user
|
||||
var user = new User();
|
||||
user.lastName = "Sanders Lama";
|
||||
user.username = "vito";
|
||||
user.phone = "405-607-8980";
|
||||
user.email = "vito@sanders.com";
|
||||
user.userStatus = 1;
|
||||
user.firstName = "Vito";
|
||||
user.password = "XXXXX";
|
||||
UserAPI.updateUser("vito", user);
|
||||
}
|
||||
|
||||
function onUserUpdated(event) {
|
||||
logResponse(event);
|
||||
|
||||
// delete the created user
|
||||
UserAPI.deleteUser("vito");
|
||||
}
|
||||
|
||||
ApiInvoker.init("http://localhost:8002/api/", null, null, false);
|
||||
|
||||
ApiInvoker.addListener(PetAPI.event_getPetById, logResponse);
|
||||
ApiInvoker.addListener(StoreAPI.event_getOrderById, logResponse);
|
||||
ApiInvoker.addListener(UserAPI.event_getUserByName, logResponse);
|
||||
ApiInvoker.addListener(UserAPI.event_loginUser, logResponse);
|
||||
ApiInvoker.addListener(UserAPI.event_createUser, onUserCreated);
|
||||
ApiInvoker.addListener(UserAPI.event_updateUser, onUserUpdated);
|
||||
ApiInvoker.addListener(UserAPI.event_deleteUser, logResponse);
|
||||
|
||||
// Get some data
|
||||
StoreAPI.getOrderById("1");
|
||||
PetAPI.getPetById("1");
|
||||
UserAPI.getUserByName("user1");
|
||||
|
||||
// login
|
||||
UserAPI.loginUser("user1", "XXXXXXXXXXX")
|
||||
|
||||
// create new user
|
||||
var user = new User();
|
||||
user.lastName = "Sanders";
|
||||
user.username = "vito";
|
||||
user.phone = "405-607-8980";
|
||||
user.email = "vito@sanders.com";
|
||||
user.userStatus = 1;
|
||||
user.firstName = "Vito";
|
||||
user.password = "XXXXX";
|
||||
UserAPI.createUser(user);
|
||||
|
||||
</script>
|
||||
<body>
|
||||
</body>
|
||||
@@ -1,233 +0,0 @@
|
||||
var ApiInvoker = new function() {
|
||||
this.apiServer = null,
|
||||
this.authToken = null,
|
||||
this.apiKey = null,
|
||||
this.loggingEnabled = false,
|
||||
this.requestHeader = new Object(),
|
||||
|
||||
this.trace = function(obj) {
|
||||
if (this.loggingEnabled && window.console) console.log(obj);
|
||||
},
|
||||
|
||||
this.error = function(obj) {
|
||||
if (window.console) console.log(obj);
|
||||
},
|
||||
|
||||
this.init = function(apiServer, apiKey, authToken, loggingEnabled) {
|
||||
if (apiServer != null && apiServer.length > 0) {
|
||||
if (apiServer.substring(apiServer.length - 1) == ("/")) {
|
||||
apiServer = apiServer.substring(0, apiServer.length - 1);
|
||||
}
|
||||
this.apiServer = apiServer;
|
||||
this.apiKey = apiKey;
|
||||
this.authToken = authToken;
|
||||
this.loggingEnabled = (loggingEnabled === null) ? false : loggingEnabled;
|
||||
|
||||
if(this.apiKey)
|
||||
this.requestHeader.api_key = this.apiKey;
|
||||
|
||||
if(this.authToken)
|
||||
this.requestHeader.auth_token = this.authToken;
|
||||
|
||||
this.trace(this.requestHeader);
|
||||
}
|
||||
},
|
||||
|
||||
this.invokeAPI = function(authToken, resourceURL, method, queryParams, postObject, completionEvent, requestId, returnType, callback) {
|
||||
if (this.apiServer == null) {
|
||||
throw new Error("Please call ApiInvoker.init() to initialize the library");
|
||||
}
|
||||
|
||||
this.trace("authToken = " + authToken);
|
||||
this.trace("resourceURL = " + resourceURL);
|
||||
this.trace("method = " + method);
|
||||
// this.trace("returnType = " + returnType);
|
||||
this.trace("completionEvent = " + completionEvent);
|
||||
this.trace("requestId = " + requestId);
|
||||
this.trace("queryParams:");
|
||||
this.trace(queryParams);
|
||||
this.trace("postObject:");
|
||||
this.trace(postObject);
|
||||
|
||||
// create queryParam
|
||||
var counter = 0;
|
||||
var symbol = 0;
|
||||
for (var headerKey in this.requestHeader) {
|
||||
queryParams[headerKey] = this.requestHeader[headerKey]
|
||||
}
|
||||
|
||||
for (var paramName in queryParams) {
|
||||
var paramValue = queryParams[paramName];
|
||||
symbol = "&";
|
||||
if (counter == 0) {
|
||||
symbol = "?";
|
||||
}
|
||||
resourceURL = resourceURL + symbol + paramName + "=" + paramValue.toString();
|
||||
counter++;
|
||||
}
|
||||
|
||||
var callURL = this.apiServer + resourceURL;
|
||||
var responseDataType = (returnType === null || returnType == String) ? "html" : "json";
|
||||
|
||||
this.trace("callURL = " + callURL);
|
||||
this.trace("responseDataType = " + responseDataType);
|
||||
var ajaxRequest = null;
|
||||
if (method == "GET") {
|
||||
// $.get(callURL, postObject,
|
||||
// function(response) {
|
||||
// ApiInvoker.fire(completionEvent, returnType, requestId, response, callback);
|
||||
// }, responseDataType).complete(this.showCompleteStatus).error(this.showErrorStatus);
|
||||
ajaxRequest = $.ajax({
|
||||
url: callURL,
|
||||
data: JSON.stringify(postObject),
|
||||
type: "GET",
|
||||
dataType: "jsonp",
|
||||
contentType: "application/json",
|
||||
success: function(response) {
|
||||
ApiInvoker.fire(completionEvent, returnType, requestId, response, callback);
|
||||
}
|
||||
}).complete(this.showCompleteStatus).error(this.showErrorStatus);
|
||||
} else if (method == "POST") {
|
||||
this.trace("sending post");
|
||||
this.trace(JSON.stringify(postObject));
|
||||
ajaxRequest = $.ajax({
|
||||
url: callURL,
|
||||
data: JSON.stringify(postObject),
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
headers: this.requestHeader,
|
||||
success: function(response) {
|
||||
ApiInvoker.fire(completionEvent, returnType, requestId, response, callback);
|
||||
}
|
||||
}).complete(this.showCompleteStatus).error(this.showErrorStatus);
|
||||
} else if (method == "PUT") {
|
||||
ajaxRequest = $.ajax({
|
||||
url: callURL,
|
||||
data: JSON.stringify(postObject),
|
||||
type: "PUT",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
success: function(response) {
|
||||
ApiInvoker.fire(completionEvent, returnType, requestId, response, callback);
|
||||
}
|
||||
}).complete(this.showCompleteStatus).error(this.showErrorStatus);
|
||||
} else if (method == "DELETE") {
|
||||
ajaxRequest = $.ajax({
|
||||
url: callURL,
|
||||
data: JSON.stringify(postObject),
|
||||
type: "DELETE",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
success: function(response) {
|
||||
ApiInvoker.fire(completionEvent, returnType, requestId, response, callback);
|
||||
}
|
||||
}).complete(this.showCompleteStatus).error(this.showErrorStatus);
|
||||
}
|
||||
|
||||
return ajaxRequest;
|
||||
},
|
||||
|
||||
this.guid = function() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,
|
||||
function(c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
}).toUpperCase();
|
||||
},
|
||||
|
||||
this._listeners = {},
|
||||
|
||||
this.addListener = function(type, listener) {
|
||||
if (!this._listeners[type]) {
|
||||
this._listeners[type] = [];
|
||||
}
|
||||
|
||||
this._listeners[type].push(listener);
|
||||
},
|
||||
|
||||
this.fire = function(completionEvent, returnType, requestId, response, callback) {
|
||||
var event = new Object();
|
||||
event.type = completionEvent;
|
||||
event.requestId = requestId;
|
||||
if (returnType === null || returnType == String) {
|
||||
event.data = response;
|
||||
} else {
|
||||
event.data = eval("new " + returnType);
|
||||
event.data.parse(response);
|
||||
}
|
||||
|
||||
if (typeof event == "string") {
|
||||
event = { type: event };
|
||||
}
|
||||
|
||||
if (!event.target) {
|
||||
event.target = this;
|
||||
}
|
||||
|
||||
if (!event.type) {
|
||||
throw new Error("Event object must have 'type' property");
|
||||
}
|
||||
|
||||
this.trace(event.data);
|
||||
if(callback) {
|
||||
this.trace("invoking callback");
|
||||
callback(event);
|
||||
} else {
|
||||
this.trace("firing event " + event.type);
|
||||
|
||||
if (this._listeners[event.type]) {
|
||||
var listeners = this._listeners[event.type];
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
listeners[i].call(this, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
this.removeListener = function(type, listener) {
|
||||
if (this._listeners[type]) {
|
||||
var listeners = this._listeners[type];
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
if (listeners[i] === listener) {
|
||||
listeners.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
this.showErrorStatus = function(data) {
|
||||
ApiInvoker.trace(data);
|
||||
if (data.status != 200) {
|
||||
ApiInvoker.error("ERROR - " + data.status + ": " + data.statusText + " / " + data.responseText);
|
||||
} else {
|
||||
ApiInvoker.showStatus(data);
|
||||
}
|
||||
},
|
||||
|
||||
this.showCompleteStatus = function(data) {
|
||||
ApiInvoker.trace("complete " + data.status);
|
||||
// ApiInvoker.showStatus(data);
|
||||
},
|
||||
|
||||
this.showStatus = function(data) {
|
||||
ApiInvoker.trace(data);
|
||||
ApiInvoker.trace(data.getAllResponseHeaders());
|
||||
},
|
||||
|
||||
this.toPathValue = function(value) {
|
||||
if(typeof value == Array){
|
||||
return this.arrayToPathValue(value);
|
||||
} else
|
||||
return value == null ? "" : value.toString();
|
||||
},
|
||||
|
||||
this.arrayToPathValue = function(objects) {
|
||||
return objects.join(",");
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
package $packageName$;
|
||||
|
||||
$imports:{ import |
|
||||
import $import$;
|
||||
}$
|
||||
|
||||
/**
|
||||
* $enum.description$
|
||||
* NOTE: This class is auto generated by the drive code generator program so please do not edit the class manually.
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
public enum $className$ {
|
||||
|
||||
$values: { value | $value.name$($value.value$)};separator=", "$;
|
||||
|
||||
final $enumValueType$ value;
|
||||
|
||||
$className$($enumValueType$ value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public $enumValueType$ getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return String.valueOf(this.getValue());
|
||||
}
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
/**
|
||||
* $model.description$
|
||||
*/
|
||||
function $className$() {
|
||||
|
||||
$fields:{ field |
|
||||
|
||||
/**
|
||||
* $field.description$
|
||||
* $if(field.required)$@Required$endif$
|
||||
* $if(field.allowableValues)$[AllowableValues(value="$field.allowedValuesString$"]$endif$
|
||||
*/
|
||||
this.$field.fieldDefinition.name$ = null;$\r$}$
|
||||
|
||||
|
||||
this.parse = function(data) {
|
||||
if(data) {
|
||||
|
||||
$fields:{ field |
|
||||
$! //$field.fieldDefinition.returnType$ (primitive=$field.fieldDefinition.hasPrimitiveType$) !$
|
||||
$if(field.fieldDefinition.hasListResponse)$
|
||||
$if(field.fieldDefinition.hasPrimitiveType)$
|
||||
this.$field.fieldDefinition.name$ = data.$field.fieldDefinition.name$;
|
||||
$else$
|
||||
this.$field.fieldDefinition.name$ = $field.fieldDefinition.collectionItemType$Object.parseArray(data.$field.fieldDefinition.name$);
|
||||
$endif$
|
||||
$elseif(field.fieldDefinition.hasSetResponse)$
|
||||
$if(field.fieldDefinition.hasPrimitiveType)$
|
||||
this.$field.fieldDefinition.name$ = data.$field.fieldDefinition.name$;
|
||||
$else$
|
||||
this.$field.fieldDefinition.name$ = $field.fieldDefinition.collectionItemType$Collection.get(data.$field.fieldDefinition.name$);
|
||||
$endif$
|
||||
$elseif(field.fieldDefinition.hasMapResponse)$
|
||||
this.$field.fieldDefinition.name$ = data.$field.fieldDefinition.name$;
|
||||
$elseif(field.fieldDefinition.hasDateResponse)$
|
||||
this.$field.fieldDefinition.name$ = new Date(Date.parse(data.$field.fieldDefinition.name$));
|
||||
$else$
|
||||
$if(field.fieldDefinition.hasPrimitiveType)$
|
||||
this.$field.fieldDefinition.name$ = data.$field.fieldDefinition.name$;
|
||||
$else$
|
||||
this.$field.fieldDefinition.name$ = new $field.fieldDefinition.returnType$(); this.$field.fieldDefinition.name$.parse(data.$field.fieldDefinition.name$);
|
||||
$endif$
|
||||
$endif$
|
||||
|
||||
}$
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var $className$Object = new function() {
|
||||
this.parseArray = function(arrayData) {
|
||||
var responseArray = new Array();
|
||||
|
||||
if(arrayData != null && arrayData.length > 0) {
|
||||
for(var i = 0; i < arrayData.length; i++) {
|
||||
var o = new $className$();
|
||||
o.parse(arrayData[i]);
|
||||
responseArray.push(o);
|
||||
}
|
||||
}
|
||||
|
||||
return responseArray;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/**
|
||||
* NOTE: This class is auto generated by the drive code generator program so please do not edit the class manually.
|
||||
*/
|
||||
var $resource$ = new function() {
|
||||
|
||||
$methods:{ method |
|
||||
this.event_$method.name$ = "$resource$.$method.name$";$\r$}$
|
||||
|
||||
// /**
|
||||
// * Constructor for the $resource$ api client
|
||||
// * @param apiCredentials Wrapper object for tokens and hostName required towards authentication
|
||||
// * @param eventDispatcher Optional event dispatcher that when provided is used by the SDK to dispatch any Response
|
||||
// */
|
||||
// public function $resource$(apiCredentials: ApiUserCredentials, eventDispatcher: EventDispatcher = null) {
|
||||
// super(apiCredentials, eventDispatcher);
|
||||
// }
|
||||
|
||||
|
||||
$methods:{ method |
|
||||
/**
|
||||
* $method.description$
|
||||
$method.arguments:{ argument |
|
||||
* @param $argument.name$ $argument.description$
|
||||
$if(argument.allowedValues)$
|
||||
* Allowed values are - $argument.allowedValues$
|
||||
$endif$}$
|
||||
*
|
||||
$if(!method.responseVoid)$
|
||||
* @return $method.returnValue$ {@link $method.returnClassName$} $endif$
|
||||
* $if(method.hasArguments)$ $length(method.argumentNames)$ $endif$
|
||||
*/
|
||||
|
||||
$if(method.hasArguments)$
|
||||
this.$method.name$ = function($method.argumentNames; separator=", "$, callback)
|
||||
$else$
|
||||
this.$method.name$ = function(callback)
|
||||
$endif$ {
|
||||
|
||||
$if(method.authToken)$
|
||||
if(authToken == null || authToken.length == 0) {
|
||||
throw new Error(ApiErrorCodes.AUTH_TOKEN_NOT_VALID);
|
||||
}$endif$
|
||||
var requestId = ApiInvoker.guid();
|
||||
//parse inputs
|
||||
var resourcePath = "$method.resourcePath$";
|
||||
resourcePath = resourcePath.replace("{format}","json");
|
||||
var method = "$method.methodType$";
|
||||
var queryParams = new Object();
|
||||
$if(!method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if( $argument.name$ != null) {
|
||||
queryParams["$argument.name$"] = encodeURIComponent(ApiInvoker.toPathValue($argument.name$));
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if( $argument.name$ != null) {
|
||||
resourcePath = resourcePath.replace("{$argument.name$}", encodeURIComponent($argument.name$));
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
$if(method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if( $argument.inputModelClassArgument$ != null && $argument.methodNameFromModelClass$ != null) {
|
||||
queryParams["$argument.name$"] = encodeURIComponent($argument.methodNameFromModelClass$);
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if( $argument.inputModelClassArgument$ != null && $argument.methodNameFromModelClass$ != null) {
|
||||
resourcePath = resourcePath.replace("{$argument.name$}", encodeURIComponent($argument.methodNameFromModelClass$));
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
//make the API Call
|
||||
var eventName = "$resource$.$method.name$";
|
||||
var returnType = null;
|
||||
$if(!method.responseVoid)$
|
||||
returnType = $method.returnClassName$;
|
||||
$endif$
|
||||
var ajaxRequest = null;
|
||||
$if(method.postObject)$
|
||||
$if(method.authToken)$
|
||||
ajaxRequest = ApiInvoker.invokeAPI(authToken, resourcePath, method, queryParams, postData, eventName, requestId, returnType, callback);
|
||||
$endif$
|
||||
$if(!method.authToken)$
|
||||
ajaxRequest = ApiInvoker.invokeAPI(null, resourcePath, method, queryParams, postData, eventName, requestId, returnType, callback);
|
||||
$endif$
|
||||
$endif$
|
||||
|
||||
$if(!method.postObject)$
|
||||
$if(method.authToken)$
|
||||
ajaxRequest = ApiInvoker.invokeAPI(authToken, resourcePath, method, queryParams, null, eventName, requestId, returnType, callback);
|
||||
$endif$
|
||||
$if(!method.authToken)$
|
||||
ajaxRequest = ApiInvoker.invokeAPI(null, resourcePath, method, queryParams, null, eventName, requestId, returnType, callback);
|
||||
$endif$
|
||||
$endif$
|
||||
|
||||
return {"requestId":requestId, "ajaxRequest":ajaxRequest};
|
||||
}
|
||||
}$
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
/**
|
||||
* Maintains the compatible server version against which the drive is written
|
||||
*
|
||||
*/
|
||||
var VersionChecker = new function() {
|
||||
this.compatibleVersion = "$apiVersion$";
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* $model.description$
|
||||
* NOTE: This class is auto generated by the drive code generator program so please do not edit the class manually.
|
||||
* @author deepak
|
||||
*
|
||||
*/
|
||||
function $className$() {
|
||||
|
||||
$fields:{ field |
|
||||
/**
|
||||
* $field.description$
|
||||
* $if(field.required)$@Required$endif$
|
||||
* $if(field.allowableValues)$[AllowableValues(value="$field.allowedValuesString$"]$endif$
|
||||
*/
|
||||
this.$field.fieldDefinition.name$ $field.fieldDefinition.initialization$;}$
|
||||
|
||||
$fields:{ field |
|
||||
/**
|
||||
* Returns the list being wrapped by this wrapper class. There will be a single list item attribute in this class.
|
||||
*/
|
||||
$if(field.fieldDefinition.collectionItemType)$
|
||||
this.getList = function() {
|
||||
return this.$field.fieldDefinition.name$;
|
||||
}
|
||||
|
||||
this.parse = function(data) {
|
||||
if(data) {
|
||||
this.$field.fieldDefinition.name$ = $field.fieldDefinition.collectionItemType$Object.parseArray(data);
|
||||
}
|
||||
}
|
||||
|
||||
$endif$}$
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2011 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
*/
|
||||
|
||||
class $resource$ {
|
||||
|
||||
function __construct(\$apiClient) {
|
||||
\$this->apiClient = \$apiClient;
|
||||
}
|
||||
|
||||
$methods:{ method |
|
||||
|
||||
/**
|
||||
* $method.title$
|
||||
*
|
||||
$if(method.description)$
|
||||
* $method.description$
|
||||
* $endif$
|
||||
* $method.arguments:{ argument |@param $argument.name$ $argument.description$
|
||||
* $if(argument.allowedValues)$
|
||||
* Allowed values are - $argument.allowedValues$ $endif$ }$
|
||||
$if(!method.responseVoid)$
|
||||
* @return $method.returnValue$ {@link $method.returnClassName$} $endif$
|
||||
* @throws APIException $method.exceptionDescription$
|
||||
*/
|
||||
|
||||
public function $method.name$($method.arguments: { argument | \$$argument.name$}; separator=", "$) {
|
||||
|
||||
//parse inputs
|
||||
\$resourcePath = "$method.resourcePath$";
|
||||
\$resourcePath = str_replace("{format}", "json", \$resourcePath);
|
||||
\$method = "$method.methodType$";
|
||||
\$queryParams = array();
|
||||
\$headerParams = array();
|
||||
|
||||
$if(!method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if(\$$argument.name$ != null) {
|
||||
\$queryParams['$argument.name$'] = \$this->apiClient->toPathValue(\$$argument.name$);
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if(\$$argument.name$ != null) {
|
||||
\$resourcePath = str_replace("{$argument.name$}", \$$argument.name$, \$resourcePath);
|
||||
}
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if(\$$argument.name$ != null) {
|
||||
\$headerParams['$argument.name$'] = \$this->apiClient->toPathValue(\$$argument.name$);
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
$if(method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if(\$$argument.inputModelClassArgument$ != null && \$$argument.inputModelClassArgument$->$argument.name$ != null) {
|
||||
\$queryParams["$argument.name$"] = \$this->apiClient->toPathValue(\$$argument.inputModelClassArgument$->$argument.name$);
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if(\$$argument.inputModelClassArgument$ != null && \$$argument.inputModelClassArgument$->$argument.name$ != null) {
|
||||
\$resourcePath = str_replace("{$argument.name$}", \$$argument.inputModelClassArgument$->$argument.name$, \$resourcePath);
|
||||
}
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if(\$$argument.inputModelClassArgument$ != null && \$$argument.inputModelClassArgument$->$argument.name$ != null) {
|
||||
\$headerParams['$argument.name$'] = \$this->apiClient->toPathValue(\$$argument.inputModelClassArgument$->$argument.name$);
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
|
||||
//make the API Call
|
||||
$if(method.postObject)$
|
||||
\$response = \$this->apiClient->callAPI(\$resourcePath, \$method, \$queryParams, \$postData, \$headerParams);
|
||||
$endif$
|
||||
$if(!method.postObject)$
|
||||
\$response = \$this->apiClient->callAPI(\$resourcePath, \$method, \$queryParams, null, \$headerParams);
|
||||
$endif$
|
||||
|
||||
$if(!method.responseVoid)$
|
||||
if(! \$response){
|
||||
return null;
|
||||
}
|
||||
|
||||
$if(!method.returnValueList)$
|
||||
//create output objects if the response has more than one object
|
||||
\$responseObject = \$this->apiClient->deserialize(\$response, '$method.returnClassName$');
|
||||
return \$responseObject;
|
||||
|
||||
$endif$
|
||||
$if(method.returnValueList)$
|
||||
\$responseObjects = array();
|
||||
foreach (\$response as \$object) {
|
||||
\$responseObjects[] = \$this->apiClient->deserialize(\$object, '$method.returnClassName$');
|
||||
}
|
||||
return \$responseObjects;
|
||||
$endif$
|
||||
$endif$
|
||||
}
|
||||
|
||||
}$
|
||||
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""Wordnik.com's Swagger generic API client. This client handles the client-
|
||||
server communication, and is invariant across implementations. Specifics of
|
||||
the methods and models for each application are generated from the Swagger
|
||||
templates."""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import urllib
|
||||
import urllib2
|
||||
import httplib
|
||||
import json
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../')
|
||||
import model
|
||||
|
||||
|
||||
class APIClient:
|
||||
"""Generic API client for Swagger client library builds"""
|
||||
|
||||
def __init__(self, apiKey=None, apiServer=None):
|
||||
if apiKey == None:
|
||||
raise Exception('You must pass an apiKey when instantiating the '
|
||||
'APIClient')
|
||||
self.apiKey = apiKey
|
||||
self.apiServer = apiServer
|
||||
|
||||
def callAPI(self, resourcePath, method, queryParams, postData,
|
||||
headerParams=None):
|
||||
|
||||
url = self.apiServer + resourcePath
|
||||
headers = {}
|
||||
if headerParams:
|
||||
for param, value in headerParams.iteritems():
|
||||
headers[param] = value
|
||||
|
||||
headers['Content-type'] = 'application/json'
|
||||
headers['api_key'] = self.apiKey
|
||||
|
||||
data = None
|
||||
if method == 'GET':
|
||||
if queryParams:
|
||||
# Need to remove None values, these should not be sent
|
||||
sentQueryParams = {}
|
||||
for param, value in queryParams.iteritems():
|
||||
if value != None:
|
||||
sentQueryParams[param] = value
|
||||
url = url + '?' + urllib.urlencode(sentQueryParams)
|
||||
request = urllib2.Request(url=url, headers=headers)
|
||||
elif method in ['POST', 'PUT', 'DELETE']:
|
||||
data = postData
|
||||
if data:
|
||||
if type(postData) not in [str, int, float, bool]:
|
||||
data = json.dumps(postData.__dict__)
|
||||
request = urllib2.Request(url=url, headers=headers, data=data)
|
||||
if method in ['PUT', 'DELETE']:
|
||||
# Monkey patch alert! Urllib2 doesn't really do PUT / DELETE
|
||||
request.get_method = lambda: method
|
||||
|
||||
else:
|
||||
raise Exception('Method ' + method + ' is not recognized.')
|
||||
|
||||
# Make the request
|
||||
response = urllib2.urlopen(request).read()
|
||||
|
||||
try:
|
||||
data = json.loads(response)
|
||||
except ValueError: # PUT requests don't return anything
|
||||
data = None
|
||||
|
||||
return data
|
||||
|
||||
def toPathValue(self, obj):
|
||||
"""Serialize a list to a CSV string, if necessary.
|
||||
Args:
|
||||
obj -- data object to be serialized
|
||||
Returns:
|
||||
string -- json serialization of object
|
||||
"""
|
||||
if type(obj) == list:
|
||||
return ','.join(obj)
|
||||
else:
|
||||
return obj
|
||||
|
||||
def deserialize(self, obj, objClass):
|
||||
"""Derialize a JSON string into an object.
|
||||
|
||||
Args:
|
||||
obj -- string or object to be deserialized
|
||||
objClass -- class literal for deserialzied object, or string
|
||||
of class name
|
||||
Returns:
|
||||
object -- deserialized object"""
|
||||
|
||||
# Have to accept objClass as string or actual type. Type could be a
|
||||
# native Python type, or one of the model classes.
|
||||
if type(objClass) == str:
|
||||
try:
|
||||
objClass = eval(objClass)
|
||||
except NameError: # not a native type, must be model class
|
||||
objClass = eval('model.' + objClass + '.' + objClass)
|
||||
|
||||
if objClass in [str, int, float, bool]:
|
||||
return objClass(obj)
|
||||
|
||||
instance = objClass()
|
||||
|
||||
for attr, attrType in instance.swaggerTypes.iteritems():
|
||||
if attr in obj:
|
||||
value = obj[attr]
|
||||
if attrType in ['str', 'int', 'float', 'bool']:
|
||||
attrType = eval(attrType)
|
||||
try:
|
||||
value = attrType(value)
|
||||
except UnicodeEncodeError:
|
||||
value = unicode(value)
|
||||
setattr(instance, attr, value)
|
||||
elif 'list<' in attrType:
|
||||
match = re.match('list<(.*)>', attrType)
|
||||
subClass = match.group(1)
|
||||
subValues = []
|
||||
|
||||
for subValue in value:
|
||||
subValues.append(self.deserialize(subValue, subClass))
|
||||
setattr(instance, attr, subValues)
|
||||
else:
|
||||
setattr(instance, attr, self.deserialize(value,
|
||||
objClass))
|
||||
|
||||
return instance
|
||||
@@ -1,118 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
$resource$.py
|
||||
Copyright 2011 Wordnik, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
"""
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../')
|
||||
import model
|
||||
|
||||
class $resource$(object):
|
||||
|
||||
def __init__(self, apiClient):
|
||||
self.apiClient = apiClient
|
||||
|
||||
$methods:{ method |
|
||||
def $method.name$(self, $method.arguments: { argument | $if(argument.required)$$argument.name$, $endif$}$$method.arguments: { argument | $if(! argument.required)$$argument.name$=None, $endif$}$):
|
||||
"""$method.title$
|
||||
$if(method.description)$
|
||||
$method.description$
|
||||
$endif$
|
||||
Args:
|
||||
$method.arguments:{ argument |$argument.name$ -- $argument.description$
|
||||
$if(argument.allowedValues)$
|
||||
Allowed values are - $argument.allowedValues$
|
||||
$endif$}$
|
||||
$if(!method.responseVoid)$
|
||||
Return:
|
||||
$method.returnValue$ -- an instance of $method.returnClassName$
|
||||
$endif$"""
|
||||
|
||||
# Parse inputs
|
||||
resourcePath = '$method.resourcePath$'
|
||||
resourcePath = resourcePath.replace('{format}', 'json')
|
||||
method = '$method.methodType$'
|
||||
|
||||
queryParams = {}
|
||||
headerParams = {}
|
||||
|
||||
$if(!method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
queryParams['$argument.name$'] = self.apiClient.toPathValue($argument.name$)
|
||||
}$
|
||||
|
||||
$method.pathParameters:{ argument |
|
||||
if $argument.name$ != None:
|
||||
resourcePath = resourcePath.replace('{$argument.name$}', $argument.name$)
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if $argument.name$ != None:
|
||||
headerParams['$argument.name$'] = self.apiClient.toPathValue($argument.name$)
|
||||
}$
|
||||
$endif$
|
||||
$if(method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if $argument.inputModelClassArgument$ != None and $argument.inputModelClassArgument$.$argument.name$ != None:
|
||||
queryParams['$argument.name$'] = self.apiClient.toPathValue($argument.inputModelClassArgument$.$argument.name$)
|
||||
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if $argument.inputModelClassArgument$ != None and $argument.inputModelClassArgument$.$argument.name$ != None:
|
||||
resourcePath = resourcePath.replace('{$argument.name$}', $argument.inputModelClassArgument$.$argument.name$)
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if $argument.inputModelClassArgument$ != None and $argument.inputModelClassArgument$.$argument.name$ != None:
|
||||
headerParams['$argument.name$'] = self.apiClient.toPathValue($argument.inputModelClassArgument$.$argument.name$)
|
||||
}$
|
||||
|
||||
$endif$
|
||||
|
||||
# Make the API Call
|
||||
$if(method.postObject)$
|
||||
response = self.apiClient.callAPI(resourcePath, method, queryParams,
|
||||
postData, headerParams)
|
||||
$endif$
|
||||
|
||||
$if(!method.postObject)$
|
||||
response = self.apiClient.callAPI(resourcePath, method, queryParams,
|
||||
None, headerParams)
|
||||
$endif$
|
||||
|
||||
$if(!method.responseVoid)$
|
||||
if not response:
|
||||
return None
|
||||
|
||||
$if(!method.returnValueList)$
|
||||
# Create output objects if the response has more than one object
|
||||
responseObject = self.apiClient.deserialize(response,
|
||||
model.$method.returnClassName$.$method.returnClassName$)
|
||||
return responseObject
|
||||
$endif$
|
||||
|
||||
$if(method.returnValueList)$
|
||||
responseObjects = []
|
||||
for responseObject in response:
|
||||
responseObjects.append(self.apiClient.deserialize(responseObject,
|
||||
model.$method.returnClassName$.$method.returnClassName$))
|
||||
return responseObjects
|
||||
$endif$
|
||||
$endif$
|
||||
|
||||
}$
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="swagger-sample-scala-lib" xmlns:ivy="antlib:org.apache.ivy.ant" default="build.all" basedir=".">
|
||||
<property environment="env" />
|
||||
<property name="version.identifier" value="1.0" />
|
||||
<property name="artifact.ext" value="jar" />
|
||||
<property name="organization" value="wordnik" />
|
||||
<property name="module" value="${ant.project.name}" />
|
||||
|
||||
<!-- default dirs for the build -->
|
||||
<mkdir dir="lib"/>
|
||||
<mkdir dir="lib/ext"/>
|
||||
|
||||
<condition property="scala.home" value="${env.SCALA_HOME}">
|
||||
<isset property="env.SCALA_HOME" />
|
||||
</condition>
|
||||
|
||||
<path id="scala.classpath">
|
||||
<fileset dir="${scala.home}/lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<ivy:settings file="ivysettings.xml" />
|
||||
|
||||
<taskdef resource="scala/tools/ant/antlib.xml">
|
||||
<classpath>
|
||||
<fileset dir="lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${scala.home}/lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
|
||||
<!-- this is the output module -->
|
||||
<property name="module" value="${ant.project.name}" />
|
||||
|
||||
<target name="build.all" depends="clean, resolve, fastcompile" description="builds the module (default target)" />
|
||||
|
||||
<target name="clean" description="cleans the project folder">
|
||||
<mkdir dir="build" />
|
||||
<echo message="deleting build files" />
|
||||
<delete quiet="true">
|
||||
<fileset dir="build">
|
||||
<include name="*.jar" />
|
||||
<include name="*.xml" />
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<delete dir="build/main" quiet="true" />
|
||||
|
||||
<delete dir="dist" quiet="true" />
|
||||
|
||||
<!-- libraries handled by ivy -->
|
||||
<echo message="deleting libs handled by ivy" />
|
||||
<delete>
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
<include name="*.zip" />
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- copies ONLY the swagger-sample jar to dist-->
|
||||
<target name="fastdist" depends="fastcompile">
|
||||
<copy todir="dist/lib">
|
||||
<fileset dir="build">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!-- copies all dependencies into the lib folder -->
|
||||
<target name="resolve" description="retreive dependencies with ivy">
|
||||
<ivy:retrieve pattern="${basedir}/lib/[artifact]-[revision].[ext]" conf="build" />
|
||||
</target>
|
||||
|
||||
<target name="fastcompile" description="builds the module without artifact resolution or cleaning">
|
||||
<delete quiet="true" file="build/${organization}-${artifact}-*.${artifact.ext}" />
|
||||
<mkdir dir="build" />
|
||||
<mkdir dir="build/main" />
|
||||
<mkdir dir="build/main/java" />
|
||||
|
||||
<javac srcdir="src/main/java" debug="true" destdir="build/main/java">
|
||||
<classpath>
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="lib/ext">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<pathelement location="build/main/java" />
|
||||
</classpath>
|
||||
</javac>
|
||||
|
||||
|
||||
<scalac srcdir="src/main/java:src/main/scala" destdir="build/main/java">
|
||||
<classpath>
|
||||
<pathelement location="build/main/java" />
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="lib/ext">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${scala.home}/lib"/>
|
||||
</classpath>
|
||||
<include name="**/*.scala" />
|
||||
<include name="**/*.java" />
|
||||
</scalac>
|
||||
|
||||
<jar jarfile="build/${module}-${version.identifier}.${artifact.ext}">
|
||||
<fileset dir="build/main/java" />
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<!-- cleans up the dist -->
|
||||
<target name="dist.clean" description="cleans the distribution folder">
|
||||
<delete quiet="true" dir="dist" />
|
||||
<delete quiet="true" file="dist.zip" />
|
||||
</target>
|
||||
|
||||
<target name="dependency.tree" description="builds a graphml dependency diagram for viewing with yEd">
|
||||
<ivy:report conf="build" graph="true" todir="." outputpattern="[artifact]-[revision].[ext]" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -1,31 +0,0 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="wordnik" module="sample-java-lib"/>
|
||||
<configurations>
|
||||
<conf name="build" description="build wordnik-java"/>
|
||||
<conf name="test" visibility="public"/>
|
||||
<conf name="source" visibility="public"/>
|
||||
<conf name="pom" visibility="public"/>
|
||||
</configurations>
|
||||
|
||||
<dependencies>
|
||||
<!-- jersey dependencies -->
|
||||
<dependency org="junit" name="junit" rev="4.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-json" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-client" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-server" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-core" rev="1.4" conf="build->default"/>
|
||||
<dependency org="asm" name="asm-parent" rev="3.1" conf="build->default"/>
|
||||
<dependency org="commons-beanutils" name="commons-beanutils" rev="1.8.0" conf="build->default"/>
|
||||
<dependency org="org.antlr" name="stringtemplate" rev="3.2" conf="build->default"/>
|
||||
<!-- jackson jars -->
|
||||
<dependency org="org.codehaus.jackson" name="jackson-jaxrs" rev="1.7.1" conf="build->default"/>
|
||||
<dependency org="org.codehaus.jackson" name="jackson-xc" rev="1.7.1" conf="build->default"/>
|
||||
<dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.7.1" conf="build->default"/>
|
||||
|
||||
|
||||
<dependency org="net.sourceforge.cobertura" name="cobertura" rev="1.9.2" conf="test->default">
|
||||
<exclude org="asm" name="asm-tree"/>
|
||||
<exclude org="asm" name="asm"/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ivysettings>
|
||||
<settings defaultResolver="chained" />
|
||||
<property name="ivy.checksums" value=""/>
|
||||
<property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local"
|
||||
override="false" />
|
||||
<property name="ivy.local.default.ivy.pattern"
|
||||
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
|
||||
override="false" />
|
||||
<property name="ivy.local.default.artifact.pattern"
|
||||
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
|
||||
override="false" />
|
||||
<resolvers>
|
||||
<chain name="chained" returnFirst="true">
|
||||
<filesystem name="local">
|
||||
<ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
|
||||
<artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />
|
||||
</filesystem>
|
||||
<ibiblio name="ibiblio" m2compatible="true" />
|
||||
<ibiblio name="javanet" root="http://download.java.net/maven/2/" m2compatible="true" />
|
||||
</chain>
|
||||
</resolvers>
|
||||
</ivysettings>
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"apiUrl":"http://localhost:8002/api/",
|
||||
|
||||
"apiKey":"special-key",
|
||||
|
||||
"defaultServiceBaseClass":"Object",
|
||||
|
||||
"defaultModelBaseClass":"Object",
|
||||
|
||||
"serviceBaseClasses":{},
|
||||
|
||||
"defaultModelImports":[],
|
||||
|
||||
"defaultServiceImports":[],
|
||||
|
||||
"modelPackageName":"com.wordnik.swagger.sample.sdk.java.model",
|
||||
|
||||
"apiPackageName":"com.wordnik.swagger.sample.sdk.java.api",
|
||||
|
||||
"ignoreMethods":[],
|
||||
|
||||
"ignoreModels":[],
|
||||
|
||||
"outputDirectory":"../swagger-sample-app/sdk-libs/src/main/java/com/wordnik/swagger/sample/sdk/java",
|
||||
|
||||
"libraryHome":"../swagger-sample-app/sdk-libs"
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"userList":[
|
||||
{
|
||||
"username":"testuser1",
|
||||
"password":"password1",
|
||||
"email":"test1@dummy.com"
|
||||
},
|
||||
{
|
||||
"username":"testuser2",
|
||||
"password":"password2",
|
||||
"email":"test2@dummy.com"
|
||||
}
|
||||
],
|
||||
"petList":[
|
||||
{
|
||||
"id":101,
|
||||
"name":"pet1",
|
||||
"photoUrls":["url1","url2"],
|
||||
"tags":[
|
||||
{
|
||||
"id":1,
|
||||
"name":"tag1"
|
||||
},
|
||||
{
|
||||
"id":2,
|
||||
"name":"tag2"
|
||||
}
|
||||
],
|
||||
"status":"available",
|
||||
"category":{"id":1,"name":"cat1"}
|
||||
}
|
||||
],
|
||||
"orderList":[
|
||||
{
|
||||
"id":101,
|
||||
"petId":1,
|
||||
"quantity":1,
|
||||
"status":"placed",
|
||||
"shipDate":13456789
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,265 +0,0 @@
|
||||
{
|
||||
"resources" : [
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "Find Per by Id",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/{petId}",
|
||||
"suggestedMethodName" : "getPetById"
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"name" : "Find pets by status",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/findByStatus",
|
||||
"suggestedMethodName" : "findPetsByStatus"
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"name" : "Find pets by tags",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/findByTags",
|
||||
"suggestedMethodName" : "findPetsByTags"
|
||||
},
|
||||
{
|
||||
"id" : 4,
|
||||
"name" : "Add a pet",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/pet.{format}",
|
||||
"suggestedMethodName" : "addPet"
|
||||
},
|
||||
{
|
||||
"id" : 5,
|
||||
"name" : "Update a pet",
|
||||
"httpMethod" : "PUT",
|
||||
"path" : "/pet.{format}",
|
||||
"suggestedMethodName" : "updatePet"
|
||||
},
|
||||
{
|
||||
"id" : 6,
|
||||
"name" : "Create user",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/user.{format}",
|
||||
"suggestedMethodName" : "createUser"
|
||||
},
|
||||
{
|
||||
"id" : 7,
|
||||
"name" : "Update user",
|
||||
"httpMethod" : "PUT",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "updateUser"
|
||||
},
|
||||
{
|
||||
"id" : 8,
|
||||
"name" : "Delete user",
|
||||
"httpMethod" : "DELETE",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "deleteUser"
|
||||
},
|
||||
{
|
||||
"id" : 9,
|
||||
"name" : "Get user by user name",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "getUserByName"
|
||||
},
|
||||
{
|
||||
"id" : 10,
|
||||
"name" : "Login",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/login",
|
||||
"suggestedMethodName" : "loginUser"
|
||||
},
|
||||
{
|
||||
"id" : 11,
|
||||
"name" : "Logout",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/logout",
|
||||
"suggestedMethodName" : "logoutUser"
|
||||
},
|
||||
{
|
||||
"id" : 12,
|
||||
"name" : "Find order by id",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/store.{format}/order/{orderId}",
|
||||
"suggestedMethodName" : "getOrderById"
|
||||
},
|
||||
{
|
||||
"id" : 13,
|
||||
"name" : "Delete order by id",
|
||||
"httpMethod" : "DELETE",
|
||||
"path" : "/store.{format}/order/{orderId}",
|
||||
"suggestedMethodName" : "deleteOrder"
|
||||
},
|
||||
{
|
||||
"id" : 14,
|
||||
"name" : "Create order",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/store.{format}/order",
|
||||
"suggestedMethodName" : "placeOrder"
|
||||
}
|
||||
],
|
||||
"testSuites" : [
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "Test User service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Create User",
|
||||
"id" : 1,
|
||||
"resourceId" : 6,
|
||||
"input" : {
|
||||
"postData":"${input.userList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Login User",
|
||||
"id" : 2,
|
||||
"resourceId" : 10,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}",
|
||||
"password":"${input.userList[0].password}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find user by name",
|
||||
"id" : 3,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.3).username}",
|
||||
"condition" : "==",
|
||||
"expectedOutput" : "${input.userList[0].username}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Delete user by name",
|
||||
"id" : 4,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.4)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"name" : "Test Pet service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Add pet",
|
||||
"id" : 1,
|
||||
"resourceId" : 4,
|
||||
"input" : {
|
||||
"postData":"${input.petList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find pet by id",
|
||||
"id" : 2,
|
||||
"resourceId" : 1,
|
||||
"input" : {
|
||||
"petId":"1"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "NULL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find pet by status",
|
||||
"id" : 3,
|
||||
"resourceId" : 2,
|
||||
"input" : {
|
||||
"status":"available,sold,pending"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.3).size}",
|
||||
"condition" : ">",
|
||||
"expectedOutput" : "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"name" : "Test Store service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Find order by id",
|
||||
"id" : 1,
|
||||
"resourceId" : 12,
|
||||
"input" : {
|
||||
"orderId":"1"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(3.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "NULL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Place order",
|
||||
"id" : 2,
|
||||
"resourceId" : 14,
|
||||
"input" : {
|
||||
"postData":"${input.orderList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
# nothing to see yet
|
||||
@@ -1,21 +0,0 @@
|
||||
class $className$Model
|
||||
attr_accessor $fields:{ field | :$field.fieldDefinition.name$};separator=", "$
|
||||
$fields:{ field |
|
||||
$if(field.required)$ validate_presence_of :$field.fieldDefinition.name$$endif$
|
||||
}$
|
||||
|
||||
# TODO: move this to base class
|
||||
def initialize(attributes = {})
|
||||
attributes.symbolize_and_underscore_keys!
|
||||
|
||||
# loop over incoming attributes, only assign to valid attr_accessor props
|
||||
$fields:{ field |
|
||||
if(UserModel.respond_to? :$field.fieldDefinition.name$) self.$field.fieldDefinition.name$ = attributes[:$field.fieldDefinition.name$]
|
||||
}$
|
||||
|
||||
# if(UserModel.respond_to? :word) self.word = attributes[:word]
|
||||
# Zap any whitespace and bad encoding
|
||||
# attributes[:name] &&= attributes[:name].strip.squeeze(' ').force_encoding('UTF-8')
|
||||
# super(attributes)
|
||||
end
|
||||
end
|
||||
@@ -1,47 +0,0 @@
|
||||
module $resource$
|
||||
|
||||
$methods:{ method |
|
||||
def $method.name$(opts={})
|
||||
$if(method.pathParameters)$ requiredKeys=[:$method.pathParameters:{ param | $param.name$};separator=", "$]$endif$
|
||||
$if(method.queryParameters)$ queryparamKeys=[:$method.queryParameters:{ param | $param.name$};separator=", "$]$endif$
|
||||
|
||||
$if(method.pathParameters)$
|
||||
#check required options
|
||||
requiredKeys.each do |key|
|
||||
raise "#{key} is required" unless options.has_key?(key)
|
||||
end
|
||||
$endif$
|
||||
|
||||
|
||||
# set default values and merge with input
|
||||
options = {
|
||||
$if(method.arguments)$$method.arguments:{ param | $if(param.defaultValue)$ :$param.name$="$param.defaultValue$"$endif$}$$endif$
|
||||
}.merge(opts)
|
||||
|
||||
#resource path
|
||||
path = "$method.resourcePath$".sub('{format}', '.json')
|
||||
|
||||
$if(method.pathParameters)$
|
||||
# sub pathparams
|
||||
$method.pathParameters:{ param |
|
||||
path.sub!('{$param.name$}', URI.encode(options[:$param.name$]))
|
||||
}$$endif$
|
||||
#pull querystring keys from options
|
||||
queryopts = options.select do |key,value|
|
||||
queryparamKeys.include? key
|
||||
end
|
||||
|
||||
$if(method.hasResponseValue)$
|
||||
results = Swagger::request.new(:get, path, queryopts, nil)
|
||||
$if(method.returnValueList)$
|
||||
output = results.map {|result| $method.returnValue$.new(result)}
|
||||
$else$
|
||||
output = $method.returnValue$.new(result)
|
||||
$endif$
|
||||
$else$
|
||||
Swagger::request.new(:get, path, queryopts, nil)
|
||||
$endif$
|
||||
|
||||
end
|
||||
|
||||
}$
|
||||
@@ -1,5 +0,0 @@
|
||||
module $resource$
|
||||
def get_compatible_version(*args)
|
||||
'$apiVersion$'
|
||||
end
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="swagger-sample-scala-lib" xmlns:ivy="antlib:org.apache.ivy.ant" default="build.all" basedir=".">
|
||||
<property environment="env" />
|
||||
<property name="version.identifier" value="1.0" />
|
||||
<property name="artifact.ext" value="jar" />
|
||||
<property name="organization" value="wordnik" />
|
||||
<property name="module" value="${ant.project.name}" />
|
||||
|
||||
<!-- default dirs for the build -->
|
||||
<mkdir dir="lib"/>
|
||||
<mkdir dir="lib/ext"/>
|
||||
|
||||
<condition property="scala.home" value="${env.SCALA_HOME}">
|
||||
<isset property="env.SCALA_HOME" />
|
||||
</condition>
|
||||
|
||||
<path id="scala.classpath">
|
||||
<fileset dir="${scala.home}/lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<ivy:settings file="ivysettings.xml" />
|
||||
|
||||
<taskdef resource="scala/tools/ant/antlib.xml">
|
||||
<classpath>
|
||||
<fileset dir="lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${scala.home}/lib">
|
||||
<include name="scala**.jar" />
|
||||
</fileset>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
|
||||
<!-- this is the output module -->
|
||||
<property name="module" value="${ant.project.name}" />
|
||||
|
||||
<target name="jar" description="creates jar file " depends="build.all">
|
||||
<jar jarfile="build/${release.module}-${release.version}.${artifact.ext}">
|
||||
<fileset dir="build/main/java" />
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="build.all" depends="clean, resolve, fastcompile" description="builds the module (default target)" />
|
||||
|
||||
<target name="clean" description="cleans the project folder">
|
||||
<mkdir dir="build" />
|
||||
<echo message="deleting build files" />
|
||||
<delete quiet="true">
|
||||
<fileset dir="build">
|
||||
<include name="*.jar" />
|
||||
<include name="*.xml" />
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<delete dir="build/main" quiet="true" />
|
||||
|
||||
<delete dir="dist" quiet="true" />
|
||||
|
||||
<!-- libraries handled by ivy -->
|
||||
<echo message="deleting libs handled by ivy" />
|
||||
<delete>
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
<include name="*.zip" />
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- copies all dependencies into the lib folder -->
|
||||
<target name="resolve" description="retreive dependencies with ivy">
|
||||
<ivy:retrieve pattern="${basedir}/lib/[artifact]-[revision].[ext]" conf="build" />
|
||||
</target>
|
||||
|
||||
<target name="fastcompile" description="builds the module without artifact resolution or cleaning">
|
||||
<delete quiet="true" file="build/${organization}-${artifact}-*.${artifact.ext}" />
|
||||
<mkdir dir="build" />
|
||||
<mkdir dir="build/main" />
|
||||
<mkdir dir="build/main/java" />
|
||||
|
||||
<javac srcdir="src/main/java" debug="true" destdir="build/main/java">
|
||||
<classpath>
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="lib/ext">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<pathelement location="build/main/java" />
|
||||
</classpath>
|
||||
</javac>
|
||||
|
||||
<scalac srcdir="src/main/java:src/main/scala" destdir="build/main/java">
|
||||
<classpath>
|
||||
<pathelement location="build/main/java" />
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="lib/ext">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${scala.home}/lib"/>
|
||||
</classpath>
|
||||
<include name="**/*.scala" />
|
||||
<include name="**/*.java" />
|
||||
</scalac>
|
||||
|
||||
<jar jarfile="build/${module}-${version.identifier}.${artifact.ext}">
|
||||
<fileset dir="build/main/java" />
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="dependency.tree" description="builds a graphml dependency diagram for viewing with yEd">
|
||||
<ivy:report conf="build" graph="true" todir="." outputpattern="[artifact]-[revision].[ext]" />
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,31 +0,0 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="wordnik" module="sample-java-lib"/>
|
||||
<configurations>
|
||||
<conf name="build" description="build wordnik-java"/>
|
||||
<conf name="test" visibility="public"/>
|
||||
<conf name="source" visibility="public"/>
|
||||
<conf name="pom" visibility="public"/>
|
||||
</configurations>
|
||||
|
||||
<dependencies>
|
||||
<!-- jersey dependencies -->
|
||||
<dependency org="junit" name="junit" rev="4.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-json" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-client" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-server" rev="1.4" conf="build->default"/>
|
||||
<dependency org="com.sun.jersey" name="jersey-core" rev="1.4" conf="build->default"/>
|
||||
<dependency org="asm" name="asm-parent" rev="3.1" conf="build->default"/>
|
||||
<dependency org="commons-beanutils" name="commons-beanutils" rev="1.8.0" conf="build->default"/>
|
||||
<dependency org="org.antlr" name="stringtemplate" rev="3.2" conf="build->default"/>
|
||||
<!-- jackson jars -->
|
||||
<dependency org="org.codehaus.jackson" name="jackson-jaxrs" rev="1.7.1" conf="build->default"/>
|
||||
<dependency org="org.codehaus.jackson" name="jackson-xc" rev="1.7.1" conf="build->default"/>
|
||||
<dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.7.1" conf="build->default"/>
|
||||
|
||||
|
||||
<dependency org="net.sourceforge.cobertura" name="cobertura" rev="1.9.2" conf="test->default">
|
||||
<exclude org="asm" name="asm-tree"/>
|
||||
<exclude org="asm" name="asm"/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ivysettings>
|
||||
<settings defaultResolver="chained" />
|
||||
<property name="ivy.checksums" value=""/>
|
||||
<property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local"
|
||||
override="false" />
|
||||
<property name="ivy.local.default.ivy.pattern"
|
||||
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
|
||||
override="false" />
|
||||
<property name="ivy.local.default.artifact.pattern"
|
||||
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
|
||||
override="false" />
|
||||
<resolvers>
|
||||
<chain name="chained" returnFirst="true">
|
||||
<filesystem name="local">
|
||||
<ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
|
||||
<artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />
|
||||
</filesystem>
|
||||
<ibiblio name="ibiblio" m2compatible="true" />
|
||||
<ibiblio name="javanet" root="http://download.java.net/maven/2/" m2compatible="true" />
|
||||
</chain>
|
||||
</resolvers>
|
||||
</ivysettings>
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"apiUrl":"http://localhost:8002/api/",
|
||||
|
||||
"apiKey":"special-key",
|
||||
|
||||
"defaultServiceBaseClass":"Object",
|
||||
|
||||
"defaultModelBaseClass":"Object",
|
||||
|
||||
"serviceBaseClasses":{},
|
||||
|
||||
"defaultModelImports":[],
|
||||
|
||||
"defaultServiceImports":[],
|
||||
|
||||
"modelPackageName":"com.wordnik.swagger.sample.sdk.java.model",
|
||||
|
||||
"apiPackageName":"com.wordnik.swagger.sample.sdk.java.api",
|
||||
|
||||
"ignoreMethods":[],
|
||||
|
||||
"ignoreModels":[],
|
||||
|
||||
"outputDirectory":"../swagger-sample-app/sdk-libs/src/main/java/com/wordnik/swagger/sample/sdk/java",
|
||||
|
||||
"libraryHome":"../swagger-sample-app/sdk-libs"
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"userList":[
|
||||
{
|
||||
"username":"testuser1",
|
||||
"password":"password1",
|
||||
"email":"test1@dummy.com"
|
||||
},
|
||||
{
|
||||
"username":"testuser2",
|
||||
"password":"password2",
|
||||
"email":"test2@dummy.com"
|
||||
}
|
||||
],
|
||||
"petList":[
|
||||
{
|
||||
"id":101,
|
||||
"name":"pet1",
|
||||
"photoUrls":["url1","url2"],
|
||||
"tags":[
|
||||
{
|
||||
"id":1,
|
||||
"name":"tag1"
|
||||
},
|
||||
{
|
||||
"id":2,
|
||||
"name":"tag2"
|
||||
}
|
||||
],
|
||||
"status":"available",
|
||||
"category":{"id":1,"name":"cat1"}
|
||||
}
|
||||
],
|
||||
"orderList":[
|
||||
{
|
||||
"id":101,
|
||||
"petId":1,
|
||||
"quantity":1,
|
||||
"status":"placed",
|
||||
"shipDate":13456789
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,265 +0,0 @@
|
||||
{
|
||||
"resources" : [
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "Find Per by Id",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/{petId}",
|
||||
"suggestedMethodName" : "getPetById"
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"name" : "Find pets by status",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/findByStatus",
|
||||
"suggestedMethodName" : "findPetsByStatus"
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"name" : "Find pets by tags",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/pet.{format}/findByTags",
|
||||
"suggestedMethodName" : "findPetsByTags"
|
||||
},
|
||||
{
|
||||
"id" : 4,
|
||||
"name" : "Add a pet",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/pet.{format}",
|
||||
"suggestedMethodName" : "addPet"
|
||||
},
|
||||
{
|
||||
"id" : 5,
|
||||
"name" : "Update a pet",
|
||||
"httpMethod" : "PUT",
|
||||
"path" : "/pet.{format}",
|
||||
"suggestedMethodName" : "updatePet"
|
||||
},
|
||||
{
|
||||
"id" : 6,
|
||||
"name" : "Create user",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/user.{format}",
|
||||
"suggestedMethodName" : "createUser"
|
||||
},
|
||||
{
|
||||
"id" : 7,
|
||||
"name" : "Update user",
|
||||
"httpMethod" : "PUT",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "updateUser"
|
||||
},
|
||||
{
|
||||
"id" : 8,
|
||||
"name" : "Delete user",
|
||||
"httpMethod" : "DELETE",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "deleteUser"
|
||||
},
|
||||
{
|
||||
"id" : 9,
|
||||
"name" : "Get user by user name",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/{username}",
|
||||
"suggestedMethodName" : "getUserByName"
|
||||
},
|
||||
{
|
||||
"id" : 10,
|
||||
"name" : "Login",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/login",
|
||||
"suggestedMethodName" : "loginUser"
|
||||
},
|
||||
{
|
||||
"id" : 11,
|
||||
"name" : "Logout",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/user.{format}/logout",
|
||||
"suggestedMethodName" : "logoutUser"
|
||||
},
|
||||
{
|
||||
"id" : 12,
|
||||
"name" : "Find order by id",
|
||||
"httpMethod" : "GET",
|
||||
"path" : "/store.{format}/order/{orderId}",
|
||||
"suggestedMethodName" : "getOrderById"
|
||||
},
|
||||
{
|
||||
"id" : 13,
|
||||
"name" : "Delete order by id",
|
||||
"httpMethod" : "DELETE",
|
||||
"path" : "/store.{format}/order/{orderId}",
|
||||
"suggestedMethodName" : "deleteOrder"
|
||||
},
|
||||
{
|
||||
"id" : 14,
|
||||
"name" : "Create order",
|
||||
"httpMethod" : "POST",
|
||||
"path" : "/store.{format}/order",
|
||||
"suggestedMethodName" : "placeOrder"
|
||||
}
|
||||
],
|
||||
"testSuites" : [
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "Test User service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Create User",
|
||||
"id" : 1,
|
||||
"resourceId" : 6,
|
||||
"input" : {
|
||||
"postData":"${input.userList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Login User",
|
||||
"id" : 2,
|
||||
"resourceId" : 10,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}",
|
||||
"password":"${input.userList[0].password}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find user by name",
|
||||
"id" : 3,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.3).username}",
|
||||
"condition" : "==",
|
||||
"expectedOutput" : "${input.userList[0].username}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Delete user by name",
|
||||
"id" : 4,
|
||||
"resourceId" : 9,
|
||||
"input" : {
|
||||
"username":"${input.userList[0].username}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.4)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"name" : "Test Pet service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Add pet",
|
||||
"id" : 1,
|
||||
"resourceId" : 4,
|
||||
"input" : {
|
||||
"postData":"${input.petList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find pet by id",
|
||||
"id" : 2,
|
||||
"resourceId" : 1,
|
||||
"input" : {
|
||||
"petId":"1"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "NULL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Find pet by status",
|
||||
"id" : 3,
|
||||
"resourceId" : 2,
|
||||
"input" : {
|
||||
"status":"available,sold,pending"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(2.3).size}",
|
||||
"condition" : ">",
|
||||
"expectedOutput" : "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"name" : "Test Store service related APIs",
|
||||
"testCases" : [
|
||||
{
|
||||
"name" : "Find order by id",
|
||||
"id" : 1,
|
||||
"resourceId" : 12,
|
||||
"input" : {
|
||||
"orderId":"1"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(3.1)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "NULL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Place order",
|
||||
"id" : 2,
|
||||
"resourceId" : 14,
|
||||
"input" : {
|
||||
"postData":"${input.orderList[0]}"
|
||||
},
|
||||
"assertions" : [
|
||||
{
|
||||
"actualOutput" : "${output(1.2)}",
|
||||
"condition" : "!=",
|
||||
"expectedOutput" : "EXCEPTION"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* Copyright 2011 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package $packageName$
|
||||
|
||||
import com.wordnik.swagger.runtime.annotations._
|
||||
|
||||
import scala.reflect.BeanProperty
|
||||
|
||||
import scala.collection.JavaConversions._
|
||||
|
||||
$imports:{ import |
|
||||
import $import$
|
||||
}$
|
||||
|
||||
/**
|
||||
* $model.description$
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
*
|
||||
* @author tony
|
||||
*
|
||||
*/
|
||||
class $className$ extends $extends$ {
|
||||
|
||||
$fields:{ field |
|
||||
/**
|
||||
* $field.description$
|
||||
* $if(field.required)$@Required$endif$
|
||||
* $if(field.allowableValues)$@AllowableValues(value="$field.allowedValuesString$")$endif$
|
||||
*/
|
||||
$if(field.fieldDefinition.hasListResponse)$
|
||||
var $field.fieldDefinition.name$ $field.fieldDefinition.initialization$
|
||||
def get$field.fieldDefinition.NameForMethod$:java.util.List[$field.fieldDefinition.collectionItemType$] = {
|
||||
$field.fieldDefinition.name$.toList
|
||||
}
|
||||
def set$field.fieldDefinition.NameForMethod$(args:java.util.List[$field.fieldDefinition.collectionItemType$]) = {
|
||||
$field.fieldDefinition.name$.clear
|
||||
args.foreach(arg=>$field.fieldDefinition.name$ += arg)
|
||||
}
|
||||
$\r$
|
||||
$else$
|
||||
@BeanProperty
|
||||
var $field.fieldDefinition.name$:$field.fieldDefinition.returnType$ $field.fieldDefinition.initialization$$\r\r$
|
||||
$endif$
|
||||
}$ override def toString:String = {
|
||||
"[" +
|
||||
$fields:{ field | "$field.fieldDefinition.name$:" + $field.fieldDefinition.name$};separator=" + \r "$ + "]"
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
/**
|
||||
* Copyright 2011 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package $packageName$
|
||||
|
||||
import $modelPackageName$._
|
||||
|
||||
import org.codehaus.jackson.map.DeserializationConfig.Feature
|
||||
import org.codehaus.jackson.map.ObjectMapper
|
||||
import org.codehaus.jackson.`type`.TypeReference
|
||||
import com.wordnik.swagger.runtime.annotations._
|
||||
import com.wordnik.swagger.runtime.common._
|
||||
import com.wordnik.swagger.runtime.exception._
|
||||
|
||||
import java.io.IOException
|
||||
|
||||
import scala.collection.mutable._
|
||||
import scala.collection.JavaConversions._
|
||||
|
||||
$imports:{ import |
|
||||
import $import$
|
||||
}$
|
||||
|
||||
/**
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
* @author tony
|
||||
*
|
||||
*/
|
||||
object $resource$ {
|
||||
|
||||
var apiInvoker:APIInvoker = null;
|
||||
|
||||
$methods:{ method |
|
||||
/**
|
||||
* $method.title$
|
||||
*
|
||||
$if(method.description)$
|
||||
* $method.description$
|
||||
* $endif$
|
||||
* $method.arguments:{ argument |@param $argument.name$ $argument.description$
|
||||
$if(argument.allowedValues)$
|
||||
* Allowed values are - $argument.allowedValues$ $endif$ }$
|
||||
$if(!method.responseVoid)$
|
||||
* @return $method.returnValue$ {@link $method.returnClassName$} $endif$
|
||||
* @throws APIException $method.exceptionDescription$
|
||||
*/
|
||||
$if(method.hasArguments)$
|
||||
@MethodArgumentNames(value="$method.argumentNames; separator=", "$")
|
||||
$endif$
|
||||
|
||||
@throws(classOf[APIException])
|
||||
def $method.name$($method.argumentDefinitions; separator=", "$)$if(method.hasResponseValue)$: $if(method.returnValueList)$$method.returnValue$$else$Option[$method.returnValue$]$endif$$endif$ = {
|
||||
//parse inputs
|
||||
var resourcePath = "$method.resourcePath$".replace("{format}","json")
|
||||
val method = "$method.methodType$";
|
||||
var queryParams = new HashMap[String, String]
|
||||
var headerParams = new HashMap[String, String]
|
||||
|
||||
$if(!method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if(null != $argument.name$) {
|
||||
queryParams += "$argument.name$" -> APIInvoker.toPathValue($argument.name$)
|
||||
}
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if(null != $argument.name$) {
|
||||
headerParams += "$argument.name$" -> APIInvoker.toPathValue($argument.name$)
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if(null != $argument.name$) {
|
||||
resourcePath = resourcePath.replace("{$argument.name$}", APIInvoker.toPathValue($argument.name$))
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
$if(method.inputModel)$
|
||||
$method.queryParameters:{ argument |
|
||||
if(null != $argument.inputModelClassArgument$ && null != $argument.methodNameFromModelClass$ ) {
|
||||
queryParams += "$argument.name$" -> APIInvoker.toPathValue($argument.methodNameFromModelClass$)
|
||||
}
|
||||
}$
|
||||
$method.headerParameters:{ argument |
|
||||
if(null != $argument.inputModelClassArgument$ && null != $argument.methodNameFromModelClass$ ) {
|
||||
headerParams += "$argument.name$" -> APIInvoker.toPathValue($argument.methodNameFromModelClass$)
|
||||
}
|
||||
}$
|
||||
$method.pathParameters:{ argument |
|
||||
if(null != $argument.inputModelClassArgument$ && null != $argument.methodNameFromModelClass$ ) {
|
||||
resourcePath = resourcePath.replace("{$argument.name$}", APIInvoker.toPathValue($argument.methodNameFromModelClass$))
|
||||
}
|
||||
}$
|
||||
$endif$
|
||||
//make the API Call
|
||||
$if(method.hasResponseValue)$
|
||||
var response: String = null
|
||||
try {
|
||||
$if(method.postObject)$
|
||||
response = apiInvoker.invokeAPI(resourcePath, method, queryParams, postData, headerParams)
|
||||
$else$
|
||||
response = apiInvoker.invokeAPI(resourcePath, method, queryParams, null, headerParams)
|
||||
$endif$
|
||||
} catch {
|
||||
case ex: APIException if ex.getCode == 404 =>
|
||||
$if(method.returnValueList)$ return List()
|
||||
$else$ return None
|
||||
$endif$
|
||||
case ex: APIException => throw ex
|
||||
}
|
||||
$else$
|
||||
$if(method.postObject)$
|
||||
apiInvoker.invokeAPI(resourcePath, method, queryParams, postData, headerParams)
|
||||
$else$
|
||||
apiInvoker.invokeAPI(resourcePath, method, queryParams, null, headerParams)
|
||||
$endif$
|
||||
$endif$
|
||||
$if(!method.responseVoid)$
|
||||
|
||||
$if(method.hasResponseValue)$
|
||||
$if(!method.returnValueList)$
|
||||
if(null == response){
|
||||
return None
|
||||
}
|
||||
$endif$
|
||||
$endif$
|
||||
$if(!method.returnValueList)$
|
||||
$if(method.hasResponseValue)$
|
||||
//create output objects if the response has more than one object
|
||||
val responseObject = APIInvoker.deserialize(response, classOf[$method.returnClassName$]).asInstanceOf[$method.returnValue$]
|
||||
|
||||
$if(method.returnValueList)$
|
||||
responseObject
|
||||
$else$
|
||||
Some(responseObject)
|
||||
$endif$
|
||||
$endif$
|
||||
$endif$
|
||||
$if(method.returnValueList)$
|
||||
val typeRef = new TypeReference[Array[$method.returnClassName$]] {}
|
||||
try {
|
||||
val responseObject = APIInvoker.mapper.readValue(response, typeRef).asInstanceOf[Array[$method.returnClassName$]]
|
||||
responseObject.toList
|
||||
} catch {
|
||||
case ioe:IOException => {
|
||||
val args = Array(response, typeRef.toString())
|
||||
throw new APIException(APIExceptionCodes.ERROR_CONVERTING_JSON_TO_JAVA, args, "Error in converting response json value to java object : " + ioe.getMessage(), ioe)
|
||||
}
|
||||
case _ => throw new APIException(APIExceptionCodes.ERROR_CONVERTING_JSON_TO_JAVA, "Error in converting response json value to java object")
|
||||
}
|
||||
$endif$
|
||||
$endif$
|
||||
}
|
||||
}$
|
||||
|
||||
def getApiInvoker():APIInvoker = {
|
||||
if(null == apiInvoker){
|
||||
apiInvoker = APIInvoker.getApiInvoker();
|
||||
}
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
def setApiInvoker(invoker:APIInvoker) = {
|
||||
apiInvoker = invoker;
|
||||
}
|
||||
}
|
||||
124
distro/pom.xml.disabled
Normal file
124
distro/pom.xml.disabled
Normal file
@@ -0,0 +1,124 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.sonatype.oss</groupId>
|
||||
<artifactId>oss-parent</artifactId>
|
||||
<version>5</version>
|
||||
</parent>
|
||||
<groupId>com.wordnik</groupId>
|
||||
<artifactId>swagger-codegen-distribution</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>2.0.2-SNAPSHOT</version>
|
||||
<name>swagger-codegen-distribution</name>
|
||||
<url>https://github.com/wordnik/swagger-codegen</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:wordnik/swagger-codegen.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:wordnik/swagger-codegen.git</developerConnection>
|
||||
<url>https://github.com/wordnik/swagger-codegen</url>
|
||||
</scm>
|
||||
<prerequisites>
|
||||
<maven>2.2.0</maven>
|
||||
</prerequisites>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>fehguy</id>
|
||||
<name>Tony Tam</name>
|
||||
<email>fehguy@gmail.com</email>
|
||||
</developer>
|
||||
</developers>
|
||||
<issueManagement>
|
||||
<system>github</system>
|
||||
<url>https://github.com/wordnik/swagger-codegen/issues</url>
|
||||
</issueManagement>
|
||||
<mailingLists>
|
||||
<mailingList>
|
||||
<name>wordnik-api</name>
|
||||
<archive>https://groups.google.com/forum/#!forum/wordnik-api</archive>
|
||||
</mailingList>
|
||||
</mailingLists>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache License 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>distro-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/distribution.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>src-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>com.wordnik</includeGroupIds>
|
||||
<includeArtifactIds>text-data</includeArtifactIds>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.wordnik</groupId>
|
||||
<artifactId>swagger-codegen_2.9.1</artifactId>
|
||||
<version>${swagger.codegen.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<swagger.codegen.version>2.0.2-SNAPSHOT</swagger.codegen.version>
|
||||
</properties>
|
||||
</project>
|
||||
29
distro/src/main/assembly/distribution.xml
Normal file
29
distro/src/main/assembly/distribution.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>distribution</id>
|
||||
<baseDirectory>swagger-codegen</baseDirectory>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<scope>compile</scope>
|
||||
<outputDirectory>target/lib</outputDirectory>
|
||||
<includes>
|
||||
<include>*:jar:*</include>
|
||||
</includes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>../bin</directory>
|
||||
<includes>
|
||||
<include>*.*</include>
|
||||
</includes>
|
||||
<outputDirectory>bin</outputDirectory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
16
package.json
Normal file
16
package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "swagger-yaml",
|
||||
"version": "2.0.1",
|
||||
"description": "Converts yaml to swagger json",
|
||||
"author": {
|
||||
"name": "Tony Tam",
|
||||
"email": "fehguy@gmail.com",
|
||||
"url": "http://developer.wordnik.com"
|
||||
},
|
||||
"license": "Apache",
|
||||
"readmeFilename": "README.md",
|
||||
"dependencies": {
|
||||
"json2yaml": "~1.0",
|
||||
"js-yaml": "~3.0"
|
||||
}
|
||||
}
|
||||
405
pom.xml
405
pom.xml
@@ -1,405 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.wordnik</groupId>
|
||||
<artifactId>swagger-codegen_2.9.1</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>swagger-codegen</name>
|
||||
<version>1.1</version>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:wordnik/swagger-codegen.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:wordnik/swagger-codegen.git</developerConnection>
|
||||
<url>https://github.com/wordnik/swagger-codegen</url>
|
||||
</scm>
|
||||
<prerequisites>
|
||||
<maven>2.2.0</maven>
|
||||
</prerequisites>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>scala-tools.org</id>
|
||||
<name>Scala-Tools Maven2 Repository</name>
|
||||
<url>http://scala-tools.org/repo-releases</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<!-- here the phase you need -->
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.outputDirectory}/conf</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>conf</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-java-resources</id>
|
||||
<!-- here the phase you need -->
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.outputDirectory}/conf/java/structure/src/main/java/com/wordnik/swagger/runtime</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java/com/wordnik/swagger/runtime/</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-scala-resources</id>
|
||||
<!-- here the phase you need -->
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.outputDirectory}/conf/scala/structure/src/main/java/com/wordnik/swagger/runtime</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java/com/wordnik/swagger/runtime/</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add_sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/main/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add_test_sources</id>
|
||||
<phase>generate-test-sources</phase>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.scala-tools</groupId>
|
||||
<artifactId>maven-scala-plugin</artifactId>
|
||||
<version>2.15.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>scala-compile-first</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>scala-test-compile</id>
|
||||
<phase>process-test-resources</phase>
|
||||
<goals>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<configuration>
|
||||
<releaseProfiles>release</releaseProfiles>
|
||||
<goals>sign</goals>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release-profile</id>
|
||||
<properties>
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.scala-tools</groupId>
|
||||
<artifactId>maven-scala-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration />
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-source</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/main/scala</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>release-sign-artifacts</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>performRelease</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.scala-tools</groupId>
|
||||
<artifactId>maven-scala-plugin</artifactId>
|
||||
<configuration>
|
||||
<scalaVersion>${scala.version}</scalaVersion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-ext</artifactId>
|
||||
<version>${slf4j-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>${slf4j-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>${commons-beanutils-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-json</artifactId>
|
||||
<version>${jersey-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-client</artifactId>
|
||||
<version>${jersey-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-core</artifactId>
|
||||
<version>${jersey-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-server</artifactId>
|
||||
<version>${jersey-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-jaxrs</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-xc</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-mapper-asl</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>stringtemplate</artifactId>
|
||||
<version>${org.antlr-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.scala-lang</groupId>
|
||||
<artifactId>scala-library</artifactId>
|
||||
<version>${scala-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.scalatest</groupId>
|
||||
<artifactId>scalatest_2.9.1</artifactId>
|
||||
<version>${scala-test-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>${commons-lang-version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>oss.sonatype.org</id>
|
||||
<url>http://oss.sonatype.org/content/repositories/releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>oss.sonatype.org-snapshot</id>
|
||||
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>scala-tools.org</id>
|
||||
<name>Scala-Tools Maven2 Repository</name>
|
||||
<url>http://scala-tools.org/repo-releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jboss</id>
|
||||
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>codehaus</id>
|
||||
<name>repository.codehaus.org</name>
|
||||
<url>http://repository.codehaus.org</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>codehaus-snapshots</id>
|
||||
<url>http://snapshots.repository.codehaus.org</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<scala-version>2.9.1-1</scala-version>
|
||||
<scala-test-version>1.6.1</scala-test-version>
|
||||
<swagger-codegen-version>1.1</swagger-codegen-version>
|
||||
<servlet-api-version>2.5</servlet-api-version>
|
||||
<jersey-version>1.7</jersey-version>
|
||||
<jackson-version>1.7.7</jackson-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<maven-plugin.version>1.0.0</maven-plugin.version>
|
||||
<commons-beanutils-version>1.8.0</commons-beanutils-version>
|
||||
<commons-lang-version>2.4</commons-lang-version>
|
||||
<slf4j-version>1.5.8</slf4j-version>
|
||||
<org.antlr-version>3.2</org.antlr-version>
|
||||
</properties>
|
||||
</project>
|
||||
1
project/build.properties
Normal file
1
project/build.properties
Normal file
@@ -0,0 +1 @@
|
||||
sbt.version=0.13.0
|
||||
2
project/plugins.sbt
Normal file
2
project/plugins.sbt
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.9.1")
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright 2013 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import com.wordnik.swagger.codegen.BasicAndroidJavaGenerator
|
||||
|
||||
object AndroidJavaPetstoreCodegen extends BasicAndroidJavaGenerator {
|
||||
def main(args: Array[String]) = generateClient(args)
|
||||
|
||||
// location of templates
|
||||
override def templateDir = "src/main/resources/android-java"
|
||||
|
||||
// where to write generated code
|
||||
override def destinationDir = "samples/client/petstore/android-java/src/main/java"
|
||||
|
||||
// package for api invoker, error files
|
||||
override def invokerPackage = Some("com.wordnik.client")
|
||||
|
||||
// package for models
|
||||
override def modelPackage = Some("com.wordnik.petstore.model")
|
||||
|
||||
// package for api classes
|
||||
override def apiPackage = Some("com.wordnik.petstore.api")
|
||||
|
||||
additionalParams ++= Map(
|
||||
"artifactId" -> "swagger-petstore",
|
||||
"artifactVersion" -> "1.0.0",
|
||||
"groupId" -> "com.wordnik")
|
||||
|
||||
// supporting classes
|
||||
override def supportingFiles = List(
|
||||
("apiInvoker.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiInvoker.java"),
|
||||
("jsonUtil.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "JsonUtil.java"),
|
||||
("apiException.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiException.java"),
|
||||
("pom.mustache", "samples/client/petstore/android-java", "pom.xml")
|
||||
)
|
||||
}
|
||||
214
samples/client/petstore/android-java/pom.xml
Normal file
214
samples/client/petstore/android-java/pom.xml
Normal file
@@ -0,0 +1,214 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.wordnik</groupId>
|
||||
<artifactId>swagger-petstore</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>swagger-petstore</name>
|
||||
<version>1.0.0</version>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:wordnik/swagger-mustache.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:wordnik/swagger-codegen.git</developerConnection>
|
||||
<url>https://github.com/wordnik/swagger-codegen</url>
|
||||
</scm>
|
||||
<prerequisites>
|
||||
<maven>2.2.0</maven>
|
||||
</prerequisites>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.12</version>
|
||||
<configuration>
|
||||
<systemProperties>
|
||||
<property>
|
||||
<name>loggerPath</name>
|
||||
<value>conf/log4j.properties</value>
|
||||
</property>
|
||||
</systemProperties>
|
||||
<argLine>-Xms512m -Xmx1500m</argLine>
|
||||
<parallel>methods</parallel>
|
||||
<forkMode>pertest</forkMode>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- attach test jar -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add_sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/main/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add_test_sources</id>
|
||||
<phase>generate-test-sources</phase>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
<version>${scala-maven-plugin-version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<configuration>
|
||||
<recompileMode>incremental</recompileMode>
|
||||
</configuration>
|
||||
<jvmArgs>
|
||||
<jvmArg>-Xmx384m</jvmArg>
|
||||
</jvmArgs>
|
||||
<args>
|
||||
<arg>-target:jvm-1.5</arg>
|
||||
<arg>-deprecation</arg>
|
||||
</args>
|
||||
<launchers>
|
||||
<launcher>
|
||||
<id>run-scalatest</id>
|
||||
<mainClass>org.scalatest.tools.Runner</mainClass>
|
||||
<args>
|
||||
<arg>-p</arg>
|
||||
<arg>${project.build.testOutputDirectory}</arg>
|
||||
</args>
|
||||
<jvmArgs>
|
||||
<jvmArg>-Xmx512m</jvmArg>
|
||||
</jvmArgs>
|
||||
</launcher>
|
||||
</launchers>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
<version>${scala-maven-plugin-version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>${httpclient-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.scala-lang</groupId>
|
||||
<artifactId>scala-library</artifactId>
|
||||
<version>${scala-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.scalatest</groupId>
|
||||
<artifactId>scalatest_2.9.1</artifactId>
|
||||
<version>${scala-test-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<jackson-version>2.1.4</jackson-version>
|
||||
<scala-version>2.9.1-1</scala-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<scala-test-version>1.6.1</scala-test-version>
|
||||
<httpclient-version>4.2.3</httpclient-version>
|
||||
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user