forked from loafle/openapi-generator-original
Compare commits
678 Commits
swagger-co
...
v2.0.18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ece072aee3 | ||
|
|
2386e394ae | ||
|
|
f55d9eaa68 | ||
|
|
0f041dae90 | ||
|
|
6c97a9c6c7 | ||
|
|
257d67346c | ||
|
|
e955c9dcfd | ||
|
|
63bb20238b | ||
|
|
55575541d8 | ||
|
|
33e6105822 | ||
|
|
87be442ad9 | ||
|
|
65b3b594e3 | ||
|
|
94ceb504b8 | ||
|
|
f914f26f3b | ||
|
|
4a6e719d6a | ||
|
|
61ea9564f8 | ||
|
|
bfc14938d0 | ||
|
|
c98a78062f | ||
|
|
fd128cbab0 | ||
|
|
59568915de | ||
|
|
bff2515bf2 | ||
|
|
dcaf639bec | ||
|
|
2f6bf95fa2 | ||
|
|
154c28b062 | ||
|
|
8106de95dc | ||
|
|
7c342a060a | ||
|
|
3abc42eee9 | ||
|
|
2d81c71b52 | ||
|
|
2d193a0e92 | ||
|
|
09e7bd9c43 | ||
|
|
0ece4a084f | ||
|
|
0821d1859b | ||
|
|
25aef5fd6e | ||
|
|
3a77287f8b | ||
|
|
d2111a8e68 | ||
|
|
3c0d639d0e | ||
|
|
1f30c65464 | ||
|
|
1b68671e98 | ||
|
|
586420b919 | ||
|
|
43a5ece5b3 | ||
|
|
9f6d883e68 | ||
|
|
524497a606 | ||
|
|
665ba22c7a | ||
|
|
0614d1b221 | ||
|
|
fb3f331e3c | ||
|
|
4e9378965b | ||
|
|
d1fe146522 | ||
|
|
b9758107c3 | ||
|
|
06332e5dce | ||
|
|
aa262f6021 | ||
|
|
88692ec42d | ||
|
|
a656ea301e | ||
|
|
5e4e838a48 | ||
|
|
f3dc69a7e7 | ||
|
|
12eba440ae | ||
|
|
4676c4cdf7 | ||
|
|
d5674c9a7b | ||
|
|
c8dac4a3cf | ||
|
|
6f30a6d65a | ||
|
|
9d1f0bf568 | ||
|
|
643c211d72 | ||
|
|
fb84985e9b | ||
|
|
afb34b4f2f | ||
|
|
1734ac2e18 | ||
|
|
72bef1fb68 | ||
|
|
ec99bef893 | ||
|
|
2fd29d74f2 | ||
|
|
033a9a4b97 | ||
|
|
885e463bcb | ||
|
|
b8f3201dba | ||
|
|
983edbd85b | ||
|
|
86d56b978a | ||
|
|
ed86bfb79b | ||
|
|
44a73c32fa | ||
|
|
39662e45b1 | ||
|
|
998bf633d8 | ||
|
|
b927ffbd53 | ||
|
|
1ff47393ed | ||
|
|
a6ecc7a65b | ||
|
|
dbf04a9563 | ||
|
|
d1603ba25e | ||
|
|
d4ce57bd15 | ||
|
|
5e56346dc9 | ||
|
|
05db83a067 | ||
|
|
707ee1c85b | ||
|
|
a54adb925f | ||
|
|
8c53837802 | ||
|
|
3625b89a15 | ||
|
|
2ed68c2df8 | ||
|
|
db1915ec89 | ||
|
|
77e9ce5ede | ||
|
|
013c19eb36 | ||
|
|
61c04ddaf1 | ||
|
|
b4d361130c | ||
|
|
8e7571c34f | ||
|
|
1ba42ef6cc | ||
|
|
fc77521d49 | ||
|
|
1522069281 | ||
|
|
a13f46e781 | ||
|
|
3ad1ecf153 | ||
|
|
6087181634 | ||
|
|
c09adc4539 | ||
|
|
a626dea181 | ||
|
|
454ec4b438 | ||
|
|
4a64d602a0 | ||
|
|
f294656073 | ||
|
|
c7da910e68 | ||
|
|
40d33693cf | ||
|
|
13eaf2bf63 | ||
|
|
d4508ed112 | ||
|
|
c252e9f7c6 | ||
|
|
6690b80b29 | ||
|
|
19bb97a725 | ||
|
|
62ee62ebd3 | ||
|
|
87083034ee | ||
|
|
d9de57da6f | ||
|
|
d0b0323925 | ||
|
|
f592414409 | ||
|
|
e1c8f58d28 | ||
|
|
4870ed7e51 | ||
|
|
bbe48814b4 | ||
|
|
3b6ffa4a1f | ||
|
|
527c40b996 | ||
|
|
3aa2c86991 | ||
|
|
e2a20447df | ||
|
|
5d42c8cc5f | ||
|
|
256485ec5b | ||
|
|
7ab0394e76 | ||
|
|
89b04b2e10 | ||
|
|
a019a438e0 | ||
|
|
9834059786 | ||
|
|
550fade9e0 | ||
|
|
aa1b4fc0fb | ||
|
|
5a659803a8 | ||
|
|
7bc7789e81 | ||
|
|
cf0721da73 | ||
|
|
dcbf4d1bfd | ||
|
|
017b578502 | ||
|
|
58bade3b01 | ||
|
|
02631e674a | ||
|
|
5f5e534d05 | ||
|
|
51deeb478d | ||
|
|
acff8229b3 | ||
|
|
233555790a | ||
|
|
d5ddac8e7e | ||
|
|
e8210cd5e3 | ||
|
|
2dc6b485e0 | ||
|
|
11bede2b7d | ||
|
|
ed51dd9dea | ||
|
|
218f514005 | ||
|
|
209e8e066c | ||
|
|
7d05b01a56 | ||
|
|
64f6bedc37 | ||
|
|
4ae4aa98bb | ||
|
|
db8bda087b | ||
|
|
06eb52118e | ||
|
|
63be7d0069 | ||
|
|
c7468125fa | ||
|
|
7b3d8bf799 | ||
|
|
c4913fe583 | ||
|
|
d3339cb087 | ||
|
|
ba4fda12dc | ||
|
|
7a6d6d27ff | ||
|
|
bcabb03225 | ||
|
|
a404823c54 | ||
|
|
96ea70e3c9 | ||
|
|
9a01331ddd | ||
|
|
3bfa468ed1 | ||
|
|
fdf8572535 | ||
|
|
cff8b1552d | ||
|
|
e73dd0a7c4 | ||
|
|
9c4c2dfd37 | ||
|
|
2f8355c953 | ||
|
|
3f480482b6 | ||
|
|
8274196999 | ||
|
|
4e8c71f754 | ||
|
|
57e7b41e9c | ||
|
|
58d9894f1f | ||
|
|
4b4d4d32cd | ||
|
|
6a2ea9f614 | ||
|
|
0d6754e167 | ||
|
|
cb5c2a9708 | ||
|
|
dc8ad7edf5 | ||
|
|
52bc82149f | ||
|
|
f53b5e27e0 | ||
|
|
ce5be3452c | ||
|
|
ce14c225e5 | ||
|
|
b78721826e | ||
|
|
85113df113 | ||
|
|
607b56cb87 | ||
|
|
2dbf8b7d41 | ||
|
|
7d4c10043d | ||
|
|
64604124c9 | ||
|
|
50f20ad836 | ||
|
|
ac40283501 | ||
|
|
e03d4fc1a5 | ||
|
|
05e9443db5 | ||
|
|
1250cc758f | ||
|
|
a18784da6c | ||
|
|
c87d637edd | ||
|
|
bf4a4e5296 | ||
|
|
4f7b80dad2 | ||
|
|
8a2f9bc7bb | ||
|
|
b9806c183b | ||
|
|
5aa4c4c999 | ||
|
|
424cfac80f | ||
|
|
715913f3b4 | ||
|
|
1c2c4fdcd3 | ||
|
|
2ea6c2a3a7 | ||
|
|
d91da857a0 | ||
|
|
31e65969b3 | ||
|
|
df250bc056 | ||
|
|
1569274684 | ||
|
|
6d8f751da4 | ||
|
|
c2dd00a4ab | ||
|
|
9e6ae6eef8 | ||
|
|
58b985ba02 | ||
|
|
b4f3143c8c | ||
|
|
84ad6b5d50 | ||
|
|
32c14af5ce | ||
|
|
46023c47f5 | ||
|
|
71212e5f68 | ||
|
|
6d1c34048c | ||
|
|
f67006057e | ||
|
|
e1e397a7b5 | ||
|
|
0f35799a77 | ||
|
|
be44221d98 | ||
|
|
94ad254a58 | ||
|
|
666a4be1f2 | ||
|
|
e542fbd0a2 | ||
|
|
f4b2d13aa4 | ||
|
|
abcae6da96 | ||
|
|
1b9b3eaa8e | ||
|
|
0babc4f192 | ||
|
|
e51ffb37b4 | ||
|
|
2fba96713c | ||
|
|
dccf8edc25 | ||
|
|
d98aeac818 | ||
|
|
62bfc4ea19 | ||
|
|
8d74029fba | ||
|
|
809cb5cf1f | ||
|
|
a4196609c9 | ||
|
|
e7eedcf48d | ||
|
|
8bf042b153 | ||
|
|
8325a12faf | ||
|
|
03abccd8e8 | ||
|
|
19e79fedb2 | ||
|
|
71eacaa3b1 | ||
|
|
7cfa46d838 | ||
|
|
7989e78460 | ||
|
|
08466f615f | ||
|
|
880d14990f | ||
|
|
39ac8f6d46 | ||
|
|
685fc7066f | ||
|
|
127600e728 | ||
|
|
d764328026 | ||
|
|
cae8296999 | ||
|
|
86efb71124 | ||
|
|
0899b08b8c | ||
|
|
a770db9d3e | ||
|
|
87b5c43166 | ||
|
|
d14ab2aeff | ||
|
|
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 | ||
|
|
b39a609226 | ||
|
|
d25f64cca0 | ||
|
|
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 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -23,3 +23,9 @@ 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.0
|
||||
11
LICENSE
Normal file
11
LICENSE
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright 2014 Reverb Technologies, 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 [apache.org/licenses/LICENSE-2.0](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.
|
||||
129
README.md
129
README.md
@@ -1,27 +1,57 @@
|
||||
# Swagger Code Generator
|
||||
|
||||
[](https://travis-ci.org/swagger-api/swagger-codegen)
|
||||
|
||||
## Overview
|
||||
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.
|
||||
Swagger-compliant server.
|
||||
|
||||
## What's Swagger?
|
||||
|
||||
The goal of Swagger™ is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swagger removes the guesswork in calling the service.
|
||||
|
||||
|
||||
Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more.
|
||||
|
||||
|
||||
## Compatibility
|
||||
The Swagger Specification has undergone 3 revisions since initial creation in 2010. Compatibility between swagger-codegen and the Swagger specification is as follows:
|
||||
|
||||
Swagger Codegen Version | Release Date | Swagger Spec compatibility | Notes
|
||||
----------------------- | ------------ | -------------------------- | -----
|
||||
2.1.0 (in development) | n/a | 1.0, 1.1, 1.2, 2.0 | [branch develop_2.0](https://github.com/swagger-api/swagger-codegen/tree/develop_2.0)
|
||||
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/2.0.17)
|
||||
1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)
|
||||
|
||||
|
||||
### Prerequisites
|
||||
You need the following installed and available in your $PATH:
|
||||
|
||||
* [Java 1.6](http://java.oracle.com)
|
||||
* [Java 1.7](http://java.oracle.com)
|
||||
|
||||
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!
|
||||
|
||||
* [Apache maven 3.0.3 or greater](http://maven.apache.org/)
|
||||
|
||||
* [Scala](http://www.scala-lang.org)
|
||||
* [Scala 2.10.4](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:
|
||||
|
||||
```
|
||||
mvn package
|
||||
./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:
|
||||
|
||||
@@ -29,7 +59,7 @@ You can build a client against Wordnik's [petstore](http://petstore.swagger.word
|
||||
./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
|
||||
This will run the script in [samples/client/petstore/ScalaPetstoreCodegen.scala](https://github.com/swagger-api/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:
|
||||
|
||||
```
|
||||
@@ -52,13 +82,13 @@ Other languages have petstore samples, too:
|
||||
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/resources.json special-key
|
||||
./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:
|
||||
script with the overrides you want. Follow [ScalaPetstoreCodegen](https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) as an example:
|
||||
|
||||
For example, create `src/main/scala/MyCodegen.scala` with these contents:
|
||||
|
||||
@@ -108,15 +138,17 @@ You can look at `src/main/resources/${your-language}` for examples. To make you
|
||||
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
|
||||
See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require
|
||||
static code generation.
|
||||
There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a swagger specification.
|
||||
|
||||
|
||||
#### 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
|
||||
-DfileMap=/path/to/resource-listing
|
||||
```
|
||||
|
||||
Or for example:
|
||||
@@ -129,42 +161,89 @@ 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
|
||||
more about the spec file and format, please see [swagger-spec](https://github.com/swagger-api/swagger-spec). 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/resources.json "" ./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/swagger-api/swagger-codegen/tree/master/samples/swagger-static-docs/docs
|
||||
```
|
||||
|
||||
which is based on these templates:
|
||||
|
||||
```
|
||||
https://github.com/swagger-api/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/swagger-api/swagger-codegen/tree/master/samples/server-generator/node)
|
||||
|
||||
* [ruby sinatra generator](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/sinatra)
|
||||
|
||||
* [scala scalatra generator](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/scalatra)
|
||||
|
||||
* [java jax-rs generator](https://github.com/swagger-api/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/swagger-api/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`.
|
||||
|
||||
|
||||
### To build the codegen library
|
||||
|
||||
This will create the swagger-codegen library from source.
|
||||
|
||||
```
|
||||
mvn package
|
||||
./sbt assembly
|
||||
```
|
||||
|
||||
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!
|
||||
|
||||
|
||||
### 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)
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Copyright 2012 Wordnik, Inc.
|
||||
Copyright 2014 Reverb Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
6
bin/Version.scala
Normal file
6
bin/Version.scala
Normal file
@@ -0,0 +1,6 @@
|
||||
val version = scala.util.Properties.scalaPropOrElse("version.number", "unknown").toString match {
|
||||
case s if s startsWith "2.10" => "2.10"
|
||||
case s if s startsWith "2.11" => "2.11"
|
||||
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"
|
||||
|
||||
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
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
|
||||
# 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/*assembly*.jar ]; then
|
||||
scala -cp $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/flash/FlashPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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.2/api-docs -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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
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"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/wordnik-api/java/JavaWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,34 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/*:$DIR/../target/lib/*"
|
||||
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"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/objc/ObjcPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/wordnik-api/objc/ObjcWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
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/objc/ObjcWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
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"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/php/PHPPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
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"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/python/PythonPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
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"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/python3/Python3PetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
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"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/ruby/RubyPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
@@ -1,7 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
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
|
||||
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
|
||||
|
||||
|
||||
# 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"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@"
|
||||
ags="$@"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar ]; then
|
||||
scala -cp $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.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=2.10 #$(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/*assembly*.jar ]; then
|
||||
java -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
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"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/scala/ScalaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/wordnik-api/scala/ScalaWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.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 "
|
||||
ags="$@ com.wordnik.swagger.codegen.SwaggerDocGenerator http://petstore.swagger.wordnik.com/api/api-docs"
|
||||
|
||||
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags
|
||||
else
|
||||
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
|
||||
fi
|
||||
@@ -1,6 +1,31 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
#!/bin/sh
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH com.wordnik.swagger.codegen.spec.Validator "$@"
|
||||
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/*assembly*.jar ]; then
|
||||
scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
137
build.sbt
Normal file
137
build.sbt
Normal file
@@ -0,0 +1,137 @@
|
||||
import xml.Group
|
||||
import AssemblyKeys._
|
||||
|
||||
organization := "com.wordnik"
|
||||
|
||||
name := "swagger-codegen"
|
||||
|
||||
version := "2.0.18-SNAPSHOT"
|
||||
|
||||
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.10.4", "2.11.0", "2.11.1")
|
||||
|
||||
scalaVersion := "2.10.4"
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"org.json4s" %% "json4s-jackson" % "3.2.10",
|
||||
"io.backchat.inflector" %% "scala-inflector" % "1.3.5",
|
||||
"commons-io" % "commons-io" % "2.3",
|
||||
"net.iharder" % "base64" % "2.3.8",
|
||||
"ch.qos.logback" % "logback-classic" % "1.0.13" % "provided",
|
||||
"org.rogach" %% "scallop" % "0.9.5",
|
||||
"junit" % "junit" % "4.11" % "test",
|
||||
"org.scalatest" %% "scalatest" % "2.1.7" % "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.scalatra.scalate" %% "scalate-core" % "1.7.0"
|
||||
case v if v.startsWith("2.11") =>
|
||||
"org.scalatra.scalate" %% "scalate-core" % "1.7.0"
|
||||
}
|
||||
|
||||
libraryDependencies ++= {
|
||||
scalaVersion.toString match {
|
||||
case v if v.startsWith("2.10") || v.startsWith("2.11") => Seq("org.scala-lang" % "scala-reflect" % v)
|
||||
case _ => Seq()
|
||||
}
|
||||
}
|
||||
|
||||
resolvers += "Typesafe releases" at "http://repo.typesafe.com/typesafe/releases"
|
||||
|
||||
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"
|
||||
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"
|
||||
}
|
||||
}
|
||||
1
project/build.properties
Normal file
1
project/build.properties
Normal file
@@ -0,0 +1 @@
|
||||
sbt.version=0.13.5
|
||||
5
project/plugins.sbt
Normal file
5
project/plugins.sbt
Normal file
@@ -0,0 +1,5 @@
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.2")
|
||||
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.9.1")
|
||||
|
||||
resolvers += "Sonatype OSS Releases" at "https://oss.sonatype.org/content/repositories/releases"
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Copyright 2014 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"),
|
||||
("httpPatch.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "HttpPatch.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")
|
||||
)
|
||||
}
|
||||
170
samples/client/petstore/android-java/pom.xml
Normal file
170
samples/client/petstore/android-java/pom.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<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>
|
||||
</plugins>
|
||||
</build>
|
||||
<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>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>${httpclient-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
<version>${httpclient-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.android</groupId>
|
||||
<artifactId>android</artifactId>
|
||||
<version>4.1.1.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<jackson-version>2.1.4</jackson-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<httpclient-version>4.3</httpclient-version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.wordnik.client;
|
||||
|
||||
public class ApiException extends Exception {
|
||||
int code = 0;
|
||||
String message = null;
|
||||
|
||||
public ApiException() {}
|
||||
|
||||
public ApiException(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
package com.wordnik.client;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator.Feature;
|
||||
import com.fasterxml.jackson.databind.*;
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
import org.apache.http.*;
|
||||
import org.apache.http.client.*;
|
||||
import org.apache.http.client.methods.*;
|
||||
import org.apache.http.conn.*;
|
||||
import org.apache.http.conn.scheme.*;
|
||||
import org.apache.http.conn.ssl.*;
|
||||
import org.apache.http.entity.mime.*;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.impl.client.*;
|
||||
import org.apache.http.impl.conn.*;
|
||||
import org.apache.http.params.*;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.Socket;
|
||||
import java.net.UnknownHostException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
public class ApiInvoker {
|
||||
private static ApiInvoker INSTANCE = new ApiInvoker();
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
|
||||
private HttpClient client = null;
|
||||
|
||||
private boolean ignoreSSLCertificates = false;
|
||||
|
||||
private ClientConnectionManager ignoreSSLConnectionManager;
|
||||
|
||||
public ApiInvoker() {
|
||||
initConnectionManager();
|
||||
}
|
||||
|
||||
public static ApiInvoker getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public void ignoreSSLCertificates(boolean ignoreSSLCertificates) {
|
||||
this.ignoreSSLCertificates = ignoreSSLCertificates;
|
||||
}
|
||||
|
||||
public void addDefaultHeader(String key, String value) {
|
||||
defaultHeaderMap.put(key, value);
|
||||
}
|
||||
|
||||
public String escapeString(String str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
public static Object deserialize(String json, String containerType, Class cls) throws ApiException {
|
||||
try{
|
||||
if("List".equals(containerType)) {
|
||||
JavaType typeInfo = JsonUtil.getJsonMapper().getTypeFactory().constructCollectionType(List.class, cls);
|
||||
List response = (List<?>) JsonUtil.getJsonMapper().readValue(json, typeInfo);
|
||||
return response;
|
||||
}
|
||||
else if(String.class.equals(cls)) {
|
||||
if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1)
|
||||
return json.substring(1, json.length() - 2);
|
||||
else
|
||||
return json;
|
||||
}
|
||||
else {
|
||||
return JsonUtil.getJsonMapper().readValue(json, cls);
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new ApiException(500, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static String serialize(Object obj) throws ApiException {
|
||||
try {
|
||||
if (obj != null)
|
||||
return JsonUtil.getJsonMapper().writeValueAsString(obj);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new ApiException(500, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String invokeAPI(String host, String path, String method, Map<String, String> queryParams, Object body, Map<String, String> headerParams, String contentType) throws ApiException {
|
||||
HttpClient client = getClient(host);
|
||||
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(String key : queryParams.keySet()) {
|
||||
String value = queryParams.get(key);
|
||||
if (value != null){
|
||||
if(b.toString().length() == 0)
|
||||
b.append("?");
|
||||
else
|
||||
b.append("&");
|
||||
b.append(escapeString(key)).append("=").append(escapeString(value));
|
||||
}
|
||||
}
|
||||
String url = host + path + b.toString();
|
||||
|
||||
HashMap<String, String> headers = new HashMap<String, String>();
|
||||
|
||||
for(String key : headerParams.keySet()) {
|
||||
headers.put(key, headerParams.get(key));
|
||||
}
|
||||
|
||||
for(String key : defaultHeaderMap.keySet()) {
|
||||
if(!headerParams.containsKey(key)) {
|
||||
headers.put(key, defaultHeaderMap.get(key));
|
||||
}
|
||||
}
|
||||
headers.put("Accept", "application/json");
|
||||
|
||||
HttpResponse response = null;
|
||||
try{
|
||||
if("GET".equals(method)) {
|
||||
HttpGet get = new HttpGet(url);
|
||||
get.addHeader("Accept", "application/json");
|
||||
for(String key : headers.keySet()) {
|
||||
get.setHeader(key, headers.get(key));
|
||||
}
|
||||
response = client.execute(get);
|
||||
}
|
||||
else if ("POST".equals(method)) {
|
||||
HttpPost post = new HttpPost(url);
|
||||
if (body != null) {
|
||||
if("application/x-www-form-urlencoded".equals(contentType)) {
|
||||
post.setHeader("Content-Type", contentType);
|
||||
post.setEntity(new UrlEncodedFormEntity((List<NameValuePair>)body));
|
||||
}
|
||||
else if("multipart/form-data".equals(contentType)) {
|
||||
String boundary = "-------------" + System.currentTimeMillis();
|
||||
post.setHeader("Content-type", "multipart/form-data; boundary="+boundary);
|
||||
MultipartEntityBuilder builder = (MultipartEntityBuilder)body;
|
||||
builder.setBoundary(boundary);
|
||||
post.setEntity(builder.build());
|
||||
}
|
||||
else {
|
||||
post.setHeader("Content-Type", contentType);
|
||||
post.setEntity(new StringEntity(serialize(body), "UTF-8"));
|
||||
}
|
||||
|
||||
}
|
||||
for(String key : headers.keySet()) {
|
||||
post.setHeader(key, headers.get(key));
|
||||
}
|
||||
response = client.execute(post);
|
||||
}
|
||||
else if ("PUT".equals(method)) {
|
||||
HttpPut put = new HttpPut(url);
|
||||
if(body != null) {
|
||||
if("application/x-www-form-urlencoded".equals(contentType)) {
|
||||
put.setHeader("Content-Type", contentType);
|
||||
put.setEntity(new UrlEncodedFormEntity((List<NameValuePair>)body));
|
||||
}
|
||||
else if("multipart/form-data".equals(contentType)) {
|
||||
String boundary = "-------------" + System.currentTimeMillis();
|
||||
put.setHeader("Content-type", "multipart/form-data; boundary="+boundary);
|
||||
MultipartEntityBuilder builder = (MultipartEntityBuilder)body;
|
||||
builder.setBoundary(boundary);
|
||||
put.setEntity(builder.build());
|
||||
}
|
||||
else {
|
||||
put.setHeader("Content-Type", contentType);
|
||||
put.setEntity(new StringEntity(serialize(body), "UTF-8"));
|
||||
}
|
||||
}
|
||||
for(String key : headers.keySet()) {
|
||||
put.setHeader(key, headers.get(key));
|
||||
}
|
||||
response = client.execute(put);
|
||||
}
|
||||
else if ("DELETE".equals(method)) {
|
||||
HttpDelete delete = new HttpDelete(url);
|
||||
for(String key : headers.keySet()) {
|
||||
delete.setHeader(key, headers.get(key));
|
||||
}
|
||||
response = client.execute(delete);
|
||||
}
|
||||
else if ("PATCH".equals(method)) {
|
||||
HttpPatch patch = new HttpPatch(url);
|
||||
|
||||
if (body != null) {
|
||||
patch.setHeader("Content-Type", contentType);
|
||||
patch.setEntity(new StringEntity(serialize(body), "UTF-8"));
|
||||
}
|
||||
for(String key : headers.keySet()) {
|
||||
patch.setHeader(key, headers.get(key));
|
||||
}
|
||||
response = client.execute(patch);
|
||||
}
|
||||
|
||||
int code = response.getStatusLine().getStatusCode();
|
||||
String responseString = null;
|
||||
if(code == 204)
|
||||
responseString = "";
|
||||
else if(code >= 200 && code < 300) {
|
||||
if(response.getEntity() != null) {
|
||||
HttpEntity resEntity = response.getEntity();
|
||||
responseString = EntityUtils.toString(resEntity);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(response.getEntity() != null) {
|
||||
HttpEntity resEntity = response.getEntity();
|
||||
responseString = EntityUtils.toString(resEntity);
|
||||
}
|
||||
else
|
||||
responseString = "no data";
|
||||
throw new ApiException(code, responseString);
|
||||
}
|
||||
return responseString;
|
||||
}
|
||||
catch(IOException e) {
|
||||
throw new ApiException(500, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private HttpClient getClient(String host) {
|
||||
if (client == null) {
|
||||
if (ignoreSSLCertificates && ignoreSSLConnectionManager != null) {
|
||||
// Trust self signed certificates
|
||||
client = new DefaultHttpClient(ignoreSSLConnectionManager, new BasicHttpParams());
|
||||
} else {
|
||||
client = new DefaultHttpClient();
|
||||
}
|
||||
}
|
||||
return client;
|
||||
}
|
||||
|
||||
private void initConnectionManager() {
|
||||
try {
|
||||
final SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||
|
||||
// set up a TrustManager that trusts everything
|
||||
TrustManager[] trustManagers = new TrustManager[] {
|
||||
new X509TrustManager() {
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
public void checkClientTrusted(X509Certificate[] certs, String authType) {}
|
||||
public void checkServerTrusted(X509Certificate[] certs, String authType) {}
|
||||
}};
|
||||
|
||||
sslContext.init(null, trustManagers, new SecureRandom());
|
||||
|
||||
SSLSocketFactory sf = new SSLSocketFactory((KeyStore)null) {
|
||||
private javax.net.ssl.SSLSocketFactory sslFactory = sslContext.getSocketFactory();
|
||||
|
||||
public Socket createSocket(Socket socket, String host, int port, boolean autoClose)
|
||||
throws IOException, UnknownHostException {
|
||||
return sslFactory.createSocket(socket, host, port, autoClose);
|
||||
}
|
||||
|
||||
public Socket createSocket() throws IOException {
|
||||
return sslFactory.createSocket();
|
||||
}
|
||||
};
|
||||
|
||||
sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
|
||||
Scheme httpsScheme = new Scheme("https", sf, 443);
|
||||
SchemeRegistry schemeRegistry = new SchemeRegistry();
|
||||
schemeRegistry.register(httpsScheme);
|
||||
schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
|
||||
|
||||
ignoreSSLConnectionManager = new SingleClientConnManager(new BasicHttpParams(), schemeRegistry);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
// This will only be thrown if SSL isn't available for some reason.
|
||||
} catch (KeyManagementException e) {
|
||||
// This might be thrown when passing a key into init(), but no key is being passed.
|
||||
} catch (GeneralSecurityException e) {
|
||||
// This catches anything else that might go wrong.
|
||||
// If anything goes wrong we default to the standard connection manager.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.wordnik.client;
|
||||
|
||||
import org.apache.http.client.methods.*;
|
||||
|
||||
public class HttpPatch extends HttpPost {
|
||||
public static final String METHOD_PATCH = "PATCH";
|
||||
|
||||
public HttpPatch(final String url) {
|
||||
super(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return METHOD_PATCH;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.wordnik.client;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import com.fasterxml.jackson.databind.*;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.core.JsonGenerator.Feature;
|
||||
|
||||
public class JsonUtil {
|
||||
public static ObjectMapper mapper;
|
||||
|
||||
static {
|
||||
mapper = new ObjectMapper();
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
}
|
||||
|
||||
public static ObjectMapper getJsonMapper() {
|
||||
return mapper;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,538 @@
|
||||
package com.wordnik.petstore.api;
|
||||
|
||||
import com.wordnik.client.ApiException;
|
||||
import com.wordnik.client.ApiInvoker;
|
||||
import com.wordnik.petstore.model.Pet;
|
||||
import java.util.*;
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.entity.mime.*;
|
||||
import org.apache.http.entity.mime.content.*;
|
||||
import org.apache.http.entity.ContentType;
|
||||
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
public class PetApi {
|
||||
String basePath = "http://petstore.swagger.wordnik.com/api";
|
||||
ApiInvoker apiInvoker = ApiInvoker.getInstance();
|
||||
|
||||
public void addHeader(String key, String value) {
|
||||
getInvoker().addDefaultHeader(key, value);
|
||||
}
|
||||
|
||||
public ApiInvoker getInvoker() {
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
public void setBasePath(String basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
private static String getMimeType(File file) {
|
||||
MimeTypeMap mime = MimeTypeMap.getSingleton();
|
||||
int index = file.getName().lastIndexOf('.')+1;
|
||||
String ext = file.getName().substring(index).toLowerCase();
|
||||
return mime.getMimeTypeFromExtension(ext);
|
||||
}
|
||||
|
||||
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
|
||||
//error info- code: 404 reason: "Pet not found" model: <none>
|
||||
//error info- code: 405 reason: "Validation exception" model: <none>
|
||||
public void updatePet (Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = body;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 405 reason: "Invalid input" model: <none>
|
||||
public void addPet (Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json","application/xml"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = body;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid status value" model: <none>
|
||||
public List<Pet> findPetsByStatus (String status) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(status == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
if(!"null".equals(String.valueOf(status)))
|
||||
queryParams.put("status", String.valueOf(status));
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid tag value" model: <none>
|
||||
public List<Pet> findPetsByTags (String tags) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(tags == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
if(!"null".equals(String.valueOf(tags)))
|
||||
queryParams.put("tags", String.valueOf(tags));
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 405 reason: "Invalid input" model: <none>
|
||||
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/x-www-form-urlencoded"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
hasFields = true;
|
||||
mp.add(new BasicNameValuePair("name", name));
|
||||
hasFields = true;
|
||||
mp.add(new BasicNameValuePair("status", status));
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
hasFields = true;
|
||||
builder.addTextBody("name", name.toString());
|
||||
hasFields = true;
|
||||
builder.addTextBody("status", status.toString());
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
|
||||
//error info- code: 404 reason: "Pet not found" model: <none>
|
||||
public Pet getPetById (Long petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return (Pet) ApiInvoker.deserialize(response, "", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid pet value" model: <none>
|
||||
public void deletePet (String petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid tag value" model: <none>
|
||||
public List<Pet> partialUpdate (String petId, Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(petId == null || body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json","application/xml"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = body;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PATCH", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void uploadFile (String additionalMetadata, File file) throws ApiException {
|
||||
Object postBody = null;
|
||||
// create path and map variables
|
||||
String path = "/pet/uploadImage".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"multipart/form-data"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
hasFields = true;
|
||||
mp.add(new BasicNameValuePair("additionalMetadata", additionalMetadata));
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
hasFields = true;
|
||||
builder.addTextBody("additionalMetadata", additionalMetadata.toString());
|
||||
hasFields = true;
|
||||
builder.addBinaryBody("file", file, ContentType.create(getMimeType(file)), file.getName());
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
package com.wordnik.petstore.api;
|
||||
|
||||
import com.wordnik.client.ApiException;
|
||||
import com.wordnik.client.ApiInvoker;
|
||||
import com.wordnik.petstore.model.Order;
|
||||
import java.util.*;
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.entity.mime.*;
|
||||
import org.apache.http.entity.mime.content.*;
|
||||
import org.apache.http.entity.ContentType;
|
||||
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
public class StoreApi {
|
||||
String basePath = "http://petstore.swagger.wordnik.com/api";
|
||||
ApiInvoker apiInvoker = ApiInvoker.getInstance();
|
||||
|
||||
public void addHeader(String key, String value) {
|
||||
getInvoker().addDefaultHeader(key, value);
|
||||
}
|
||||
|
||||
public ApiInvoker getInvoker() {
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
public void setBasePath(String basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
private static String getMimeType(File file) {
|
||||
MimeTypeMap mime = MimeTypeMap.getSingleton();
|
||||
int index = file.getName().lastIndexOf('.')+1;
|
||||
String ext = file.getName().substring(index).toLowerCase();
|
||||
return mime.getMimeTypeFromExtension(ext);
|
||||
}
|
||||
|
||||
//error info- code: 400 reason: "Invalid order" model: <none>
|
||||
public void placeOrder (Order body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = body;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
|
||||
//error info- code: 404 reason: "Order not found" model: <none>
|
||||
public void deleteOrder (String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(orderId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
|
||||
//error info- code: 404 reason: "Order not found" model: <none>
|
||||
public Order getOrderById (String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(orderId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return (Order) ApiInvoker.deserialize(response, "", Order.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,468 @@
|
||||
package com.wordnik.petstore.api;
|
||||
|
||||
import com.wordnik.client.ApiException;
|
||||
import com.wordnik.client.ApiInvoker;
|
||||
import com.wordnik.petstore.model.User;
|
||||
import java.util.*;
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.entity.mime.*;
|
||||
import org.apache.http.entity.mime.content.*;
|
||||
import org.apache.http.entity.ContentType;
|
||||
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
public class UserApi {
|
||||
String basePath = "http://petstore.swagger.wordnik.com/api";
|
||||
ApiInvoker apiInvoker = ApiInvoker.getInstance();
|
||||
|
||||
public void addHeader(String key, String value) {
|
||||
getInvoker().addDefaultHeader(key, value);
|
||||
}
|
||||
|
||||
public ApiInvoker getInvoker() {
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
public void setBasePath(String basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
private static String getMimeType(File file) {
|
||||
MimeTypeMap mime = MimeTypeMap.getSingleton();
|
||||
int index = file.getName().lastIndexOf('.')+1;
|
||||
String ext = file.getName().substring(index).toLowerCase();
|
||||
return mime.getMimeTypeFromExtension(ext);
|
||||
}
|
||||
|
||||
public void createUsersWithArrayInput (List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = body;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void createUsersWithListInput (List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = body;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid username supplied" model: <none>
|
||||
//error info- code: 404 reason: "User not found" model: <none>
|
||||
public void updateUser (String username, User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(username == null || body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = body;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid username supplied" model: <none>
|
||||
//error info- code: 404 reason: "User not found" model: <none>
|
||||
public void deleteUser (String username) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(username == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid username supplied" model: <none>
|
||||
//error info- code: 404 reason: "User not found" model: <none>
|
||||
public User getUserByName (String username) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(username == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return (User) ApiInvoker.deserialize(response, "", User.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid username and password combination" model: <none>
|
||||
public String loginUser (String username, String password) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(username == null || password == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
if(!"null".equals(String.valueOf(username)))
|
||||
queryParams.put("username", String.valueOf(username));
|
||||
if(!"null".equals(String.valueOf(password)))
|
||||
queryParams.put("password", String.valueOf(password));
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return (String) ApiInvoker.deserialize(response, "", String.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void logoutUser () throws ApiException {
|
||||
Object postBody = null;
|
||||
// create path and map variables
|
||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = null;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void createUser (User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("application/x-www-form-urlencoded")) {
|
||||
boolean hasFields = false;
|
||||
List<NameValuePair> mp = new ArrayList<NameValuePair>();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||
if(hasFields)
|
||||
postBody = builder;
|
||||
}
|
||||
else {
|
||||
postBody = body;
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.wordnik.petstore.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class Category {
|
||||
@JsonProperty("id")
|
||||
private Long id = null;
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Category {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" name: ").append(name).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.wordnik.petstore.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Date;
|
||||
public class Order {
|
||||
@JsonProperty("id")
|
||||
private Long id = null;
|
||||
@JsonProperty("petId")
|
||||
private Long petId = null;
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity = null;
|
||||
/* Order Status */
|
||||
@JsonProperty("status")
|
||||
private String status = null;
|
||||
@JsonProperty("shipDate")
|
||||
private Date shipDate = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
public void setPetId(Long petId) {
|
||||
this.petId = petId;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
public void setShipDate(Date shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Order {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" petId: ").append(petId).append("\n");
|
||||
sb.append(" quantity: ").append(quantity).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append(" shipDate: ").append(shipDate).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.wordnik.petstore.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.*;
|
||||
import com.wordnik.petstore.model.Category;
|
||||
public class Pet {
|
||||
/* unique identifier for the pet */
|
||||
@JsonProperty("id")
|
||||
private Long id = null;
|
||||
@JsonProperty("category")
|
||||
private Category category = null;
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
@JsonProperty("photoUrls")
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
@JsonProperty("tags")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
/* pet status in the store */
|
||||
@JsonProperty("status")
|
||||
private String status = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
public void setCategory(Category category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Pet {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" category: ").append(category).append("\n");
|
||||
sb.append(" name: ").append(name).append("\n");
|
||||
sb.append(" photoUrls: ").append(photoUrls).append("\n");
|
||||
sb.append(" tags: ").append(tags).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.wordnik.petstore.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class Tag {
|
||||
@JsonProperty("id")
|
||||
private Long id = null;
|
||||
@JsonProperty("name")
|
||||
private String name = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Tag {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" name: ").append(name).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.wordnik.petstore.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class User {
|
||||
@JsonProperty("id")
|
||||
private Long id = null;
|
||||
@JsonProperty("firstName")
|
||||
private String firstName = null;
|
||||
@JsonProperty("username")
|
||||
private String username = null;
|
||||
@JsonProperty("lastName")
|
||||
private String lastName = null;
|
||||
@JsonProperty("email")
|
||||
private String email = null;
|
||||
@JsonProperty("password")
|
||||
private String password = null;
|
||||
@JsonProperty("phone")
|
||||
private String phone = null;
|
||||
/* User Status */
|
||||
@JsonProperty("userStatus")
|
||||
private Integer userStatus = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
public void setUserStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class User {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" firstName: ").append(firstName).append("\n");
|
||||
sb.append(" username: ").append(username).append("\n");
|
||||
sb.append(" lastName: ").append(lastName).append("\n");
|
||||
sb.append(" email: ").append(email).append("\n");
|
||||
sb.append(" password: ").append(password).append("\n");
|
||||
sb.append(" phone: ").append(phone).append("\n");
|
||||
sb.append(" userStatus: ").append(userStatus).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
45
samples/client/petstore/csharp/CSharpPetstoreCodegen.scala
Normal file
45
samples/client/petstore/csharp/CSharpPetstoreCodegen.scala
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Copyright 2014 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.BasicCSharpGenerator
|
||||
|
||||
object CSharpPetstoreCodegen extends BasicCSharpGenerator {
|
||||
def main(args: Array[String]) = generateClient(args)
|
||||
|
||||
// location of templates
|
||||
override def templateDir = "csharp"
|
||||
|
||||
// where to write generated code
|
||||
override def destinationDir = "samples/client/petstore/csharp/src"
|
||||
|
||||
// package for api invoker, error files
|
||||
override def invokerPackage = Some("Com.Wordnik.Petstore")
|
||||
|
||||
// package for models
|
||||
override def modelPackage = Some("Com.Wordnik.Petstore.Model")
|
||||
|
||||
// package for api classes
|
||||
override def apiPackage = Some("Com.Wordnik.Petstore.Api")
|
||||
|
||||
// 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.cs"),
|
||||
("apiException.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiException.cs"),
|
||||
("Newtonsoft.Json.dll", "samples/client/petstore/csharp/bin", "Newtonsoft.Json.dll"),
|
||||
("compile.mustache", "samples/client/petstore/csharp", "compile.bat"))
|
||||
}
|
||||
|
||||
BIN
samples/client/petstore/csharp/bin/Com.Wordnik.Petstore.dll
Normal file
BIN
samples/client/petstore/csharp/bin/Com.Wordnik.Petstore.dll
Normal file
Binary file not shown.
BIN
samples/client/petstore/csharp/bin/Newtonsoft.Json.dll
Normal file
BIN
samples/client/petstore/csharp/bin/Newtonsoft.Json.dll
Normal file
Binary file not shown.
2
samples/client/petstore/csharp/compile.bat
Normal file
2
samples/client/petstore/csharp/compile.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
|
||||
%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll /target:library /out:bin/Com.Wordnik.Petstore.dll /recurse:src\*.cs /doc:bin/Com.Wordnik.Petstore.xml
|
||||
@@ -0,0 +1,348 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Com.Wordnik.Petstore;
|
||||
using Com.Wordnik.Petstore.Model;
|
||||
namespace Com.Wordnik.Petstore.Api {
|
||||
public class PetApi {
|
||||
string basePath = "http://petstore.swagger.wordnik.com/api";
|
||||
private readonly ApiInvoker apiInvoker = ApiInvoker.GetInstance();
|
||||
|
||||
public ApiInvoker getInvoker() {
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
// Sets the endpoint base url for the services being accessed
|
||||
public void setBasePath(string basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
// Gets the endpoint base url for the services being accessed
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find pet by ID Returns a pet based on ID
|
||||
/// </summary>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns></returns>
|
||||
public Pet getPetById (long petId) {
|
||||
// create path and map variables
|
||||
var path = "/pet/{petId}".Replace("{format}","json").Replace("{" + "petId" + "}", apiInvoker.escapeString(petId.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return (Pet) ApiInvoker.deserialize(response, typeof(Pet));
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Deletes a pet
|
||||
/// </summary>
|
||||
/// <param name="petId">Pet id to delete</param>
|
||||
/// <returns></returns>
|
||||
public void deletePet (string petId) {
|
||||
// create path and map variables
|
||||
var path = "/pet/{petId}".Replace("{format}","json").Replace("{" + "petId" + "}", apiInvoker.escapeString(petId.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// partial updates to a pet
|
||||
/// </summary>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||
/// <returns></returns>
|
||||
public List<Pet> partialUpdate (string petId, Pet body) {
|
||||
// create path and map variables
|
||||
var path = "/pet/{petId}".Replace("{format}","json").Replace("{" + "petId" + "}", apiInvoker.escapeString(petId.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (petId == null || body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "PATCH", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, typeof(List<Pet>));
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Updates a pet in the store with form data
|
||||
/// </summary>
|
||||
/// <param name="petId">ID of pet that needs to be updated</param>
|
||||
/// <param name="name">Updated name of the pet</param>
|
||||
/// <param name="status">Updated status of the pet</param>
|
||||
/// <returns></returns>
|
||||
public void updatePetWithForm (string petId, string name, string status) {
|
||||
// create path and map variables
|
||||
var path = "/pet/{petId}".Replace("{format}","json").Replace("{" + "petId" + "}", apiInvoker.escapeString(petId.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// uploads an image
|
||||
/// </summary>
|
||||
/// <param name="additionalMetadata">Additional data to pass to server</param>
|
||||
/// <param name="body">file to upload</param>
|
||||
/// <returns></returns>
|
||||
public void uploadFile (string additionalMetadata, File body) {
|
||||
// create path and map variables
|
||||
var path = "/pet/uploadImage".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Add a new pet to the store
|
||||
/// </summary>
|
||||
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||
/// <returns></returns>
|
||||
public void addPet (Pet body) {
|
||||
// create path and map variables
|
||||
var path = "/pet".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Update an existing pet
|
||||
/// </summary>
|
||||
/// <param name="body">Pet object that needs to be updated in the store</param>
|
||||
/// <returns></returns>
|
||||
public void updatePet (Pet body) {
|
||||
// create path and map variables
|
||||
var path = "/pet".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Finds Pets by status Multiple status values can be provided with comma seperated strings
|
||||
/// </summary>
|
||||
/// <param name="status">Status values that need to be considered for filter</param>
|
||||
/// <returns></returns>
|
||||
public List<Pet> findPetsByStatus (string status) {
|
||||
// create path and map variables
|
||||
var path = "/pet/findByStatus".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (status == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
if (status != null){
|
||||
paramStr = (status != null && status is DateTime) ? ((DateTime)(object)status).ToString("u") : Convert.ToString(status);
|
||||
queryParams.Add("status", paramStr);
|
||||
}
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, typeof(List<Pet>));
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
/// </summary>
|
||||
/// <param name="tags">Tags to filter by</param>
|
||||
/// <returns></returns>
|
||||
public List<Pet> findPetsByTags (string tags) {
|
||||
// create path and map variables
|
||||
var path = "/pet/findByTags".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (tags == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
if (tags != null){
|
||||
paramStr = (tags != null && tags is DateTime) ? ((DateTime)(object)tags).ToString("u") : Convert.ToString(tags);
|
||||
queryParams.Add("tags", paramStr);
|
||||
}
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, typeof(List<Pet>));
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Com.Wordnik.Petstore;
|
||||
using Com.Wordnik.Petstore.Model;
|
||||
namespace Com.Wordnik.Petstore.Api {
|
||||
public class StoreApi {
|
||||
string basePath = "http://petstore.swagger.wordnik.com/api";
|
||||
private readonly ApiInvoker apiInvoker = ApiInvoker.GetInstance();
|
||||
|
||||
public ApiInvoker getInvoker() {
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
// Sets the endpoint base url for the services being accessed
|
||||
public void setBasePath(string basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
// Gets the endpoint base url for the services being accessed
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors
|
||||
/// </summary>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns></returns>
|
||||
public Order getOrderById (string orderId) {
|
||||
// create path and map variables
|
||||
var path = "/store/order/{orderId}".Replace("{format}","json").Replace("{" + "orderId" + "}", apiInvoker.escapeString(orderId.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (orderId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return (Order) ApiInvoker.deserialize(response, typeof(Order));
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </summary>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns></returns>
|
||||
public void deleteOrder (string orderId) {
|
||||
// create path and map variables
|
||||
var path = "/store/order/{orderId}".Replace("{format}","json").Replace("{" + "orderId" + "}", apiInvoker.escapeString(orderId.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (orderId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns></returns>
|
||||
public void placeOrder (Order body) {
|
||||
// create path and map variables
|
||||
var path = "/store/order".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Com.Wordnik.Petstore;
|
||||
using Com.Wordnik.Petstore.Model;
|
||||
namespace Com.Wordnik.Petstore.Api {
|
||||
public class UserApi {
|
||||
string basePath = "http://petstore.swagger.wordnik.com/api";
|
||||
private readonly ApiInvoker apiInvoker = ApiInvoker.GetInstance();
|
||||
|
||||
public ApiInvoker getInvoker() {
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
// Sets the endpoint base url for the services being accessed
|
||||
public void setBasePath(string basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
// Gets the endpoint base url for the services being accessed
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updated user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="body">Updated user object</param>
|
||||
/// <returns></returns>
|
||||
public void updateUser (string username, User body) {
|
||||
// create path and map variables
|
||||
var path = "/user/{username}".Replace("{format}","json").Replace("{" + "username" + "}", apiInvoker.escapeString(username.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (username == null || body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Delete user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <param name="username">The name that needs to be deleted</param>
|
||||
/// <returns></returns>
|
||||
public void deleteUser (string username) {
|
||||
// create path and map variables
|
||||
var path = "/user/{username}".Replace("{format}","json").Replace("{" + "username" + "}", apiInvoker.escapeString(username.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (username == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Get user by user name
|
||||
/// </summary>
|
||||
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
|
||||
/// <returns></returns>
|
||||
public User getUserByName (string username) {
|
||||
// create path and map variables
|
||||
var path = "/user/{username}".Replace("{format}","json").Replace("{" + "username" + "}", apiInvoker.escapeString(username.ToString()));
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (username == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return (User) ApiInvoker.deserialize(response, typeof(User));
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <returns></returns>
|
||||
public string loginUser (string username, string password) {
|
||||
// create path and map variables
|
||||
var path = "/user/login".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (username == null || password == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
if (username != null){
|
||||
paramStr = (username != null && username is DateTime) ? ((DateTime)(object)username).ToString("u") : Convert.ToString(username);
|
||||
queryParams.Add("username", paramStr);
|
||||
}
|
||||
if (password != null){
|
||||
paramStr = (password != null && password is DateTime) ? ((DateTime)(object)password).ToString("u") : Convert.ToString(password);
|
||||
queryParams.Add("password", paramStr);
|
||||
}
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return (string) ApiInvoker.deserialize(response, typeof(string));
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Logs out current logged in user session
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public void logoutUser () {
|
||||
// create path and map variables
|
||||
var path = "/user/logout".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Create user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <param name="body">Created user object</param>
|
||||
/// <returns></returns>
|
||||
public void createUser (User body) {
|
||||
// create path and map variables
|
||||
var path = "/user".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns></returns>
|
||||
public void createUsersWithArrayInput (List<User> body) {
|
||||
// create path and map variables
|
||||
var path = "/user/createWithArray".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates list of users with given list input
|
||||
/// </summary>
|
||||
/// <param name="body">List of user object</param>
|
||||
/// <returns></returns>
|
||||
public void createUsersWithListInput (List<User> body) {
|
||||
// create path and map variables
|
||||
var path = "/user/createWithList".Replace("{format}","json");
|
||||
|
||||
// query params
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if (body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
string paramStr = null;
|
||||
try {
|
||||
var response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.ErrorCode == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace Com.Wordnik.Petstore {
|
||||
public class ApiException : Exception {
|
||||
|
||||
private int errorCode = 0;
|
||||
|
||||
public ApiException() {}
|
||||
|
||||
public int ErrorCode {
|
||||
get
|
||||
{
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
|
||||
public ApiException(int errorCode, string message) : base(message) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Com.Wordnik.Petstore {
|
||||
public class ApiInvoker {
|
||||
private static readonly ApiInvoker _instance = new ApiInvoker();
|
||||
private Dictionary<String, String> defaultHeaderMap = new Dictionary<String, String>();
|
||||
|
||||
public static ApiInvoker GetInstance() {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
public void addDefaultHeader(string key, string value) {
|
||||
defaultHeaderMap.Add(key, value);
|
||||
}
|
||||
|
||||
public string escapeString(string str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
public static object deserialize(string json, Type type) {
|
||||
try
|
||||
{
|
||||
return JsonConvert.DeserializeObject(json, type);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new ApiException(500, e.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static string serialize(object obj) {
|
||||
try
|
||||
{
|
||||
return obj != null ? JsonConvert.SerializeObject(obj) : null;
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new ApiException(500, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public string invokeAPI(string host, string path, string method, Dictionary<String, String> queryParams, object body, Dictionary<String, String> headerParams) {
|
||||
var b = new StringBuilder();
|
||||
|
||||
foreach (var queryParamItem in queryParams)
|
||||
{
|
||||
var value = queryParamItem.Value;
|
||||
if (value == null) continue;
|
||||
b.Append(b.ToString().Length == 0 ? "?" : "&");
|
||||
b.Append(escapeString(queryParamItem.Key)).Append("=").Append(escapeString(value));
|
||||
}
|
||||
|
||||
var querystring = b.ToString();
|
||||
|
||||
host = host.EndsWith("/") ? host.Substring(0, host.Length - 1) : host;
|
||||
|
||||
var client = WebRequest.Create(host + path + querystring);
|
||||
client.ContentType = "application/json";
|
||||
client.Method = method;
|
||||
|
||||
foreach (var headerParamsItem in headerParams)
|
||||
{
|
||||
client.Headers.Add(headerParamsItem.Key, headerParamsItem.Value);
|
||||
}
|
||||
foreach (var defaultHeaderMapItem in defaultHeaderMap.Where(defaultHeaderMapItem => !headerParams.ContainsKey(defaultHeaderMapItem.Key)))
|
||||
{
|
||||
client.Headers.Add(defaultHeaderMapItem.Key, defaultHeaderMapItem.Value);
|
||||
}
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case "GET":
|
||||
break;
|
||||
case "POST":
|
||||
case "PUT":
|
||||
case "DELETE":
|
||||
var swRequestWriter = new StreamWriter(client.GetRequestStream());
|
||||
swRequestWriter.Write(serialize(body));
|
||||
swRequestWriter.Close();
|
||||
break;
|
||||
default:
|
||||
throw new ApiException(500, "unknown method type " + method);
|
||||
}
|
||||
var webResponse = (HttpWebResponse) client.GetResponse();
|
||||
if (webResponse.StatusCode != HttpStatusCode.OK) throw new ApiException((int) webResponse.StatusCode, webResponse.StatusDescription);
|
||||
|
||||
var responseReader = new StreamReader(webResponse.GetResponseStream());
|
||||
var responseData = responseReader.ReadToEnd();
|
||||
responseReader.Close();
|
||||
return responseData;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Com.Wordnik.Petstore.Model {
|
||||
public class Category {
|
||||
public long id { get; set; }
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
public override string ToString() {
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Category {\n");
|
||||
sb.Append(" id: ").Append(id).Append("\n");
|
||||
sb.Append(" name: ").Append(name).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Com.Wordnik.Petstore.Model {
|
||||
public class Order {
|
||||
public long id { get; set; }
|
||||
|
||||
public long petId { get; set; }
|
||||
|
||||
public int quantity { get; set; }
|
||||
|
||||
/* Order Status */
|
||||
public string status { get; set; }
|
||||
|
||||
public DateTime shipDate { get; set; }
|
||||
|
||||
public override string ToString() {
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Order {\n");
|
||||
sb.Append(" id: ").Append(id).Append("\n");
|
||||
sb.Append(" petId: ").Append(petId).Append("\n");
|
||||
sb.Append(" quantity: ").Append(quantity).Append("\n");
|
||||
sb.Append(" status: ").Append(status).Append("\n");
|
||||
sb.Append(" shipDate: ").Append(shipDate).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Com.Wordnik.Petstore.Model {
|
||||
public class Pet {
|
||||
/* unique identifier for the pet */
|
||||
public long id { get; set; }
|
||||
|
||||
public Category category { get; set; }
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
public List<string> photoUrls { get; set; }
|
||||
|
||||
public List<Tag> tags { get; set; }
|
||||
|
||||
/* pet status in the store */
|
||||
public string status { get; set; }
|
||||
|
||||
public override string ToString() {
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Pet {\n");
|
||||
sb.Append(" id: ").Append(id).Append("\n");
|
||||
sb.Append(" category: ").Append(category).Append("\n");
|
||||
sb.Append(" name: ").Append(name).Append("\n");
|
||||
sb.Append(" photoUrls: ").Append(photoUrls).Append("\n");
|
||||
sb.Append(" tags: ").Append(tags).Append("\n");
|
||||
sb.Append(" status: ").Append(status).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Com.Wordnik.Petstore.Model {
|
||||
public class Tag {
|
||||
public long id { get; set; }
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
public override string ToString() {
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Tag {\n");
|
||||
sb.Append(" id: ").Append(id).Append("\n");
|
||||
sb.Append(" name: ").Append(name).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Com.Wordnik.Petstore.Model {
|
||||
public class User {
|
||||
public long id { get; set; }
|
||||
|
||||
public string firstName { get; set; }
|
||||
|
||||
public string username { get; set; }
|
||||
|
||||
public string lastName { get; set; }
|
||||
|
||||
public string email { get; set; }
|
||||
|
||||
public string password { get; set; }
|
||||
|
||||
public string phone { get; set; }
|
||||
|
||||
/* User Status */
|
||||
public int userStatus { get; set; }
|
||||
|
||||
public override string ToString() {
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class User {\n");
|
||||
sb.Append(" id: ").Append(id).Append("\n");
|
||||
sb.Append(" firstName: ").Append(firstName).Append("\n");
|
||||
sb.Append(" username: ").Append(username).Append("\n");
|
||||
sb.Append(" lastName: ").Append(lastName).Append("\n");
|
||||
sb.Append(" email: ").Append(email).Append("\n");
|
||||
sb.Append(" password: ").Append(password).Append("\n");
|
||||
sb.Append(" phone: ").Append(phone).Append("\n");
|
||||
sb.Append(" userStatus: ").Append(userStatus).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2012 Wordnik, Inc.
|
||||
* Copyright 2014 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<arg line="-source-path ${sourcepath}"/>
|
||||
<arg line="-footer 'Copyright Wordnik'"/>
|
||||
<arg line="-package com.wordnik.swagger.api 'Contains the apis which are used by clients to make calls to the services deployed'"/>
|
||||
<arg line="-package com.wordnik.swagger.model 'Contains common classes which encapsulate data elements required'"/>
|
||||
<arg line="-package com.wordnik.swagger.codegen.model 'Contains common classes which encapsulate data elements required'"/>
|
||||
<arg line="-package com.wordnik.swagger.common 'Contains classes which are used by the api classes to invoke the deployed api like SwaggerApi - a base class, ApiUserCredentials, etc.'"/>
|
||||
<arg line="-package com.wordnik.swagger.event 'Results of calls made to Wordnik are returned via dispatched events. This package contains such event classes. Right now thats just ApiClientEvent and Response.'"/>
|
||||
<arg line="-package com.wordnik.swagger.exception 'Contains classes that encapsulate the errors generated'"/>
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.wordnik.swagger.common.ApiUserCredentials;
|
||||
import com.wordnik.swagger.event.Response;
|
||||
import com.wordnik.swagger.common.SwaggerApi;
|
||||
import com.wordnik.client.model.Pet;
|
||||
import com.wordnik.client.model.File;
|
||||
import mx.rpc.AsyncToken;
|
||||
import mx.utils.UIDUtil;
|
||||
import flash.utils.Dictionary;
|
||||
@@ -23,15 +24,19 @@ public class PetApi extends SwaggerApi {
|
||||
}
|
||||
|
||||
public static const event_getPetById: String = "getPetById";
|
||||
public static const event_deletePet: String = "deletePet";
|
||||
public static const event_partialUpdate: String = "partialUpdate";
|
||||
public static const event_updatePetWithForm: String = "updatePetWithForm";
|
||||
public static const event_uploadFile: String = "uploadFile";
|
||||
public static const event_addPet: String = "addPet";
|
||||
public static const event_updatePet: String = "updatePet";
|
||||
public static const event_findPetsByStatus: String = "findPetsByStatus";
|
||||
public static const event_findPetsByTags: String = "findPetsByTags";
|
||||
/*
|
||||
* Returns Pet */
|
||||
public function getPetById (petId: String): String {
|
||||
public function getPetById (petId: Number): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet.{format}/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId));
|
||||
var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -51,12 +56,108 @@ public static const event_findPetsByTags: String = "findPetsByTags";
|
||||
token.returnType = Pet;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function deletePet (petId: String): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(petId == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "DELETE", queryParams, null, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "deletePet";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns Array[Pet] */
|
||||
public function partialUpdate (petId: String, body: Pet): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(petId == null || body == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "PATCH", queryParams, body, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "partialUpdate";
|
||||
|
||||
token.returnType = Array[Pet];
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function updatePetWithForm (petId: String, name: String, status: String): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet/{petId}".replace(/{format}/g,"xml").replace("{" + "petId" + "}", getApiInvoker().escapeString(petId));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(petId == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, null, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "updatePetWithForm";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function uploadFile (additionalMetadata: String, body: File): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet/uploadImage".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "uploadFile";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function addPet (body: Pet): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet.{format}".replace(/{format}/g,"xml");
|
||||
var path: String = "/pet".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -81,7 +182,7 @@ public static const event_findPetsByTags: String = "findPetsByTags";
|
||||
* Returns void */
|
||||
public function updatePet (body: Pet): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet.{format}".replace(/{format}/g,"xml");
|
||||
var path: String = "/pet".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -103,10 +204,10 @@ public static const event_findPetsByTags: String = "findPetsByTags";
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns com.wordnik.client.model.PetList */
|
||||
* Returns Array[Pet] */
|
||||
public function findPetsByStatus (status: String= "available"): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet.{format}/findByStatus".replace(/{format}/g,"xml");
|
||||
var path: String = "/pet/findByStatus".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -125,15 +226,15 @@ public static const event_findPetsByTags: String = "findPetsByTags";
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "findPetsByStatus";
|
||||
|
||||
token.returnType = com.wordnik.client.model.PetList;
|
||||
token.returnType = Array[Pet];
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns com.wordnik.client.model.PetList */
|
||||
* Returns Array[Pet] */
|
||||
public function findPetsByTags (tags: String): String {
|
||||
// create path and map variables
|
||||
var path: String = "/pet.{format}/findByTags".replace(/{format}/g,"xml");
|
||||
var path: String = "/pet/findByTags".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -152,7 +253,7 @@ public static const event_findPetsByTags: String = "findPetsByTags";
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "findPetsByTags";
|
||||
|
||||
token.returnType = com.wordnik.client.model.PetList;
|
||||
token.returnType = Array[Pet];
|
||||
return requestId;
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public static const event_placeOrder: String = "placeOrder";
|
||||
* Returns Order */
|
||||
public function getOrderById (orderId: String): String {
|
||||
// create path and map variables
|
||||
var path: String = "/store.{format}/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId));
|
||||
var path: String = "/store/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -54,7 +54,7 @@ public static const event_placeOrder: String = "placeOrder";
|
||||
* Returns void */
|
||||
public function deleteOrder (orderId: String): String {
|
||||
// create path and map variables
|
||||
var path: String = "/store.{format}/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId));
|
||||
var path: String = "/store/order/{orderId}".replace(/{format}/g,"xml").replace("{" + "orderId" + "}", getApiInvoker().escapeString(orderId));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -79,7 +79,7 @@ public static const event_placeOrder: String = "placeOrder";
|
||||
* Returns void */
|
||||
public function placeOrder (body: Order): String {
|
||||
// create path and map variables
|
||||
var path: String = "/store.{format}/order".replace(/{format}/g,"xml");
|
||||
var path: String = "/store/order".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
|
||||
@@ -22,94 +22,19 @@ public class UserApi extends SwaggerApi {
|
||||
super(apiCredentials, eventDispatcher);
|
||||
}
|
||||
|
||||
public static const event_createUsersWithArrayInput: String = "createUsersWithArrayInput";
|
||||
public static const event_createUser: String = "createUser";
|
||||
public static const event_createUsersWithListInput: String = "createUsersWithListInput";
|
||||
public static const event_updateUser: String = "updateUser";
|
||||
public static const event_deleteUser: String = "deleteUser";
|
||||
public static const event_getUserByName: String = "getUserByName";
|
||||
public static const event_loginUser: String = "loginUser";
|
||||
public static const event_logoutUser: String = "logoutUser";
|
||||
public static const event_createUser: String = "createUser";
|
||||
public static const event_createUsersWithArrayInput: String = "createUsersWithArrayInput";
|
||||
public static const event_createUsersWithListInput: String = "createUsersWithListInput";
|
||||
/*
|
||||
* Returns void */
|
||||
public function createUsersWithArrayInput (body: Array): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user.{format}/createWithArray".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "createUsersWithArrayInput";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function createUser (body: User): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user.{format}".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "createUser";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function createUsersWithListInput (body: Array): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user.{format}/createWithList".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "createUsersWithListInput";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function updateUser (username: String, body: User): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user.{format}/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username));
|
||||
var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -134,7 +59,7 @@ public static const event_logoutUser: String = "logoutUser";
|
||||
* Returns void */
|
||||
public function deleteUser (username: String): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user.{format}/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username));
|
||||
var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -159,7 +84,7 @@ public static const event_logoutUser: String = "logoutUser";
|
||||
* Returns User */
|
||||
public function getUserByName (username: String): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user.{format}/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username));
|
||||
var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username));
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -184,7 +109,7 @@ public static const event_logoutUser: String = "logoutUser";
|
||||
* Returns string */
|
||||
public function loginUser (username: String, password: String): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user.{format}/login".replace(/{format}/g,"xml");
|
||||
var path: String = "/user/login".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -213,7 +138,7 @@ public static const event_logoutUser: String = "logoutUser";
|
||||
* Returns void */
|
||||
public function logoutUser (): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user.{format}/logout".replace(/{format}/g,"xml");
|
||||
var path: String = "/user/logout".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
@@ -229,6 +154,81 @@ public static const event_logoutUser: String = "logoutUser";
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function createUser (body: User): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "createUser";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function createUsersWithArrayInput (body: Array): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user/createWithArray".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "createUsersWithArrayInput";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
/*
|
||||
* Returns void */
|
||||
public function createUsersWithListInput (body: Array): String {
|
||||
// create path and map variables
|
||||
var path: String = "/user/createWithList".replace(/{format}/g,"xml");
|
||||
|
||||
// query params
|
||||
var queryParams: Dictionary = new Dictionary();
|
||||
var headerParams: Dictionary = new Dictionary();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiError(400, "missing required params");
|
||||
}
|
||||
var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams);
|
||||
|
||||
var requestId: String = getUniqueId();
|
||||
|
||||
token.requestId = requestId;
|
||||
token.completionEventType = "createUsersWithListInput";
|
||||
|
||||
token.returnType = null ;
|
||||
return requestId;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ package com.wordnik.client.model {
|
||||
[XmlElement(name="petId")]
|
||||
public var petId: Number = 0.0;
|
||||
|
||||
[XmlElement(name="quantity")]
|
||||
public var quantity: Number = 0.0;
|
||||
|
||||
/* Order Status */
|
||||
[XmlElement(name="status")]
|
||||
public var status: String = null;
|
||||
|
||||
[XmlElement(name="quantity")]
|
||||
public var quantity: Number = 0.0;
|
||||
|
||||
[XmlElement(name="shipDate")]
|
||||
public var shipDate: Date = null;
|
||||
|
||||
@@ -22,8 +22,8 @@ package com.wordnik.client.model {
|
||||
var str: String = "Order: ";
|
||||
str += " (id: " + id + ")";
|
||||
str += " (petId: " + petId + ")";
|
||||
str += " (status: " + status + ")";
|
||||
str += " (quantity: " + quantity + ")";
|
||||
str += " (status: " + status + ")";
|
||||
str += " (shipDate: " + shipDate + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -4,22 +4,13 @@ import com.wordnik.client.model.Category;
|
||||
import com.wordnik.client.model.Tag;
|
||||
[XmlRootNode(name="Pet")]
|
||||
public class Pet {
|
||||
// This declaration below of _tags_obj_class is to force flash compiler to include this class
|
||||
private var _tags_obj_class: com.wordnik.client.model.Tag = null;
|
||||
[XmlElementWrapper(name="tags")]
|
||||
[XmlElements(name="tag", type="com.wordnik.client.model.Tag")]
|
||||
public var tags: Array = new Array();
|
||||
|
||||
/* unique identifier for the pet */
|
||||
[XmlElement(name="id")]
|
||||
public var id: Number = 0.0;
|
||||
|
||||
[XmlElement(name="category")]
|
||||
public var category: Category = null;
|
||||
|
||||
/* pet status in the store */
|
||||
[XmlElement(name="status")]
|
||||
public var status: String = null;
|
||||
|
||||
[XmlElement(name="name")]
|
||||
public var name: String = null;
|
||||
|
||||
@@ -29,14 +20,24 @@ import com.wordnik.client.model.Tag;
|
||||
[XmlElements(name="photoUrl", type="com.wordnik.client.model.String")]
|
||||
public var photoUrls: Array = new Array();
|
||||
|
||||
// This declaration below of _tags_obj_class is to force flash compiler to include this class
|
||||
private var _tags_obj_class: com.wordnik.client.model.Tag = null;
|
||||
[XmlElementWrapper(name="tags")]
|
||||
[XmlElements(name="tag", type="com.wordnik.client.model.Tag")]
|
||||
public var tags: Array = new Array();
|
||||
|
||||
/* pet status in the store */
|
||||
[XmlElement(name="status")]
|
||||
public var status: String = null;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "Pet: ";
|
||||
str += " (tags: " + tags + ")";
|
||||
str += " (id: " + id + ")";
|
||||
str += " (category: " + category + ")";
|
||||
str += " (status: " + status + ")";
|
||||
str += " (name: " + name + ")";
|
||||
str += " (photoUrls: " + photoUrls + ")";
|
||||
str += " (tags: " + tags + ")";
|
||||
str += " (status: " + status + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,38 +5,38 @@ package com.wordnik.client.model {
|
||||
[XmlElement(name="id")]
|
||||
public var id: Number = 0.0;
|
||||
|
||||
[XmlElement(name="lastName")]
|
||||
public var lastName: String = null;
|
||||
|
||||
[XmlElement(name="phone")]
|
||||
public var phone: String = null;
|
||||
[XmlElement(name="firstName")]
|
||||
public var firstName: String = null;
|
||||
|
||||
[XmlElement(name="username")]
|
||||
public var username: String = null;
|
||||
|
||||
[XmlElement(name="lastName")]
|
||||
public var lastName: String = null;
|
||||
|
||||
[XmlElement(name="email")]
|
||||
public var email: String = null;
|
||||
|
||||
[XmlElement(name="password")]
|
||||
public var password: String = null;
|
||||
|
||||
[XmlElement(name="phone")]
|
||||
public var phone: String = null;
|
||||
|
||||
/* User Status */
|
||||
[XmlElement(name="userStatus")]
|
||||
public var userStatus: Number = 0.0;
|
||||
|
||||
[XmlElement(name="firstName")]
|
||||
public var firstName: String = null;
|
||||
|
||||
[XmlElement(name="password")]
|
||||
public var password: String = null;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "User: ";
|
||||
str += " (id: " + id + ")";
|
||||
str += " (lastName: " + lastName + ")";
|
||||
str += " (phone: " + phone + ")";
|
||||
str += " (username: " + username + ")";
|
||||
str += " (email: " + email + ")";
|
||||
str += " (userStatus: " + userStatus + ")";
|
||||
str += " (firstName: " + firstName + ")";
|
||||
str += " (username: " + username + ")";
|
||||
str += " (lastName: " + lastName + ")";
|
||||
str += " (email: " + email + ")";
|
||||
str += " (password: " + password + ")";
|
||||
str += " (phone: " + phone + ")";
|
||||
str += " (userStatus: " + userStatus + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ public class ApiInvoker extends EventDispatcher
|
||||
var qualifiedClassName:String=objDescriptor.@name;
|
||||
qualifiedClassName=qualifiedClassName.replace("::",".");
|
||||
var className: String = qualifiedClassName.substring(qualifiedClassName.lastIndexOf(".") + 1);
|
||||
className = className.charAt().toLowerCase() + className.substring(1);
|
||||
className = className().toLowerCase() + className.substring(1);
|
||||
writer.xml.setName(className);
|
||||
|
||||
for each(property in objDescriptor.elements("variable")){
|
||||
|
||||
@@ -31,7 +31,7 @@ internal class ApiUrlHelper {
|
||||
}
|
||||
|
||||
internal static function getProxyUrl(hostName: String, proxyPath: String): String{
|
||||
if (hostName.charAt(hostName.length - 1) == "/") //remove trailing slash
|
||||
if (hostName(hostName.length - 1) == "/") //remove trailing slash
|
||||
{
|
||||
hostName = hostName.substring(0, hostName.length - 1);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2012 Wordnik, Inc.
|
||||
* Copyright 2014 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,7 +20,7 @@ object JavaPetstoreCodegen extends BasicJavaGenerator {
|
||||
def main(args: Array[String]) = generateClient(args)
|
||||
|
||||
// location of templates
|
||||
override def templateDir = "Java"
|
||||
override def templateDir = "src/main/resources/Java"
|
||||
|
||||
// where to write generated code
|
||||
override def destinationDir = "samples/client/petstore/java/src/main/java"
|
||||
@@ -34,10 +34,16 @@ object JavaPetstoreCodegen extends BasicJavaGenerator {
|
||||
// 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.replaceAll("\\.", java.io.File.separator) + java.io.File.separator, "ApiInvoker.java"),
|
||||
("apiException.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replaceAll("\\.", java.io.File.separator) + java.io.File.separator, "ApiException.java"),
|
||||
("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/java", "pom.xml"))
|
||||
}
|
||||
|
||||
@@ -1,225 +1,170 @@
|
||||
<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-client</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>swagger-client</name>
|
||||
<version>1.0</version>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:wordnik/swagger-mustache.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:wordnik/swagger-mustache.git</developerConnection>
|
||||
<url>https://github.com/wordnik/swagger-mustache</url>
|
||||
</scm>
|
||||
<prerequisites>
|
||||
<maven>2.2.0</maven>
|
||||
</prerequisites>
|
||||
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>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>scala-tools.org</id>
|
||||
<name>Scala-Tools Maven2 Repository</name>
|
||||
<url>http://scala-tools.org/repo-releases</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>maven-mongodb-plugin-repo</id>
|
||||
<name>maven mongodb plugin repository</name>
|
||||
<url>http://maven-mongodb-plugin.googlecode.com/svn/maven/repo</url>
|
||||
<layout>default</layout>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<!-- 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>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>
|
||||
<configuration>
|
||||
<jvmArgs>
|
||||
<jvmArg>-Xms128m</jvmArg>
|
||||
<jvmArg>-Xmx1500m</jvmArg>
|
||||
</jvmArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.scala-tools</groupId>
|
||||
<artifactId>maven-scala-plugin</artifactId>
|
||||
<configuration>
|
||||
<scalaVersion>${scala-version}</scalaVersion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
<dependencies>
|
||||
<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>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-client</artifactId>
|
||||
<version>${jersey-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>com.wordnik</groupId>
|
||||
<artifactId>swagger-core_2.9.1</artifactId>
|
||||
<version>${swagger-core-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>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>scala-tools.org</id>
|
||||
<name>Scala-Tools Maven2 Repository</name>
|
||||
<url>http://scala-tools.org/repo-releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>wordnik-ci-aws</id>
|
||||
<url>https://ci.aws.wordnik.com/artifactory/libs-snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>wordnik-ci-aws-maven</id>
|
||||
<url>https://ci.aws.wordnik.com/artifactory/m2-snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>wordnik-ci-aws-remote</id>
|
||||
<url>https://ci.aws.wordnik.com/artifactory/remote-repos/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey.contribs</groupId>
|
||||
<artifactId>jersey-multipart</artifactId>
|
||||
<version>${jersey-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<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>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-joda</artifactId>
|
||||
<version>2.1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>${jodatime-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<properties>
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<jersey-version>1.7</jersey-version>
|
||||
<swagger-core-version>1.1.0</swagger-core-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>
|
||||
<scala-test-version>1.6.1</scala-test-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<scala-test-version>1.6.1</scala-test-version>
|
||||
</properties>
|
||||
<jackson-version>2.1.4</jackson-version>
|
||||
<jodatime-version>2.3</jodatime-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.wordnik.client;
|
||||
|
||||
import com.wordnik.swagger.core.util.JsonUtil;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator.Feature;
|
||||
import com.fasterxml.jackson.databind.*;
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
@@ -13,29 +11,43 @@ import com.sun.jersey.api.client.config.ClientConfig;
|
||||
import com.sun.jersey.api.client.config.DefaultClientConfig;
|
||||
import com.sun.jersey.api.client.filter.LoggingFilter;
|
||||
import com.sun.jersey.api.client.WebResource.Builder;
|
||||
import com.sun.jersey.multipart.FormDataMultiPart;
|
||||
|
||||
import javax.ws.rs.core.Response.Status.Family;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
public class ApiInvoker {
|
||||
private static ApiInvoker INSTANCE = new ApiInvoker();
|
||||
private Map<String, Client> hostMap = new HashMap<String, Client>();
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
private boolean isDebug = false;
|
||||
|
||||
public void enableDebug() {
|
||||
isDebug = true;
|
||||
}
|
||||
|
||||
public static ApiInvoker getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
|
||||
public void addDefaultHeader(String key, String value) {
|
||||
defaultHeaderMap.put(key, value);
|
||||
}
|
||||
|
||||
public String escapeString(String str) {
|
||||
return str;
|
||||
try{
|
||||
return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
|
||||
}
|
||||
catch(UnsupportedEncodingException e) {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
public static Object deserialize(String json, String containerType, Class cls) throws ApiException {
|
||||
@@ -46,10 +58,9 @@ public class ApiInvoker {
|
||||
return response;
|
||||
}
|
||||
else if(String.class.equals(cls)) {
|
||||
if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) {
|
||||
if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1)
|
||||
return json.substring(1, json.length() - 2);
|
||||
}
|
||||
else
|
||||
else
|
||||
return json;
|
||||
}
|
||||
else {
|
||||
@@ -63,34 +74,38 @@ public class ApiInvoker {
|
||||
|
||||
public static String serialize(Object obj) throws ApiException {
|
||||
try {
|
||||
if (obj != null) return JsonUtil.getJsonMapper().writeValueAsString(obj);
|
||||
else return null;
|
||||
if (obj != null)
|
||||
return JsonUtil.getJsonMapper().writeValueAsString(obj);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new ApiException(500, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String invokeAPI(String host, String path, String method, Map<String, String> queryParams, Object body, Map<String, String> headerParams) throws ApiException {
|
||||
public String invokeAPI(String host, String path, String method, Map<String, String> queryParams, Object body, Map<String, String> headerParams, Map<String, String> formParams, String contentType) throws ApiException {
|
||||
Client client = getClient(host);
|
||||
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
||||
|
||||
for(String key : queryParams.keySet()) {
|
||||
String value = queryParams.get(key);
|
||||
if (value != null){
|
||||
if(b.toString().length() == 0) b.append("?");
|
||||
else b.append("&");
|
||||
if(b.toString().length() == 0)
|
||||
b.append("?");
|
||||
else
|
||||
b.append("&");
|
||||
b.append(escapeString(key)).append("=").append(escapeString(value));
|
||||
}
|
||||
}
|
||||
String querystring = b.toString();
|
||||
|
||||
Builder builder = client.resource(host + path + querystring).type("application/json");
|
||||
Builder builder = client.resource(host + path + querystring).accept("application/json");
|
||||
for(String key : headerParams.keySet()) {
|
||||
builder.header(key, headerParams.get(key));
|
||||
}
|
||||
|
||||
|
||||
for(String key : defaultHeaderMap.keySet()) {
|
||||
if(!headerParams.containsKey(key)) {
|
||||
builder.header(key, defaultHeaderMap.get(key));
|
||||
@@ -102,34 +117,72 @@ public class ApiInvoker {
|
||||
response = (ClientResponse) builder.get(ClientResponse.class);
|
||||
}
|
||||
else if ("POST".equals(method)) {
|
||||
response = builder.post(ClientResponse.class, serialize(body));
|
||||
if(body == null)
|
||||
response = builder.post(ClientResponse.class, null);
|
||||
else if(body instanceof FormDataMultiPart) {
|
||||
response = builder.type(contentType).post(ClientResponse.class, body);
|
||||
}
|
||||
else
|
||||
response = builder.type(contentType).post(ClientResponse.class, serialize(body));
|
||||
}
|
||||
else if ("PUT".equals(method)) {
|
||||
response = builder.put(ClientResponse.class, serialize(body));
|
||||
if(body == null)
|
||||
response = builder.put(ClientResponse.class, serialize(body));
|
||||
else {
|
||||
if("application/x-www-form-urlencoded".equals(contentType)) {
|
||||
StringBuilder formParamBuilder = new StringBuilder();
|
||||
|
||||
// encode the form params
|
||||
for(String key : formParams.keySet()) {
|
||||
String value = formParams.get(key);
|
||||
if(value != null && !"".equals(value.trim())) {
|
||||
if(formParamBuilder.length() > 0) {
|
||||
formParamBuilder.append("&");
|
||||
}
|
||||
try {
|
||||
formParamBuilder.append(URLEncoder.encode(key, "utf8")).append("=").append(URLEncoder.encode(value, "utf8"));
|
||||
}
|
||||
catch (Exception e) {
|
||||
// move on to next
|
||||
}
|
||||
}
|
||||
}
|
||||
response = builder.type(contentType).put(ClientResponse.class, formParamBuilder.toString());
|
||||
}
|
||||
else
|
||||
response = builder.type(contentType).put(ClientResponse.class, serialize(body));
|
||||
}
|
||||
}
|
||||
else if ("DELETE".equals(method)) {
|
||||
if(body == null)
|
||||
response = builder.delete(ClientResponse.class, serialize(body));
|
||||
else
|
||||
response = builder.type(contentType).delete(ClientResponse.class, serialize(body));
|
||||
}
|
||||
else {
|
||||
throw new ApiException(500, "unknown method type " + method);
|
||||
}
|
||||
if(response.getClientResponseStatus() == ClientResponse.Status.OK) {
|
||||
if(response.getClientResponseStatus() == ClientResponse.Status.NO_CONTENT) {
|
||||
return null;
|
||||
}
|
||||
else if(response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
|
||||
return (String) response.getEntity(String.class);
|
||||
}
|
||||
else {
|
||||
throw new ApiException(
|
||||
response.getClientResponseStatus().getStatusCode(),
|
||||
response.getEntity(String.class));
|
||||
response.getEntity(String.class));
|
||||
}
|
||||
}
|
||||
|
||||
private Client getClient(String host) {
|
||||
if(!hostMap.containsKey(host)) {
|
||||
Client client = Client.create();
|
||||
client.addFilter(new LoggingFilter());
|
||||
hostMap.put(host, client);
|
||||
}
|
||||
return hostMap.get(host);
|
||||
if(!hostMap.containsKey(host)) {
|
||||
Client client = Client.create();
|
||||
if(isDebug)
|
||||
client.addFilter(new LoggingFilter());
|
||||
hostMap.put(host, client);
|
||||
}
|
||||
return hostMap.get(host);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.wordnik.client;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import com.fasterxml.jackson.databind.*;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.core.JsonGenerator.Feature;
|
||||
|
||||
import com.fasterxml.jackson.datatype.joda.*;
|
||||
|
||||
public class JsonUtil {
|
||||
public static ObjectMapper mapper;
|
||||
|
||||
static {
|
||||
mapper = new ObjectMapper();
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
mapper.registerModule(new JodaModule());
|
||||
}
|
||||
|
||||
public static ObjectMapper getJsonMapper() {
|
||||
return mapper;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,13 @@ package com.wordnik.petstore.api;
|
||||
|
||||
import com.wordnik.client.ApiException;
|
||||
import com.wordnik.client.ApiInvoker;
|
||||
|
||||
import com.wordnik.petstore.model.Pet;
|
||||
import com.sun.jersey.multipart.FormDataMultiPart;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
public class PetApi {
|
||||
@@ -21,20 +27,38 @@ public class PetApi {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
public Pet getPetById (String petId) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/pet.{format}/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
|
||||
//error info- code: 404 reason: "Pet not found" model: <none>
|
||||
public Pet getPetById (Long petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (Pet) ApiInvoker.deserialize(response, "", Pet.class);
|
||||
}
|
||||
@@ -50,20 +74,179 @@ public class PetApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 405 reason: "Invalid input" model: <none>
|
||||
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/x-www-form-urlencoded"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
hasFields = true;
|
||||
mp.field("name", name, MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||
hasFields = true;
|
||||
mp.field("status", status, MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
formParams.put("name", name);formParams.put("status", status);}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid pet value" model: <none>
|
||||
public void deletePet (String petId) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(petId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid tag value" model: <none>
|
||||
public List<Pet> partialUpdate (String petId, Pet body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(petId == null || body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json","application/xml"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PATCH", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 405 reason: "Invalid input" model: <none>
|
||||
public void addPet (Pet body) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/pet.{format}".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json","application/xml"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
@@ -79,20 +262,39 @@ public class PetApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
|
||||
//error info- code: 404 reason: "Pet not found" model: <none>
|
||||
//error info- code: 405 reason: "Validation exception" model: <none>
|
||||
public void updatePet (Pet body) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/pet.{format}".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, body, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
@@ -108,53 +310,39 @@ public class PetApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid status value" model: <none>
|
||||
public List<Pet> findPetsByStatus (String status) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/pet.{format}/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(status == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
if(!"null".equals(String.valueOf(status)))
|
||||
queryParams.put("status", String.valueOf(status));
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public List<Pet> findPetsByTags (String tags) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/pet.{format}/findByTags".replaceAll("\\{format\\}","json");
|
||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if(tags == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
if(!"null".equals(String.valueOf(status)))
|
||||
queryParams.put("status", String.valueOf(status));
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
if(!"null".equals(String.valueOf(tags)))
|
||||
queryParams.put("tags", String.valueOf(tags));
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
|
||||
}
|
||||
@@ -170,5 +358,98 @@ public class PetApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid tag value" model: <none>
|
||||
public List<Pet> findPetsByTags (String tags) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(tags == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
if(!"null".equals(String.valueOf(tags)))
|
||||
queryParams.put("tags", String.valueOf(tags));
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void uploadFile (String additionalMetadata, File file) throws ApiException {
|
||||
Object postBody = null;
|
||||
// create path and map variables
|
||||
String path = "/pet/uploadImage".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"multipart/form-data"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
hasFields = true;
|
||||
mp.field("additionalMetadata", additionalMetadata, MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||
hasFields = true;
|
||||
mp.field("file", file, MediaType.MULTIPART_FORM_DATA_TYPE);
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
formParams.put("additionalMetadata", additionalMetadata);}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@ package com.wordnik.petstore.api;
|
||||
|
||||
import com.wordnik.client.ApiException;
|
||||
import com.wordnik.client.ApiInvoker;
|
||||
|
||||
import com.wordnik.petstore.model.Order;
|
||||
import com.sun.jersey.multipart.FormDataMultiPart;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
public class StoreApi {
|
||||
@@ -21,20 +27,131 @@ public class StoreApi {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
public Order getOrderById (String orderId) throws ApiException {
|
||||
//error info- code: 400 reason: "Invalid order" model: <none>
|
||||
public void placeOrder (Order body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/store.{format}/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId));
|
||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
|
||||
//error info- code: 404 reason: "Order not found" model: <none>
|
||||
public void deleteOrder (String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(orderId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
|
||||
//error info- code: 404 reason: "Order not found" model: <none>
|
||||
public Order getOrderById (String orderId) throws ApiException {
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(orderId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (Order) ApiInvoker.deserialize(response, "", Order.class);
|
||||
}
|
||||
@@ -50,63 +167,5 @@ public class StoreApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
public void deleteOrder (String orderId) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/store.{format}/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if(orderId == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void placeOrder (Order body) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/store.{format}/order".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@ package com.wordnik.petstore.api;
|
||||
|
||||
import com.wordnik.client.ApiException;
|
||||
import com.wordnik.client.ApiInvoker;
|
||||
|
||||
import com.wordnik.petstore.model.User;
|
||||
import com.sun.jersey.multipart.FormDataMultiPart;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
public class UserApi {
|
||||
@@ -21,107 +27,38 @@ public class UserApi {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
public void createUsersWithArrayInput (List<User> body) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/user.{format}/createWithArray".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void createUser (User body) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/user.{format}".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void createUsersWithListInput (List<User> body) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/user.{format}/createWithList".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid username supplied" model: <none>
|
||||
//error info- code: 404 reason: "User not found" model: <none>
|
||||
public void updateUser (String username, User body) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/user.{format}/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(username == null || body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, body, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
@@ -137,20 +74,38 @@ public class UserApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid username supplied" model: <none>
|
||||
//error info- code: 404 reason: "User not found" model: <none>
|
||||
public void deleteUser (String username) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/user.{format}/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(username == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
@@ -166,20 +121,38 @@ public class UserApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid username supplied" model: <none>
|
||||
//error info- code: 404 reason: "User not found" model: <none>
|
||||
public User getUserByName (String username) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/user.{format}/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(username == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (User) ApiInvoker.deserialize(response, "", User.class);
|
||||
}
|
||||
@@ -195,24 +168,41 @@ public class UserApi {
|
||||
}
|
||||
}
|
||||
}
|
||||
//error info- code: 400 reason: "Invalid username and password combination" model: <none>
|
||||
public String loginUser (String username, String password) throws ApiException {
|
||||
// create path and map variables
|
||||
String path = "/user.{format}/login".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
|
||||
Object postBody = null;
|
||||
// verify required params are set
|
||||
if(username == null || password == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
if(!"null".equals(String.valueOf(username)))
|
||||
queryParams.put("username", String.valueOf(username));
|
||||
if(!"null".equals(String.valueOf(password)))
|
||||
queryParams.put("password", String.valueOf(password));
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return (String) ApiInvoker.deserialize(response, "", String.class);
|
||||
}
|
||||
@@ -229,15 +219,166 @@ public class UserApi {
|
||||
}
|
||||
}
|
||||
public void logoutUser () throws ApiException {
|
||||
Object postBody = null;
|
||||
// create path and map variables
|
||||
String path = "/user.{format}/logout".replaceAll("\\{format\\}","json");
|
||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams);
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void createUsersWithArrayInput (List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void createUsersWithListInput (List<User> body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
} catch (ApiException ex) {
|
||||
if(ex.getCode() == 404) {
|
||||
return ;
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void createUser (User body) throws ApiException {
|
||||
Object postBody = body;
|
||||
// verify required params are set
|
||||
if(body == null ) {
|
||||
throw new ApiException(400, "missing required params");
|
||||
}
|
||||
// create path and map variables
|
||||
String path = "/user".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
String[] contentTypes = {
|
||||
"application/json"};
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
boolean hasFields = false;
|
||||
FormDataMultiPart mp = new FormDataMultiPart();
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
try {
|
||||
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType);
|
||||
if(response != null){
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,10 @@ import java.util.Date;
|
||||
public class Order {
|
||||
private Long id = null;
|
||||
private Long petId = null;
|
||||
private Integer quantity = null;
|
||||
/* Order Status */
|
||||
private String status = null;
|
||||
private Integer quantity = null;
|
||||
//public enum statusEnum { placed, approved, delivered, };
|
||||
private Date shipDate = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -22,13 +23,6 @@ public class Order {
|
||||
this.petId = petId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@@ -36,6 +30,13 @@ public class Order {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@@ -49,8 +50,8 @@ public class Order {
|
||||
sb.append("class Order {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" petId: ").append(petId).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append(" quantity: ").append(quantity).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append(" shipDate: ").append(shipDate).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
|
||||
@@ -4,20 +4,15 @@ import java.util.*;
|
||||
import com.wordnik.petstore.model.Category;
|
||||
import com.wordnik.petstore.model.Tag;
|
||||
public class Pet {
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
/* unique identifier for the pet */
|
||||
private Long id = null;
|
||||
private Category category = null;
|
||||
/* pet status in the store */
|
||||
private String status = null;
|
||||
private String name = null;
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
/* pet status in the store */
|
||||
private String status = null;
|
||||
//public enum statusEnum { available, pending, sold, };
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -32,13 +27,6 @@ public class Pet {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -53,16 +41,30 @@ public class Pet {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Pet {\n");
|
||||
sb.append(" tags: ").append(tags).append("\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" category: ").append(category).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append(" name: ").append(name).append("\n");
|
||||
sb.append(" photoUrls: ").append(photoUrls).append("\n");
|
||||
sb.append(" tags: ").append(tags).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -2,14 +2,15 @@ package com.wordnik.petstore.model;
|
||||
|
||||
public class User {
|
||||
private Long id = null;
|
||||
private String lastName = null;
|
||||
private String phone = null;
|
||||
private String firstName = null;
|
||||
private String username = null;
|
||||
private String lastName = null;
|
||||
private String email = null;
|
||||
private String password = null;
|
||||
private String phone = null;
|
||||
/* User Status */
|
||||
private Integer userStatus = null;
|
||||
private String firstName = null;
|
||||
private String password = null;
|
||||
//public enum userStatusEnum { 1-registered, 2-active, 3-closed, };
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -17,41 +18,6 @@ public class User {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
public void setUserStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@@ -59,6 +25,27 @@ public class User {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@@ -66,18 +53,32 @@ public class User {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
public void setUserStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class User {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" lastName: ").append(lastName).append("\n");
|
||||
sb.append(" phone: ").append(phone).append("\n");
|
||||
sb.append(" username: ").append(username).append("\n");
|
||||
sb.append(" email: ").append(email).append("\n");
|
||||
sb.append(" userStatus: ").append(userStatus).append("\n");
|
||||
sb.append(" firstName: ").append(firstName).append("\n");
|
||||
sb.append(" username: ").append(username).append("\n");
|
||||
sb.append(" lastName: ").append(lastName).append("\n");
|
||||
sb.append(" email: ").append(email).append("\n");
|
||||
sb.append(" password: ").append(password).append("\n");
|
||||
sb.append(" phone: ").append(phone).append("\n");
|
||||
sb.append(" userStatus: ").append(userStatus).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2012 Wordnik, Inc.
|
||||
* Copyright 2014 Wordnik, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,18 +20,24 @@ object ObjcPetstoreCodegen extends BasicObjcGenerator {
|
||||
def main(args: Array[String]) = generateClient(args)
|
||||
|
||||
// where to write generated code
|
||||
override def destinationDir = "samples/client/petstore/objc/client"
|
||||
val outputFolder = "samples/client/petstore/objc/"
|
||||
override def destinationDir = outputFolder + java.io.File.separator + "client"
|
||||
|
||||
// to avoid recompiling ...
|
||||
override def templateDir = "src/main/resources/objc"
|
||||
override def templateDir = "objc"
|
||||
|
||||
additionalParams ++= Map("projectName" -> "PetstoreClient")
|
||||
|
||||
// supporting classes
|
||||
override def supportingFiles =
|
||||
List(
|
||||
("NIKSwaggerObject.h", destinationDir, "NIKSwaggerObject.h"),
|
||||
("NIKSwaggerObject.m", destinationDir, "NIKSwaggerObject.m"),
|
||||
("NIKApiInvoker.h", destinationDir, "NIKApiInvoker.h"),
|
||||
("NIKApiInvoker.m", destinationDir, "NIKApiInvoker.m"),
|
||||
("NIKDate.h", destinationDir, "NIKDate.h"),
|
||||
("NIKDate.m", destinationDir, "NIKDate.m"))
|
||||
("SWGObject.h", destinationDir, "SWGObject.h"),
|
||||
("SWGObject.m", destinationDir, "SWGObject.m"),
|
||||
("SWGApiClient.h", destinationDir, "SWGApiClient.h"),
|
||||
("SWGApiClient.m", destinationDir, "SWGApiClient.m"),
|
||||
("SWGFile.h", destinationDir, "SWGFile.h"),
|
||||
("SWGFile.m", destinationDir, "SWGFile.m"),
|
||||
("SWGDate.h", destinationDir, "SWGDate.h"),
|
||||
("SWGDate.m", destinationDir, "SWGDate.m"),
|
||||
("Podfile.mustache", outputFolder, "Podfile")
|
||||
)
|
||||
}
|
||||
|
||||
1
samples/client/petstore/objc/PetstoreClient.xcworkspace/contents.xcworkspacedata
generated
Normal file
1
samples/client/petstore/objc/PetstoreClient.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?><Workspace version='1.0'><FileRef location='group:PetstoreClient/PetstoreClient.xcodeproj'/><FileRef location='group:Pods/Pods.xcodeproj'/></Workspace>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>81EB09FA-DD8C-4FE1-82D3-1FB6FF0D9C43</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>PetstoreClient</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>92840518-904D-4771-AA3D-9AF52CA48B71</key>
|
||||
<string>ssh://github.com/wordnik/swagger-codegen.git</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>samples/client/petstore/objc/PetstoreClient.xcworkspace</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>92840518-904D-4771-AA3D-9AF52CA48B71</key>
|
||||
<string>../../../../..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>ssh://github.com/wordnik/swagger-codegen.git</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>110</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>92840518-904D-4771-AA3D-9AF52CA48B71</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>92840518-904D-4771-AA3D-9AF52CA48B71</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>swagger-codegen</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -7,236 +7,245 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
EA07F4BE16134F27006A2112 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA07F4BD16134F27006A2112 /* Foundation.framework */; };
|
||||
EA07F4C116134F27006A2112 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F4C016134F27006A2112 /* main.m */; };
|
||||
EA07F4C516134F27006A2112 /* PetstoreClient.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = EA07F4C416134F27006A2112 /* PetstoreClient.1 */; };
|
||||
EA07F5221613569A006A2112 /* NIKApiInvoker.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F50D1613569A006A2112 /* NIKApiInvoker.m */; };
|
||||
EA07F5231613569A006A2112 /* NIKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F50F1613569A006A2112 /* NIKCategory.m */; };
|
||||
EA07F5241613569A006A2112 /* NIKDate.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5111613569A006A2112 /* NIKDate.m */; };
|
||||
EA07F5251613569A006A2112 /* NIKOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5131613569A006A2112 /* NIKOrder.m */; };
|
||||
EA07F5261613569A006A2112 /* NIKPet.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5151613569A006A2112 /* NIKPet.m */; };
|
||||
EA07F5271613569A006A2112 /* NIKPetApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5171613569A006A2112 /* NIKPetApi.m */; };
|
||||
EA07F5281613569A006A2112 /* NIKStoreApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5191613569A006A2112 /* NIKStoreApi.m */; };
|
||||
EA07F5291613569A006A2112 /* NIKSwaggerObject.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51B1613569A006A2112 /* NIKSwaggerObject.m */; };
|
||||
EA07F52A1613569A006A2112 /* NIKTag.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51D1613569A006A2112 /* NIKTag.m */; };
|
||||
EA07F52B1613569A006A2112 /* NIKUser.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51F1613569A006A2112 /* NIKUser.m */; };
|
||||
EA07F52C1613569A006A2112 /* NIKUserApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5211613569A006A2112 /* NIKUserApi.m */; };
|
||||
EA07F5311613580E006A2112 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA07F5301613580E006A2112 /* SenTestingKit.framework */; };
|
||||
EA07F53316135819006A2112 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA07F53216135819006A2112 /* Cocoa.framework */; };
|
||||
EA07F53516135916006A2112 /* NIKApiInvoker.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F50C1613569A006A2112 /* NIKApiInvoker.h */; };
|
||||
EA07F53616135916006A2112 /* NIKApiInvoker.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F50D1613569A006A2112 /* NIKApiInvoker.m */; };
|
||||
EA07F53716135916006A2112 /* NIKCategory.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F50E1613569A006A2112 /* NIKCategory.h */; };
|
||||
EA07F53816135916006A2112 /* NIKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F50F1613569A006A2112 /* NIKCategory.m */; };
|
||||
EA07F53916135916006A2112 /* NIKDate.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5101613569A006A2112 /* NIKDate.h */; };
|
||||
EA07F53A16135916006A2112 /* NIKDate.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5111613569A006A2112 /* NIKDate.m */; };
|
||||
EA07F53B16135916006A2112 /* NIKOrder.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5121613569A006A2112 /* NIKOrder.h */; };
|
||||
EA07F53C16135916006A2112 /* NIKOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5131613569A006A2112 /* NIKOrder.m */; };
|
||||
EA07F53D16135916006A2112 /* NIKPet.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5141613569A006A2112 /* NIKPet.h */; };
|
||||
EA07F53E16135916006A2112 /* NIKPet.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5151613569A006A2112 /* NIKPet.m */; };
|
||||
EA07F53F16135916006A2112 /* NIKPetApi.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5161613569A006A2112 /* NIKPetApi.h */; };
|
||||
EA07F54016135916006A2112 /* NIKPetApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5171613569A006A2112 /* NIKPetApi.m */; };
|
||||
EA07F54116135916006A2112 /* NIKStoreApi.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5181613569A006A2112 /* NIKStoreApi.h */; };
|
||||
EA07F54216135916006A2112 /* NIKStoreApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5191613569A006A2112 /* NIKStoreApi.m */; };
|
||||
EA07F54316135916006A2112 /* NIKSwaggerObject.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51A1613569A006A2112 /* NIKSwaggerObject.h */; };
|
||||
EA07F54416135916006A2112 /* NIKSwaggerObject.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51B1613569A006A2112 /* NIKSwaggerObject.m */; };
|
||||
EA07F54516135916006A2112 /* NIKTag.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51C1613569A006A2112 /* NIKTag.h */; };
|
||||
EA07F54616135916006A2112 /* NIKTag.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51D1613569A006A2112 /* NIKTag.m */; };
|
||||
EA07F54716135916006A2112 /* NIKUser.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51E1613569A006A2112 /* NIKUser.h */; };
|
||||
EA07F54816135916006A2112 /* NIKUser.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F51F1613569A006A2112 /* NIKUser.m */; };
|
||||
EA07F54916135916006A2112 /* NIKUserApi.h in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5201613569A006A2112 /* NIKUserApi.h */; };
|
||||
EA07F54A16135916006A2112 /* NIKUserApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EA07F5211613569A006A2112 /* NIKUserApi.m */; };
|
||||
EA5A034416141443003B3E41 /* UserApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = EA5A034316141443003B3E41 /* UserApiTest.m */; };
|
||||
EAE96DE616138695004AB97C /* PetApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = EA81837816137FD500341A6E /* PetApiTest.m */; };
|
||||
EAE96DE716138695004AB97C /* PetApiTest.h in Sources */ = {isa = PBXBuildFile; fileRef = EA81837916137FD500341A6E /* PetApiTest.h */; };
|
||||
BA525648922D4C0E9F44D4F1 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73DA4F1067C343C3962F1542 /* libPods.a */; };
|
||||
EA66999A1811D2FA00A70D03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699991811D2FA00A70D03 /* Foundation.framework */; };
|
||||
EA66999C1811D2FA00A70D03 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */; };
|
||||
EA66999E1811D2FA00A70D03 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999D1811D2FA00A70D03 /* UIKit.framework */; };
|
||||
EA6699A41811D2FA00A70D03 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA6699A21811D2FA00A70D03 /* InfoPlist.strings */; };
|
||||
EA6699A61811D2FA00A70D03 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699A51811D2FA00A70D03 /* main.m */; };
|
||||
EA6699AA1811D2FA00A70D03 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699A91811D2FA00A70D03 /* AppDelegate.m */; };
|
||||
EA6699AD1811D2FA00A70D03 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */; };
|
||||
EA6699B01811D2FA00A70D03 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */; };
|
||||
EA6699B31811D2FA00A70D03 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699B21811D2FA00A70D03 /* ViewController.m */; };
|
||||
EA6699B51811D2FA00A70D03 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EA6699B41811D2FA00A70D03 /* Images.xcassets */; };
|
||||
EA6699BC1811D2FB00A70D03 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699BB1811D2FB00A70D03 /* XCTest.framework */; };
|
||||
EA6699BD1811D2FB00A70D03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA6699991811D2FA00A70D03 /* Foundation.framework */; };
|
||||
EA6699BE1811D2FB00A70D03 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA66999D1811D2FA00A70D03 /* UIKit.framework */; };
|
||||
EA6699C61811D2FB00A70D03 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA6699C41811D2FB00A70D03 /* InfoPlist.strings */; };
|
||||
EA6699C81811D2FB00A70D03 /* PetstoreClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EA6699C71811D2FB00A70D03 /* PetstoreClientTests.m */; };
|
||||
EAEA85E41811D3AE00F06E69 /* SWGApiClient.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */; };
|
||||
EAEA85E51811D3AE00F06E69 /* SWGCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */; };
|
||||
EAEA85E61811D3AE00F06E69 /* SWGDate.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D11811D3AE00F06E69 /* SWGDate.m */; };
|
||||
EAEA85E71811D3AE00F06E69 /* SWGFile.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D31811D3AE00F06E69 /* SWGFile.m */; };
|
||||
EAEA85E81811D3AE00F06E69 /* SWGObject.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D51811D3AE00F06E69 /* SWGObject.m */; };
|
||||
EAEA85E91811D3AE00F06E69 /* SWGOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D71811D3AE00F06E69 /* SWGOrder.m */; };
|
||||
EAEA85EA1811D3AE00F06E69 /* SWGPet.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85D91811D3AE00F06E69 /* SWGPet.m */; };
|
||||
EAEA85EB1811D3AE00F06E69 /* SWGPetApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */; };
|
||||
EAEA85EC1811D3AE00F06E69 /* SWGStoreApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */; };
|
||||
EAEA85ED1811D3AE00F06E69 /* SWGTag.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85DF1811D3AE00F06E69 /* SWGTag.m */; };
|
||||
EAEA85EE1811D3AE00F06E69 /* SWGUser.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85E11811D3AE00F06E69 /* SWGUser.m */; };
|
||||
EAEA85EF1811D3AE00F06E69 /* SWGUserApi.m in Sources */ = {isa = PBXBuildFile; fileRef = EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */; };
|
||||
EAEA85F11811D8F100F06E69 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EAEA85F01811D8F100F06E69 /* libPods.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
EA07F52E161357A5006A2112 /* PBXContainerItemProxy */ = {
|
||||
EA6699BF1811D2FB00A70D03 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = EA07F4B016134F27006A2112 /* Project object */;
|
||||
containerPortal = EA66998E1811D2FA00A70D03 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = EA07F4B816134F27006A2112;
|
||||
remoteGlobalIDString = EA6699951811D2FA00A70D03;
|
||||
remoteInfo = PetstoreClient;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
EA07F4B716134F27006A2112 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = /usr/share/man/man1/;
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
EA07F4C516134F27006A2112 /* PetstoreClient.1 in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
EA07F4B916134F27006A2112 /* PetstoreClient */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = PetstoreClient; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EA07F4BD16134F27006A2112 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
EA07F4C016134F27006A2112 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
EA07F4C316134F27006A2112 /* PetstoreClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-Prefix.pch"; sourceTree = "<group>"; };
|
||||
EA07F4C416134F27006A2112 /* PetstoreClient.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = PetstoreClient.1; sourceTree = "<group>"; };
|
||||
EA07F4F21613521A006A2112 /* PetstoreClientTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PetstoreClientTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EA07F50C1613569A006A2112 /* NIKApiInvoker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKApiInvoker.h; path = ../client/NIKApiInvoker.h; sourceTree = "<group>"; };
|
||||
EA07F50D1613569A006A2112 /* NIKApiInvoker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKApiInvoker.m; path = ../client/NIKApiInvoker.m; sourceTree = "<group>"; };
|
||||
EA07F50E1613569A006A2112 /* NIKCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKCategory.h; path = ../client/NIKCategory.h; sourceTree = "<group>"; };
|
||||
EA07F50F1613569A006A2112 /* NIKCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKCategory.m; path = ../client/NIKCategory.m; sourceTree = "<group>"; };
|
||||
EA07F5101613569A006A2112 /* NIKDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKDate.h; path = ../client/NIKDate.h; sourceTree = "<group>"; };
|
||||
EA07F5111613569A006A2112 /* NIKDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKDate.m; path = ../client/NIKDate.m; sourceTree = "<group>"; };
|
||||
EA07F5121613569A006A2112 /* NIKOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKOrder.h; path = ../client/NIKOrder.h; sourceTree = "<group>"; };
|
||||
EA07F5131613569A006A2112 /* NIKOrder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKOrder.m; path = ../client/NIKOrder.m; sourceTree = "<group>"; };
|
||||
EA07F5141613569A006A2112 /* NIKPet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKPet.h; path = ../client/NIKPet.h; sourceTree = "<group>"; };
|
||||
EA07F5151613569A006A2112 /* NIKPet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKPet.m; path = ../client/NIKPet.m; sourceTree = "<group>"; };
|
||||
EA07F5161613569A006A2112 /* NIKPetApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKPetApi.h; path = ../client/NIKPetApi.h; sourceTree = "<group>"; };
|
||||
EA07F5171613569A006A2112 /* NIKPetApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKPetApi.m; path = ../client/NIKPetApi.m; sourceTree = "<group>"; };
|
||||
EA07F5181613569A006A2112 /* NIKStoreApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKStoreApi.h; path = ../client/NIKStoreApi.h; sourceTree = "<group>"; };
|
||||
EA07F5191613569A006A2112 /* NIKStoreApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKStoreApi.m; path = ../client/NIKStoreApi.m; sourceTree = "<group>"; };
|
||||
EA07F51A1613569A006A2112 /* NIKSwaggerObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKSwaggerObject.h; path = ../client/NIKSwaggerObject.h; sourceTree = "<group>"; };
|
||||
EA07F51B1613569A006A2112 /* NIKSwaggerObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKSwaggerObject.m; path = ../client/NIKSwaggerObject.m; sourceTree = "<group>"; };
|
||||
EA07F51C1613569A006A2112 /* NIKTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKTag.h; path = ../client/NIKTag.h; sourceTree = "<group>"; };
|
||||
EA07F51D1613569A006A2112 /* NIKTag.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKTag.m; path = ../client/NIKTag.m; sourceTree = "<group>"; };
|
||||
EA07F51E1613569A006A2112 /* NIKUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKUser.h; path = ../client/NIKUser.h; sourceTree = "<group>"; };
|
||||
EA07F51F1613569A006A2112 /* NIKUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKUser.m; path = ../client/NIKUser.m; sourceTree = "<group>"; };
|
||||
EA07F5201613569A006A2112 /* NIKUserApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIKUserApi.h; path = ../client/NIKUserApi.h; sourceTree = "<group>"; };
|
||||
EA07F5211613569A006A2112 /* NIKUserApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIKUserApi.m; path = ../client/NIKUserApi.m; sourceTree = "<group>"; };
|
||||
EA07F5301613580E006A2112 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||
EA07F53216135819006A2112 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
EA5A034216141443003B3E41 /* UserApiTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserApiTest.h; path = ../tests/UserApiTest.h; sourceTree = "<group>"; };
|
||||
EA5A034316141443003B3E41 /* UserApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UserApiTest.m; path = ../tests/UserApiTest.m; sourceTree = "<group>"; };
|
||||
EA81837816137FD500341A6E /* PetApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PetApiTest.m; path = ../tests/PetApiTest.m; sourceTree = "<group>"; };
|
||||
EA81837916137FD500341A6E /* PetApiTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PetApiTest.h; path = ../tests/PetApiTest.h; sourceTree = "<group>"; };
|
||||
73DA4F1067C343C3962F1542 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EA5799F266AC4D21AD004BC4 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = ../Pods/Pods.xcconfig; sourceTree = "<group>"; };
|
||||
EA6699961811D2FA00A70D03 /* PetstoreClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PetstoreClient.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EA6699991811D2FA00A70D03 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
EA66999D1811D2FA00A70D03 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
EA6699A11811D2FA00A70D03 /* PetstoreClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PetstoreClient-Info.plist"; sourceTree = "<group>"; };
|
||||
EA6699A31811D2FA00A70D03 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
EA6699A51811D2FA00A70D03 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
EA6699A71811D2FA00A70D03 /* PetstoreClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-Prefix.pch"; sourceTree = "<group>"; };
|
||||
EA6699A81811D2FA00A70D03 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
EA6699A91811D2FA00A70D03 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
EA6699AC1811D2FA00A70D03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = "<group>"; };
|
||||
EA6699AF1811D2FA00A70D03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = "<group>"; };
|
||||
EA6699B11811D2FA00A70D03 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||
EA6699B21811D2FA00A70D03 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||
EA6699B41811D2FA00A70D03 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
EA6699BA1811D2FB00A70D03 /* PetstoreClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PetstoreClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EA6699BB1811D2FB00A70D03 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
||||
EA6699C31811D2FB00A70D03 /* PetstoreClientTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PetstoreClientTests-Info.plist"; sourceTree = "<group>"; };
|
||||
EA6699C51811D2FB00A70D03 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
EA6699C71811D2FB00A70D03 /* PetstoreClientTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PetstoreClientTests.m; sourceTree = "<group>"; };
|
||||
EAEA85CC1811D3AE00F06E69 /* SWGApiClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGApiClient.h; sourceTree = "<group>"; };
|
||||
EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClient.m; sourceTree = "<group>"; };
|
||||
EAEA85CE1811D3AE00F06E69 /* SWGCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGCategory.h; sourceTree = "<group>"; };
|
||||
EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGCategory.m; sourceTree = "<group>"; };
|
||||
EAEA85D01811D3AE00F06E69 /* SWGDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGDate.h; sourceTree = "<group>"; };
|
||||
EAEA85D11811D3AE00F06E69 /* SWGDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGDate.m; sourceTree = "<group>"; };
|
||||
EAEA85D21811D3AE00F06E69 /* SWGFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGFile.h; sourceTree = "<group>"; };
|
||||
EAEA85D31811D3AE00F06E69 /* SWGFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGFile.m; sourceTree = "<group>"; };
|
||||
EAEA85D41811D3AE00F06E69 /* SWGObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGObject.h; sourceTree = "<group>"; };
|
||||
EAEA85D51811D3AE00F06E69 /* SWGObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGObject.m; sourceTree = "<group>"; };
|
||||
EAEA85D61811D3AE00F06E69 /* SWGOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGOrder.h; sourceTree = "<group>"; };
|
||||
EAEA85D71811D3AE00F06E69 /* SWGOrder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGOrder.m; sourceTree = "<group>"; };
|
||||
EAEA85D81811D3AE00F06E69 /* SWGPet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGPet.h; sourceTree = "<group>"; };
|
||||
EAEA85D91811D3AE00F06E69 /* SWGPet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGPet.m; sourceTree = "<group>"; };
|
||||
EAEA85DA1811D3AE00F06E69 /* SWGPetApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGPetApi.h; sourceTree = "<group>"; };
|
||||
EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGPetApi.m; sourceTree = "<group>"; };
|
||||
EAEA85DC1811D3AE00F06E69 /* SWGStoreApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGStoreApi.h; sourceTree = "<group>"; };
|
||||
EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGStoreApi.m; sourceTree = "<group>"; };
|
||||
EAEA85DE1811D3AE00F06E69 /* SWGTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGTag.h; sourceTree = "<group>"; };
|
||||
EAEA85DF1811D3AE00F06E69 /* SWGTag.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGTag.m; sourceTree = "<group>"; };
|
||||
EAEA85E01811D3AE00F06E69 /* SWGUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGUser.h; sourceTree = "<group>"; };
|
||||
EAEA85E11811D3AE00F06E69 /* SWGUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGUser.m; sourceTree = "<group>"; };
|
||||
EAEA85E21811D3AE00F06E69 /* SWGUserApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWGUserApi.h; sourceTree = "<group>"; };
|
||||
EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGUserApi.m; sourceTree = "<group>"; };
|
||||
EAEA85F01811D8F100F06E69 /* libPods.a */ = {isa = PBXFileReference; lastKnownFileType = file; name = libPods.a; path = "../Pods/build/Debug-iphoneos/libPods.a"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
EA07F4B616134F27006A2112 /* Frameworks */ = {
|
||||
EA6699931811D2FA00A70D03 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EA07F4BE16134F27006A2112 /* Foundation.framework in Frameworks */,
|
||||
EA66999C1811D2FA00A70D03 /* CoreGraphics.framework in Frameworks */,
|
||||
EA66999E1811D2FA00A70D03 /* UIKit.framework in Frameworks */,
|
||||
EA66999A1811D2FA00A70D03 /* Foundation.framework in Frameworks */,
|
||||
BA525648922D4C0E9F44D4F1 /* libPods.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
EA07F4EE1613521A006A2112 /* Frameworks */ = {
|
||||
EA6699B71811D2FB00A70D03 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EA07F53316135819006A2112 /* Cocoa.framework in Frameworks */,
|
||||
EA07F5311613580E006A2112 /* SenTestingKit.framework in Frameworks */,
|
||||
EAEA85F11811D8F100F06E69 /* libPods.a in Frameworks */,
|
||||
EA6699BC1811D2FB00A70D03 /* XCTest.framework in Frameworks */,
|
||||
EA6699BE1811D2FB00A70D03 /* UIKit.framework in Frameworks */,
|
||||
EA6699BD1811D2FB00A70D03 /* Foundation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
EA07F4AE16134F27006A2112 = {
|
||||
EA66998D1811D2FA00A70D03 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA81837C1613809300341A6E /* Tests */,
|
||||
EA07F52D1613569E006A2112 /* Generated Client */,
|
||||
EA07F4BF16134F27006A2112 /* PetstoreClient */,
|
||||
EA07F4BC16134F27006A2112 /* Frameworks */,
|
||||
EA07F4BA16134F27006A2112 /* Products */,
|
||||
EAEA85CB1811D3AE00F06E69 /* client */,
|
||||
EA66999F1811D2FA00A70D03 /* PetstoreClient */,
|
||||
EA6699C11811D2FB00A70D03 /* PetstoreClientTests */,
|
||||
EA6699981811D2FA00A70D03 /* Frameworks */,
|
||||
EA6699971811D2FA00A70D03 /* Products */,
|
||||
EA5799F266AC4D21AD004BC4 /* Pods.xcconfig */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA07F4BA16134F27006A2112 /* Products */ = {
|
||||
EA6699971811D2FA00A70D03 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA07F4B916134F27006A2112 /* PetstoreClient */,
|
||||
EA07F4F21613521A006A2112 /* PetstoreClientTests.octest */,
|
||||
EA6699961811D2FA00A70D03 /* PetstoreClient.app */,
|
||||
EA6699BA1811D2FB00A70D03 /* PetstoreClientTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA07F4BC16134F27006A2112 /* Frameworks */ = {
|
||||
EA6699981811D2FA00A70D03 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA07F53216135819006A2112 /* Cocoa.framework */,
|
||||
EA07F5301613580E006A2112 /* SenTestingKit.framework */,
|
||||
EA07F4BD16134F27006A2112 /* Foundation.framework */,
|
||||
EA07F4F71613521A006A2112 /* Other Frameworks */,
|
||||
EAEA85F01811D8F100F06E69 /* libPods.a */,
|
||||
EA6699991811D2FA00A70D03 /* Foundation.framework */,
|
||||
EA66999B1811D2FA00A70D03 /* CoreGraphics.framework */,
|
||||
EA66999D1811D2FA00A70D03 /* UIKit.framework */,
|
||||
EA6699BB1811D2FB00A70D03 /* XCTest.framework */,
|
||||
73DA4F1067C343C3962F1542 /* libPods.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA07F4BF16134F27006A2112 /* PetstoreClient */ = {
|
||||
EA66999F1811D2FA00A70D03 /* PetstoreClient */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA07F4C016134F27006A2112 /* main.m */,
|
||||
EA07F4C416134F27006A2112 /* PetstoreClient.1 */,
|
||||
EA07F4C216134F27006A2112 /* Supporting Files */,
|
||||
EA6699A81811D2FA00A70D03 /* AppDelegate.h */,
|
||||
EA6699A91811D2FA00A70D03 /* AppDelegate.m */,
|
||||
EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */,
|
||||
EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */,
|
||||
EA6699B11811D2FA00A70D03 /* ViewController.h */,
|
||||
EA6699B21811D2FA00A70D03 /* ViewController.m */,
|
||||
EA6699B41811D2FA00A70D03 /* Images.xcassets */,
|
||||
EA6699A01811D2FA00A70D03 /* Supporting Files */,
|
||||
);
|
||||
path = PetstoreClient;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA07F4C216134F27006A2112 /* Supporting Files */ = {
|
||||
EA6699A01811D2FA00A70D03 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA07F4C316134F27006A2112 /* PetstoreClient-Prefix.pch */,
|
||||
EA6699A11811D2FA00A70D03 /* PetstoreClient-Info.plist */,
|
||||
EA6699A21811D2FA00A70D03 /* InfoPlist.strings */,
|
||||
EA6699A51811D2FA00A70D03 /* main.m */,
|
||||
EA6699A71811D2FA00A70D03 /* PetstoreClient-Prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA07F4F71613521A006A2112 /* Other Frameworks */ = {
|
||||
EA6699C11811D2FB00A70D03 /* PetstoreClientTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA6699C71811D2FB00A70D03 /* PetstoreClientTests.m */,
|
||||
EA6699C21811D2FB00A70D03 /* Supporting Files */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
path = PetstoreClientTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA07F52D1613569E006A2112 /* Generated Client */ = {
|
||||
EA6699C21811D2FB00A70D03 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA07F50C1613569A006A2112 /* NIKApiInvoker.h */,
|
||||
EA07F50D1613569A006A2112 /* NIKApiInvoker.m */,
|
||||
EA07F50E1613569A006A2112 /* NIKCategory.h */,
|
||||
EA07F50F1613569A006A2112 /* NIKCategory.m */,
|
||||
EA07F5101613569A006A2112 /* NIKDate.h */,
|
||||
EA07F5111613569A006A2112 /* NIKDate.m */,
|
||||
EA07F5121613569A006A2112 /* NIKOrder.h */,
|
||||
EA07F5131613569A006A2112 /* NIKOrder.m */,
|
||||
EA07F5141613569A006A2112 /* NIKPet.h */,
|
||||
EA07F5151613569A006A2112 /* NIKPet.m */,
|
||||
EA07F5161613569A006A2112 /* NIKPetApi.h */,
|
||||
EA07F5171613569A006A2112 /* NIKPetApi.m */,
|
||||
EA07F5181613569A006A2112 /* NIKStoreApi.h */,
|
||||
EA07F5191613569A006A2112 /* NIKStoreApi.m */,
|
||||
EA07F51A1613569A006A2112 /* NIKSwaggerObject.h */,
|
||||
EA07F51B1613569A006A2112 /* NIKSwaggerObject.m */,
|
||||
EA07F51C1613569A006A2112 /* NIKTag.h */,
|
||||
EA07F51D1613569A006A2112 /* NIKTag.m */,
|
||||
EA07F51E1613569A006A2112 /* NIKUser.h */,
|
||||
EA07F51F1613569A006A2112 /* NIKUser.m */,
|
||||
EA07F5201613569A006A2112 /* NIKUserApi.h */,
|
||||
EA07F5211613569A006A2112 /* NIKUserApi.m */,
|
||||
EA6699C31811D2FB00A70D03 /* PetstoreClientTests-Info.plist */,
|
||||
EA6699C41811D2FB00A70D03 /* InfoPlist.strings */,
|
||||
);
|
||||
name = "Generated Client";
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA81837C1613809300341A6E /* Tests */ = {
|
||||
EAEA85CB1811D3AE00F06E69 /* client */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA81837816137FD500341A6E /* PetApiTest.m */,
|
||||
EA81837916137FD500341A6E /* PetApiTest.h */,
|
||||
EA5A034216141443003B3E41 /* UserApiTest.h */,
|
||||
EA5A034316141443003B3E41 /* UserApiTest.m */,
|
||||
EAEA85CC1811D3AE00F06E69 /* SWGApiClient.h */,
|
||||
EAEA85CD1811D3AE00F06E69 /* SWGApiClient.m */,
|
||||
EAEA85CE1811D3AE00F06E69 /* SWGCategory.h */,
|
||||
EAEA85CF1811D3AE00F06E69 /* SWGCategory.m */,
|
||||
EAEA85D01811D3AE00F06E69 /* SWGDate.h */,
|
||||
EAEA85D11811D3AE00F06E69 /* SWGDate.m */,
|
||||
EAEA85D21811D3AE00F06E69 /* SWGFile.h */,
|
||||
EAEA85D31811D3AE00F06E69 /* SWGFile.m */,
|
||||
EAEA85D41811D3AE00F06E69 /* SWGObject.h */,
|
||||
EAEA85D51811D3AE00F06E69 /* SWGObject.m */,
|
||||
EAEA85D61811D3AE00F06E69 /* SWGOrder.h */,
|
||||
EAEA85D71811D3AE00F06E69 /* SWGOrder.m */,
|
||||
EAEA85D81811D3AE00F06E69 /* SWGPet.h */,
|
||||
EAEA85D91811D3AE00F06E69 /* SWGPet.m */,
|
||||
EAEA85DA1811D3AE00F06E69 /* SWGPetApi.h */,
|
||||
EAEA85DB1811D3AE00F06E69 /* SWGPetApi.m */,
|
||||
EAEA85DC1811D3AE00F06E69 /* SWGStoreApi.h */,
|
||||
EAEA85DD1811D3AE00F06E69 /* SWGStoreApi.m */,
|
||||
EAEA85DE1811D3AE00F06E69 /* SWGTag.h */,
|
||||
EAEA85DF1811D3AE00F06E69 /* SWGTag.m */,
|
||||
EAEA85E01811D3AE00F06E69 /* SWGUser.h */,
|
||||
EAEA85E11811D3AE00F06E69 /* SWGUser.m */,
|
||||
EAEA85E21811D3AE00F06E69 /* SWGUserApi.h */,
|
||||
EAEA85E31811D3AE00F06E69 /* SWGUserApi.m */,
|
||||
);
|
||||
name = Tests;
|
||||
name = client;
|
||||
path = ../client;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
EA07F4B816134F27006A2112 /* PetstoreClient */ = {
|
||||
EA6699951811D2FA00A70D03 /* PetstoreClient */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = EA07F4C816134F27006A2112 /* Build configuration list for PBXNativeTarget "PetstoreClient" */;
|
||||
buildConfigurationList = EA6699CB1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "PetstoreClient" */;
|
||||
buildPhases = (
|
||||
EA07F4B516134F27006A2112 /* Sources */,
|
||||
EA07F4B616134F27006A2112 /* Frameworks */,
|
||||
EA07F4B716134F27006A2112 /* CopyFiles */,
|
||||
04DAA264FD78471BBAD25173 /* Check Pods Manifest.lock */,
|
||||
EA6699921811D2FA00A70D03 /* Sources */,
|
||||
EA6699931811D2FA00A70D03 /* Frameworks */,
|
||||
EA6699941811D2FA00A70D03 /* Resources */,
|
||||
3692D11BB04F489DAA7C0B6A /* Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -244,161 +253,213 @@
|
||||
);
|
||||
name = PetstoreClient;
|
||||
productName = PetstoreClient;
|
||||
productReference = EA07F4B916134F27006A2112 /* PetstoreClient */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
productReference = EA6699961811D2FA00A70D03 /* PetstoreClient.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
EA07F4F11613521A006A2112 /* PetstoreClientTests */ = {
|
||||
EA6699B91811D2FB00A70D03 /* PetstoreClientTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = EA07F5051613521A006A2112 /* Build configuration list for PBXNativeTarget "PetstoreClientTests" */;
|
||||
buildConfigurationList = EA6699CE1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "PetstoreClientTests" */;
|
||||
buildPhases = (
|
||||
EA07F4ED1613521A006A2112 /* Sources */,
|
||||
EA07F4EE1613521A006A2112 /* Frameworks */,
|
||||
EA07F4EF1613521A006A2112 /* Resources */,
|
||||
EA07F4F01613521A006A2112 /* ShellScript */,
|
||||
EA6699B61811D2FB00A70D03 /* Sources */,
|
||||
EA6699B71811D2FB00A70D03 /* Frameworks */,
|
||||
EA6699B81811D2FB00A70D03 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
EA07F52F161357A5006A2112 /* PBXTargetDependency */,
|
||||
EA6699C01811D2FB00A70D03 /* PBXTargetDependency */,
|
||||
);
|
||||
name = PetstoreClientTests;
|
||||
productName = PetstoreClientTests;
|
||||
productReference = EA07F4F21613521A006A2112 /* PetstoreClientTests.octest */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
productReference = EA6699BA1811D2FB00A70D03 /* PetstoreClientTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
EA07F4B016134F27006A2112 /* Project object */ = {
|
||||
EA66998E1811D2FA00A70D03 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0450;
|
||||
ORGANIZATIONNAME = "Tony Tam";
|
||||
LastUpgradeCheck = 0500;
|
||||
ORGANIZATIONNAME = Reverb;
|
||||
TargetAttributes = {
|
||||
EA6699B91811D2FB00A70D03 = {
|
||||
TestTargetID = EA6699951811D2FA00A70D03;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = EA07F4B316134F27006A2112 /* Build configuration list for PBXProject "PetstoreClient" */;
|
||||
buildConfigurationList = EA6699911811D2FA00A70D03 /* Build configuration list for PBXProject "PetstoreClient" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = EA07F4AE16134F27006A2112;
|
||||
productRefGroup = EA07F4BA16134F27006A2112 /* Products */;
|
||||
mainGroup = EA66998D1811D2FA00A70D03;
|
||||
productRefGroup = EA6699971811D2FA00A70D03 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
EA07F4B816134F27006A2112 /* PetstoreClient */,
|
||||
EA07F4F11613521A006A2112 /* PetstoreClientTests */,
|
||||
EA6699951811D2FA00A70D03 /* PetstoreClient */,
|
||||
EA6699B91811D2FB00A70D03 /* PetstoreClientTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
EA07F4EF1613521A006A2112 /* Resources */ = {
|
||||
EA6699941811D2FA00A70D03 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EA6699B01811D2FA00A70D03 /* Main_iPad.storyboard in Resources */,
|
||||
EA6699B51811D2FA00A70D03 /* Images.xcassets in Resources */,
|
||||
EA6699AD1811D2FA00A70D03 /* Main_iPhone.storyboard in Resources */,
|
||||
EA6699A41811D2FA00A70D03 /* InfoPlist.strings in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
EA6699B81811D2FB00A70D03 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EA6699C61811D2FB00A70D03 /* InfoPlist.strings in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
EA07F4F01613521A006A2112 /* ShellScript */ = {
|
||||
04DAA264FD78471BBAD25173 /* Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3692D11BB04F489DAA7C0B6A /* Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/../Pods/Pods-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
EA07F4B516134F27006A2112 /* Sources */ = {
|
||||
EA6699921811D2FA00A70D03 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EA07F4C116134F27006A2112 /* main.m in Sources */,
|
||||
EA07F5221613569A006A2112 /* NIKApiInvoker.m in Sources */,
|
||||
EA07F5231613569A006A2112 /* NIKCategory.m in Sources */,
|
||||
EA07F5241613569A006A2112 /* NIKDate.m in Sources */,
|
||||
EA07F5251613569A006A2112 /* NIKOrder.m in Sources */,
|
||||
EA07F5261613569A006A2112 /* NIKPet.m in Sources */,
|
||||
EA07F5271613569A006A2112 /* NIKPetApi.m in Sources */,
|
||||
EA07F5281613569A006A2112 /* NIKStoreApi.m in Sources */,
|
||||
EA07F5291613569A006A2112 /* NIKSwaggerObject.m in Sources */,
|
||||
EA07F52A1613569A006A2112 /* NIKTag.m in Sources */,
|
||||
EA07F52B1613569A006A2112 /* NIKUser.m in Sources */,
|
||||
EA07F52C1613569A006A2112 /* NIKUserApi.m in Sources */,
|
||||
EAEA85E51811D3AE00F06E69 /* SWGCategory.m in Sources */,
|
||||
EAEA85ED1811D3AE00F06E69 /* SWGTag.m in Sources */,
|
||||
EA6699B31811D2FA00A70D03 /* ViewController.m in Sources */,
|
||||
EA6699AA1811D2FA00A70D03 /* AppDelegate.m in Sources */,
|
||||
EAEA85EE1811D3AE00F06E69 /* SWGUser.m in Sources */,
|
||||
EAEA85EF1811D3AE00F06E69 /* SWGUserApi.m in Sources */,
|
||||
EAEA85EB1811D3AE00F06E69 /* SWGPetApi.m in Sources */,
|
||||
EAEA85E61811D3AE00F06E69 /* SWGDate.m in Sources */,
|
||||
EA6699A61811D2FA00A70D03 /* main.m in Sources */,
|
||||
EAEA85EA1811D3AE00F06E69 /* SWGPet.m in Sources */,
|
||||
EAEA85E41811D3AE00F06E69 /* SWGApiClient.m in Sources */,
|
||||
EAEA85EC1811D3AE00F06E69 /* SWGStoreApi.m in Sources */,
|
||||
EAEA85E91811D3AE00F06E69 /* SWGOrder.m in Sources */,
|
||||
EAEA85E81811D3AE00F06E69 /* SWGObject.m in Sources */,
|
||||
EAEA85E71811D3AE00F06E69 /* SWGFile.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
EA07F4ED1613521A006A2112 /* Sources */ = {
|
||||
EA6699B61811D2FB00A70D03 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EAE96DE616138695004AB97C /* PetApiTest.m in Sources */,
|
||||
EAE96DE716138695004AB97C /* PetApiTest.h in Sources */,
|
||||
EA07F53516135916006A2112 /* NIKApiInvoker.h in Sources */,
|
||||
EA07F53616135916006A2112 /* NIKApiInvoker.m in Sources */,
|
||||
EA07F53716135916006A2112 /* NIKCategory.h in Sources */,
|
||||
EA07F53816135916006A2112 /* NIKCategory.m in Sources */,
|
||||
EA07F53916135916006A2112 /* NIKDate.h in Sources */,
|
||||
EA07F53A16135916006A2112 /* NIKDate.m in Sources */,
|
||||
EA07F53B16135916006A2112 /* NIKOrder.h in Sources */,
|
||||
EA07F53C16135916006A2112 /* NIKOrder.m in Sources */,
|
||||
EA07F53D16135916006A2112 /* NIKPet.h in Sources */,
|
||||
EA07F53E16135916006A2112 /* NIKPet.m in Sources */,
|
||||
EA07F53F16135916006A2112 /* NIKPetApi.h in Sources */,
|
||||
EA07F54016135916006A2112 /* NIKPetApi.m in Sources */,
|
||||
EA07F54116135916006A2112 /* NIKStoreApi.h in Sources */,
|
||||
EA07F54216135916006A2112 /* NIKStoreApi.m in Sources */,
|
||||
EA07F54316135916006A2112 /* NIKSwaggerObject.h in Sources */,
|
||||
EA07F54416135916006A2112 /* NIKSwaggerObject.m in Sources */,
|
||||
EA07F54516135916006A2112 /* NIKTag.h in Sources */,
|
||||
EA07F54616135916006A2112 /* NIKTag.m in Sources */,
|
||||
EA07F54716135916006A2112 /* NIKUser.h in Sources */,
|
||||
EA07F54816135916006A2112 /* NIKUser.m in Sources */,
|
||||
EA07F54916135916006A2112 /* NIKUserApi.h in Sources */,
|
||||
EA07F54A16135916006A2112 /* NIKUserApi.m in Sources */,
|
||||
EA5A034416141443003B3E41 /* UserApiTest.m in Sources */,
|
||||
EA6699C81811D2FB00A70D03 /* PetstoreClientTests.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
EA07F52F161357A5006A2112 /* PBXTargetDependency */ = {
|
||||
EA6699C01811D2FB00A70D03 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = EA07F4B816134F27006A2112 /* PetstoreClient */;
|
||||
targetProxy = EA07F52E161357A5006A2112 /* PBXContainerItemProxy */;
|
||||
target = EA6699951811D2FA00A70D03 /* PetstoreClient */;
|
||||
targetProxy = EA6699BF1811D2FB00A70D03 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
EA6699A21811D2FA00A70D03 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
EA6699A31811D2FA00A70D03 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA6699AB1811D2FA00A70D03 /* Main_iPhone.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
EA6699AC1811D2FA00A70D03 /* Base */,
|
||||
);
|
||||
name = Main_iPhone.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA6699AE1811D2FA00A70D03 /* Main_iPad.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
EA6699AF1811D2FA00A70D03 /* Base */,
|
||||
);
|
||||
name = Main_iPad.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EA6699C41811D2FB00A70D03 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
EA6699C51811D2FB00A70D03 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
EA07F4C616134F27006A2112 /* Debug */ = {
|
||||
EA6699C91811D2FB00A70D03 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"\"$(SDKROOT)/Developer/Library/Frameworks $(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@@ -406,124 +467,153 @@
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
EA07F4C716134F27006A2112 /* Release */ = {
|
||||
EA6699CA1811D2FB00A70D03 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"\"$(SDKROOT)/Developer/Library/Frameworks $(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
|
||||
);
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
SDKROOT = macosx;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
EA07F4C916134F27006A2112 /* Debug */ = {
|
||||
EA6699CC1811D2FB00A70D03 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = EA5799F266AC4D21AD004BC4 /* Pods.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "PetstoreClient/PetstoreClient-Prefix.pch";
|
||||
INFOPLIST_FILE = "PetstoreClient/PetstoreClient-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
EA07F4CA16134F27006A2112 /* Release */ = {
|
||||
EA6699CD1811D2FB00A70D03 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = EA5799F266AC4D21AD004BC4 /* Pods.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "PetstoreClient/PetstoreClient-Prefix.pch";
|
||||
INFOPLIST_FILE = "PetstoreClient/PetstoreClient-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
EA07F5061613521A006A2112 /* Debug */ = {
|
||||
EA6699CF1811D2FB00A70D03 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/PetstoreClient.app/PetstoreClient";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
|
||||
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
|
||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "../tests/PetstoreClientTests-Prefix.pch";
|
||||
INFOPLIST_FILE = "../tests/PetstoreClientTests-Info.plist";
|
||||
GCC_PREFIX_HEADER = "PetstoreClient/PetstoreClient-Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = "PetstoreClientTests/PetstoreClientTests-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = octest;
|
||||
TEST_HOST = "$(BUNDLE_LOADER)";
|
||||
WRAPPER_EXTENSION = xctest;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
EA07F5071613521A006A2112 /* Release */ = {
|
||||
EA6699D01811D2FB00A70D03 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/PetstoreClient.app/PetstoreClient";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
|
||||
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
|
||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "../tests/PetstoreClientTests-Prefix.pch";
|
||||
INFOPLIST_FILE = "../tests/PetstoreClientTests-Info.plist";
|
||||
GCC_PREFIX_HEADER = "PetstoreClient/PetstoreClient-Prefix.pch";
|
||||
INFOPLIST_FILE = "PetstoreClientTests/PetstoreClientTests-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = octest;
|
||||
TEST_HOST = "$(BUNDLE_LOADER)";
|
||||
WRAPPER_EXTENSION = xctest;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
EA07F4B316134F27006A2112 /* Build configuration list for PBXProject "PetstoreClient" */ = {
|
||||
EA6699911811D2FA00A70D03 /* Build configuration list for PBXProject "PetstoreClient" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
EA07F4C616134F27006A2112 /* Debug */,
|
||||
EA07F4C716134F27006A2112 /* Release */,
|
||||
EA6699C91811D2FB00A70D03 /* Debug */,
|
||||
EA6699CA1811D2FB00A70D03 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
EA07F4C816134F27006A2112 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = {
|
||||
EA6699CB1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
EA07F4C916134F27006A2112 /* Debug */,
|
||||
EA07F4CA16134F27006A2112 /* Release */,
|
||||
EA6699CC1811D2FB00A70D03 /* Debug */,
|
||||
EA6699CD1811D2FB00A70D03 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
EA07F5051613521A006A2112 /* Build configuration list for PBXNativeTarget "PetstoreClientTests" */ = {
|
||||
EA6699CE1811D2FB00A70D03 /* Build configuration list for PBXNativeTarget "PetstoreClientTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
EA07F5061613521A006A2112 /* Debug */,
|
||||
EA07F5071613521A006A2112 /* Release */,
|
||||
EA6699CF1811D2FB00A70D03 /* Debug */,
|
||||
EA6699D01811D2FB00A70D03 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = EA07F4B016134F27006A2112 /* Project object */;
|
||||
rootObject = EA66998E1811D2FA00A70D03 /* Project object */;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>7A33CEA3-5D3F-4B6D-8F47-84701AB3E283</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>PetstoreClient</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>92840518-904D-4771-AA3D-9AF52CA48B71</key>
|
||||
<string>ssh://github.com/wordnik/swagger-codegen.git</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>samples/client/petstore/objc/PetstoreClient/PetstoreClient.xcodeproj/project.xcworkspace</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>92840518-904D-4771-AA3D-9AF52CA48B71</key>
|
||||
<string>../../../../../../..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>ssh://github.com/wordnik/swagger-codegen.git</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>110</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>92840518-904D-4771-AA3D-9AF52CA48B71</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>92840518-904D-4771-AA3D-9AF52CA48B71</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>swagger-codegen</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
type = "1"
|
||||
version = "1.0">
|
||||
</Bucket>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0450"
|
||||
LastUpgradeVersion = "0500"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -14,8 +14,8 @@
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "EA07F4B816134F27006A2112"
|
||||
BuildableName = "PetstoreClient"
|
||||
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
|
||||
BuildableName = "PetstoreClient.app"
|
||||
BlueprintName = "PetstoreClient"
|
||||
ReferencedContainer = "container:PetstoreClient.xcodeproj">
|
||||
</BuildableReference>
|
||||
@@ -28,12 +28,22 @@
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "EA6699B91811D2FB00A70D03"
|
||||
BuildableName = "PetstoreClientTests.xctest"
|
||||
BlueprintName = "PetstoreClientTests"
|
||||
ReferencedContainer = "container:PetstoreClient.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "EA07F4B816134F27006A2112"
|
||||
BuildableName = "PetstoreClient"
|
||||
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
|
||||
BuildableName = "PetstoreClient.app"
|
||||
BlueprintName = "PetstoreClient"
|
||||
ReferencedContainer = "container:PetstoreClient.xcodeproj">
|
||||
</BuildableReference>
|
||||
@@ -51,8 +61,8 @@
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "EA07F4B816134F27006A2112"
|
||||
BuildableName = "PetstoreClient"
|
||||
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
|
||||
BuildableName = "PetstoreClient.app"
|
||||
BlueprintName = "PetstoreClient"
|
||||
ReferencedContainer = "container:PetstoreClient.xcodeproj">
|
||||
</BuildableReference>
|
||||
@@ -69,8 +79,8 @@
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "EA07F4B816134F27006A2112"
|
||||
BuildableName = "PetstoreClient"
|
||||
BlueprintIdentifier = "EA6699951811D2FA00A70D03"
|
||||
BuildableName = "PetstoreClient.app"
|
||||
BlueprintName = "PetstoreClient"
|
||||
ReferencedContainer = "container:PetstoreClient.xcodeproj">
|
||||
</BuildableReference>
|
||||
|
||||
@@ -9,20 +9,15 @@
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>PetstoreClientTests.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>EA07F4B816134F27006A2112</key>
|
||||
<key>EA6699951811D2FA00A70D03</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>EA07F4F11613521A006A2112</key>
|
||||
<key>EA6699B91811D2FB00A70D03</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// AppDelegate.h
|
||||
// PetstoreClient
|
||||
//
|
||||
// Created by Tony Tam on 10/18/13.
|
||||
// Copyright (c) 2013 Reverb. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// AppDelegate.m
|
||||
// PetstoreClient
|
||||
//
|
||||
// Created by Tony Tam on 10/18/13.
|
||||
// Copyright (c) 2013 Reverb. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
// Override point for customization after application launch.
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application
|
||||
{
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application
|
||||
{
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application
|
||||
{
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||
{
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application
|
||||
{
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--class Prefix:identifier View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="20" width="768" height="1004"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--class Prefix:identifier View Controller-->
|
||||
<scene sceneID="ufC-wZ-h7g">
|
||||
<objects>
|
||||
<viewController id="vXZ-lx-hvc" customClass="ViewController" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination" type="retina4"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "retina4",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "ipad",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user