Compare commits

...

2640 Commits

Author SHA1 Message Date
Tony Tam
c00f4ba805 Merge pull request #1437 from swagger-api/release-prepare
updated versions for release
2015-10-25 19:41:11 -07:00
Tony Tam
dd3b253e15 updated versions 2015-10-25 19:31:36 -07:00
Tony Tam
3969a9f294 fix for #925 2015-10-25 17:02:08 -07:00
Tony Tam
78f8eaa687 set to release version 2015-10-25 16:31:40 -07:00
wing328
fe676c83c0 Merge pull request #1412 from Edubits/swift-alamofire-3.0
Swift Alamofire 3.0
2015-10-25 18:28:39 +08:00
wing328
18370b9076 Merge pull request #1402 from lugaru1234/issue960
Fixes #960: Enums have been added to result file
2015-10-25 17:52:37 +08:00
wing328
70d987666e Merge pull request #1436 from tomekc/swift_enum_naming
Swift enum names capitalization follows Swift convention.
2015-10-25 17:46:14 +08:00
Tomek Cejner
6247dd0cde Swift enum names capitalization follows Swift convention. 2015-10-25 00:06:00 +02:00
wing328
ea7ef990b9 Merge pull request #1432 from xhh/ruby-empty-array
Ruby client: include empty arrays in model serialization
2015-10-24 11:45:27 +08:00
Tony Tam
83afaffd92 Merge pull request #1430 from nbruno/java-child-enum-bug
Ensure hasMore is updated when reconciling enum properties from parent
2015-10-23 08:08:30 -07:00
wing328
d2faa63ebc Merge pull request #1431 from wing328/fix_empty_operation_id
Better error message for empty operationId
2015-10-23 18:47:04 +08:00
xhh
dcec2e7b5d Forgot to use _to_hash for non-array value 2015-10-23 18:03:38 +08:00
xhh
940e76f45f Ruby client: include empty arrays in model serialization 2015-10-23 17:08:12 +08:00
wing328
fecbc3c45d Merge pull request #1306 from fdorothy/master
Specifying configuration files from Codegen class
2015-10-23 15:41:00 +08:00
Tony Tam
a6e4203cd5 added property check 2015-10-22 22:39:09 -07:00
wing328
dd34d75f00 better error message for empty operationId 2015-10-23 12:46:44 +08:00
Nick Bruno
1eed1917b9 Ensure hasMore is updated when reconciling enum properties from parent 2015-10-22 22:33:20 -04:00
Tony Tam
91afec43a6 fixed NPE on empty props 2015-10-22 15:43:02 -07:00
Tony Tam
adeff7855c instructions for selective generation 2015-10-22 15:34:20 -07:00
Tony Tam
e289b858a9 Merge pull request #1428 from swagger-api/feature/selective-generation
made selective generation of models
2015-10-22 15:28:58 -07:00
Tony Tam
7170f7fa01 updated supporitng file support 2015-10-22 15:28:49 -07:00
Tony Tam
6253a592d9 added optional support for apis, supoprtingFiles 2015-10-22 14:54:29 -07:00
Tony Tam
9f842a1295 added environment variable support 2015-10-22 14:34:52 -07:00
Tony Tam
723cf9b823 made selective generation of models 2015-10-22 14:03:44 -07:00
Tony Tam
bbb59f93db Merge pull request #1427 from crissdev/patch-1
Update TypeScriptAngularClientCodegen.java
2015-10-22 14:00:27 -07:00
Cristian Trifan
2fcb705826 Update TypeScriptAngularClientCodegen.java
Fix minor typo
2015-10-22 23:19:46 +03:00
wing328
4723f51c63 Merge pull request #1397 from lugaru1234/issue1251
Fixes #1251, #1212: Form parameters has been added to the html template
2015-10-22 16:48:13 +08:00
wing328
485186e6b6 Merge pull request #1418 from ampem/master
[Perl] Ensure parameters to "each" is a hash in TO_JSON and from_hash
2015-10-22 15:14:27 +08:00
Ampem Darko
1ac6842b5a Update mustache template to pass hashes in TO_JSON and from_hash 2015-10-21 16:15:42 +00:00
Ampem Darko
57e3ea3e9c Ensure parameters to "each" is a hash in TO_JSON and from_hash 2015-10-21 13:35:48 +00:00
wing328
0f75b053c8 Merge pull request #1417 from akkie/master
ApiException doesn't use deserialized data
2015-10-21 19:13:18 +08:00
wing328
eee69f1e05 Merge pull request #1416 from xhh/java-do-not-serialize-nulls
[Java] Ignore null fields in model serialization in Java clients
2015-10-21 19:00:09 +08:00
akkie
9b8a633435 ApiException doesn't use deserialized data
This is a fix for #1394. I had not merged the data correctly after the rebase
2015-10-21 12:56:15 +02:00
Tony Tam
dcc47a92b5 added https support 2015-10-20 21:25:51 -07:00
Tony Tam
e9aaa6da36 enabled https 2015-10-20 21:25:35 -07:00
Tony Tam
568a7be994 enabled https 2015-10-20 21:25:21 -07:00
xhh
214e0186e8 Ignore null fields in model serialization
in Java clients.

Closes #1413
2015-10-21 12:05:27 +08:00
Tony Tam
7f5cdba606 rebuilt 2015-10-20 11:42:40 -07:00
Tony Tam
295af57c9a fixed build error 2015-10-20 11:31:21 -07:00
Tony Tam
bade71c6ba merged 2015-10-20 10:59:20 -07:00
Tony Tam
9adb077a7b Merge branch 'feature/inline-models' 2015-10-20 10:57:50 -07:00
Tony Tam
10a9c62e2b merged 2015-10-20 10:57:36 -07:00
Tony Tam
a6bd0773f7 added files 2015-10-20 10:56:18 -07:00
Tony Tam
b2506ab598 rebuilt 2015-10-20 10:32:19 -07:00
Tony Tam
a21f08118e rebuilt 2015-10-20 10:31:42 -07:00
Tony Tam
96380bbc83 rebuilt 2015-10-20 10:31:17 -07:00
Tony Tam
abe4980449 rebuilt 2015-10-20 10:30:19 -07:00
Tony Tam
e3151c57a0 rebuilt 2015-10-20 10:29:48 -07:00
Tony Tam
d2dc333699 rebuilt 2015-10-20 10:29:25 -07:00
Tony Tam
b41a40f9be rebuilt 2015-10-20 10:28:49 -07:00
Tony Tam
2f3a2413c7 rebuilt 2015-10-20 08:49:26 -07:00
Tony Tam
19ea3ecf66 update test for inline body param flattening 2015-10-20 08:48:44 -07:00
Tony Tam
5c29562926 ensure body params are flattened when type ModelImpl 2015-10-20 08:48:26 -07:00
Tony Tam
b827d06077 fix for npe on map models 2015-10-20 08:48:04 -07:00
Tony Tam
539496d735 rebuilt 2015-10-20 07:10:05 -07:00
wing328
6b7059d23f Merge pull request #1394 from akkie/api-exception-json
Deserialize the response body in case of an ApiException
2015-10-20 18:01:09 +08:00
wing328
bff8f96b99 Merge pull request #1404 from tomekc/swift-enhanced
Add default initializer to Swift model classes.
2015-10-20 17:54:41 +08:00
Tony Tam
5e69d929a0 rebuilt 2015-10-19 23:13:27 -07:00
Tony Tam
e1ee7065d5 rebuilt client 2015-10-19 23:12:02 -07:00
Tony Tam
aaf1df1971 more flattening fixes 2015-10-19 23:10:48 -07:00
Tony Tam
555fd54fbb updated swagger-core versions 2015-10-19 22:09:33 -07:00
Tony Tam
905a7746e7 updated test 2015-10-19 21:45:47 -07:00
Tony Tam
eeaf4071f9 updated to not flatten array, map properties in responses unless necessary 2015-10-19 21:35:45 -07:00
Tony Tam
84b7302f12 updated swagger-core version 2015-10-19 21:34:42 -07:00
Robin Eggenkamp
1b0963ebe0 Minimal changes to upgrade to Alamofire 3.0.0 2015-10-19 17:06:41 +02:00
akkie
b054cd3cc6 Deserialize the response body in case of an ApiException
Currently it's not possible to use custom models in the ApiException because the body gets not deserialized to Json and therefore the object deserializer cannot deserialize it to a custom model. This pull request uses the same mechanism as used to deserialize the response body in case of a 2xx status code.
2015-10-19 15:17:29 +02:00
wing328
4ea797d0e8 Merge pull request #1392 from nbruno/add-auth-annotations-jaxrs
Add authorization scope data to CodegenSecurity
2015-10-19 14:15:05 +08:00
Tony Tam
002feb3e7c build error 2015-10-18 21:10:13 -07:00
Tony Tam
89dc4d29ab added map support 2015-10-18 21:05:57 -07:00
Tony Tam
3cf1f1a56a added support for array and model inline types 2015-10-18 20:51:55 -07:00
Nick Bruno
b83db8e535 Merge remote-tracking branch 'upstream/master' into add-auth-annotations-jaxrs 2015-10-18 17:19:44 -04:00
wing328
eb1e0b5034 Merge pull request #1408 from kkrauth/patch-1
Fix syntax issue when no auth methods defined
2015-10-18 16:34:11 +08:00
wing328
d7b4f58994 Merge pull request #1411 from wing328/master
Add support for top-level consumes and produces
2015-10-17 17:41:19 +08:00
wing328
e8fbdaabe3 replace tabs with spaces 2015-10-17 16:44:55 +08:00
wing328
b82333aea4 Add support for top-level consumes and produces
This reverts commit 0b4b5e8839.
2015-10-17 16:30:19 +08:00
Nick Bruno
7bbb883a00 Generate JAXRS and SpringMVC samples to demo Authorization annotations 2015-10-16 21:25:54 -04:00
Nick Bruno
6477a27579 Update SpringMVC template to include Authorization annotations 2015-10-16 21:24:17 -04:00
Tony Tam
ad1626ad2d added yaml sample 2015-10-16 18:22:13 -07:00
Tony Tam
bfa4303e6e added inline model resolver 2015-10-16 18:21:34 -07:00
Tony Tam
9508579eed added inline resolver 2015-10-16 18:21:06 -07:00
Kosta Krauth
9ac980298f Fix syntax issue when no auth methods defined
When no authentication methods are defined, the generated code does not compile due to where the authMethods closing tag is located. Moved the closing tag further down and opening tag further up so that the generated code is correct both when authentication are and aren't present.
2015-10-16 16:45:34 -04:00
wing328
a2fda604f8 Merge pull request #1396 from akkie/disable-ssl-verification
Allow to disable SSL verification
2015-10-16 21:08:31 +08:00
Tomek Cejner
8339e4b092 Add default initializer to Swift model classes. 2015-10-16 14:09:55 +02:00
wing328
90eab19305 Merge pull request #1401 from xhh/ruby-base-url-slashes
Ruby client: remove trailing slashes from base_url
2015-10-16 19:32:13 +08:00
wing328
8a2c34ba7a Merge pull request #1403 from cbornet/retrofit_useless_import
Remove useless import
2015-10-16 19:12:35 +08:00
wing328
8c5991b793 Merge pull request #1372 from cbornet/retrofit_collectionformat
Add colllectionFormat support to retrofit
2015-10-16 18:50:59 +08:00
cbornet
3debd08a32 remove useless import 2015-10-16 12:47:25 +02:00
cbornet
92d1e8a1d9 use StringUtil to format csv 2015-10-16 12:21:45 +02:00
cbornet
71c5160739 add colllectionFormat support to retrofit
Fix #1364
2015-10-16 12:21:45 +02:00
Nadezhda Makarkina
3dd0b04fb9 Enums have been added to result file 2015-10-16 11:53:05 +03:00
Nadezhda Makarkina
04369ddfce Form parameters has been added to the html template 2015-10-16 10:33:56 +03:00
wing328
084e7f7199 Merge pull request #1380 from xhh/java-global-security
Apply global security to operations when necessary
2015-10-16 12:50:41 +08:00
wing328
ab026fdde3 Merge pull request #1393 from gwen15/genfix
REST client code generation bug fix proposal
2015-10-16 12:42:32 +08:00
xhh
e0dfc1b43d Ruby client: remove trailing slashes from base_url
Closes #1399
2015-10-16 12:02:30 +08:00
wing328
d5e2aea723 Merge pull request #1375 from xhh/issue-1308
Remove duplicate fields from sub-classes of the Java codegen
2015-10-16 12:02:25 +08:00
wing328
d2df310290 Merge pull request #1400 from testn/add-library
add library in the additional option
2015-10-16 12:00:28 +08:00
Nat Luengnaruemitchai
7db67aa192 add library in the additional option 2015-10-15 20:44:27 -07:00
xhh
a1fa0b0834 Rebuild Petstore samples 2015-10-16 10:47:00 +08:00
xhh
02a9fe2618 Add more test cases for global security 2015-10-16 10:30:26 +08:00
akkie
97a5a8922f Allow to disable SSL verification
This pull request adds the possibility to disable SSL verification for hosts using a self-signed SSL certificate
2015-10-15 16:07:35 +02:00
gwen15
0802f94d94 Bug fix: some character replacement where done on the local directories
names.

The dot character was replaced by the file separator on the whole paths,
not only on the package name based part.
2015-10-15 12:35:23 +02:00
gwen15
21eb406140 Fix default long value in java client code generation
The generated java code for a Long was "Long id=1;" which is not
compilable by javac because "1" is a primitive integer that cannot be
cast to a Long object. This fix generates now "Long id=1l;".
2015-10-15 12:35:16 +02:00
xhh
84928abd8d Merge branch 'master' into java-global-security 2015-10-15 17:57:27 +08:00
xhh
1c21730607 Log a warning on more than 1 security requirements 2015-10-15 17:56:38 +08:00
xhh
5a76a1b155 Fix tests regarding security 2015-10-15 16:51:43 +08:00
xhh
bc5a610567 Use the first security requirement from the array
According to swagger spec, "there is a logical OR between the security
requirements". The original behavior was to apply the security
requirements as the logic AND and skip security requirements that
include more that 1 security.
2015-10-15 15:17:30 +08:00
wing328
860b551e9b Merge pull request #1376 from xhh/java-util-model-package
[Java] Add a config option to use fully qualified name for java.util classes
2015-10-15 12:12:37 +08:00
wing328
22218cb132 Merge pull request #1378 from xhh/java-invalid-enum-name
[Java] Handle enum names starting with number in Java client
2015-10-15 10:51:03 +08:00
Nick Bruno
300a0dc82c Update retrofit library for changes to OAuth scope handling 2015-10-14 22:50:58 -04:00
wing328
3a66c0c710 Merge pull request #1384 from cbornet/retrofit_test_sample
Add retrofit to CI verified samples
2015-10-15 10:42:40 +08:00
xhh
a94384ca7f Merge branch 'master' into java-util-model-package 2015-10-15 10:38:19 +08:00
xhh
6d50ce6a77 Fix a typo 2015-10-15 10:34:45 +08:00
wing328
583493f5ca Merge pull request #1377 from cbornet/java_gradle_android
Add gradle files with android support to java templates
2015-10-15 10:28:28 +08:00
Nick Bruno
6cc17d8508 Add authorization scope data to CodegenSecurity, demo use in JAXRS 2015-10-14 22:07:43 -04:00
wing328
265b4b5945 Merge pull request #1385 from aersamkull/master
Updates to TypeScript Templates 2
2015-10-15 09:46:46 +08:00
xhh
65e63a8c52 Merge remote-tracking branch 'origin/master' into java-global-security 2015-10-14 20:42:20 +08:00
xhh
e4e77d03f5 Add test cases for global security 2015-10-14 20:40:10 +08:00
wing328
638bbfaf43 Merge pull request #1386 from swagger-api/revert-1370-global_consume
Revert "Add support for top-level consumes and produces"
2015-10-13 23:56:57 +08:00
wing328
0b4b5e8839 Revert "Add support for top-level consumes and produces" 2015-10-13 23:47:42 +08:00
wing328
c7b08bc112 Merge pull request #1373 from estiller/master
Fix bug in handling 204 "No Content" responses from the server in Android & Java generated clients
2015-10-13 22:47:47 +08:00
wing328
f1b0cf839a Merge pull request #1370 from wing328/global_consume
Add support for top-level consumes and produces
2015-10-13 22:35:33 +08:00
aersamkull
988de07c17 Fixes noImplicitAny Error 2015-10-13 13:32:01 +02:00
cbornet
f603efc419 add retrofit to CI verified samples 2015-10-13 12:18:32 +02:00
aersamkull
4e7d893a8e Updates to TypeScript Templates 2015-10-13 12:01:34 +02:00
xhh
1ef51e5ad7 Apply global security to operations when necessary
Closes #1365
2015-10-13 16:22:02 +08:00
xhh
17545e959a Handle enum names starting with number in Java client 2015-10-13 10:32:07 +08:00
cbornet
5ed52b3e1d add gradle files with android support 2015-10-12 16:16:38 +02:00
wing328
6ce09ee779 Update config option 2015-10-12 17:34:07 +08:00
xhh
7b1799f874 Merge branch 'master' into java-util-model-package
Conflicts:
	samples/client/petstore/java/default/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/java/default/src/main/java/io/swagger/client/api/StoreApi.java
	samples/client/petstore/java/default/src/main/java/io/swagger/client/api/UserApi.java
	samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Order.java
	samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Pet.java
2015-10-12 17:11:43 +08:00
xhh
43b3acf550 Remove duplicate fields from sub-classes of the Java codegen
Closes #1308
2015-10-12 17:07:17 +08:00
wing328
d162d48fa3 Merge pull request #1359 from wing328/better_exception_handling2
Better exception handling
2015-10-12 16:58:01 +08:00
Eran Stiller
e562b0ae34 Fix indentation 2015-10-12 09:52:20 +03:00
Eran Stiller
748460488a Regenerate only the ApiInvoker.java file in the sample 2015-10-12 09:25:24 +03:00
Eran Stiller
1fb2a97497 Revert "Regenerate Android-Java sample"
This reverts commit 15f5eae2a8.
2015-10-12 09:22:36 +03:00
Eran Stiller
15f5eae2a8 Regenerate Android-Java sample 2015-10-12 08:52:52 +03:00
Eran Stiller
6fd54d5285 Fix bug in handling 204 responses 2015-10-12 08:51:00 +03:00
wing328
00517a1ad3 remove unused operation in test json file 2015-10-10 23:27:21 +08:00
wing328
5cd01af350 fix typo in test cases 2015-10-10 23:22:42 +08:00
wing328
9ecb2e92ae restore sample files for objc, php and ruby 2015-10-10 23:13:26 +08:00
wing328
6cc5a32d40 update objc sample 2015-10-10 23:09:41 +08:00
wing328
64fd94262f add globalConsumesAndProduces.json 2015-10-10 22:54:13 +08:00
wing328
5144c54895 add test case for global consumes and produces 2015-10-10 22:47:24 +08:00
wing328
9311dcaccb update codegen to support global consumes and produces 2015-10-10 18:39:54 +08:00
Tony Tam
a5a6ae72c3 Merge pull request #1368 from ducin/badge-maven-central
maven central badge added
2015-10-09 09:38:50 -07:00
Tomasz Ducin
c31ed5a30d maven central badge added 2015-10-09 18:14:27 +02:00
xhh
aa0fbada07 Add a "fullJavaUtil" option to Java clients
to toggle whether to use full qualified name (with full package prefix)
for classes under java.util
2015-10-09 22:10:22 +08:00
xhh
ab34dc5697 Rebuild Java cilents of the Petstore sample 2015-10-09 22:10:21 +08:00
xhh
edf2642e73 Support model name like "List" in Java clients
Support generating model files with name like "List", "Map" and "Date"
by using full qualified names when using them from the java.util
package.
2015-10-09 22:10:21 +08:00
wing328
d95660aca1 Merge pull request #1340 from onnertech/ios-tweaks
[objc] Add casts that avoid method resolution errors for `count`
2015-10-09 16:44:54 +08:00
wing328
297f9e961c Merge pull request #1362 from cristiangarciascmspain/fix-OSX-Pom-TestNG
Add StartAttachListener that fixes #1330
2015-10-09 15:34:15 +08:00
wing328
42b716207f Merge pull request #1360 from wing328/nodejs_server_port
[NodeJS] update index.js to use the var serverPort
2015-10-09 11:32:01 +08:00
wing328
7d69107696 Merge pull request #1356 from arnested/deserialize-httpHeader
Deserialize httpHeader.
2015-10-09 11:31:24 +08:00
wing328
4d2fb1cc9a Merge pull request #1355 from arnested/usage-of-httpHeader-in-exceptions
Use HTTP headers from ApiException in PHP client.
2015-10-09 11:31:15 +08:00
cristiangarciascmspain
503ffd06d0 Add StartAttachListener that fixes #1330 2015-10-08 18:30:13 +02:00
wing328
725df15dd5 update sample for nodejs 2015-10-08 23:57:14 +08:00
wing328
8e9e3a6171 update nodejs to use the var serverport 2015-10-08 23:52:41 +08:00
wing328
6ee42bebe6 add exception handling for #1267 2015-10-08 23:38:09 +08:00
wing328
69a346cb57 remove python3 frmo all-petstore.sh 2015-10-08 23:38:09 +08:00
wing328
d451d4efb8 fix NPE when model's allof with no property 2015-10-08 23:38:09 +08:00
Arne Jørgensen
b7b8b527db Use HTTP headers from ApiException in PHP client.
The `$httpHeader` variable was not set when catching exceptions.

See also #1354.

Regenerated php-petstore sample.
2015-10-08 11:46:36 +02:00
Arne Jørgensen
3bd4502bbf Deserialize httpHeader.
See #1354.

Regenerated php-petstore sample.
2015-10-08 11:25:43 +02:00
Tony Tam
733e19c113 fixed NPE for objc client 2015-10-07 17:11:52 -07:00
wing328
735cae7b49 Merge pull request #1335 from wing328/html_remove_site_css
[HTML] remove site.css from html docs
2015-10-07 16:26:53 +08:00
wing328
3b36bbe97d Update README.mustache 2015-10-06 18:39:44 +08:00
wing328
228e039046 Merge pull request #1333 from wing328/csharp_fix_accept
[C#] better Accept header selection for C# API client
2015-10-06 18:26:02 +08:00
wing328
b27663e1ad Update README.md 2015-10-06 16:14:13 +08:00
wing328
eaddebe220 Update list of generator 2015-10-06 16:13:06 +08:00
wing328
f8485f26d3 Merge pull request #1317 from cbornet/online_options
Add options to online generator
2015-10-06 12:00:51 +08:00
Ches Martin
d9117480f8 [objc] Add casts that avoid method resolution errors
Because the `data` that we're deserializing is of type `id` (essentially
untyped), it's possible to have method resolution clashes without
explicitly casting here once we've parsed a type. I had this issue with
a pagination container model, for instance, which has a field named
`count` that conflicts with the property of the same name on `NSArray`
or `NSDictionary`.
2015-10-06 10:58:48 +07:00
wing328
7b79abef63 update c# sample 2015-10-06 11:33:00 +08:00
wing328
dbd89092f0 add accept header select to async method 2015-10-06 11:30:17 +08:00
wing328
6ed7663466 add remarks to csharp method 2015-10-06 11:28:18 +08:00
wing328
d882e9fe0a remove site.css from html docs 2015-10-05 22:33:25 +08:00
wing328
ea1c2809f7 Merge pull request #1329 from iushankin/issue-1304-part3
Fixed #1304: Migrate tests from the Scala to the plain Java. Part 3
2015-10-05 18:29:36 +08:00
wing328
3c78e29a12 better Accept header for C# 2015-10-05 13:19:58 +08:00
wing328
6cb4473526 Merge pull request #1328 from ducin/docs-toc
readme: Table of Contents
2015-10-05 00:05:32 +08:00
wing328
65a9c78544 Merge pull request #1319 from cbornet/online_version
Add version to swagger.json from pom's version
2015-10-04 23:57:16 +08:00
wing328
69911a1974 Merge pull request #1311 from xhh/java-okhttp-gson-ssl
Add some SSL options to Java okhttp-gson client
2015-10-04 23:02:25 +08:00
wing328
761029241e Merge pull request #1331 from qswinson/csharp_comments
Csharp comments
2015-10-03 10:31:44 +08:00
Quenby Mitchell
1018ca634d generic types need to be escaped for the xmldoc to work for return documentation. List<Foo> should be List{Foo} for the c# compiler to generate the documentation for the generic type. since there is not a spare parameter on the CodegenOperation model to put this correctly formatted documentation, for right now, don't include the return type in the documentation. 2015-10-02 13:11:54 -05:00
Quenby Mitchell
ff0b0c15a8 fix build warnings on CSharp xml comments 2015-10-02 12:14:41 -05:00
wing328
727c32f2a2 Merge pull request #1312 from iushankin/issue-1304
Issue #1304: Migrate tests from the Scala to the plain Java. Part 2
2015-10-02 23:50:37 +08:00
wing328
3c0eab65f3 Merge pull request #1323 from cbornet/fix_scopes_npe
Fix NPE in empty operation oauth scopes
2015-10-02 23:39:25 +08:00
wing328
a72ac99c91 Merge pull request #1316 from cbornet/dynamic_enum
Dynamically fill swagger enum from codegen client names
2015-10-02 23:37:15 +08:00
Ivan Ushankin
4b62a94350 Fixed #1304: Migrate tests from the Scala to the plain Java. Part 3 2015-10-02 16:20:16 +03:00
Tomasz Ducin
12d8f97aee improving ToC 2015-10-01 23:26:24 +02:00
Tomasz Ducin
acaf1b1cd0 added Table of Contents
Initial version of table of contents - showing all headers in the current shape.
2015-10-01 23:14:34 +02:00
cbornet
c1c3439b86 fix some wrong indentations 2015-10-01 17:42:33 +02:00
cbornet
5744bb4053 fix npe in empty operation scopes
Fix #1322
2015-10-01 17:35:07 +02:00
wing328
2711e375cc Merge pull request #1310 from wing328/fix_dynamic_html_parameter_name
[HTML] Fix parameter name in dynamic-html
2015-10-01 20:07:29 +08:00
cbornet
25abc15233 add version to swagger.json from pom's version
Fix #1314
2015-10-01 14:00:19 +02:00
cbornet
984b645ea1 add options to online generator
Fix #1313
2015-10-01 11:09:25 +02:00
wing328
253c46a0d5 Merge pull request #1309 from wing328/fix_springmvc_object
[SpringMVC] fix compilation error by removing import of Object
2015-10-01 10:02:20 +08:00
cbornet
7c431a8e11 dynamically fill swagger enum from codegen client names 2015-10-01 01:12:09 +02:00
Ivan Ushankin
3c98e32765 Issue #1304: Migrate tests from the Scala to the plain Java. Part 2 2015-09-30 17:38:01 +03:00
xhh
f483f934d8 Add some SSL options Java okhttp-gson client
* Add the `verifyingSsl` option to allow skipping verifying SSL
  certificate and host name (default to verify)
* Add `sslCaCert` to allow customizing the CA certificates
2015-09-30 19:48:18 +08:00
wing328
053af7a749 Merge pull request #1305 from iushankin/issue-1304
Fixed #1304: Migrate tests from the Scala to the plain Java. Part 1
2015-09-30 17:57:05 +08:00
wing328
d2d6ff661a fix parameter name in dynamic html 2015-09-30 17:24:11 +08:00
wing328
17bdd73891 fix springmvc by removing import of Object 2015-09-30 16:28:17 +08:00
Tony Tam
d9bfb884da Merge pull request #1307 from warnyul/master
Fix objc model inheritance.
2015-09-29 22:58:43 -07:00
Balázs Varga
19d8766363 Fix model inheritance. 2015-09-29 10:07:51 +02:00
wing328
e270fdcfd9 Merge pull request #1300 from geekerzp/python_client_cert
[Python] Support client certificate file and client key file in TLS/SSL
2015-09-29 14:50:11 +08:00
wing328
a2f47672e7 Merge pull request #1297 from geekerzp/objc_upload_file
[Objc] Add test case in objc client
2015-09-29 14:49:37 +08:00
wing328
90dc0a7bd8 Merge pull request #1302 from geekerzp/ruby_client_cert
[Ruby] Support client ceritficate in ruby client
2015-09-29 14:44:17 +08:00
Fredric Dorothy
2a679f798a Merge https://github.com/fdorothy/swagger-codegen 2015-09-28 11:52:30 -05:00
Fredric Dorothy
dbecb9e562 Added ability to set a configuration file for custom code generators. This should work the same as when you're using one of the built-in generators. 2015-09-28 11:50:08 -05:00
Ivan Ushankin
4db86003f5 Fixed #1304: Migrate tests from the Scala to the plain Java. Part 1 2015-09-28 19:03:02 +03:00
Tony Tam
d5cf2b6cfe made host dynamic for link generation 2015-09-28 08:51:39 -07:00
geekerzp
6a3108a6bf Support client ceritficate in ruby client 2015-09-28 16:31:47 +08:00
wing328
2ea3816e65 Merge pull request #1290 from geekerzp/model_name
[Python, Ruby] Fix issues in python and ruby clients
2015-09-28 08:35:28 +08:00
wing328
baca3027f4 Merge pull request #1298 from geekerzp/ruby_upload_file
[Ruby] Add test case in ruby client
2015-09-27 22:20:20 +08:00
wing328
0e9e2046e7 Merge pull request #1293 from xhh/fix-set-date-format
[Java jersey2]: Fix ApiClient.setDateFormat in Java jersey2 client
2015-09-27 21:48:53 +08:00
wing328
e301020acc Merge pull request #1295 from geekerzp/python_upload_file
[Python] Fix issue in python client
2015-09-27 21:48:29 +08:00
geekerzp
cf1f113852 Support client certificate file and client key file in TLS/SSL in python client 2015-09-26 16:16:59 +08:00
wing328
c26a387d9a Merge pull request #1271 from laurentvdl/master
implement form parameter support using Angular $httpParamSerializer
2015-09-26 09:37:40 +08:00
geekerzp
c70ca9d572 Add test case in ruby client 2015-09-25 17:33:39 +08:00
geekerzp
6bdfb8810c Add test case in objc client 2015-09-25 16:48:19 +08:00
wing328
2a5ab78056 Merge pull request #1296 from xhh/fix-enum-constructor
Fix hard-coded constructor name of enum class in Java okhttp-gson client
2015-09-25 16:34:13 +08:00
xhh
e5a4ef3ba0 Fix hard-coded constructor name of enum class
in Java okhttp-gson client
2015-09-25 15:52:52 +08:00
geekerzp
9b148be57e Fix issue in python client.
If upload only file it will not send file content.
2015-09-25 15:10:32 +08:00
wing328
0380fc5a35 Merge pull request #1274 from geekerzp/objc_log
[Objc] Update objc debug logging
2015-09-25 11:57:28 +08:00
xhh
597282742b Fix ApiClient.setDateFormat in Java jersey2 client 2015-09-24 21:56:50 +08:00
wing328
5e805c2be6 Merge pull request #1284 from acourtneybrown/master
Fixed method name in Java ApiClient mustache template
2015-09-24 16:39:46 +08:00
wing328
b080abeb01 Merge pull request #1280 from xhh/primitive-string-response
[Java] Support primitive string response in Java clients
2015-09-24 16:37:17 +08:00
geekerzp
2943f41cdd Update python and ruby clients.
Use `sanitizeName` to sanitize model name.
2015-09-24 16:29:20 +08:00
geekerzp
84e0df6115 Fixed issue that model name not camelized in python client and ruby client 2015-09-24 16:23:44 +08:00
wing328
a49826e4d7 Merge pull request #1289 from geekerzp/python_log
[Python] Update python log
2015-09-24 16:09:06 +08:00
wing328
b8792b6a71 Merge pull request #1276 from bedag/master
Better diagnostics when something goes wrong
2015-09-24 11:42:48 +08:00
wing328
5ee86b9816 Merge pull request #1264 from xhh/java-enum-improvements
[Java] Improvements on enum var name in Java client
2015-09-24 11:42:11 +08:00
geekerzp
e32272aedb Update log in python client 2015-09-24 10:54:24 +08:00
wing328
ee7f447f77 Merge pull request #1187 from Edubits/swift-2.0
[Swift] Update generated code to Swift 2.0
2015-09-24 10:51:05 +08:00
wing328
a5fb689615 Merge pull request #1260 from wing328/remove_python3_generator
[Python] remove python3 generator
2015-09-24 10:50:47 +08:00
geekerzp
a26cf60a22 Revert "Revert "[Python] Fix issue in python client""
This reverts commit c59e2b88b1.
2015-09-24 10:08:16 +08:00
wing328
ed13d7b1b8 Merge pull request #1288 from swagger-api/revert-1281-python_log
Revert "[Python] Fix issue in python client"
2015-09-24 09:41:18 +08:00
wing328
c59e2b88b1 Revert "[Python] Fix issue in python client" 2015-09-24 09:30:49 +08:00
wing328
e8d40a146c Merge pull request #1281 from geekerzp/python_log
[Python] Fix issue in python client
2015-09-24 09:27:00 +08:00
Adam Brown
4ef69794a3 Fixed method name in Java ApiClient mustache template 2015-09-23 14:16:26 -07:00
geekerzp
30fbdd4d05 Add class prefix to macro DebugLog in objc client 2015-09-23 17:18:07 +08:00
geekerzp
13c079342e Fixed issue #1262 2015-09-23 14:55:46 +08:00
xhh
a284bb7a51 Rebuild Java clients of the Petstore sample 2015-09-23 13:31:28 +08:00
xhh
44bbe301cb Support primitive string response in Java clients 2015-09-23 12:50:38 +08:00
wing328
69f8274287 Merge pull request #1272 from wing328/add_cli_parameter_order
Add CLI option to sort method arguments
2015-09-23 09:47:00 +08:00
wing328
770ea9d12e Merge pull request #1270 from xhh/php-sanitize-model-name
Fix #1145: sanitize model name in PHP client
2015-09-23 09:44:38 +08:00
wing328
d09d8bb495 Merge pull request #1269 from efossier/expose-readonly-to-template
Expose readOnly attribute on model properties to templates
2015-09-23 09:29:49 +08:00
wing328
85f99934c8 Merge pull request #1256 from cbornet/java_retrofit_lib
Set retrofit as a java library
2015-09-23 09:12:07 +08:00
Adrian Moos
66dee928d2 consistent indentation (spaces, not tabs) 2015-09-22 18:08:47 +02:00
Adrian Moos
d4a94fbf52 - DefaultGenerator now communicates failures by throwing exceptions
rather than setting a status flag in a public field
- DefaultGenerator now decorates exceptions to record where a failure
occured (which api, model or operation?)
- CodeGenMojo now propagates this exception to maven to abort the build
2015-09-22 18:01:29 +02:00
geekerzp
844cae75b7 Update debug logging in objc client 2015-09-22 16:32:15 +08:00
wing328
4e4e9e7893 add a CLI option to sort method argument 2015-09-22 15:57:22 +08:00
Laurent Van der Linden
61690d625f change the constructor signature to be backwards compatible
update petstore samples for angular and node
2015-09-22 09:20:52 +02:00
Laurent Van der Linden
1cd8141645 implement form parameter support using Angular $httpParamSerializer 2015-09-22 08:37:49 +02:00
wing328
98ff2d231f Merge pull request #1261 from wing328/typescript-node-fix-param-name
[TypeScript] fix parameter name for typescript-node using baseName
2015-09-22 14:22:07 +08:00
xhh
09add2d871 Fix test failure by allowing backslash in model name 2015-09-22 14:03:27 +08:00
xhh
9cbf2d3707 Fix #1145: sanitize model name in PHP client 2015-09-22 11:33:11 +08:00
geekerzp
0622838947 Fixed issues about logging in objc client 2015-09-22 09:29:48 +08:00
Evan Fossier
a6df340cdc Expose readOnly attribute on model properties to templates, can now use isReadOnly property in model templates 2015-09-21 17:34:23 -07:00
xhh
bcbf9c54c7 Remove unnecessary checking of empty string 2015-09-21 18:14:57 +08:00
xhh
6dcaa890cf Improvements on enum var name in Java client
* Place each enum var in a separate line
* Truncate common prefix when present
2015-09-21 17:29:26 +08:00
wing328
2b06a81a52 remove extra line break in typescript-node sample code 2015-09-20 23:17:04 +08:00
wing328
956624f1a4 remove extra line break for typescript-node 2015-09-20 23:15:02 +08:00
wing328
b1728aed7c update sample for typescript-node 2015-09-20 23:11:46 +08:00
wing328
8733be9ac9 update sample, fix formData basename 2015-09-20 23:06:29 +08:00
wing328
c203854254 fix parameter name for typescript-node using baseName 2015-09-20 22:59:56 +08:00
wing328
3dc3af8d18 remove python3 generator 2015-09-20 22:43:43 +08:00
wing328
cbc2fb237d Merge pull request #1252 from seanbright/model-with-no-props
Fix NPE in JavaClientCodegen when model has no properties of its own
2015-09-20 21:57:05 +08:00
wing328
b7d64d1352 Merge pull request #1254 from GoodTRKR/master
[Obj-C] removed extraneous logs unless logging is specifically enabled in the [SWGConfiguration sharedConfig] instance
2015-09-19 01:04:10 +08:00
cbornet
047b06ac84 remove retrofit codegen from config 2015-09-18 15:03:55 +02:00
cbornet
f29f5d6f13 fix error with formParams in async ops 2015-09-18 14:45:37 +02:00
cbornet
1863aca0fa set retrofit as a java library
Fix #1247
Fix #1248
2015-09-18 14:21:48 +02:00
wing328
cf300c09da Merge pull request #1246 from laurentvdl/patch
Use the baseName when referring to path and query parameters.
2015-09-18 16:46:46 +08:00
wing328
27ab9c2e57 Merge pull request #1238 from DariusMR/master
unicode type forgotten in api_client.mustache for python
2015-09-18 16:44:35 +08:00
Laurent Van der Linden
c83c564a19 Use the baseName when referring to header parameters. 2015-09-18 08:05:13 +02:00
wing328
8978a0a906 Merge pull request #1242 from xhh/options-http-method
[Java okhttp-gson] Support the "OPTIONS"  HTTP method
2015-09-18 10:47:27 +08:00
wing328
6d21422bad Merge pull request #1245 from geekerzp/objc_ssl
[Objc] Enhancements of objc client
2015-09-18 10:45:43 +08:00
Matthew Davis
65cfa735d5 [Obj-C] removed extraneous logs unless logging is specifically enabled in the [SWGConfiguration sharedConfig] instance 2015-09-17 17:39:26 -07:00
Sean Bright
e2ce427fb1 Fix NPE in JavaClientCodegen when model has no properties of its own
A model that inherits from another model and does not add its own properties
causes JavaClientCodegen to crash silently with an NPE.

Fixes #1141
2015-09-17 14:35:07 -04:00
Laurent Van der Linden
781458b0d1 Use the baseName when referring to path and query parameters. 2015-09-17 12:46:20 +02:00
DariusM
65f86dbb0f unicode type forgotten in api_client.mustache for python2, works also with python3 2015-09-17 10:31:40 +02:00
DariusM
cc1c495ea5 unicode type forgotten in api_client.mustache 2015-09-17 10:26:08 +02:00
geekerzp
261ae79528 Remove space from parameterToString in objc client 2015-09-17 15:59:03 +08:00
geekerzp
fb14585adf Add parameterToString method 2015-09-17 15:20:11 +08:00
wing328
27e434d786 Merge pull request #1239 from ePaul/feature/use-baseName-for-jsonproperty
Use the swagger property names in all Java models.
2015-09-17 14:43:21 +08:00
wing328
2a37c48e12 Merge pull request #1243 from process/patch-1
[DOC] fix typo in Python api_client template
2015-09-17 14:42:45 +08:00
Justin Chines
85df7c8ed7 [DOC] fix typo in Python api_client template 2015-09-16 22:09:01 -07:00
wing328
b3ca9cdbe0 Merge pull request #1154 from cbornet/retrofit_oauth
[Retrofit] add authorizations to retrofit client
2015-09-17 11:47:06 +08:00
xhh
477d5c40d9 Rebuild Java okhttp-gson client of Petstore sample 2015-09-17 10:22:53 +08:00
xhh
460c8caa8a Support OPTIONS in Java okhttp-gson client 2015-09-17 10:22:53 +08:00
wing328
53e13aee19 Merge pull request #1234 from geekerzp/python_http_verb
[Python] Enhancements http verbs of python client
2015-09-16 22:32:58 +08:00
wing328
ec05dc4414 Merge pull request #1236 from wing328/springmvc_file_upload
[SpringMVC] Replaced hard-coded fileDetail with {{baseName}}
2015-09-16 18:17:12 +08:00
Paul Ebermann
7eec769654 Use the swagger property names in all Java models.
This changes `@JsonProperty({{name}})` to `@JsonProperty({{baseName}})` in model.mustache for JavaInflector, JavaJaxRS and JavaSpringMVC.
In pull request #535 this was already done for the plain Java files (which get used on client side).

This replaces the sanitized names in the generated code by the original property names from the swagger document.
2015-09-16 11:36:51 +02:00
wing328
f483b8dfa8 Merge pull request #1233 from geekerzp/ruby-apiclient
Fix issue that using temp_folder_path from ApiClient in ruby client
2015-09-15 22:28:54 +08:00
wing328
2ac41ff080 repalced hard-coded fileDetail with {{baseName}} 2015-09-15 22:14:13 +08:00
geekerzp
ade61c0701 Support http body in OPTIONS request in python client 2015-09-15 17:48:59 +08:00
geekerzp
bd63c1d9d9 Support OPTIONS http verb in python client. 2015-09-15 16:40:23 +08:00
geekerzp
5d1e70544c Fix issue that using temp_folder_path from ApiClient
It should use the one from the Configuration object
2015-09-15 15:04:39 +08:00
wing328
349702adf9 Merge pull request #1232 from geekerzp/python_issue
Fix issue in python client
2015-09-15 12:14:49 +08:00
wing328
88410635b3 Merge pull request #1228 from geekerzp/objc_ssl
Objc client ssl verification
2015-09-15 10:14:20 +08:00
geekerzp
0262d3c8d2 Fix issue #1230 2015-09-15 09:57:55 +08:00
wing328
96f4a3ab71 Merge pull request #1226 from xhh/java-okhttp-gson-file-downloading
[Java okhttp-gson] Add support of file downloading
2015-09-14 22:09:48 +08:00
geekerzp
b0063d9e9f Objc client ssl verification 2015-09-14 18:29:49 +08:00
wing328
48bd888483 Merge pull request #1222 from madhukard/master
Java: Support List of Enums in postProcessModels
2015-09-14 01:21:34 +08:00
wing328
1358e33bf6 Merge pull request #1223 from GoodTRKR/master
[Obj-C] Fixed an issue where NSNumber parameters would cause a crash in multipart/form-data upload endpoints
2015-09-14 00:28:43 +08:00
wing328
c8edacb25c Merge pull request #1225 from wing328/fix_getHasXXXParam
Fix getHasXxxParam in CodegenOperation
2015-09-13 22:15:50 +08:00
wing328
47dc4d7642 Merge pull request #1218 from wing328/csharp_fix_map_string
[C#] update map to use String instead of string
2015-09-13 22:15:22 +08:00
xhh
1ecb8a74c1 Allow customizing temp folder for file downloading 2015-09-13 21:02:22 +08:00
xhh
967c574f5b Support file downloading in Java okhttp-gson client 2015-09-13 18:41:53 +08:00
wing328
8bb8a7a79a fix getHasXxxParam 2015-09-12 16:00:10 +08:00
Matthew Davis
1268b0627f added NSNumber catch to pathParams as well 2015-09-11 17:33:36 -07:00
Matthew Davis
761f172c2f forgot an 'else' statement 2015-09-11 17:27:25 -07:00
Matthew Davis
1321d5f9a5 [Obj-C] Fixed an issue where NSNumber parameters would cause a crash in multipart/form-data upload endpoints 2015-09-11 17:23:48 -07:00
Madhukar Devaraju
35f462f571 Java: Support List of Enums in postProcessModels 2015-09-11 14:56:37 -07:00
wing328
f21fa08cd6 update C# ParamterToString to support array of object, add test case 2015-09-11 22:48:38 +08:00
wing328
16afd4ee9b update map to use String instead of string 2015-09-11 18:02:51 +08:00
wing328
46f78f2180 Merge pull request #1215 from xhh/java-last-resp-info
[Java jersey2 okhttp-gson] Fix compilation error, record status code and response headers of last request
2015-09-11 16:05:09 +08:00
xhh
2e402bba97 Rebuild Java clients for the petstore sample 2015-09-11 13:22:37 +08:00
xhh
34f196a144 Java-okhttp-gson: allow access to status code and response headers of last (async) request 2015-09-11 13:22:37 +08:00
xhh
def3f5b3fb Java-jersey2: record status code and response headers of last request 2015-09-11 13:22:37 +08:00
xhh
60e5a34534 Update Java-jersey2 client to skip binary support
Binary parameter/response support was added to the default Java client
codegen which changed the signature of the `invokeAPI` method in
"api.mustache", causing the "jersey2" client fail to compile.
Here an separate version of `api.mustache` is added for "jersey2" client
which does not handle binary support (for now).
2015-09-11 13:22:37 +08:00
wing328
1eed90f34e Merge pull request #1214 from GoodTRKR/master
[Obj-C] Fixed an issue with incorrect references in the ApiClient when using a custom prefix.
2015-09-11 09:30:58 +08:00
wing328
e34063f0f2 Merge pull request #1213 from LeoYReyes/patch-1
[C#] Api.mustache - Remove the parameter in the BasePath getter
2015-09-11 08:41:08 +08:00
Matthew Davis
dbdcf34044 [Obj-C] Fixed an issue with incorrect references in the ApiClient when using a custom prefix. 2015-09-10 15:14:53 -07:00
Leo
43d71ed10c Remove the parameter in the BasePath getter
The parameter in the BasePath getter is not needed.
2015-09-10 12:17:23 -05:00
wing328
b3db24ead6 Merge pull request #1210 from arnested/missing-head-and-options-in-php-client
Add HEAD and OPTIONS support in PHP client.
2015-09-10 22:07:31 +08:00
wing328
d21c6f2b45 Merge pull request #1205 from wing328/SLF4J_warning
update pom.xml to remove warning
2015-09-10 21:52:45 +08:00
Arne Jørgensen
3c3762fd92 Add HEAD and OPTIONS support in PHP client.
The generated PHP client didn't support the HEAD and OPTIONS methods.

Followup on #1156 and #1201.
2015-09-10 14:55:49 +02:00
Robin Eggenkamp
0edbfeff15 Bump Alamofire version to final 2.0.0 2015-09-10 14:24:55 +02:00
Ron
4b539a9d6e Merge pull request #1206 from wing328/fix_sinatra_type
[Sinatra] fix sinatra type (tag)
2015-09-09 15:59:22 +03:00
wing328
71a3218bb3 fix sinatra type (tag) 2015-09-09 20:27:59 +08:00
wing328
d37cf6595a update pom.xml to get rid of the warning 2015-09-09 16:20:17 +08:00
wing328
1bac705876 Merge pull request #1200 from wing328/dart_permission
[Dart] update dart-petstore.sh permission
2015-09-08 22:28:12 +08:00
wing328
3385082e2c Merge pull request #1201 from arnested/missing-head
Fix HEAD path item is missing.
2015-09-08 22:28:03 +08:00
wing328
2b1a63a7de Merge pull request #1150 from ePaul/bugfix/1146-escape-line-breaks-in-response-description
jaxrs: escape line breaks in response description
2015-09-08 21:38:50 +08:00
wing328
93847d8dc7 Merge pull request #1149 from ePaul/feature/1146-do-not-escape-javadocs
jaxrs (and other Java generators): do not escape newlines in generated javadocs.
2015-09-08 21:17:14 +08:00
Arne Jørgensen
3514bf14b3 Fix HEAD path item is missing.
Fixes #1156.
2015-09-08 10:00:17 +02:00
wing328
e215a1c87f update dart permission 2015-09-08 11:38:01 +08:00
wing328
5bcd8fb207 Merge pull request #1199 from xhh/java-okhttp-gson
[Java okhttp-gson, Android] Set source and target compatibility to 1.7 in build.gradle
2015-09-08 11:31:38 +08:00
wing328
a8f7708789 Merge pull request #1198 from yissachar/dart
Add Dart support
2015-09-08 09:18:51 +08:00
wing328
26c0bfef7d Merge pull request #1196 from wing328/typescript_basepath
[TypeScript] Fix base path
2015-09-07 21:57:23 +08:00
wing328
12190e0900 Merge pull request #1172 from xhh/ruby-apiclient
[Ruby] Implement API client structure for Ruby client
2015-09-07 21:56:59 +08:00
wing328
f340a389e9 Merge pull request #1182 from Helmsdown/cli-enhancements-2
Refactor codegen to support an "uber" meta model for user defined values
2015-09-07 21:55:50 +08:00
xhh
8b96cdb7d7 Set source/target compatibility in Android client 2015-09-07 16:35:34 +08:00
xhh
90307cafc6 Merge branch 'master' into java-okhttp-gson 2015-09-07 15:33:18 +08:00
Yissachar Radcliffe
58c5ecf13c Generate auth files to correct location 2015-09-06 19:58:28 -04:00
Yissachar Radcliffe
e72a53448e Add Dart support 2015-09-06 18:35:29 -04:00
wing328
90b89c6189 fix typescript basepath 2015-09-05 16:48:00 +08:00
wing328
ee1febcd95 Merge pull request #1188 from wing328/master
[NodeJS] fixed HTML-escaped description on nodejs json files
2015-09-05 15:44:16 +08:00
russellb337
6c079e95d9 Merge remote-tracking branch 'upstream/master' into cli-enhancements-2 2015-09-04 15:25:10 -07:00
russellb337
d22398eb73 put all values into dynamic properties map 2015-09-04 15:24:36 -07:00
wing328
30228dcca5 Merge pull request #1192 from SparrowJang/master
Python - response is empty object
2015-09-04 22:42:39 +08:00
wing328
2e30a3af27 Merge pull request #1189 from mad102190/feature/objc-response-headers
[Obj-C] Added ability to access HTTP Response headers
2015-09-04 16:42:25 +08:00
wing328
212d240316 Merge pull request #1190 from mad102190/fixes/objc-podspec-generation
[Obj-C][Cocoapods] Added extra CLI options to generate a valid podspec file.
2015-09-04 16:36:17 +08:00
sparrow.jang
ba701be2f2 fixed a empty object for response 2015-09-04 15:20:34 +08:00
SparrowJang
f6d624be2a Merge pull request #2 from swagger-api/master
merge
2015-09-04 14:25:34 +08:00
Matthew Davis
f705e03fc4 changes to podspec.mustache to accept new params 2015-09-03 13:02:24 -07:00
Matthew Davis
75bb59572a added extra CLI options required to generate a valid (lint-able) podspec file. 2015-09-03 12:54:25 -07:00
Matthew Davis
f067b86fa0 re-built sample objc-petstore 2015-09-03 12:31:30 -07:00
Matthew Davis
2822e9ea38 added support for retrieving HTTP response headers in obj-c. Also added a +sharedAPI class method for easy initialization of an API class without passing headers 2015-09-03 12:18:00 -07:00
russellb337
435ce7b9d5 make JsonAnySetter for dynamic properties "builder" style 2015-09-03 10:16:44 -07:00
russellb337
ab6118afe4 update default generator to skip generation of models that have import mappings defined 2015-09-03 08:24:33 -07:00
wing328
8ce06fc898 fix HTML-escaped description on nodejs json files 2015-09-03 22:38:19 +08:00
wing328
9e8e5db7b3 Merge pull request #1180 from ist-ltd/master
Support dots in output folder for C# generator
2015-09-03 22:26:38 +08:00
russellb337
44b5c22cd4 Merge remote-tracking branch 'upstream/master' into cli-enhancements-2 2015-09-02 09:28:58 -07:00
russellb337
6d7557971b switch Generate to use CodegenConfigurator 2015-09-02 09:28:40 -07:00
Cameron
9af16c0d79 Support dots in output folder for C# generator 2015-09-02 13:36:35 +01:00
xhh
027e4c5a20 Set source and target compatibility to 1.7
in build.gradle to make it work with Android
2015-09-02 18:35:58 +08:00
wing328
c56d807a15 Merge pull request #1169 from boazsapir/master
Handle correctly the case of no default response (see comment in #1124)
2015-09-02 18:03:02 +08:00
wing328
7d4ba27e01 Merge pull request #1162 from xhh/java-okhttp-gson
[Java] Add a new library template: okhttp-gson
2015-09-02 16:21:39 +08:00
Tony Tam
c8ed2b0d50 Merge pull request #1175 from swagger-api/feature/issue-1173
formatting, vendor extensions on operations
2015-09-02 00:02:20 -07:00
Tony Tam
1520ec536e formatting, vendor extensions on operations 2015-09-01 23:34:29 -07:00
Tony Tam
e434380eae Merge pull request #1174 from swagger-api/feature/issue-1173
Feature/issue 1173
2015-09-01 23:16:13 -07:00
Tony Tam
5940f46f56 added vendor extensions on parameters per #1173 2015-09-01 23:04:33 -07:00
xhh
7c60e2097f Update API client initialization in Ruby test 2015-09-02 12:00:27 +08:00
xhh
fc7cffbab7 Merge branch 'master' into ruby-apiclient
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java
2015-09-02 11:46:53 +08:00
Tony Tam
b099d1e7a2 added configuration to superclass for overriding param reordering for #1171 2015-09-01 15:53:58 -07:00
b_sapir
31e8aca357 Handle correctly the case of no default response (see comment in #1124) 2015-09-01 18:26:15 +03:00
wing328
d746894ecb Merge pull request #1168 from xhh/bug-enum-constructor
Fix bug of hard-coded enum name in Java client
2015-09-01 22:56:04 +08:00
xhh
2c64e0893b Fix bug of hard-coded enum name in Java client 2015-09-01 20:06:44 +08:00
xhh
3c79a692aa Use a separate library for base64-encoding in the okhttp-gson template 2015-09-01 19:56:06 +08:00
wing328
72255286b3 Merge pull request #1144 from ePaul/bugfix/1143-add-nullcheck-for-allowedvalues
Add null check to fix issue #1143
2015-09-01 11:54:22 +08:00
xhh
3112e4ad06 Add build files for Gradle and SBT 2015-09-01 11:20:44 +08:00
russellb337
38b1e1aad7 Merge branch 'master' into cli-enhancements-2 2015-08-31 15:20:17 -07:00
wing328
dfb87abe3a Merge pull request #1151 from ePaul/feature/1146-trim-whitespaces-before-escaping
trim strings before escaping
2015-08-31 22:21:38 +08:00
wing328
b96fdb6766 Merge pull request #1164 from ePaul/bugfix/1142-sanitize-api-name-for-spring-mvc
Issue #1142: sanitize api name before camelizing.
2015-08-31 21:46:25 +08:00
wing328
369ceb634d Merge pull request #1163 from ePaul/bugfix/1142-sanitize-file-name-for-models
Issue #1142: sanitize the class name for Java model classes.
2015-08-31 21:44:28 +08:00
Paul Ebermann
92f9b33eb6 Issue #1142: sanitize api name before camelizing.
This builds on #1139 in order to solve another part of #1142:
When the first component of a path contained a dash, the generated class name contained this dash too (for the "language" spring-mvc).
2015-08-31 15:14:54 +02:00
Robin Eggenkamp
5b12379a07 Add missing NSDateFormatter 2015-08-31 15:04:37 +02:00
Robin Eggenkamp
39b4034958 Replace NSError by ErrorType 2015-08-31 15:03:56 +02:00
Robin Eggenkamp
28030cba19 Merge branch 'master' into swift-2.0
Conflicts:
	modules/swagger-codegen/src/main/resources/swift/APIs.mustache
	modules/swagger-codegen/src/main/resources/swift/AlamofireImplementations.mustache
	modules/swagger-codegen/src/main/resources/swift/Cartfile.mustache
	modules/swagger-codegen/src/main/resources/swift/Models.mustache
	modules/swagger-codegen/src/main/resources/swift/Podspec.mustache
	modules/swagger-codegen/src/main/resources/swift/api.mustache
2015-08-31 14:41:41 +02:00
Paul Ebermann
e0679c0b14 Issue #1142: sanitize the class name for Java model classes.
This builds on #1139, calling the new sanitizeName() method before camelizing it when generating model names.
2015-08-31 14:13:48 +02:00
xhh
2fd8b8ff16 Update help text of config options in README 2015-08-31 20:10:29 +08:00
xhh
e35be1bd40 Generate Java petstore sample for okhttp-gson 2015-08-31 19:59:17 +08:00
wing328
39ac64d24a Merge pull request #1161 from wing328/upgrade_JMockit
Upgrade JMockit to 1.19
2015-08-31 18:55:38 +08:00
wing328
b846fa5c3e update JMockit to 1.19 2015-08-31 18:44:01 +08:00
xhh
3c84847adb Add a new library template to Java client: okhttp-gson
which uses OkHttp as HTTP library and Gson as JSON processing library
2015-08-31 18:42:09 +08:00
wing328
2b48ec072c Merge pull request #1153 from wing328/csharp_fix_encode
[C#] Fix UrlEncode in API client
2015-08-31 12:42:48 +08:00
wing328
8114c416b9 Merge pull request #1139 from wing328/sanitize_name
Add function to sanitize name (1)
2015-08-30 22:46:58 +08:00
wing328
adee62da7d Merge pull request #1138 from Helmsdown/cli-enhancements
Expose more configuration items in the CLI
2015-08-30 22:46:25 +08:00
cbornet
a207251b29 minor changes
removed gson version in pom and added a space between the parameters
2015-08-29 18:41:16 +02:00
cbornet
265de9654b add authorizations to retrofit client
added basic auth, api key and oauth support to the service generator using okhttp interceptors

Fix #962
2015-08-29 18:14:33 +02:00
wing328
177436e69c fix decode with encode 2015-08-29 22:43:22 +08:00
wing328
1331484a0f fix urlencode in apiclient 2015-08-29 22:39:44 +08:00
geekerzp
4477009ef8 Handle special characters in parameter names in ruby client 2015-08-29 16:19:43 +08:00
Paul Ebermann
930c5191e0 Issue #1146: trim string before escaping
This removes leading and trailing whitespace before escaping strings. This gets rid of annoying `\n` in some string literals (e.g. in annotations).
2015-08-28 19:56:37 +02:00
russellb337
5f811f3ba7 merge from upstream/master 2015-08-28 10:47:08 -07:00
Paul Ebermann
74bffbaadb Issue #1146: fix indentation in the generated API file. 2015-08-28 19:41:32 +02:00
Paul Ebermann
cdd104d3fb Issue #1146: escape the response description.
This prevents line breaks in string literals, which are not allowed in Java.
2015-08-28 19:39:01 +02:00
Paul Ebermann
be84f03d14 Issue #1146: do not escape newlines in generated javadocs.
For this, we add a property `unescapedDescription` to CodegenModel + CodegenProperty, and use them for the Javadoc generation, while the annotation uses the escaped `description`.
2015-08-28 18:40:14 +02:00
wing328
28579cee03 Merge pull request #1135 from restlet/fix/nodejs_server_swagger_invalid_json
[Node.js] fix invalid JSON being generated in swagger.json
2015-08-28 18:31:39 +08:00
Paul Ebermann
32ffab4519 fix issue #1143: add another null check.
The problem was trying to iterate over a null list.
2015-08-28 11:39:45 +02:00
wing328
e3c6cc3220 Merge pull request #1121 from Edubits/prevent-NPE
Fix possible NullPointerException
2015-08-28 16:05:20 +08:00
wing328
84346c0ba6 Merge pull request #1122 from F481/master
added some useful log/output messages and exception handling
2015-08-28 15:53:35 +08:00
russellb337
acbf3d3cc5 comment twak 2015-08-27 15:59:10 -07:00
russellb337
5c74146879 a few tweaks 2015-08-27 15:56:58 -07:00
russellb337
a59c128f90 curse you github desktop client for not refreshing when i want you to 2015-08-27 15:40:56 -07:00
russellb337
810bf58c3a first draft of CodegenConfigurator 2015-08-27 15:40:33 -07:00
russellb337
724683fab0 Merge branch 'master' into cli-enhancements 2015-08-27 10:18:55 -07:00
russellb337
074ba1ea54 undo some of the debugging changes I made 2015-08-27 09:11:49 -07:00
wing328
9e5de7da5e Merge pull request #1132 from geekerzp/python-configuration
[Python] Add option `verify_ssl` to switch SSL/TLS verification
2015-08-27 17:01:29 +08:00
wing328
50f6067831 add a case to handle space in name 2015-08-27 16:47:41 +08:00
wing328
9453967815 add function to sanitize name 2015-08-27 16:14:07 +08:00
F481
fc4fce3731 write processOperation debug output only if the debugOperations property is set 2015-08-27 08:06:24 +02:00
russellb337
d31013d977 remove reflections from parent pom 2015-08-26 18:50:29 -07:00
russellb337
ccf0cc8375 whoops, didn't mean to upgrade the minor version 2015-08-26 18:35:22 -07:00
russellb337
99ed012fc6 trying a new version of jetty 2015-08-26 18:31:29 -07:00
russellb337
8ba4a6d7ad downgrade reflections version
I’m guessing
2015-08-26 18:25:23 -07:00
russellb337
60fddcf378 adding back imports that somewhere got deleted during reformatting 2015-08-26 17:55:02 -07:00
russellb337
cf5982d2c4 remove class comment 2015-08-26 17:51:19 -07:00
russellb337
1378976d37 merging upstream changes 2015-08-26 17:40:49 -07:00
russellb337
e5811ebdc7 expose more generate options in the cli 2015-08-26 17:38:51 -07:00
Hugo Wood
d434b7c440 fix invalid JSON being generated in swagger.json of Node.js server 2015-08-26 17:34:53 +02:00
wing328
8de9e23814 Merge pull request #1131 from wing328/csharp_fix_compilebat
[C#] fix invokerPackage with packageName in compile.mustache
2015-08-26 17:30:07 +08:00
wing328
b35a7b696e Merge pull request #1127 from ivanmartinvalle/master
Add status code and response headers of the last request to java and c#
2015-08-26 17:27:34 +08:00
wing328
587028efd1 Merge pull request #1129 from geekerzp/objc-test
[Objc] Add test cases for sanitizeForSerialization method in objc client
2015-08-26 17:02:55 +08:00
wing328
af8d61cc02 Merge pull request #1130 from geekerzp/python-test
[Python] Add test cases for sanitize_for_serialization method in python client
2015-08-26 16:46:42 +08:00
wing328
1996aa9244 Merge pull request #1126 from xhh/java-enum-refactor
[Java] Support special characters in enum values
2015-08-26 16:41:56 +08:00
wing328
f79f8895c5 Merge pull request #1125 from wing328/php_param_name
[PHP] add camelCase support for variable naming
2015-08-26 09:49:08 +08:00
geekerzp
b3d28f07f1 Add option verify_ssl to switch SSL/TLS verification. 2015-08-25 17:58:14 +08:00
wing328
570a595ffb fix invokerPackage with packageName in compile.mustache 2015-08-25 15:35:22 +08:00
geekerzp
568b7a4fcd Add test cases for sanitize_for_serialization method in python client. 2015-08-25 15:04:46 +08:00
geekerzp
1b2f491b0e Add tese case for sanitizing array of models in objc client. 2015-08-25 11:16:19 +08:00
geekerzp
eb21963fa5 Update test case testSanitizeForSerialization in objc client. 2015-08-25 10:51:03 +08:00
geekerzp
ab5483cd04 Add test cases for sanitizeForSerialization method in objc client. 2015-08-25 09:54:30 +08:00
Tony Tam
392e5172b5 changed default behavior for inflector to have unimplemented handlers 2015-08-24 17:26:26 -07:00
ivanmartinvalle
52dc7e210c Add status code and response headers of the last request to java and csharp templates per #990 2015-08-24 18:35:06 -05:00
Tony Tam
15e336b90a Merge pull request #1123 from wing328/python_typo
[Python] better wording for documentation
2015-08-24 07:18:42 -07:00
Tony Tam
698ed970dc Merge pull request #1124 from boazsapir/binary
support binary input and output
2015-08-24 07:16:29 -07:00
wing328
a43d2163a0 add camelCase support for php variable naming 2015-08-24 21:53:28 +08:00
b_sapir
564dffa7e8 Merge remote-tracking branch 'origin/binary' into binary
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
	modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache
	modules/swagger-codegen/src/main/resources/Java/api.mustache
2015-08-24 16:15:18 +03:00
wing328
68f61d9a37 use snake_case instead of under_score 2015-08-24 21:11:52 +08:00
wing328
a7c08e680c update python samples 2015-08-24 21:08:21 +08:00
wing328
2251a2f892 fix typo, update documentation for python lib 2015-08-24 21:08:21 +08:00
b_sapir
b0c776bbea Support binary input and output - fix some merge problems 2015-08-24 15:59:58 +03:00
F481
3d89399b58 fixed syntax error 2015-08-24 14:28:13 +02:00
F481
0261121d78 added some useful log/output messages and exception handling 2015-08-24 14:04:50 +02:00
b_sapir
c177cf75d2 Support binary input and output (for body parameters or responses with type "string" and format "binary". Implemented for Java. 2015-08-24 15:04:10 +03:00
b_sapir
d4b4fe4b47 Support binary input and output (for body parameters or responses with type "string" and format "binary". Implemented for Java. 2015-08-24 14:33:15 +03:00
Robin Eggenkamp
e956495665 [Swift] Update to new Swift 2.0 syntax and Xcode 7
Note: configs with responseAs: “PromiseKit” won’t work yet
2015-08-24 12:27:33 +02:00
xhh
8408a97aef Java: Support special characters in enum values
and use upper case for enum names

Conflicts:
	samples/client/petstore/java/default/src/main/java/io/swagger/client/JSON.java
	samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Order.java
	samples/client/petstore/java/default/src/main/java/io/swagger/client/model/Pet.java
2015-08-24 18:21:16 +08:00
Robin Eggenkamp
b3afbe73b9 [Swift] Add missing checks for usePromiseKit 2015-08-24 12:20:34 +02:00
Robin Eggenkamp
85aabbe810 Fix possible NullPointerException
getWrapped() returns a Boolean which can be null
2015-08-24 12:09:14 +02:00
Ron
3f8dbf416d Update README.md 2015-08-24 11:20:51 +03:00
Ron
0e0bfde3a8 Update README.md 2015-08-24 11:20:30 +03:00
Tony Tam
29a2eedc1e java8 tag fixes 2015-08-24 01:04:33 -07:00
Tony Tam
0d5c066605 fixed scalatest version 2015-08-24 01:04:28 -07:00
Tony Tam
6820179903 fixed scalatest version 2015-08-24 01:04:24 -07:00
Tony Tam
617fa43a89 updated development version 2015-08-24 00:52:35 -07:00
Tony Tam
dd67287d63 updated development version 2015-08-24 00:51:18 -07:00
Tony Tam
6aa66897aa updated readme 2015-08-24 00:44:03 -07:00
Tony Tam
9b0ddd3a7f Merge branch 'develop_2.0' 2015-08-24 00:39:03 -07:00
Tony Tam
ee05366d0b updated README for release 2015-08-24 00:37:23 -07:00
Tony Tam
d048a68438 added sample 2015-08-24 00:33:26 -07:00
Tony Tam
9cc7615b71 rebuilt, updated versions 2015-08-24 00:32:58 -07:00
Tony Tam
dfb9d26c75 Merge branch 'wing328-fix_java_serialize' into develop_2.0 2015-08-24 00:03:31 -07:00
Tony Tam
715c0af41f merged & rebuilt 2015-08-24 00:03:20 -07:00
Tony Tam
65829e5b6e merged & rebuilt 2015-08-24 00:03:08 -07:00
Tony Tam
a3c7e22d55 Merge pull request #1116 from swagger-api/issue-1115
fixes for jaxrs codegen
2015-08-23 23:56:14 -07:00
Tony Tam
d8ceb8c648 enabled samples 2015-08-23 23:47:01 -07:00
Tony Tam
87f1ef4dc2 re-ordered 2015-08-23 23:46:54 -07:00
Tony Tam
7c2310a13f updated to jersey 1.18.1, fixes for #1115 2015-08-23 23:34:35 -07:00
Tony Tam
6dcb8da2d8 altered to return inner type only 2015-08-23 23:33:55 -07:00
Tony Tam
a83f01ad60 made string safe 2015-08-23 23:33:27 -07:00
Tony Tam
6c1f7243bf rebuilt 2015-08-23 23:29:53 -07:00
wing328
164ed99812 fix serializableModel (boolean) 2015-08-24 11:50:21 +08:00
Tony Tam
355cc88e0d Merge pull request #1113 from swagger-api/issue-1112
moved file
2015-08-23 19:04:14 -07:00
Tony Tam
35ed412d1e moved file 2015-08-23 18:58:46 -07:00
Tony Tam
a5190266b6 Merge pull request #1111 from swagger-api/revert-1029-jaxrs-server-codegen-improvements
Revert "fixed generated code to go to target/generated-sources, added…
2015-08-23 18:53:05 -07:00
Tony Tam
d51fe80138 Revert "fixed generated code to go to target/generated-sources, added maven-c…" 2015-08-23 18:28:42 -07:00
Tony Tam
ec9cdca7cb Merge pull request #1109 from swagger-api/rebase-issue-838
update files as rebase from #838
2015-08-23 17:38:34 -07:00
Tony Tam
8a9f43b142 Merge pull request #910 from swagger-api/maven-plugin-configuration-improvements
Maven plugin configuration improvements
2015-08-23 17:33:55 -07:00
Tony Tam
0fc5702e4d Merge pull request #1029 from swagger-api/jaxrs-server-codegen-improvements
fixed generated code to go to target/generated-sources, added maven-c…
2015-08-23 17:32:29 -07:00
Tony Tam
3390fae15b Merge branch 'tiffanyperumpail-develop_2.0' into develop_2.0 2015-08-23 17:25:24 -07:00
Tony Tam
e19b883c89 Merge branch 'develop_2.0' of ssh://github.com/tiffanyperumpail/swagger-codegen into tiffanyperumpail-develop_2.0 2015-08-23 17:24:27 -07:00
Tony Tam
9531e1ae59 Merge branch 'Rogercf-support-to-array-of-enums' into develop_2.0 2015-08-23 17:22:44 -07:00
Tony Tam
3d38c41b0e resolved merge issue 2015-08-23 17:22:34 -07:00
Tony Tam
718e1ff68a Merge branch 'TobiasPfeifer-develop_2.0' into develop_2.0 2015-08-23 14:23:33 -07:00
Tony Tam
a6a9d743be added template 2015-08-23 14:23:20 -07:00
Tony Tam
414de00894 fixed return type, rebuilt 2015-08-23 14:23:00 -07:00
Tony Tam
cc7366787f Merge branch 'develop_2.0' of ssh://github.com/TobiasPfeifer/swagger-codegen into TobiasPfeifer-develop_2.0 2015-08-23 11:20:02 -07:00
Tony Tam
3486eecdfc Merge branch 'xhh-library-template-jersey2' into develop_2.0 2015-08-23 11:10:12 -07:00
Tony Tam
66e6d4fb8a rebuilt client 2015-08-23 11:10:04 -07:00
Tony Tam
f7dc066dec merged 2015-08-23 11:09:47 -07:00
Tony Tam
3160913433 update files as rebase from #838 2015-08-23 11:05:19 -07:00
Ole Lensmar
e253fdea33 Merge branches 'develop_2.0' and 'jaxrs-server-codegen-improvements' of https://github.com/swagger-api/swagger-codegen into jaxrs-server-codegen-improvements
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java
2015-08-23 10:26:07 -04:00
Ole Lensmar
ac49d0dcdc post-merge fixes 2015-08-23 09:37:28 -04:00
Ole Lensmar
b956d47a9d Merge branches 'develop_2.0' and 'maven-plugin-configuration-improvements' of https://github.com/swagger-api/swagger-codegen into maven-plugin-configuration-improvements
Conflicts:
	modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java
2015-08-23 09:37:08 -04:00
wing328
f662699fd0 Merge pull request #1107 from wing328/php_fix_datetime
[PHP] Fixed deserialization for datetime object
2015-08-23 17:11:55 +08:00
wing328
1c1571cc3a Merge pull request #1106 from geekerzp/python-query
[Python] Fix issue that missing query parameters in python client.
2015-08-23 17:11:19 +08:00
wing328
e13374e1df Merge pull request #1105 from who/serializable_java_models
[Java] Adding an option so java models can implement Serializable
2015-08-23 17:10:57 +08:00
wing328
f2df26f6e6 fix deserializing datetime, add test case 2015-08-22 23:09:12 +08:00
xhh
569082743f Remove the unused LibraryHelp command 2015-08-22 22:05:43 +08:00
xhh
595c01c537 Merge branch 'develop_2.0' into library-template-jersey2
Conflicts:
	modules/swagger-codegen/src/main/resources/Java/JsonUtil.mustache
2015-08-22 21:53:04 +08:00
geekerzp
dc423cc11d Fix issue that Mssing query parameters in python client. 2015-08-22 17:46:13 +08:00
Andrew B
4f25a0e6c5 adding an option so java models can implement Serializable 2015-08-21 18:36:03 -07:00
Tony Tam
0af29cc5cf Merge pull request #1104 from swagger-api/issue-1103
added check, fix for #1103
2015-08-21 15:22:22 -07:00
Tony Tam
44b4af0374 added check, fix for #1103 2015-08-21 15:02:56 -07:00
Tony Tam
b68beefa69 Merge pull request #1101 from swagger-api/issue-1099
optional files are never written
2015-08-21 09:35:11 -07:00
Tony Tam
07162811a7 fix for #1099, added file check 2015-08-21 08:56:22 -07:00
wing328
4023460f2e Merge pull request #1096 from geekerzp/objc-param-to-str
[Objc] Sanitize request parameters in objc client
2015-08-21 22:22:17 +08:00
wing328
83bea6a0c5 Merge pull request #1095 from who/fix_issue_1089
[Java] Sanitize configurable package names (fixes #1089)
2015-08-21 22:15:53 +08:00
wing328
d03f680c64 Merge pull request #1090 from geekerzp/python-keyword
[Python] Change reserved word handling in python client.
2015-08-21 21:51:32 +08:00
geekerzp
4189d0765b Update api body template of objc client 2015-08-21 11:40:59 +08:00
geekerzp
6218ad139f Fix issue that it will throw error if not pass optional form param in objc client. 2015-08-21 11:20:29 +08:00
geekerzp
b7cd38d38b Update objc client.
Sanitize request parameters (path, query, header, form, body).
2015-08-21 09:42:31 +08:00
Andrew B
2b61305582 Fixing issue #1089 2015-08-20 14:16:10 -07:00
wing328
2057d0e144 Merge pull request #1068 from Helmsdown/add-generated-annotation
Add @Generated annotation to all generated Java templates
2015-08-20 17:45:17 +08:00
xhh
af2ec4cf85 Merge branch 'develop_2.0' into library-template-jersey2
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
	modules/swagger-codegen/src/main/resources/Java/api.mustache
2015-08-20 17:36:42 +08:00
wing328
9a239ad2a4 Merge pull request #1076 from DavidBiesack/static-html
improve static html; add template guards for collections.
2015-08-20 17:31:03 +08:00
wing328
a610fb5ac3 Merge pull request #1051 from who/develop_2.0
[Java] Fixing subClassed types so that they can use enums
2015-08-20 17:14:17 +08:00
Andrew B
fb4c62cc28 Fixing merge conflict in pom.xml 2015-08-19 23:08:49 -07:00
geekerzp
6d58d44542 Merge branch 'ruby-api-client' into ruby-apiclient 2015-08-20 11:34:07 +08:00
xhh
0e2e7838ae Merge branch 'bug-fix-ruby-file-upload' into ruby-api-client
Conflicts:
	modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache
	samples/client/petstore/ruby/lib/petstore/swagger/request.rb
2015-08-20 11:24:33 +08:00
xhh
2e3f94c2a5 Add file used in test: hello.txt 2015-08-20 11:18:05 +08:00
xhh
e02a9f1797 Merge branch 'develop_2.0' into ruby-api-client 2015-08-20 11:10:25 +08:00
xhh
0d399d3f6a Add spec for file uploading 2015-08-20 11:07:20 +08:00
xhh
030e45982c Add back support of file uploading to Ruby client 2015-08-20 10:45:40 +08:00
geekerzp
894d571ea5 Change reserved word handling in python client.
* First, remove the beginning underscores.
* Then, append underscore if the var is reserved word or number.
2015-08-19 18:05:47 +08:00
wing328
dc1992ad45 Merge pull request #1081 from wing328/php_var_name_number
[PHP, Perl, Silex] fixed variable names starting with number, made LOGGER protected
2015-08-19 14:56:13 +08:00
geekerzp
7be6e971fa Update api client of ruby client.
Update ApiClient#build_request, change `@verify_ssl`, `@ssl_ca_cert`, `@debugging`
to `Configuration.verify_ssl`, `Configuration.ssl_ca_cert`, `Configuration.debugging`.
2015-08-18 20:21:56 +08:00
wing328
c62fca8c54 Merge pull request #1079 from wing328/add_flash_generator
[Flash] Add back Flash generator
2015-08-18 20:04:53 +08:00
geekerzp
828f8694c8 Fix typo in ruby client 2015-08-18 16:13:32 +08:00
geekerzp
31d948fc16 Update readme of ruby client 2015-08-18 14:35:54 +08:00
geekerzp
a481db7486 Add configuration object in ruby client 2015-08-18 14:27:09 +08:00
wing328
5d52952ebd Merge pull request #1077 from geekerzp/objc-apiclient
[Objc] Change the ApiClient  initialization of objc client
2015-08-18 09:39:48 +08:00
wing328
c1fbf6bb1c Merge branch 'php_var_name_number' of https://github.com/wing328/swagger-codegen into php_var_name_number 2015-08-17 14:40:12 +08:00
wing328
10cd672529 fix variable name starting with number, make LOGGER protected 2015-08-17 14:39:29 +08:00
wing328
52918d325e Merge pull request #1082 from wing328/fix_pom_swagger_parser
update swagger-parser-version to 1.0.10 (removed snapshot)
2015-08-17 14:38:11 +08:00
wing328
8cff8fc55a update swagger-parser-version to 1.0.10 (removed snapshot) 2015-08-17 14:27:33 +08:00
wing328
90d5ce228a Merge pull request #1067 from Helmsdown/path-level-params
Codegen should honor path level parameters
2015-08-17 14:13:22 +08:00
wing328
d4ff25f0b3 fix variable name starting with number, make LOGGER protected 2015-08-17 10:43:03 +08:00
wing328
4163f07911 Merge pull request #1069 from geekerzp/python-httplib
[Python] Fix issues in python client
2015-08-16 15:03:16 +08:00
wing328
560fd5718d Merge pull request #1074 from wing328/php_improve1
[PHP] minor improvements
2015-08-16 14:59:43 +08:00
wing328
97580a8c45 Merge pull request #1070 from wing328/objc_readme_update
[Objc] minor wording change for readme based on feedback from developers
2015-08-16 14:59:27 +08:00
wing328
aee72d97c3 Merge pull request #1080 from wing328/update_pomxml
Update swagger-core-version to 1.5.4-SNAPSHOT
2015-08-16 00:22:54 +08:00
wing328
49ad008d7c update pom.xml 2015-08-16 00:14:24 +08:00
wing328
7a2c0a076a update readme, change default value, update pom 2015-08-16 00:03:19 +08:00
wing328
365f4bc0c0 beta release of flash generator 2015-08-15 23:56:01 +08:00
wing328
3478e053e1 add back flash generator 2015-08-15 18:12:14 +08:00
geekerzp
75536868f2 Add default api client in configuration class in objc client 2015-08-14 17:54:41 +08:00
geekerzp
84e8ef489c Update pom.xml 2015-08-14 11:55:22 +08:00
wing328
cffba0299a update core to 1.5.4 2015-08-14 11:19:04 +08:00
geekerzp
a6c07a8364 Change api client pool pattern to singleton pattern in objc client 2015-08-14 09:47:02 +08:00
David Biesack
b14edffc79 improve static html; add template guards for collections. Update -core dependency 2015-08-13 13:46:32 -04:00
wing328
b971aa7433 add example to config option, replace localhost with basePath 2015-08-13 23:27:59 +08:00
wing328
bb4311b7a2 minor wording change for objc readme based on feedback from developers 2015-08-12 20:53:15 +08:00
geekerzp
1c0eb60c71 Fix issues in python client 2015-08-12 11:19:29 +08:00
russellb337
a0eeb90a97 fixing bug 2015-08-11 12:50:19 -07:00
russellb337
38fccbd73d add @Generated to all Java class templates 2015-08-11 12:42:18 -07:00
russellb337
6fbb8ab1e0 add @Generated annotation to all Java class templates 2015-08-11 12:42:06 -07:00
russellb337
6044f0586e removing unnecessary getTypeDeclaration implementation in JaxRSServerCodegen 2015-08-11 09:19:22 -07:00
wing328
84ff5cfc87 Merge pull request #1064 from RMarinaro/develop_2.0
fix for #1061 java
2015-08-11 21:33:08 +08:00
wing328
96be2b196b Merge pull request #1037 from restlet/fix/nodejs_server_swagger
Fix swagger.json supporting file for the node.js server (fixes #652)
2015-08-11 21:28:06 +08:00
Hugo Wood
d93b404b23 Fix swagger.json supporting file for the node.js server (fixes #652) 2015-08-11 14:37:00 +02:00
wing328
be63776162 Merge pull request #1063 from geekerzp/objc-deserialize-bool
[Objc] Fix deserialize bool value issue
2015-08-11 10:18:52 +08:00
russellb337
ae4b4979a7 add defensive null check 2015-08-10 13:58:02 -07:00
russellb337
0a8fb1e532 codegen should honor path level parameters 2015-08-10 13:50:52 -07:00
wing328
e78844cb54 Merge pull request #1043 from marcospri/develop_2.0
Support for nested lists/maps for the python client
2015-08-10 18:30:02 +08:00
Ryan Marinaro
2eb0c8cea6 added a fix for #1061. The only problematic spot was the api.mustache file, although if more parameterized templates were to evolve in the other mustache files we could definitely add {{localVariablePrefix}} to those. For now I didn't want to add any extra noise to the template files which didn't need the prefixes. 2015-08-08 10:19:31 -04:00
geekerzp
2aaad03ab6 Fix the issue of bool deserialization in objc client 2015-08-08 15:13:13 +08:00
xhh
cb181e3480 Merge branch 'develop_2.0' into library-template-jersey2 2015-08-08 11:18:17 +08:00
xhh
b686b53259 Support overriding API/model templates with library template 2015-08-08 11:14:06 +08:00
wing328
f27eb7e0de Merge pull request #1058 from xhh/str-response-offset
Fix bug with truncated lone string responses for Android/Scala clients
2015-08-08 11:10:02 +08:00
wing328
36b7fb20b2 Merge pull request #1059 from geekerzp/objc-auth
[Objc] Fix issue about authentication
2015-08-08 09:37:47 +08:00
Ron
f2ef21e756 Merge pull request #1062 from swagger-api/dependencies-version-update
Update pom.xml
2015-08-07 17:32:28 -04:00
Ron
e57f1de21f Update pom.xml 2015-08-07 17:10:35 -04:00
xhh
a41361c959 Change the "--library" option into a config option 2015-08-07 22:16:32 +08:00
xhh
167e95bb3a Merge branch 'develop_2.0' into library-template-jersey2
Conflicts:
	modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache
2015-08-07 21:18:27 +08:00
geekerzp
732a9eb64d Fix issue in Configuration-body.mustache in objc client 2015-08-07 18:31:07 +08:00
xhh
c7f595fc91 Fix bug with truncated lone string responses for Android/Scala clients 2015-08-07 10:40:42 +08:00
Tony Tam
29e8a8f573 Merge pull request #1057 from who/fix_1056
Fixing a bug with truncated lone string responses
2015-08-06 17:38:54 -07:00
Andrew B
d5b959d8cd Fixing a bug with truncated lone string responses 2015-08-06 16:54:24 -07:00
Andrew B
7a92f53b55 Adding some tests for PR 1051 2015-08-06 15:22:18 -07:00
tiffanyperumpail
4ac8a93022 Change swagger-parser-version to 1.0.9-SNAPSHOT 2015-08-06 11:29:59 -07:00
Marcos Prieto
cad2f961bd Undo unicode on sanitize method. Keep the PR on point 2015-08-06 10:21:56 +02:00
tiffanyperumpail
5328c00e8f Simplified enum by changing CodeGenStatus to an enum instead of a wrapper. Updated version of swagger-parser to 1.0.9. 2015-08-05 16:53:39 -07:00
tiffanyperumpail
1b31a01b76 Added CodeGenStatus class with Status enum 2015-08-05 16:18:24 -07:00
Andrew B
c67a6582fc Bumping the version of swagger-parser to 1.0.9 2015-08-05 15:58:54 -07:00
Andrew B
dc76887820 Fixing subClassed types so that they can use enums 2015-08-05 15:50:34 -07:00
xhh
4321339d4f Java petstore sample: move to "default" sub-folder, add jersey2 2015-08-05 17:28:45 +08:00
xhh
07f10a8abc Add command to display all library templates supported
for a specific language
2015-08-05 16:37:08 +08:00
xhh
4ba521a5c0 Add jersey2 library template for Java client 2015-08-05 15:37:26 +08:00
xhh
d88ec847ae Remave unused imports 2015-08-05 09:43:15 +08:00
xhh
7c16dfcf13 Rebuild Java petstore sample 2015-08-04 18:36:03 +08:00
xhh
aff21e5e6b Add a "library" option to generate with sub-template 2015-08-04 18:32:54 +08:00
Marcos Prieto
befacc41bd Support for nested dict/list
Checking for `startwith` instead of just `in` to correctly categorize
nested structures.
2015-08-04 11:51:38 +02:00
Marcos Prieto
edebbcb802 Support for unicode headers, ie support for urlib3.util.make_headers 2015-08-04 11:51:25 +02:00
xhh
bfb4629ab7 Java client: decouple JSON handling 2015-08-04 15:47:55 +08:00
Tony Tam
1007534575 fix for #1042, removed empty / when basePath is null 2015-08-03 16:47:51 -07:00
Rogercf
97d24a7119 Update DefaultCodegen.java
Fixed indentation
2015-08-03 19:50:29 -03:00
Rogercf
13038d2a12 Update DefaultCodegen.java
Replaced hardcoded "String" with property.items.baseType
2015-08-03 19:46:10 -03:00
Rogercf
c5dc070685 Update model.mustache
Fixed generating array of enums properties in the java template
2015-08-03 19:21:54 -03:00
Rogercf
a30b66beb1 Update DefaultCodegen.java
Setting the "items" field when the type is array and updating some values if the array is an array of enums
2015-08-03 19:20:51 -03:00
Rogercf
aff766b785 Update CodegenProperty.java
Added a "items" field to keep track of the inner type to be accessed in the mustache templates
2015-08-03 19:19:10 -03:00
xhh
112a7ec8c1 Java client: move form params handling to ApiClient 2015-08-03 18:33:42 +08:00
wing328
55be0330e3 Merge pull request #1039 from geekerzp/python-desciption
[Python] Fix issue in python client
2015-08-03 10:48:56 +08:00
wing328
fe83d18a09 Merge pull request #1026 from geekerzp/objc-deserializtion
[Objc] Fix deserialize nested map error
2015-07-31 16:17:11 +08:00
wing328
a6f8f9e4ff Merge pull request #1017 from herveDarritchon/develop_2.0
Defect (Issue #905) : Add code to be able to override the configPackage …
2015-07-31 16:05:17 +08:00
geekerzp
79c988616c Fix issue #1038 2015-07-31 16:01:45 +08:00
wing328
dc62f688d9 Merge pull request #1015 from tandrup/conditional-copy-from-parent
Conditional copy properties from parent
2015-07-31 15:56:48 +08:00
wing328
db10bd764b Merge pull request #1036 from wing328/csharp_add_back_dll
[C#] add back RestSharp and Newtonsoft.Json DLL
2015-07-31 15:56:21 +08:00
wing328
92208b4ec2 Merge pull request #987 from xhh/retrofit-form-field-naming
Retrofit: fix form field naming by using baseName
2015-07-31 09:09:09 +08:00
xhh
0ef4702aa8 Merge branch 'develop_2.0' into retrofit-form-field-naming
Conflicts:
	samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/PetApi.java
2015-07-30 16:40:43 +08:00
wing328
cc358cf9ce Merge pull request #1032 from xhh/retrofit-string-resp
Retrofit template: return body string directly when failed to parse response body as JSON
2015-07-30 15:58:05 +08:00
xhh
a1e6908b65 Merge branch 'develop_2.0' into retrofit-string-resp 2015-07-30 15:02:02 +08:00
xhh
2d4c07a474 Fix typo 2015-07-30 15:01:51 +08:00
wing328
05f00013f1 add back csharp dll, update sample 2015-07-30 10:19:46 +08:00
wing328
bc528ef928 Merge pull request #1027 from adamholdenyall/patch-3
Catch all exceptions on Deserialize
2015-07-30 10:06:32 +08:00
Tony Tam
318a239976 Merge pull request #1031 from Toilal/pom-issues
Fix issues in POM configuration
2015-07-29 07:35:05 -07:00
Toilal
189962208e Update scala maven plugin and fix issues in POM configuration 2015-07-29 15:15:12 +02:00
wing328
bd28271b0b Merge pull request #1019 from geekerzp/python-refactor
[Python] Enhancements of python client
2015-07-29 17:39:58 +08:00
xhh
14b808a910 Retrofit template: return body string directly
when failed to parse response body as JSON, fixing unit test for
UserApi#loginUser
2015-07-29 17:10:49 +08:00
wing328
d345f8fae3 Merge pull request #967 from moander/feature/docker
Docker build script and Dockerfile
2015-07-29 15:36:08 +08:00
Ole Lensmar
26336356cf added generated samples for jaxrs and inflector 2015-07-28 14:56:23 -07:00
Ole Lensmar
9c3fad3040 fixed generated code to go to target/generated-sources, added maven-codegen-plugin to generated jaxrs project together with initial swagger definition, fixed overwrite flag to kick in only if file exists, fixed initial readme 2015-07-28 14:40:43 -07:00
moander
d396a0a0e4 Friendly error message when project is not built 2015-07-28 22:48:18 +02:00
Tony Tam
dc7c2a4bab updated name 2015-07-28 13:35:33 -07:00
Tony Tam
0b85ad464a Merge pull request #1028 from swagger-api/inflector-template
added template for the inflector
2015-07-28 10:31:40 -07:00
Ole Lensmar
c5d02fe98e added template for the inflector 2015-07-28 10:19:36 -07:00
adamholdenyall
a81e5096f5 Catch all exceptions on Deserialize
If you look at the source of NewtonSoft.Json, you'll see that DeserializeObject never throws an IOException. All exceptions should be caught in this method, just like Serialize.
2015-07-28 09:53:10 -05:00
wing328
52971e6aa9 Merge pull request #1018 from wing328/fix_empty_operationid
[All] Better exception handling for empty operationId (method name)
2015-07-28 17:39:19 +08:00
geekerzp
b2e0d83f2e Update objc client.
* Fix issue that list of primitive types deserialization.
* Add test cases for list of primitive types deserialization and nested list deserialization.
2015-07-28 17:21:10 +08:00
geekerzp
2be3414357 Update python client.
Add test case for nested list deserialization.
2015-07-28 15:23:44 +08:00
geekerzp
ea901bf1ce Update python client.
Add test case for nested dict deserialization.
2015-07-28 14:34:50 +08:00
geekerzp
8bd282acd6 Change parameter name key to identifier of
Configuration#get_api_key_with_prefix in python client.
2015-07-28 11:25:19 +08:00
geekerzp
b51ef77401 Remove #!/usr/bin/env python from python client 2015-07-28 11:25:19 +08:00
geekerzp
3265ec0f72 Refactor python client. 2015-07-28 11:25:19 +08:00
wing328
732e645042 Merge pull request #1022 from SparrowJang/develop_2.0
fixed a error rule for parsing `)`
2015-07-28 11:15:28 +08:00
geekerzp
cc45ff17cb Fix deserialize nested map error in objc client 2015-07-28 10:51:20 +08:00
wing328
b843b55339 Merge pull request #1001 from who/csharp_dotnet2_template
C# .Net 2.0 generator and template
2015-07-28 09:32:03 +08:00
Sparrow.jang
75711f954b fixed a bug for parsing ) error 2015-07-27 18:50:32 +08:00
SparrowJang
d0b5af31a5 Merge pull request #1 from swagger-api/develop_2.0
Develop 2.0
2015-07-27 18:47:40 +08:00
wing328
c01c06b198 Merge pull request #1004 from mhardorf/conf-file-maven-plugin
Add support for specifying configuration file in maven plugin
2015-07-27 18:30:09 +08:00
Mads Mætzke Tandrup
586f4c14e1 Merge remote-tracking branch 'upstream/develop_2.0' into conditional-copy-from-parent
# Conflicts:
#	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptNodeClientCodegen.java
2015-07-27 11:30:47 +02:00
wing328
fe0e43f963 Merge pull request #1012 from tandrup/combine-ts-node
Combine TypeScript Node output and beautify Angular output
2015-07-27 17:24:34 +08:00
wing328
47abfe7079 Merge pull request #1014 from 2rs2ts/module-generation-readme-path-fix
Fix path in instructions for making your own codegen modules
2015-07-27 17:12:13 +08:00
Mads Mætzke Tandrup
d0a3def441 Adding npm run clean command to clean the sample dir 2015-07-27 11:02:38 +02:00
xhh
7af5db3565 Rebuild Ruby petstore sample 2015-07-27 16:37:26 +08:00
xhh
47c8597d36 Ruby: move request/response logic to api_client 2015-07-27 16:34:51 +08:00
Mads Mætzke Tandrup
64f2e85608 Update TypeScript angular sample 2015-07-27 10:20:55 +02:00
Mads Mætzke Tandrup
09ccf12a3b Update Typescript node samples 2015-07-27 10:19:12 +02:00
Mads Mætzke Tandrup
fde5c60cb0 Support authentication from swagger in TypeScript Node 2015-07-27 10:18:38 +02:00
Mads Mætzke Tandrup
b18cc5e0de Include header parameters 2015-07-27 10:13:36 +02:00
wing328
6d8dea5dfc better exception handling for empty method name 2015-07-27 12:07:35 +08:00
wing328
a8f580032f fix empty operationId in java codegen 2015-07-27 11:39:37 +08:00
wing328
d0baa48fcd fix empty operationId 2015-07-27 11:21:51 +08:00
wing328
31200acc1a Merge pull request #998 from geekerzp/objc-date
[Objc] Enhancements of objective-c client
2015-07-27 10:41:42 +08:00
xhh
5bfae7b78c Ruby: use a default ApiClient when not provided 2015-07-27 10:32:51 +08:00
geekerzp
3b9b3e82f9 Update comments in objc client 2015-07-27 10:29:27 +08:00
wing328
783a4c0572 Merge pull request #1016 from ngs/swift-podspec-version
[Swift] Add version to Podspec template
2015-07-27 08:33:44 +08:00
wing328
9ce824d720 Merge pull request #1007 from ngs/swift-alamofire-1.3.0
[Swift] Support file upload with Alamofire 1.3.0
2015-07-27 08:29:34 +08:00
Mads Mætzke Tandrup
dee828622a Test file upload in sample client 2015-07-26 14:26:01 +02:00
Hervé Darritchon
5c0ae7babe Defect (PR #905) : Add code to be able to override the configPackage in the spring mvc template. 2015-07-26 12:11:29 +02:00
Mads Mætzke Tandrup
02da80e837 Update sample with small test script 2015-07-26 08:22:32 +02:00
Mads Mætzke Tandrup
e41a475335 Update typescript node sample 2015-07-25 22:05:43 +02:00
Mads Mætzke Tandrup
fea8e680df Fix TypeScript node file upload 2015-07-25 22:05:29 +02:00
Mads Mætzke Tandrup
b0f6b49595 Fix TypeScript Map type 2015-07-25 22:02:06 +02:00
Atsushi Nagase
b56da43953 [Swift] Add version to Podspec template 2015-07-26 03:19:33 +09:00
Atsushi Nagase
979a704310 [Swift] Update Alamofire to 1.3 in Podspec 2015-07-26 03:01:11 +09:00
Atsushi Nagase
5dcdadb751 [Swift] tweak conditions
336bb87b53 (commitcomment-12318006)
2015-07-26 02:59:43 +09:00
Atsushi Nagase
f98974190e [Swift] Support file upload with Alamofire 1.3.0
refs:

- https://github.com/Alamofire/Alamofire/milestones/1.3.0
- https://github.com/Alamofire/Alamofire/pull/539
2015-07-26 02:59:43 +09:00
wing328
6719a6cc74 Merge pull request #1013 from SparrowJang/develop_2.0
added a utf8 declaration to fix #1011 issue
2015-07-25 23:15:04 +08:00
Mads Mætzke Tandrup
3f9b2a9678 Adding build system for typescript AngularJS sample 2015-07-25 14:11:10 +02:00
Mads Mætzke Tandrup
bbf0ce8c80 Adding README for sample 2015-07-25 13:57:45 +02:00
Mads Mætzke Tandrup
9fc8c770d3 Adding build system for poetaster typescript node sample 2015-07-25 13:55:30 +02:00
wing328
8f2c99f0af Merge pull request #1005 from mhardorf/sort-by-inheritance
Sort model objects by inheritance
2015-07-25 18:18:29 +08:00
Mads Mætzke Tandrup
81f5cc47e7 Rename property to be more language specific 2015-07-25 12:03:17 +02:00
wing328
db37c02ebd Merge pull request #1010 from onovy/develop_2.0
[Python] Allow to set cookie in python(3) API constructor.
2015-07-25 17:03:11 +08:00
wing328
fc71b23464 Merge pull request #1006 from ngs/podspec
[Swift] Add podspec template
2015-07-25 16:46:13 +08:00
Mads Mætzke Tandrup
e924cec595 Conditional copy properties from parent.
Pull request #946 broke the TypeScript generation with inheritance where a superclass defined an enum. This makes it up to each language to decide the behavior appropriate for the language.
2015-07-25 07:45:08 +02:00
Andrew Garrett
90f152da75 Fix path in instructions for making your own codegen modules 2015-07-24 11:44:30 -07:00
Sparrow.jang
713ae4a957 added a utf8 declaration to fix #1011 issue 2015-07-24 22:40:24 +08:00
Ondrej Novy
50736458d0 Allow to set cookie in python(3) API constructor. 2015-07-24 11:48:43 +02:00
Mads Mætzke Tandrup
34b341874c Include api and model package in angular 2015-07-24 11:05:36 +02:00
Mads Mætzke Tandrup
7a1f3dbf9e Fix angular output to go to one dir to make it build 2015-07-24 10:23:07 +02:00
Mads Mætzke Tandrup
3723a9ba2d Updating typescript samples 2015-07-24 10:22:41 +02:00
Mads Mætzke Tandrup
bc8eae838c Beautify typescript angular output 2015-07-24 10:14:42 +02:00
Mads Mætzke Tandrup
88ed496b44 Extract abstract class for TypeScript generators 2015-07-24 10:03:02 +02:00
Mads Mætzke Tandrup
646da19c7d Combine TypeScript node output in one file and add missing require statements 2015-07-24 09:48:49 +02:00
Atsushi Nagase
80b5363202 [Swift] add cliOptions for podspec
```
podSource
    Source information used for Podspec

podVersion
    Version used for Podspec

podAuthors
    Authors used for Podspec

podSocialMediaURL
    Social Media URL used for Podspec

podDocsetURL
    Docset URL used for Podspec

podLicense
    License used for Podspec

podHomepage
    Homepage used for Podspec

podSummary
    Summary used for Podspec

podDescription
    Description used for Podspec

podScreenshots
    Screenshots used for Podspec

podDocumentationURL
    Documentation URL used for Podspec
```
2015-07-24 16:27:28 +09:00
Atsushi Nagase
071fc2ded6 [Swift] Add podspec template 2015-07-23 22:22:45 +09:00
Martin Hardorf
992b0c7e5e Sort model objects by inheritance 2015-07-23 13:11:53 +02:00
Martin Hardorf
037f59d0df Add support for specifying configuration file in maven plugin 2015-07-23 13:10:59 +02:00
geekerzp
5a235c642a Update comments of objc client 2015-07-23 18:03:19 +08:00
geekerzp
08ea05f7a1 Update objc client.
* Add comments in SWGConfiguration.h
* Change `Date` to `date` in ObjcClientCodegen.java
* Update comments in model body template
2015-07-23 16:03:38 +08:00
Andrew B
e301d9d00e Adding sample generator and output 2015-07-22 11:31:29 -07:00
Andrew B
8a399ee1cb Renaming the C# .net 2.0 to be more generic 2015-07-22 11:13:13 -07:00
Andrew B
4e5b9e4af3 Renaming the C# .net 2.0 to be more generic 2015-07-22 11:13:08 -07:00
geekerzp
37c79525f7 Update model body template in objc client.
* Add some comments.
2015-07-22 18:31:50 +08:00
geekerzp
f9ad16e7aa Update objc client.
* Add test cases for deserialization.
* Pretty print model infomation.
2015-07-22 17:45:31 +08:00
wing328
cde8d7ba4c Merge pull request #984 from geekerzp/python-enum
[Python] Support enum for model property
2015-07-22 16:48:34 +08:00
xhh
a75b05b952 Update tests with latest code 2015-07-22 16:02:18 +08:00
geekerzp
bd6fa6a2e4 Update PetApiTests#test_find_pet_by_tags test case of python client 2015-07-22 15:50:40 +08:00
xhh
609d915541 Rebuild Ruby petstore sample 2015-07-22 15:39:48 +08:00
xhh
948cdb3a75 Done with API client structure for Ruby client 2015-07-22 15:37:29 +08:00
geekerzp
b9287cf417 Add to_str method in python client and add test cases. 2015-07-22 11:00:51 +08:00
Andrew B
df93ca80f7 Fixing an issue that was causing incorrect JSON key names 2015-07-21 15:49:37 -07:00
Andrew B
0247f0774d Updating the mono compile script to target .net 2 2015-07-21 11:12:17 -07:00
wing328
37dbd6e4cd Merge pull request #992 from who/develop_2.0
[C#] Fixing a mono compilation error
2015-07-21 21:43:06 +08:00
wing328
34db9814d8 Merge pull request #994 from wing328/fix_swagger_parser_version
Fix compilation error with a newer swagger parser
2015-07-21 17:39:24 +08:00
xhh
4ecc757bea More on API client structure for Ruby client 2015-07-21 17:07:41 +08:00
wing328
cf7082c2e6 fix swagger parser version to use 1.0.9-SNAPSHOT 2015-07-21 16:54:14 +08:00
wing328
6b4f810fec Merge pull request #981 from Edubits/develop_2.0
[Swift] Support use in Framework
2015-07-21 16:35:36 +08:00
Tony Tam
f7a07f72b8 added resolve option for #903 2015-07-20 23:31:49 -07:00
Andrew B
a6012ecf41 Initial commit of the Unity3D C# .net 2.0 generator 2015-07-20 23:26:59 -07:00
Andrew B
0b7b57bf4d [C#] Fixing a mono compilation error 2015-07-20 21:22:49 -07:00
wing328
498a400d4e Merge pull request #988 from wing328/csharp_update_unit_test
[C#] Updated unit test and minor change to conform style guide
2015-07-21 12:08:15 +08:00
wing328
405e5a7a35 Merge pull request #946 from xhh/model-all-of
Copy properties from parent models defined with allOf
2015-07-21 11:41:24 +08:00
xhh
3de42afed3 Implement API client structure for Ruby client 2015-07-21 11:37:46 +08:00
wing328
f1304022b0 Merge pull request #852 from tomtit/issue837
Fixed #837: Generation of default values for complex arrays and maps has been improved.
2015-07-21 11:28:43 +08:00
wing328
fc7f2a92d0 Merge pull request #878 from lugaru1234/issue798
Fixed #798: original jar generation has been fixed.
2015-07-20 21:50:51 +08:00
wing328
27113cf326 Merge pull request #859 from lugaru1234/issue831
Fixed #831: skipOverwrite flag has been added
2015-07-20 21:14:33 +08:00
wing328
7179c15158 Merge pull request #966 from wing328/nodejs_fix_summary
[NodeJS] Add back summary and description to the endpoint definition
2015-07-20 11:12:15 +08:00
wing328
ba72e7344a remove nuget pacakges 2015-07-20 10:48:20 +08:00
wing328
596bde2ef6 remove leading space for path variable, update unit test 2015-07-20 10:43:08 +08:00
wing328
a863e538a8 Merge pull request #943 from psmay/develop_2.0-RestSharp-path-params
[C#] Use RestSharp's mechanism for path parameters in URL templates
2015-07-20 10:16:01 +08:00
xhh
a134b5ca76 Retrofit: fix form field naming by using baseName 2015-07-20 10:12:36 +08:00
Peter S. May
1f7664f81e Fixed case typo in previous edit. 2015-07-18 19:38:20 -04:00
geekerzp
68820e5a80 Update comments of api template of python client 2015-07-18 15:54:00 +08:00
geekerzp
195c71da37 Update comments of python client 2015-07-18 15:35:12 +08:00
geekerzp
ddfa713f55 Update wording of comment in api template of python client 2015-07-18 15:22:39 +08:00
geekerzp
c9889c5baf Update api template of python client 2015-07-18 15:03:55 +08:00
geekerzp
60d6cd744a Format python client using pep8 2015-07-18 14:30:19 +08:00
Peter S. May
1072c9d017 Merge remote-tracking branch 'upstream/develop_2.0' into develop_2.0-RestSharp-path-params
Conflicts:
	modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache
	modules/swagger-codegen/src/main/resources/csharp/api.mustache
2015-07-17 21:45:54 -04:00
Peter S. May
4bc4a8aed1 WIP pre-adding new sources for ApiClient and api 2015-07-17 21:09:05 -04:00
Robin Eggenkamp
0ad7005547 [Swift] Add support for basic form data 2015-07-16 17:56:20 +02:00
geekerzp
3993ef3dc8 Update python codegen.
Remove leading underscore.
2015-07-16 18:58:23 +08:00
geekerzp
8746f1544b Merge branch 'develop_2.0' into python-enum 2015-07-16 17:27:17 +08:00
geekerzp
f0e09ae33a Add enum support for model property of python client 2015-07-16 17:24:42 +08:00
wing328
e879268043 Merge pull request #941 from geekerzp/develop_2.0_python_async
[Python] Support asynchronous request in python client
2015-07-16 10:47:02 +08:00
geekerzp
33561fa159 Support date type in python client 2015-07-16 10:11:27 +08:00
Robin Eggenkamp
78760907a5 [Swift] Support use in a Framework
To support use in a Framework set access level of relevant classes,
methods and members to public
2015-07-15 18:22:36 +02:00
Robin Eggenkamp
30eb1f1075 Fix bug in api name placeholder 2015-07-15 18:20:05 +02:00
wing328
5c9afbafb2 Merge pull request #918 from geekerzp/develop_2.0_objc_issue
[Objc] Enhancements and Issue fix
2015-07-15 18:20:40 +08:00
geekerzp
0092d8a63b Update unit tests of objc client 2015-07-15 18:11:04 +08:00
wing328
3c6f07cbe3 Merge pull request #975 from wing328/sinatra_fix_tag
[Sinatra] Fixed outdated tag in mustache template
2015-07-15 17:50:25 +08:00
geekerzp
95cb5f73a3 Remove SWGFile from objc client 2015-07-15 17:10:24 +08:00
geekerzp
02f6c805af Update integration test of objc client 2015-07-15 17:10:24 +08:00
geekerzp
13d74f01a2 Add logging in objc client 2015-07-15 17:10:24 +08:00
geekerzp
8877be82f0 Update api-body.mustache of objc client 2015-07-15 17:10:24 +08:00
geekerzp
a25d3f2543 Update README file of objc client 2015-07-15 17:10:23 +08:00
geekerzp
3f017af464 Update objc client.
Replace SWGFile with NSURL.
2015-07-15 17:10:23 +08:00
geekerzp
0e56d0d1c6 Support file downloading in Objc codegen. 2015-07-15 17:10:23 +08:00
geekerzp
f48a7f20e6 Update config-help of objc cli 2015-07-15 17:10:23 +08:00
geekerzp
9a15ced211 Supoort customize classPrefix in objc client. 2015-07-15 17:10:23 +08:00
geekerzp
e244d20152 Remove lib files. 2015-07-15 17:10:23 +08:00
geekerzp
412b6b3839 Update objc client.
* Package objc client using cocoapods.
* Support cli options.
2015-07-15 17:08:45 +08:00
geekerzp
0a652a3d13 Fix issue#896 https://github.com/swagger-api/swagger-codegen/issues/896 2015-07-15 17:08:44 +08:00
geekerzp
4d302683f3 Update logging of python client 2015-07-15 15:58:45 +08:00
geekerzp
517717958d Update doc string of RESTClientObject#agent method of python client 2015-07-15 15:27:15 +08:00
geekerzp
b42ead3c0f Replace urllib3.util.url.parse_url with urllib3.util.parse_url 2015-07-15 15:27:14 +08:00
geekerzp
8a3c64aa41 Add logging and debug report for python client. 2015-07-15 15:27:14 +08:00
geekerzp
d97b0984cb Update ApiClient of python client.
Add docstring for method call_api.
2015-07-15 15:25:32 +08:00
geekerzp
0e8cf70dc4 Fix typo 2015-07-15 15:25:32 +08:00
geekerzp
88e5860d9b support asynchronous request in python client 2015-07-15 15:25:31 +08:00
wing328
157b07e552 Merge pull request #912 from gabrielar/develop_2.0-pull-requests/add-pathPrefix-key-to-operations
Add a `pathPrefix` key to the `operations` key
2015-07-15 10:26:13 +08:00
wing328
1f097ee1a1 Merge pull request #977 from who/develop_2.0
[PHP] Support for customizing namespace and Composer fields
2015-07-15 10:06:26 +08:00
wing328
7a5fd24785 Merge pull request #979 from xhh/auth-methods-fix
Fix NullPointerException for authMethods
2015-07-15 09:50:53 +08:00
wing328
59258be3dd Merge pull request #978 from tkQubo/fix/swift_bug
[Swift] Fix a bug
2015-07-15 09:42:39 +08:00
xhh
e5bdb3a0c1 Fix NullPointerException for authMethods 2015-07-15 09:21:09 +08:00
wing328
dd35c672f0 Merge pull request #935 from geekerzp/python-file-response
[Python] Support file downloading for Python API client
2015-07-14 17:45:11 +08:00
geekerzp
18ea21087f Update README file of python client 2015-07-14 17:34:38 +08:00
geekerzp
746a55be73 Update README file of python client 2015-07-14 17:15:24 +08:00
wing328
7242a664e3 Merge pull request #923 from xhh/ruby-debug
[Ruby] Some improvements & cleaning-up on Ruby API client
2015-07-14 16:34:41 +08:00
geekerzp
9f76acbbd7 Update README file of python client 2015-07-14 15:42:01 +08:00
geekerzp
af67353022 Update integration test of python client 2015-07-14 15:38:23 +08:00
kubo_takaichi
ecf4082d68 Fix bug in api name placeholder and api url 2015-07-14 13:41:28 +09:00
wing328
5821e41185 Merge pull request #927 from wing328/csharp_file_response
[C# ] Add file response
2015-07-14 12:34:51 +08:00
xhh
822e640e0a Merge branch 'develop_2.0' into ruby-debug
Conflicts:
	modules/swagger-codegen/src/main/resources/ruby/swagger/configuration.mustache
	modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache
	samples/client/petstore/ruby/lib/petstore/swagger/request.rb
	samples/client/petstore/ruby/lib/swagger_client.rb
	samples/client/petstore/ruby/lib/swagger_client/swagger/configuration.rb
2015-07-14 12:33:17 +08:00
geekerzp
30925b7800 Update pom.xml of python client 2015-07-14 10:28:36 +08:00
geekerzp
bb570d7efa Update integration-test of python client 2015-07-14 09:43:59 +08:00
geekerzp
c88c85a317 Enhancements intergration-test of python client 2015-07-14 09:39:19 +08:00
geekerzp
23dfac0194 Update deserialization of python client.
Return None if deserialize data is None.
2015-07-14 09:39:19 +08:00
geekerzp
b99f006861 Update Python client.
Throw ApiException if fail to parse string to datetime.
2015-07-14 09:39:19 +08:00
geekerzp
80d1deb2dd Update unit tests of Python client.
Add more test cases for deserialization.
2015-07-14 09:39:19 +08:00
geekerzp
2912ee8ae1 Update deserialize response of Python client. 2015-07-14 09:39:18 +08:00
geekerzp
6df6c079ee Support file downloading in Python codegen. 2015-07-14 09:39:18 +08:00
Andrew B
f4226474e2 Updating command-line parameter description for artifactVersion 2015-07-13 15:02:14 -07:00
Andrew B
b70a0bf0c6 Fixing an issue with errant namespace in the sample petstore 2015-07-13 14:56:33 -07:00
Andrew B
7dca394eca Support for customizing Composer package and namespaces 2015-07-13 14:46:56 -07:00
wing328
80303b524d Merge pull request #884 from xhh/params-order
Make sure "required" parameters are placed in front of "optional" parameters
2015-07-13 17:51:22 +08:00
wing328
6e7c70f247 fix sinatra outdated tag, use version tag 2015-07-13 17:43:18 +08:00
xhh
715c56afcc Rebuild petstore PHP sample with updated order on params 2015-07-13 16:51:19 +08:00
xhh
aad05c4dee Merge branch 'develop_2.0' into params-order
Conflicts:
	samples/client/petstore/php/SwaggerClient-php/lib/PetApi.php
	samples/client/petstore/php/SwaggerClient-php/lib/StoreApi.php
	samples/client/petstore/php/SwaggerClient-php/lib/UserApi.php
2015-07-13 16:48:19 +08:00
wing328
3f9d1607b6 Merge pull request #926 from wing328/php_support_file_response
[PHP] support "file" response
2015-07-13 15:51:20 +08:00
wing328
879c1b921c update php petstore sample 2015-07-13 15:31:20 +08:00
xhh
fb0b7d622f Merge branch 'develop_2.0' into params-order
Conflicts:
	modules/swagger-codegen/src/main/resources/php/api.mustache
2015-07-13 15:30:06 +08:00
wing328
f154e407d2 update coding style based on CodeSniffer 2015-07-13 15:26:12 +08:00
wing328
44705b566d add default version for package 2015-07-13 15:24:12 +08:00
wing328
71a22141bf add enum support for model property 2015-07-13 15:24:11 +08:00
wing328
38149173ff revert petstore json, fixed test case 2015-07-13 15:21:39 +08:00
wing328
2258a4632d fix test.php, fix default configuration 2015-07-13 15:21:39 +08:00
wing328
259b31ccd4 temporary folder setting 2015-07-13 15:21:38 +08:00
wing328
7f31da734d add file response for php, update test case 2015-07-13 15:09:09 +08:00
wing328
fcd0b31d7d add file response for php 2015-07-13 15:09:09 +08:00
wing328
4c2df94ec7 Merge pull request #953 from bletail/develop_2.0
Python/Python3 datetime and date type fixed
2015-07-13 15:05:13 +08:00
wing328
38760d2aa1 Merge pull request #915 from xhh/ruby-file-response
[Ruby] Support file downloading for Ruby API client
2015-07-13 14:50:40 +08:00
wing328
f6174051cb Merge pull request #931 from cbornet/oauth_support
generate oauth2 fields in the data for the templates
2015-07-13 14:39:14 +08:00
wing328
68915eeb8f Merge pull request #968 from mhardorf/develop_2.0
Cleaned up TypeScript code generator
2015-07-13 12:16:11 +08:00
wing328
1434691927 Merge pull request #916 from wing328/fix_optional
[Perl, Python AsyncScala] Fix optional tag in the template
2015-07-13 11:53:58 +08:00
wing328
b46efd839d Merge pull request #914 from webjunkie/patch-1
Optional is used in PHP template although not available
2015-07-13 11:52:55 +08:00
wing328
c7f8f0171b Merge pull request #919 from wing328/fix_java_android_path_issue
[Java, Android] Fix path variable name
2015-07-13 11:51:45 +08:00
wing328
045a3b44c1 Merge pull request #901 from tkQubo/feature/swift_develop_2.0
[Swift] Some fixes for SwiftGenerator for develop 2.0
2015-07-13 11:51:07 +08:00
wing328
6c85fc285a Merge pull request #959 from dilipkrish/develop_2.0
Updated the swagger-codegen sample for generating the service side stubs
2015-07-13 10:14:05 +08:00
Dilip Krishnan
7cc9581f04 Updated the mustache template to remove the spurious import
Also regenerated the spring-mvc server sample
2015-07-12 20:56:36 -05:00
Dilip Krishnan
9283249963 Updated the swagger-codegen sample for generating the service side stubs
for spring mvc using springfox implementation
2015-07-12 20:56:31 -05:00
Tony Tam
461f556289 Merge pull request #893 from sudohippie/develop_2.0-fork
Android & Java template modifications to check collectionFormat when creating query parameters
2015-07-09 10:11:54 -07:00
Martin Hardorf
e3d3641b96 Removed unused import 2015-07-09 14:57:40 +02:00
Martin Hardorf
7e8f8e85d7 Changed default name of the modelPackage 2015-07-09 14:55:15 +02:00
Martin Hardorf
abc7100a17 Removed unused code from the api classes 2015-07-09 14:54:36 +02:00
Morten Andersen
661b9d6315 Docker generate example 2015-07-09 12:58:33 +02:00
moander
a21c2be877 Set executable flag 2015-07-09 10:39:35 +00:00
moander
5c29cbf33d Build and run script for docker 2015-07-09 12:33:43 +02:00
Martin Hardorf
d3bc347e31 Changed base path to use contextPath 2015-07-09 10:34:39 +02:00
wing328
1f35f58841 add back summary and description to nodejs swagger.json 2015-07-09 14:05:08 +08:00
xhh
a51d71e728 Fix syntax error when there are no authMethods 2015-07-09 10:48:16 +08:00
wing328
b8c06505f6 use fully qualified name for Task 2015-07-09 10:21:55 +08:00
moander
80731633b4 Created a Dockerfile 2015-07-09 01:22:06 +02:00
Tobias Pfeifer
4c16366f45 fix SpringMVCServerCodegen for maps as in JavaClientCodegen 2015-07-08 15:45:38 +02:00
Martin Hardorf
4133cae2bc Fixed mustache to handle non-required parameters 2015-07-08 11:19:25 +02:00
Martin Hardorf
f6a1af2831 Changed maps to any and DateTime to Date 2015-07-08 11:17:06 +02:00
xhh
a24fee00cb Support primitive response in Ruby client 2015-07-08 16:46:31 +08:00
xhh
f42f329ace Parse "date" as Date in Ruby client 2015-07-08 13:10:28 +08:00
xhh
6fd2ccabee Merge branch 'develop_2.0' into ruby-debug 2015-07-08 12:38:21 +08:00
DariusM
20c7932df4 Python /python3 datetime and date fixed 2015-07-07 13:00:28 +02:00
wing328
e49fe7a12f better style for model, add <value> to all properties 2015-07-07 16:25:33 +08:00
wing328
b1b0e28f59 update c# style 2015-07-06 23:06:28 +08:00
Tony Tam
dfd8d5ef64 updated to latest release version 2015-07-06 04:55:12 -07:00
wing328
94768d44b5 better type comparision 2015-07-06 13:55:33 +08:00
wing328
3b1999af4b update csharp sample 2015-07-06 11:24:59 +08:00
wing328
7e4a82bcfb add readme 2015-07-06 11:18:05 +08:00
wing328
f823c0e26a update newtonsoft json 2015-07-06 11:03:36 +08:00
xhh
bf32777b67 Fix NullPointerException in tests, improve usage to addVars 2015-07-03 18:07:34 +08:00
wing328
987a61640b fix file upload issue. add error handling for status code 0 2015-07-03 17:39:27 +08:00
xhh
66d16cfeaf Validate parameter against allowed values (enum) 2015-07-03 16:46:23 +08:00
xhh
0bf4163389 Copy properties of intermediate (interface) models 2015-07-03 15:08:37 +08:00
xhh
b61a400d91 Copy properties of parent model to model with allOf
Also fix #936
2015-07-03 15:08:37 +08:00
wing328
55827fe516 fix model import for csharp 2015-07-03 14:20:54 +08:00
wing328
5c888ad039 better method comment 2015-07-03 13:55:51 +08:00
wing328
d7d6ba957e fix comment and use 4-space indentation 2015-07-03 11:45:31 +08:00
wing328
57b54d8ad7 update code style for apiclient, configuration and apiexception 2015-07-03 10:36:21 +08:00
Peter S. May
4b896c759c [C#] Use RestSharp's mechanism for path parameters in URL templates
Previously, a simple find-and-replace had been used to substitute path parameters into the path. Among other omissions, this resulted in special characters such as `/` being left unescaped.

The RestSharp request object, as it turns out, expects a path template in the same format as provided by Swagger (with param names in braces), to be filled in using `AddParameter()`. In this edit, the code now uses this mechanism. The form parameter values are now passed to `CallApi*()` as a `Dictionary<String, String>`, where they are added to the request before submission. Since this was already how query and form parameters (etc.) were implemented, the resulting code is more consistent with itself than before.
2015-07-02 15:33:30 -04:00
Ole Lensmar
aba755d3de Merge pull request #940 from xhh/jax-rs-classname
Sanitize API class name in Jax RS server codegen
2015-07-02 11:38:10 +02:00
xhh
fe35675168 Allow numbers for classname
and remove spaces
2015-07-02 17:15:53 +08:00
xhh
d825b96720 Sanitize API class name in Jax RS server codegen 2015-07-02 12:00:18 +08:00
wing328
422da698f6 import model only if it has import for c# 2015-07-02 11:18:41 +08:00
wing328
488e604207 use stream for file 2015-07-01 21:37:48 +08:00
xhh
846d282ba0 Add helper methods for last response 2015-07-01 18:48:31 +08:00
xhh
6f1dd5ce35 Store last response in a thread-safe way 2015-07-01 17:37:16 +08:00
xhh
108b2241c0 Validate model property against allowed values (enum)
when present with attribute setters
2015-07-01 17:18:29 +08:00
wing328
4d6dbf7d92 show return in doc only if it has a return 2015-07-01 15:16:28 +08:00
Nadezhda Makarkina
eca827613d Fixed #831: skipOverwrite flag has been added 2015-06-30 17:58:35 +03:00
wing328
2e76b56f30 revert file to String, add test case for upload file 2015-06-30 17:50:22 +08:00
wing328
f290de95dd update parameter name to camelize lower 2015-06-29 23:14:00 +08:00
wing328
59987a54a9 fix deserialization of string and other primitive 2015-06-29 22:16:38 +08:00
cbornet
2d59c5d190 generate oauth2 fields in the data for the templates
Fixes #347
2015-06-29 13:39:39 +02:00
wing328
9726ada8d1 fix return type and tempfolder 2015-06-29 15:30:34 +08:00
wing328
76ece5a4eb add file response support for c# (passed test cases) 2015-06-29 12:17:49 +08:00
kubo_takaichi
91af76cf41 Use CLI option 2015-06-27 23:24:49 +09:00
kubo_takaichi
65af735d6c Merge commit '4143e286374bdd384c39a68df1f8f3a3eb58e6a4' into feature/swift_develop_2.0 2015-06-27 21:19:32 +09:00
wing328
30bc58f6ff Merge branch 'fix_optional' of https://github.com/wing328/swagger-codegen into fix_optional 2015-06-26 23:57:06 +08:00
wing328
3eca940e7d fix perl and asyncscala optional tab 2015-06-26 23:56:20 +08:00
wing328
38d62d768a fix optional for python, python3 2015-06-26 23:56:20 +08:00
xhh
1de6952279 Support customizing default headers via config option
for example:

    config.default_headers['X-MY-HEADER'] = 'my-header-value'
2015-06-26 19:09:20 +08:00
xhh
54d6a7e19c Merge branch 'develop_2.0' into ruby-file-response 2015-06-26 17:44:37 +08:00
xhh
fafddbf040 Fix naming in specs 2015-06-26 17:16:38 +08:00
xhh
d8b0cb739f Add config file for bin/ruby-petstore.sh
to rename swagger_client to petstore
2015-06-26 17:15:14 +08:00
xhh
2d3d35cfd7 Rebuild Ruby petstore client 2015-06-26 16:37:58 +08:00
xhh
8c10e4f2b0 Remove unused code 2015-06-26 16:06:32 +08:00
xhh
0ac1ef266f Avoid more monkey-patching 2015-06-26 16:04:18 +08:00
xhh
327128dbba Fix "date" type deserialization 2015-06-26 15:57:46 +08:00
xhh
16e80c65d7 Avoiding monkey-patching in Ruby API client 2015-06-26 15:56:59 +08:00
xhh
40c9f05536 Merge branch 'develop_2.0' into ruby-debug 2015-06-26 10:38:58 +08:00
wing328
091e76703c update sample 2015-06-26 10:35:50 +08:00
wing328
6a24b328e3 fix variable name in path 2015-06-26 10:30:12 +08:00
Tony Tam
4143e28637 Merge branch 'wing328-csharp_add_cli_support' into develop_2.0 2015-06-25 11:55:41 -07:00
Tony Tam
31efefe0b9 Merge branch 'csharp_add_cli_support' of ssh://github.com/wing328/swagger-codegen into wing328-csharp_add_cli_support 2015-06-25 11:54:30 -07:00
Tony Tam
e60bd564cb Merge pull request #864 from geekerzp/python-cli-option
[Python] Enabling cli config options for python generator
2015-06-25 11:53:29 -07:00
Tony Tam
69b75bb1af Merge pull request #885 from mhardorf/develop_2.0
Added support for TypeScript generation for AngularJS and Node.js
2015-06-25 11:53:21 -07:00
Tony Tam
1fb796f14d Merge pull request #891 from who/develop_2.0
Replacing getClientResponseStatus() with getStatusInfo()
2015-06-25 11:53:10 -07:00
Tony Tam
e996498a24 Merge pull request #913 from xhh/scala-warnings
[Scala] Fix warnings and upgrade jersey for Scala client
2015-06-25 11:52:57 -07:00
Tony Tam
c3d1367e7c Merge pull request #894 from wing328/csharp_add_nunit
[C#] Add NUnit test
2015-06-25 11:52:19 -07:00
Tony Tam
69eae7d35b merged 2015-06-25 10:23:05 -07:00
Tony Tam
162d1d1f98 merged 2015-06-25 10:21:38 -07:00
Tony Tam
07d5365c5c merged from #902, rebuilt client 2015-06-25 10:17:28 -07:00
Tony Tam
f1239aba6c Merge pull request #908 from wing328/fix_php_file_sep
[PHP] Fix regular expression in toPackagePath
2015-06-25 10:10:30 -07:00
Tony Tam
37620518e7 Merge pull request #892 from wing328/add_sinatra
[Ruby] Add back Sinatra tempates
2015-06-25 10:10:22 -07:00
William Cheng
9d739a44cd update python test case 2015-06-25 21:47:00 +08:00
wing328
18ac6e8aae fix perl and asyncscala optional tab 2015-06-25 23:10:25 +08:00
wing328
8cce7ac053 fix optional for python, python3 2015-06-25 22:40:14 +08:00
xhh
e6e1db2064 Support looser format when detecting filename 2015-06-25 16:26:04 +08:00
xhh
ceafbcc97f Add config option for file downloading folder. Log about file downloading 2015-06-25 16:07:02 +08:00
xhh
f3a0f464f7 Support file downloading in Ruby generator 2015-06-25 15:35:48 +08:00
Raghav Sidhanti
1af23fb751 Unit tests for Android and Java parameterToPairs method 2015-06-24 11:55:03 -07:00
Raghav Sidhanti
ea76f34de5 Merge branch 'develop_2.0' of https://github.com/swagger-api/swagger-codegen into develop_2.0-fork 2015-06-24 11:25:32 -07:00
Julian Bez
8ce3823698 Change to not required 2015-06-24 16:34:32 +02:00
Julian Bez
644231b915 Change optional to required 2015-06-24 16:32:49 +02:00
xhh
621e3e7b1a Add comments for some configuration options 2015-06-24 15:57:01 +08:00
wing328
6aac24398a update model to support inheritance (#879) 2015-06-24 14:34:05 +08:00
xhh
545fb52b7d Merge branch 'develop_2.0' into ruby-debug 2015-06-24 14:10:47 +08:00
Ole Lensmar
8e6c0f96fb updated documentation and removed java-specific parameters from general configuration 2015-06-24 07:31:10 +02:00
Gabriel Radu
1b1f860c82 Add a pathPrefix key to the operations key 2015-06-24 03:28:38 +01:00
Ole Lensmar
50dd196d42 fixed code formatting and imports 2015-06-24 00:12:50 +02:00
Ole Lensmar
ce6ec20fef added config parameters for all default parameters and a configOptions map for language specific parameters 2015-06-24 00:11:13 +02:00
Ole Lensmar
11e56f5c9c Merge pull request #898 from garethjevans/develop_2.0
Contributed maven plugin to the swagger-codegen project
2015-06-23 23:20:49 +02:00
nmonterroso
efd5b806be updating php generated samples and updating tests 2015-06-23 09:27:52 -07:00
nmonterroso
1b4c71c280 re-adding Configuration->deleteDefaultHeader 2015-06-23 09:27:34 -07:00
wing328
d83036ccdf fix regular expression 2015-06-23 22:36:57 +08:00
wing328
d18426c69a fix reg expression 2015-06-23 22:30:43 +08:00
wing328
351833a923 test fix 2015-06-23 21:52:00 +08:00
wing328
2979d93829 use replace instead of replaceAll 2015-06-23 21:47:10 +08:00
Martin Hardorf
2fce2e4109 Removed wrong hasMore from Angular TypeScript mustache 2015-06-23 15:37:07 +02:00
xhh
13d350be2e Fix warnings and upgrade jersey for Scala client
* Upgrade jersey to latest version (from 1.7 to 1.19)
* Replace getClientResponseStatus() with getStatusInfo()
* Fix the following maven warnings and model import warnings

    [WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:build-helper-maven-plugin is missing. @ line 72, column 15
    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

    [WARNING]  Expected all dependencies to require Scala version: 2.10.4
    [WARNING]  com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.2 requires scala version: 2.10.4
    [WARNING]  org.scala-lang:scala-reflect:2.10.4 requires scala version: 2.10.4
    [WARNING]  io.swagger:swagger-scala-client:1.0.0 requires scala version: 2.10.4
    [WARNING]  org.scalatest:scalatest_2.10:2.1.3 requires scala version: 2.10.3
    [WARNING] Multiple versions of scala libraries detected!

   [WARNING] /Users/xhh/projects/swagger-codegen/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala:3: warning: imported `Category' is permanently hidden by definition of object Category in package model
2015-06-23 21:23:48 +08:00
wing328
550493ba84 fix php separator 2015-06-23 21:20:12 +08:00
Martin Hardorf
c45af23946 Fixed headerParams and paramName 2015-06-23 12:05:43 +02:00
xhh
19ee56592e Allow customizing SSL CA certificate
by adding a `ssl_ca_cert` configuration option
2015-06-23 17:23:22 +08:00
kubo_takaichi
aec4af1b88 Replace slash with File.separator 2015-06-23 16:10:21 +09:00
xhh
46869df631 Make HTTP response accessible by storing the last response
so that users are able to retrieve, for example, rate-limit headers
from the response
2015-06-23 15:02:40 +08:00
nmonterroso
c91a1b963b change serializer to be instanced, rather than static methods 2015-06-22 21:33:44 -07:00
nmonterroso
2fced0f634 Revert "Updates to csharp model template to support inheritance"
This reverts commit 5f1df9e093.
2015-06-22 21:12:13 -07:00
nmonterroso
60b0ffeb0e don't prepend the invokerPackage - an artifact from an earlier implementation 2015-06-22 21:06:22 -07:00
nmonterroso
6623e120cd renaming to Configuration 2015-06-22 20:53:59 -07:00
nmonterroso
46ec934a9c java7 doesn't have replace, but put operates as such, so switch to that 2015-06-22 20:49:12 -07:00
nmonterroso
5a9e9550ca fixing php-doc 2015-06-22 20:43:00 -07:00
nmonterroso
8e0142338e removing unused imports 2015-06-22 20:36:57 -07:00
nmonterroso
61e368ce87 Merge remote-tracking branch 'swagger/develop_2.0' into php-upgrades 2015-06-22 20:29:09 -07:00
nmonterroso
c93b0dd3b8 make srcBasePath configureable 2015-06-22 20:24:19 -07:00
kubo_takaichi
79e31a5761 Add a workaround against void forcibly being converted to string 2015-06-23 12:20:00 +09:00
kubo_takaichi
fa3a9a9d61 Change class package 2015-06-23 12:20:00 +09:00
kubo_takaichi
febaa340e3 Treat object as String (temporary measure) 2015-06-23 12:20:00 +09:00
kubo_takaichi
bcab55e3ef Tighten parameter requirement 2015-06-23 12:20:00 +09:00
kubo_takaichi
24465d2df4 Change model naming 2015-06-23 12:20:00 +09:00
kubo_takaichi
8540ac71c8 Update swift code generation script 2015-06-23 12:20:00 +09:00
kubo_takaichi
9e47042122 Update models 2015-06-23 12:20:00 +09:00
kubo_takaichi
e0109afc60 Fix typo 2015-06-23 12:20:00 +09:00
kubo_takaichi
ff88f7175d Update models 2015-06-23 12:20:00 +09:00
kubo_takaichi
c9a9b0ad2b Refine authMethods description 2015-06-23 12:20:00 +09:00
kubo_takaichi
db01ec801f Add suppressRequired functionality 2015-06-23 12:20:00 +09:00
kubo_takaichi
495e528eec Add generated code 2015-06-23 12:20:00 +09:00
kubo_takaichi
a7c91d610f Add error response body to NSError 2015-06-23 12:20:00 +09:00
kubo_takaichi
d08acf7298 Add a dateTime formatter candidate 2015-06-23 12:20:00 +09:00
kubo_takaichi
7be35bb02e Change method name to avoid name collision 2015-06-23 12:20:00 +09:00
Raghav sidhanti
b4d6fd3ba3 Returning when query param value is null. 2015-06-22 20:16:35 -07:00
nmonterroso
d5d1483656 properly account for custom and non-custom settings for modelPackage and apiPackage 2015-06-22 20:14:54 -07:00
Tony Tam
02c41ac574 fix for #900, invalid param name for java client 2015-06-22 20:00:28 -07:00
nmonterroso
3a6f431f62 make packagePath configureable, and remove unused code 2015-06-22 19:34:03 -07:00
nmonterroso
4fe979a8c0 code compiles and *should* work, but need to re-organize for separate client/api-specific class namespaces 2015-06-22 19:26:26 -07:00
xhh
3b6a3b4a38 Add logging for API call entry and result 2015-06-23 10:12:20 +08:00
nmonterroso
da14c9e692 changing to invokerPackage 2015-06-22 19:09:32 -07:00
nmonterroso
b8b003bc83 Merge remote-tracking branch 'swagger/develop_2.0' into php-upgrades
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java
	modules/swagger-codegen/src/main/resources/php/ApiClient.mustache
	modules/swagger-codegen/src/main/resources/php/ApiException.mustache
	modules/swagger-codegen/src/main/resources/php/api.mustache
	modules/swagger-codegen/src/main/resources/php/autoload.mustache
	modules/swagger-codegen/src/main/resources/php/configuration.mustache
	modules/swagger-codegen/src/main/resources/php/model.mustache
	modules/swagger-codegen/src/test/scala/php/PhpModelTest.scala
2015-06-22 19:09:13 -07:00
xhh
229ea93627 Add debugging switch to Ruby generator 2015-06-23 10:06:01 +08:00
xhh
24296eacea Merge branch 'develop_2.0' into params-order
Conflicts:
	samples/client/petstore/ruby/lib/swagger_client/api/pet_api.rb
2015-06-23 10:02:18 +08:00
Raghav Sidhanti
6958db3d3d Refactored Pairs to use List instead of Set. 2015-06-22 17:14:18 -07:00
Raghav Sidhanti
32b50e7c8e Refactored parameterToPairs 2015-06-22 17:02:00 -07:00
Tony Tam
b803895750 Merge pull request #865 from ammmze/feature/php-namespace-and-doc
Improve PHP namespace support
2015-06-22 16:53:57 -07:00
Tony Tam
d1153dfeb4 Merge pull request #866 from geekerzp/develop_2.0_objc_deserialize_map
[Objc] bug fix for map response
2015-06-22 16:53:28 -07:00
Tony Tam
385fab225e Merge pull request #871 from xhh/ruby-object-type
[Ruby] Support deserialization of "object" type in Ruby generator
2015-06-22 16:53:21 -07:00
Tony Tam
89a5abb217 Merge pull request #870 from wing328/perl_cli_support
[Perl] Add CLI config options and code enhancement
2015-06-22 16:53:12 -07:00
Raghav Sidhanti
79a5614be9 Invalid strings will be passed as blank query param. 2015-06-22 15:55:29 -07:00
Raghav Sidhanti
a1b56c9b83 Renamed QueryParam to Pair class in Android templates. 2015-06-22 15:28:29 -07:00
Raghav Sidhanti
ecddfb7ccf Renamed QueryParam to Pair class in Java templates. 2015-06-22 15:16:45 -07:00
nmonterroso
bd5eb7ace3 update tests 2015-06-22 12:30:52 -07:00
nmonterroso
8e15bd6a85 call setHost on config 2015-06-22 12:13:39 -07:00
nmonterroso
5ef50f9f4b rename ApiConfiguration to ApiClientConfiguration 2015-06-22 12:07:48 -07:00
nmonterroso
a6331244e1 move all configuration to ApiConfiguration 2015-06-22 12:05:22 -07:00
nmonterroso
01d7776fc1 don't create a new response object, and keep the old string value in the exception and have the object as ApiException->responseObject 2015-06-22 11:47:23 -07:00
nmonterroso
109b7eeaec adding static setters/getters for models since members are no public 2015-06-22 11:19:01 -07:00
nmonterroso
5de99bafa7 fixing package output 2015-06-22 11:18:36 -07:00
Gareth Evans
a664abcf51 Contributed maven plugin to the swagger-codegen project 2015-06-22 19:17:29 +01:00
nmonterroso
6f11092a57 call setHost using API baspath when no apiclient is provided 2015-06-22 10:35:57 -07:00
nmonterroso
e598384d97 move authentication to the API level, so that supporting classes aren't api-specific 2015-06-22 10:31:38 -07:00
nmonterroso
53bddae904 separate serialization responsibility to ObjectSerializer class 2015-06-22 09:47:28 -07:00
nmonterroso
1519912a1a cleaning up some php doc 2015-06-22 09:26:45 -07:00
nmonterroso
b3a3bdd2e0 add fully-qualified class names to deserialize params 2015-06-22 09:18:41 -07:00
nmonterroso
04be474f56 moving $host back to ApiClient and making ApiClient setters fluent 2015-06-22 08:36:49 -07:00
nmonterroso
99e963709b renaming configuration 2015-06-22 08:30:08 -07:00
nmonterroso
b9ca19168a remove static fields in Configuration and make variable case more consistent 2015-06-22 08:28:22 -07:00
geekerzp
acf09da578 Fix typo in python codegen 2015-06-22 16:35:15 +08:00
wing328
1d59937150 add nunit test for csharp 2015-06-22 11:53:44 +08:00
nmonterroso
caa1b7f411 generate model imports for support files, and use them as imports 2015-06-19 15:20:29 -07:00
Raghav Sidhanti
7a9a41fe01 Java and Android template changes to accommodate query params defined by the collection-format. 2015-06-19 14:06:25 -07:00
nmonterroso
acdc5328fe deserialize thrown exceptions 2015-06-19 11:24:56 -07:00
nmonterroso
3252dd0d18 check for null array in constructor 2015-06-19 10:32:38 -07:00
nmonterroso
5c409884b9 make setters fluent 2015-06-19 10:31:05 -07:00
nmonterroso
f9f58596b8 account for return type where the response type is in a list container, and properly import models into operations 2015-06-18 16:51:24 -07:00
nmonterroso
bb11322919 use proper namespaces, getters/setters, and phpdocs 2015-06-18 15:41:12 -07:00
nmonterroso
4495774fd5 proper autoloader and move generated files to PSR-4 compliant locations 2015-06-18 15:08:45 -07:00
Andrew B
1aeb50feef Replacing getClientResponseStatus() with getStatusInfo() 2015-06-18 14:41:17 -07:00
Branden Cash
b74050dd7b Change to use the autoload.php and change the namespacing 2015-06-18 11:45:08 -07:00
Branden Cash
2ac7384abf Fix tests 2015-06-18 11:43:54 -07:00
Branden Cash
eed45a41a3 Fixed the missing closing doc chars and updated sample 2015-06-18 11:43:54 -07:00
Branden Cash
69c2f6f945 Add phpdoc for the api.apiClient 2015-06-18 11:43:54 -07:00
Branden Cash
5119299e8a Remove unused code 2015-06-18 11:43:54 -07:00
Branden Cash
719a0b732e Update sample client 2015-06-18 11:43:48 -07:00
Branden Cash
8ed690cad0 Better namespace support, so that your not limited to only having a single vendor space, you can have \Vendor\Package\Model as a namespace. Also updates with proper phpdoc comments so that IDE code hinting can function properly. 2015-06-18 11:41:14 -07:00
William Cheng
f957471509 update silex sample code location 2015-06-19 02:37:08 +08:00
William Cheng
0b0325b8af update readme, fix swaggering name 2015-06-19 02:32:50 +08:00
William Cheng
d178d5e7d8 add sinatra template 2015-06-19 02:11:08 +08:00
nmonterroso
4ef34680cd renaming to ApiClient.mustache 2015-06-18 10:30:53 -07:00
wing328
6ab7be4058 add package version 2015-06-18 22:20:52 +08:00
wing328
df72188bc0 add cli support to csharp 2015-06-18 22:06:59 +08:00
geekerzp
8d18aee2f2 Update test case test_deserialize_to_dict of python client 2015-06-18 22:02:54 +08:00
Martin Hardorf
449ba4f644 Fixed required parameters for APIs in TypeScript 2015-06-18 12:42:04 +02:00
geekerzp
194c8ff71d Update config-help message of python client 2015-06-18 10:43:25 +08:00
geekerzp
62f4c252f2 Update python codegen.
* Update config-help message.
* Do not sanitize packageName to underscore format.
2015-06-18 10:43:24 +08:00
geekerzp
5d19ef6146 Generate the python into python/ folder directly 2015-06-18 10:43:24 +08:00
geekerzp
a32335dfbc Enable cli config options for python generator 2015-06-18 10:43:24 +08:00
geekerzp
6b6480a026 Updated xcode project of objc client 2015-06-18 10:38:19 +08:00
geekerzp
a4df33d040 Add comments for SWGJSONResponseSerializer#responseObjectForResponse
method of objective-c client.
2015-06-18 10:03:51 +08:00
geekerzp
8b15416be5 Add SWGJSONResponseSerializer for objective-c client.
If the response data is valid json, return the deserialized json.
If the response data is invalid json, return the string of response data.
2015-06-18 10:03:51 +08:00
geekerzp
bc92465bf7 Update Objective-C method description (doc comments) style 2015-06-18 10:03:51 +08:00
geekerzp
a6bdc35d59 Support pure object response for objc client 2015-06-18 10:03:51 +08:00
geekerzp
c50c8b724d Support map response for objc client.
completed.
2015-06-18 10:03:50 +08:00
geekerzp
0da3e58fff Support map response for objc client.
not completed
2015-06-18 10:03:12 +08:00
xhh
edcb71ad22 Merge branch 'develop_2.0' into params-order
Conflicts:
	bin/all-petstore.sh
2015-06-18 09:59:13 +08:00
xhh
d6d707543d Merge branch 'develop_2.0' into ruby-object-type
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java
2015-06-18 09:56:58 +08:00
William Cheng
8858e7d7e3 update perl sample 2015-06-18 02:44:40 +08:00
William Cheng
64b46c2e15 update indentation, remove export 2015-06-18 02:40:15 +08:00
wing328
82baa7ce4b update help text 2015-06-18 10:57:10 +08:00
wing328
d7315b56dc removed non-perl update 2015-06-18 10:57:10 +08:00
wing328
10e07eaf74 add support for cli (perl) 2015-06-18 10:57:09 +08:00
Martin Hardorf
e7d4a438dd Added tests for TypeScript Angular and Node.js 2015-06-17 17:58:52 +02:00
Martin Hardorf
9e8631b75f Added shell scripts for sample generation of TypeScript 2015-06-17 17:56:37 +02:00
Tony Tam
e39ec927a2 Merge pull request #879 from shoatman/master
Updates to csharp model template to support inheritance
2015-06-17 08:30:07 -07:00
Tony Tam
6ad3a717fe Merge pull request #882 from wing328/php_add_silex
[PHP] add Silex server-side codegen
2015-06-17 08:29:48 -07:00
Tony Tam
f66b5cf65b Merge pull request #867 from wing328/fix_jar_path
[Bug fix] Fix path inside JAR for non-template files
2015-06-17 08:28:30 -07:00
Tony Tam
d8c337185f Merge pull request #857 from wing328/php_warning
[PHP] Remove PHP5.3 warning
2015-06-17 08:27:47 -07:00
Tony Tam
5ade64b3e1 Merge pull request #856 from wing328/csharp_upgrade_restsharp
[C#] upgrade restsharp to 105.1.0
2015-06-17 08:27:10 -07:00
Tony Tam
e65a079f0e Merge pull request #855 from geekerzp/develop_2.0_python_deserialize_map
[Python] bug fix for map response
2015-06-17 08:26:58 -07:00
Tony Tam
378ffffdc7 Merge pull request #854 from geekerzp/develop_2.0_objc_pro_rename
[Objc] Change xcode project name in objc sample code
2015-06-17 08:26:42 -07:00
Tony Tam
dd356b54c0 Merge pull request #853 from wing328/perl_support_map3
[Perl] update deserialization to support Map and List
2015-06-17 08:25:45 -07:00
Tony Tam
f56388845c Merge pull request #850 from xhh/ruby-cli-option2
[Ruby] Enabling cli config options for ruby generator
2015-06-17 08:25:34 -07:00
William Cheng
436db1f8e7 add __toString and update php sample 2015-06-17 19:00:29 +08:00
Martin Hardorf
ba4b88ef86 Fixed TypeScript mustache 2015-06-17 12:22:15 +02:00
xhh
b39d44db03 Add missing petstore scripts to bin/all-petstore.sh 2015-06-17 16:16:44 +08:00
xhh
9c4e5ed596 Rebuild Petstare sample for Java, Android, PHP, etc. 2015-06-17 16:15:37 +08:00
wing328
ce40da0f71 add php silex server side codegen 2015-06-17 16:01:24 +08:00
xhh
7f4586a47f Fix comment regarding required parameter in PHP generator 2015-06-17 16:00:59 +08:00
xhh
24a2de7389 Sort parameters to move required ones in front of optional ones 2015-06-17 16:00:16 +08:00
Shane Oatman
5f1df9e093 Updates to csharp model template to support inheritance 2015-06-16 12:12:17 -07:00
xhh
5435777c65 Merge remote-tracking branch 'origin/develop_2.0' into ruby-object-type 2015-06-16 18:42:18 +08:00
xhh
7c355030f4 Add to_s method for models 2015-06-16 18:41:51 +08:00
Nadezhda Makarkina
7b5b874fdc Fixed #798: original jar generation has been fixed. 2015-06-16 11:58:22 +03:00
Martin Hardorf
f87bb12ebb Added support for TypeScript generation for AngularJS and Node.js 2015-06-16 10:44:05 +02:00
xhh
d2d5cf0d57 Add convention notes to Ruby CLI options 2015-06-16 12:17:11 +08:00
xhh
6348f67b18 Merge remote-tracking branch 'origin/develop_2.0' into ruby-cli-option2 2015-06-16 12:07:15 +08:00
Ron
eaf5a371ff Merge pull request #863 from wing328/fix_typo
Fixed a minor typo with the command example
2015-06-15 13:20:05 +03:00
Ron
dee0948e3e Update README.md 2015-06-15 13:19:56 +03:00
xhh
a59d4ba346 Add test case for finding nonexistent pet 2015-06-15 16:51:38 +08:00
xhh
ec8e5179cb Remove unused comments 2015-06-15 16:46:30 +08:00
xhh
9d5928551b Unify ClientError and ServerError into ApiError
in Ruby generator
2015-06-15 16:38:08 +08:00
wing328
456e17430b Merge branch 'php_warning' of https://github.com/wing328/swagger-codegen into php_warning 2015-06-15 15:51:12 +08:00
wing328
839f0971f0 rename php ApiClient 2015-06-15 15:50:40 +08:00
xhh
e9c1dd7842 Regard bare "object" type as Object, add comments
The handling of base "object" type (without definions of
"additionalProperties") is similar to Java generator now.
2015-06-15 12:49:17 +08:00
wing328
24b110be9d show writing file for non-template file 2015-06-14 01:27:47 +08:00
wing328
7a560865a0 fix jar path in windows 2015-06-14 00:59:40 +08:00
geekerzp
718a9a79ed Update test case test_deserialize_to_object of python client. 2015-06-13 19:05:15 +08:00
geekerzp
ff9623fb5c Support pure object response for python client. 2015-06-13 18:58:27 +08:00
xhh
80616b4c2b Add test cases for StoreApi#get_inventory 2015-06-12 23:03:17 +08:00
xhh
36f0ed6d0c Add test cases for Response#deserialize 2015-06-12 22:44:52 +08:00
xhh
4c8c6c3880 Rebuild Ruby Petstore sample 2015-06-12 20:18:50 +08:00
xhh
e38fc2c3da Deserialize response for "object" type in Ruby client 2015-06-12 20:15:48 +08:00
wing328
2fdae91cbc fix a typo in readme 2015-06-12 16:12:54 +08:00
William Cheng
7aab1eaffb update test.php to put exception test at last 2015-06-10 23:53:56 +08:00
wing328
a0c55693dc add test case for loginUser, separate test cases into different files 2015-06-10 21:59:48 +08:00
wing328
9aca2868b9 change static method to instance method, update test case to remove php warning 2015-06-10 21:18:48 +08:00
wing328
4982784d7c upgrade restsharp to 105.1.0 2015-06-10 15:57:07 +08:00
geekerzp
e2d441e862 support map type response for python client 2015-06-10 11:55:12 +08:00
wing328
303dbe7730 fix array,map for perl, add test case 2015-06-10 10:53:21 +08:00
geekerzp
d7b10a17c1 Renamed objc client from PetstoreClient to SwaggerClient 2015-06-10 10:53:16 +08:00
Alexey Nechaev
3f194d3288 Fixed #837: Generation of default values for complex arrays and maps has been improved. 2015-06-09 19:34:09 +03:00
fehguy
672fcd5a14 updated dev version 2015-06-09 01:36:52 -07:00
fehguy
3768932ba2 updated dev version 2015-06-09 01:36:48 -07:00
Tony Tam
eafcc43295 Merge pull request #851 from swagger-api/develop_2.0
merge from develop 2.0 for release
2015-06-09 01:13:42 -07:00
xhh
1315e2d72c Add new line to make code more readable 2015-06-09 15:47:37 +08:00
xhh
44780e6e1b Merge branch 'develop_2.0' into ruby-cli-option2
Conflicts:
	modules/swagger-codegen/src/main/resources/ruby/swagger/version.mustache
2015-06-09 15:44:50 +08:00
fehguy
570383d5d5 updated name, disabled test 2015-06-09 00:41:08 -07:00
fehguy
3d2f09a693 updated versions 2015-06-09 00:25:09 -07:00
Tony Tam
33c2b1b623 Merge pull request #849 from wing328/fix_podfile
Fix objc podfile in sample
2015-06-09 00:18:24 -07:00
wing328
207776cec6 udpate podfile 2015-06-09 15:14:37 +08:00
Tony Tam
3b3738e587 Merge pull request #847 from wing328/fix_indentation
Fix indentation
2015-06-08 23:43:09 -07:00
wing328
680078dc58 fix csharp refer to apiinvoker 2015-06-09 13:52:01 +08:00
wing328
a593271de1 rollback flash apiinvoker based on 8ee8eddcff 2015-06-09 13:33:30 +08:00
wing328
7fd996bc86 update php sample 2015-06-09 13:31:14 +08:00
wing328
d155ddd026 rollback java spring mvc template 2015-06-09 13:15:03 +08:00
wing328
fc38b9bb79 rollback akkascala to another commit (637ee77d66) 2015-06-09 13:13:56 +08:00
wing328
29c41adddf rollback java jxrs template 2015-06-09 13:11:16 +08:00
wing328
180d48e89d rollback java template 2015-06-09 13:08:32 +08:00
wing328
900f39686d rollback grovvy template 2015-06-09 13:07:45 +08:00
wing328
46c5b776ed rollback csharp template 2015-06-09 13:04:34 +08:00
wing328
7b6480f7f8 rollback codegen template 2015-06-09 13:04:03 +08:00
wing328
f610958209 rollback asyncscala template 2015-06-09 13:03:29 +08:00
wing328
ab9daaacd6 rollback android template 2015-06-09 13:02:54 +08:00
wing328
a8f6044c9b rollback akka-scala template 2015-06-09 13:01:50 +08:00
wing328
6efef51036 rollback validator template 2015-06-09 13:01:11 +08:00
wing328
6617af5209 rollback tizen template 2015-06-09 13:00:42 +08:00
wing328
410144ea1c rollback swift template 2015-06-09 13:00:13 +08:00
wing328
d8060f47a8 rollback swagger-static template 2015-06-09 12:58:41 +08:00
wing328
f2ee63da3b rollback scalatra template 2015-06-09 12:57:31 +08:00
wing328
b636d2a2c9 rollback scala template 2015-06-09 12:56:26 +08:00
wing328
7d6fdf96c0 rollback retroit template 2015-06-09 12:54:48 +08:00
wing328
b1f5c0314e rollback objc templates 2015-06-09 12:53:33 +08:00
wing328
eede02a6ab rollback nodejs and htmldocs template 2015-06-09 12:51:52 +08:00
wing328
eee8685847 rollback flash template 2015-06-09 12:47:18 +08:00
wing328
6253bbff3d roll back qt5cpp template 2015-06-09 12:42:07 +08:00
wing328
263b4080ee rollback python3 template 2015-06-09 12:40:45 +08:00
wing328
50ae9659ad rollback php template 2015-06-09 12:37:30 +08:00
wing328
2e12ac5957 rollback perl template 2015-06-09 12:34:38 +08:00
wing328
5f6622c70d rollback ruby template 2015-06-09 12:33:30 +08:00
wing328
d5cbbae182 rollback ruby swagger template 2015-06-09 12:26:02 +08:00
wing328
0dd8670724 rollback python template 2015-06-09 12:22:59 +08:00
xhh
d2a82d56aa Enable CLI options for Ruby generator 2015-06-09 10:16:52 +08:00
Tony Tam
915ad77d03 Merge branch 'develop_2.0' 2015-06-08 16:22:15 -07:00
Tony Tam
f025dda4e2 merged 2015-06-08 16:21:58 -07:00
Ron
1644956a9c Merge pull request #843 from swagger-api/repackage
merge repackage into development
2015-06-08 19:13:10 -04:00
Tony Tam
b1cea25237 updated version 2015-06-08 16:07:31 -07:00
Tony Tam
c1ddb84839 restored imports 2015-06-08 16:04:04 -07:00
Tony Tam
445d0f7928 rebuilt 2015-06-08 15:48:49 -07:00
Tony Tam
637ee77d66 added script, fixed templates 2015-06-08 15:40:05 -07:00
Ron
fb989fcd0e Integrated UI with the generator's packaging process 2015-06-08 16:25:37 -04:00
Tony Tam
64ea3f8177 rebuilt 2015-06-07 20:50:35 -07:00
Tony Tam
aaa0603e29 rebuilt, added back imports 2015-06-07 20:47:22 -07:00
Tony Tam
450edae160 fixed imports 2015-06-07 20:35:56 -07:00
Tony Tam
4f0198dd13 rebuilt, fixed test imports 2015-06-07 20:30:41 -07:00
Ron
56714e6c07 Code fixes after reformatting 2015-06-07 23:20:34 -04:00
Ron
aa0586c666 Dependency update 2015-06-07 11:56:34 -04:00
Ron
8ee8eddcff Code reformatting 2015-06-07 11:56:26 -04:00
Ron
1c2d0656b0 Code reformatting 2015-06-07 11:56:08 -04:00
Ron
22d7db2cb4 url changes 2015-06-07 11:46:11 -04:00
Ron
96107193e9 updated reverb references 2015-06-07 11:18:49 -04:00
Ron
1a39678206 Refactoring 2015-06-07 11:05:00 -04:00
Tony Tam
6c57810128 rebuilt 2015-06-07 00:08:01 -07:00
Tony Tam
8c340d52a4 updated packages 2015-06-06 23:58:36 -07:00
Tony Tam
1df3ed4487 repackaged 2015-06-06 23:44:20 -07:00
Tony Tam
0c1657d744 updated package 2015-06-06 23:43:34 -07:00
Tony Tam
44af46c9b3 updated files 2015-06-06 23:11:28 -07:00
Tony Tam
18eb3cde97 updated files 2015-06-06 23:11:20 -07:00
Ron
776508759d Merge pull request #834 from xhh/fix-package
Fix package name for generator/online/Generator.java
2015-06-05 23:26:43 -04:00
xhh
6a7fa67581 Fix package name in test 2015-06-06 10:43:04 +08:00
xhh
3f97d63886 Fix package name for generator/online/Generator.java 2015-06-06 09:01:08 +08:00
Tony Tam
c3d2a581c9 Merge pull request #790 from xhh/java-accept-contenttype
Minor improvement to Java API client accept and content-type header
2015-06-05 17:51:23 -07:00
xhh
d345283ab5 Merge branch 'develop_2.0' into java-accept-contenttype
Conflicts:
	modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JavaClientCodegen.java
	modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache
	modules/swagger-codegen/src/main/resources/Java/api.mustache
	samples/client/petstore/java/src/main/java/io/swagger/client/ApiClient.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java
	samples/client/petstore/java/src/test/java/io/swagger/client/ApiClientTest.java
2015-06-06 08:46:19 +08:00
Tony Tam
ddbef8b25d implemented processOpts to avoid clobbering by superclass 2015-06-05 11:40:30 -07:00
Tony Tam
d2cb05f14f Merge pull request #797 from geekerzp/develop_2.0_python_auth
[Python] Add authentication support (API key, HTTP basic)
2015-06-05 09:15:54 -07:00
Tony Tam
3fe2169ffa Merge branch 'Hadou1-Generic_API_Exception' into develop_2.0 2015-06-05 08:46:22 -07:00
Tony Tam
ab5b2da21a Merge branch 'Generic_API_Exception' of ssh://github.com/Hadou1/swagger-codegen into Hadou1-Generic_API_Exception 2015-06-05 08:46:02 -07:00
Tony Tam
b4f153c202 Merge pull request #826 from xhh/java-auth
[Java] Add authentication support (API key, HTTP basic)
2015-06-05 08:45:08 -07:00
Tony Tam
0d09d43257 Merge pull request #823 from wing328/fix_file_rename
[C#] Fix ApiException file name
2015-06-05 08:43:08 -07:00
Tony Tam
98c303042e Merge pull request #829 from wing328/php_support_map
[PHP] bug fix for map, added test case
2015-06-05 08:41:58 -07:00
wing328
d0f9345c5a fix php map, add test case for get inventory 2015-06-05 21:57:12 +08:00
xhh
fffc5d7c35 Move authentications into ApiClient 2015-06-05 20:00:32 +08:00
Fredrik Gustafsson
e737964f66 minor refactoring 2015-06-05 13:51:52 +02:00
Fredrik Gustafsson
8f2e84d263 Merge branch 'develop_2.0' into Generic_API_Exception
Conflicts:
	modules/swagger-codegen/src/main/resources/csharp/apiException.mustache
2015-06-05 12:47:48 +02:00
xhh
947935f3d9 Merge remote-tracking branch 'origin/develop_2.0' into java-auth
Conflicts:
	modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JavaClientCodegen.java
	modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache
	modules/swagger-codegen/src/main/resources/Java/api.mustache
	samples/client/petstore/java/src/main/java/io/swagger/client/ApiClient.java
	samples/client/petstore/java/src/main/java/io/swagger/client/Configuration.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java
	samples/client/petstore/java/src/test/java/io/swagger/client/ConfigurationTest.java
	samples/client/petstore/java/src/test/java/io/swagger/petstore/test/PetApiTest.java
2015-06-05 18:43:49 +08:00
Fredrik Gustafsson
277287a341 Merge branch 'develop_2.0' of https://github.com/Hadou1/swagger-codegen into develop_2.0
Conflicts:
	modules/swagger-codegen/src/main/resources/csharp/api.mustache
2015-06-05 12:33:49 +02:00
wing328
5a75eba42b regenerated perl sample 2015-06-05 18:30:58 +08:00
Fredrik Gustafsson
31c6a0a9da Extended the api-class generation by a interface generation 2015-06-05 12:29:25 +02:00
Fredrik Gustafsson
a1f156ca19 Updated 'api.mustache' to generate asynchronous methods aswell 2015-06-05 11:39:15 +02:00
geekerzp
eb90b907e7 rebuild python client 2015-06-05 17:02:38 +08:00
wing328
61a7d848f7 rename files in csharp and perl to fix issue 2015-06-05 17:00:11 +08:00
xhh
d70742119b Update unit tests 2015-06-05 16:45:19 +08:00
xhh
622b5c179a Merge remote-tracking branch 'origin/develop_2.0' into java-accept-contenttype
Conflicts:
	modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JavaClientCodegen.java
	modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache
	modules/swagger-codegen/src/main/resources/Java/api.mustache
	samples/client/petstore/java/src/main/java/io/swagger/client/ApiClient.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java
	samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java
2015-06-05 16:31:21 +08:00
geekerzp
ddc5293e6a updated api.mustache of python. 2015-06-05 16:19:49 +08:00
geekerzp
a30f537f5f fixed typo 2015-06-05 16:19:49 +08:00
geekerzp
813c0119aa added test case for 500 response of python client 2015-06-05 16:19:49 +08:00
geekerzp
8ef4c4401e updated rest.mustache of python client 2015-06-05 16:19:48 +08:00
geekerzp
5fbda0e206 added test case for 404 response of python client 2015-06-05 16:19:48 +08:00
geekerzp
fbe327ac2f Updated PythonClientCodegen.java
* updated method apiFileFolder.
* udpated method modelFileFolder.
2015-06-05 16:19:48 +08:00
geekerzp
ab6f327f35 Updated python client.
* Rename `ResponseError` exception to `ApiException`
* Use `File.separatorChar` to build file path in
  PythonClientCodegen.java
* Rename `config.py` module to `configuration.py`
* Rename `swagger.py` module to `api_client.py`
2015-06-05 16:19:48 +08:00
geekerzp
51887c64b5 Updated python codegen.
Use File.separatorChar to create invokerPacakge variable instread of '\'
char.
2015-06-05 16:17:29 +08:00
geekerzp
654a73c5a8 rebuild python client 2015-06-05 16:17:29 +08:00
geekerzp
eac884d85b updated ApiClient of python sdk. 2015-06-05 16:16:48 +08:00
geekerzp
d7aaaea0df updated config.py of python client. 2015-06-05 16:15:57 +08:00
geekerzp
b09250ed33 added authentication for python client.
completed.
2015-06-05 16:15:57 +08:00
geekerzp
0ca97e4b68 added authentication for python client.
Not completed
2015-06-05 16:15:14 +08:00
Tony Tam
59ca8bd986 Merge pull request #821 from geekerzp/develop_2.0_objc_test
[Objc] Update test case
2015-06-05 00:55:57 -07:00
Tony Tam
e1393d1912 Merge pull request #817 from who/develop_2.0
[Android] Enabling cli config options for android generator
2015-06-05 00:53:20 -07:00
Tony Tam
ddb3bd5477 Merge pull request #816 from geekerzp/develop_2.0_objc_auth
[Objc] Add authentication support (API key, HTTP basic)
2015-06-05 00:52:35 -07:00
Tony Tam
2ec18a1397 Merge branch 'wing328-php_object_support' into develop_2.0 2015-06-05 00:52:06 -07:00
Tony Tam
34072faccd merged 2015-06-05 00:51:52 -07:00
Tony Tam
26d9215e43 Merge pull request #808 from wing328/csharp_api_instance
[C#] Added ApiClient (Pluggable) and authentication (API key and HTTP basic auth)
2015-06-05 00:42:44 -07:00
Tony Tam
496e06a373 Merge pull request #806 from geekerzp/develop_2.0_python_https
[Python] Verified HTTPS with SSL/TLS cert.
2015-06-05 00:42:13 -07:00
Tony Tam
513bd17610 Merge pull request #803 from wing328/objc_fix_filepath
[ObjC] Minor fix to output path
2015-06-05 00:41:52 -07:00
Tony Tam
d9fcb777c1 Merge pull request #799 from wing328/perl_apiinvoker_instance
[Perl] Make API client more pluggable (ref: #778)
2015-06-05 00:41:26 -07:00
Tony Tam
05700a6799 Merge pull request #794 from wing328/php_debug_switch
[PHP] add debug switch
2015-06-05 00:40:32 -07:00
Tony Tam
29bd743391 Merge pull request #793 from geekerzp/develop_2.0_objc_apiclient
Make objc client more pluggable
2015-06-05 00:40:17 -07:00
Tony Tam
13e14652e3 Merge pull request #787 from geekerzp/develop_2.0_python_apiclient
[Python] Make API client more pluggable
2015-06-05 00:38:11 -07:00
Tony Tam
b41e88e83a Merge pull request #785 from wing328/csharp_add_restsharp_dll
[C#] Added RestSharp.dll and updated compile.bat
2015-06-05 00:38:05 -07:00
Tony Tam
cbc4da58ab Merge pull request #783 from xhh/ruby-auth
[Ruby] Add authentication support (API key, HTTP basic)
2015-06-05 00:36:12 -07:00
Tony Tam
aecb4adf4a Merge pull request #791 from xhh/java-api-client
[Java] Make API client more pluggable
2015-06-05 00:36:05 -07:00
wing328
ba227b7e72 rename api client 2015-06-04 21:19:16 +08:00
wing328
0423e0a2df support object response 2015-06-04 21:12:26 +08:00
wing328
afe816efb6 remove unused file 2015-06-04 20:30:41 +08:00
geekerzp
58feda7c8e Updated test case testCreateAndGetPet of objc client. 2015-06-04 16:44:12 +08:00
Fredrik Gustafsson
217765998d Extended the APIException by ErrorContent from response body 2015-06-03 16:23:45 +02:00
xhh
0ffe53933d Bug fix: "null" was used as post body for empty form parameters
The form parameters could be empty when all of them are optional and no
values are assigned to them.
2015-06-03 21:17:42 +08:00
xhh
cf4b4de970 Skip null header/form parameters
and fix the bug of getting file name for file parameter
2015-06-03 20:26:14 +08:00
xhh
2e285ed562 Support skipping SSL certification verification
in Ruby clients by e.g.:

    SwaggerClient::Swagger.configure do |config|
      config.verify_ssl = false
    end
2015-06-03 12:49:09 +08:00
wing328
9b919c54dd added http basic auth test 2015-06-03 11:21:10 +08:00
xhh
9618960558 Merge branch 'develop_2.0' into ruby-auth 2015-06-03 11:19:40 +08:00
wing328
fceaed34e4 rename apiclient 2015-06-03 10:19:07 +08:00
xhh
eb4973237b Add comments to code 2015-06-03 10:09:36 +08:00
wing328
9c747e3e37 fix query parameters 2015-06-03 09:21:45 +08:00
wing328
3d16d8b2b6 fix header 2015-06-03 08:34:45 +08:00
Andrew B
1a75489b42 Enabling cli config options for android generator 2015-06-02 09:04:50 -07:00
xhh
24c29acc09 Merge branch 'develop_2.0' into java-api-client
Conflicts:
	modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JavaClientCodegen.java
2015-06-02 22:36:55 +08:00
Ole Lensmar
2662167372 Merge pull request #805 from hyeghiazaryan/develop_2.0
Support for file based config. Implementation for #616.
2015-06-02 09:33:52 -04:00
Ole Lensmar
e98320862c Merge pull request #706 from 0legg/feature/retrofit-templates
[WIP] add template for Retrofit and Gson
2015-06-02 09:09:41 -04:00
wing328
2d6a7092e3 removed unused file 2015-06-02 20:43:11 +08:00
wing328
7080983521 return exception instead of null for 404, add properties to api exception class 2015-06-02 17:25:38 +08:00
xhh
19540ed7f0 Store response headers and body in ApiException 2015-06-02 15:33:44 +08:00
geekerzp
699df0029b updated comments for objc client. 2015-06-02 15:33:33 +08:00
geekerzp
86971ee752 added comments for objc client 2015-06-02 11:50:47 +08:00
Hrachya Yeghiazaryan
d258a6c1c2 Merge branch 'develop_2.0' of https://github.com/hyeghiazaryan/swagger-codegen into develop_2.0 2015-06-01 10:44:23 -07:00
hrachya
3e0913a813 removing generic header comments 2015-06-01 10:43:23 -07:00
wing328
762a3279ea clean up test.php 2015-06-01 14:50:57 +08:00
wing328
f357f4c9d7 fix default header 2015-06-01 14:24:09 +08:00
wing328
8d708c2442 add test case for default header 2015-05-31 11:17:59 +08:00
wing328
83d069d053 add support for obj, remove null from serialized json string 2015-05-31 09:49:24 +08:00
geekerzp
b5429d9e8e Added authentication for objc client. 2015-05-30 18:04:20 +08:00
Richie Azaria
0996901e72 add documentation -c option and config-help 2015-05-29 13:01:42 -07:00
Oleg Godovykh
ec08d31031 add template for Retrofit and Gson 2015-05-29 12:23:18 -04:00
Ron
ca46405850 Update README.md 2015-05-29 08:53:06 -04:00
Ron
7d7ed15fdc Update README.md 2015-05-29 08:52:48 -04:00
Ron
34315f7338 Create LICENSE 2015-05-29 08:52:29 -04:00
Ron
26a22a30a1 Create LICENSE 2015-05-29 08:52:03 -04:00
Fredrik Gustafsson
41e4fc79ae Extended the api-class generation by a interface generation 2015-05-29 12:19:28 +02:00
Fredrik Gustafsson
049299f07f Updated 'api.mustache' to generate asynchronous methods aswell 2015-05-29 10:53:48 +02:00
wing328
5f36ad3b75 add authentication support 2015-05-29 16:43:27 +08:00
geekerzp
18cf6bcfa6 Updated python client.
Verified HTTPS with SSL/TLS.
2015-05-29 15:09:19 +08:00
xhh
a8c526efd5 Add unit tests for Configuration and ApiClient 2015-05-29 12:08:42 +08:00
xhh
62c8f9e1e2 Rebuild Java Petstore sample 2015-05-29 12:08:42 +08:00
xhh
ac134c0afa Make ApiClient more pluggable for Java
- Rename ApiInvoker to ApiClient
- Make ApiClient pluggable by allowing setting the ApiClient field of
  API classes
- Introduce a Configuration class, containing the default
  ApiClient (which is also customizable)
- Move basePath from API class to ApiClient
- Change static methods in ApiClient to instance level
2015-05-29 12:08:42 +08:00
xhh
a29c3abeb8 Use File.separatorChar in Ruby generator, add comments 2015-05-29 12:05:47 +08:00
xhh
623a1278cf Add test case for API key auth 2015-05-29 11:57:46 +08:00
xhh
e52694cde0 Regenerate Ruby Petstore sample 2015-05-29 11:57:46 +08:00
xhh
95813714a5 Add support of HTTP basic and API key auth to Ruby codegen 2015-05-29 11:57:46 +08:00
xhh
6a6473ede3 Allow omitting username/password for HTTP basic auth 2015-05-29 11:55:48 +08:00
xhh
e10e1f5249 Refactor auth method naming, add comments 2015-05-29 11:29:06 +08:00
xhh
6eb1a89205 Add authentication helper methods and test cases 2015-05-29 11:28:03 +08:00
xhh
4d25d264c4 Merge remote-tracking branch 'origin/develop_2.0' into java-auth
Conflicts:
	modules/swagger-codegen/src/main/resources/Java/apiInvoker.mustache
	samples/client/petstore/java/src/main/java/io/swagger/client/ApiInvoker.java
2015-05-29 10:08:50 +08:00
hrachya
ba7025d54b Adding config-help command 2015-05-28 15:02:32 -07:00
hrachya
1f360961e0 Simplifying CliOption class 2015-05-28 14:55:36 -07:00
hrachya
08647b337f fixing property name 2015-05-28 13:08:52 -07:00
hrachya
c5a7800ec6 fixing typo 2015-05-28 13:02:30 -07:00
hrachya
26a2290078 adding classPrefix, sourceFolder, projectName cli options to objc 2015-05-28 13:01:54 -07:00
wing328
2edcd82094 minor fix to output path 2015-05-28 19:16:26 +08:00
wing328
165efdbdbb rename apiinvoker to apiclient, add configuration, make apiclient an instance 2015-05-28 18:24:03 +08:00
wing328
412fcf11f9 update file separator 2015-05-28 15:19:05 +08:00
wing328
e993d08563 rename APIClient to ApiClient, APIClientException to APIException 2015-05-28 15:06:31 +08:00
wing328
61bc652229 use file separator 2015-05-28 14:34:39 +08:00
wing328
699f6fff44 update file path 2015-05-28 14:18:05 +08:00
wing328
1a868abdfa rename APIClient to ApiClient 2015-05-28 10:51:36 +08:00
hrachya
c9c58cbe4c new -c/--config option for swagger-cli to specify json config file path
setting options passed in config file if those were allowed by lang specific CodegenConfig
2015-05-27 17:37:07 -07:00
hrachya
c3055c7cc4 Adding Config and ConfigParser classes 2015-05-27 17:30:42 -07:00
hrachya
2cca1a8c2c Changing templateDir back to explicit option for cli 2015-05-27 17:22:44 -07:00
hrachya
a9e767cbd8 Rolling back changes to deprecated class 2015-05-27 17:19:34 -07:00
Ron
1657f2e5f7 Merge pull request #801 from rlo2014/develop_2.0
Removing comment (// do some magic!) that is no longer necessary and …
2015-05-27 19:48:51 -04:00
rlo2014
e93a377982 Removing comment (// do some magic!) that is no longer necessary and confusing. After olensmar refactor of jax-rs codegen, magic/implementation should be placed in the delegate/implementation as opposed to the api itself. Any logic put in api itself will be overwritten with the next code gen, whereas the delegate implemenation will remain intact. 2015-05-27 14:55:28 -07:00
wing328
2c12312b97 update user agent and add more test cases 2015-05-27 22:44:56 +08:00
wing328
866b546cfd make api client pluggable 2015-05-27 17:56:39 +08:00
hrachya
74f5c769f9 removing extra file, was committed by mistake 2015-05-26 17:10:19 -07:00
hrachya
1e09f5149e Add 'invokerPackage', 'groupId', 'arifactId', 'artifactVersion', 'sourceFolder' command line options for java (and all the derived ones jaxrs, spring-mvc ...)
Add processOpts override to process java  specific options
Move supporting file initialization from constructor to processOpts, since it uses some of the options that are not yet set in the constructor
Add setters
2015-05-26 17:05:53 -07:00
hrachya
e08a5a9d83 Add 'modelPackage' and 'apiPackage' as command line options
Add setters for modelPackage and apiPackage
2015-05-26 17:01:07 -07:00
hrachya
d7dec5a43d Use new functionality to add 't' as a command line option to set 'templateDir' 2015-05-26 16:02:27 -07:00
hrachya
33436d62c3 Get all cliOptions for available codegen configs and add to command line options
Add all the specified ones to clientOpts properties
2015-05-26 15:57:01 -07:00
hrachya
9f1504062a add List<CliOption> cliOptions() method to CodegenConfig interface with default implementation in DefaultCodegen 2015-05-26 15:52:25 -07:00
hrachya
f8cafaaee7 new CliOption class for wrapping org.apache.commons.cli.Option 2015-05-26 15:49:32 -07:00
wing328
4d1d163a73 update php template to debug curl 2015-05-26 23:52:35 +08:00
wing328
171bf969c7 add debug switch to configuration 2015-05-26 23:20:34 +08:00
geekerzp
ca145297e9 Updated ApiClient of objc sdk.
When create api instance, if we don't pass the `apiClient` parameter,
then get api client instance from the pool.
2015-05-26 18:00:45 +08:00
wing328
c2c43bba37 make datetime nullable 2015-05-26 17:48:52 +08:00
xhh
951b7a9075 Do not use JSON as default Accept header when no produces present 2015-05-26 10:35:49 +08:00
wing328
f807e34b2b refactor csharp (no compile error) 2015-05-25 18:21:17 +08:00
xhh
aa03be7f76 Clean up old code 2015-05-25 17:25:32 +08:00
xhh
ed14c515bf Add comments to string utility methods 2015-05-25 16:01:57 +08:00
geekerzp
2d545c7f0b updated ApiClient of python sdk.
Change staticmethod to instance method.
2015-05-25 15:29:31 +08:00
geekerzp
3beeb6125e updated ApiClient of python sdk.
When create api instance, if we don't pass the `api_client` parameter,
then use the default api_client in `config` module.
2015-05-25 14:31:55 +08:00
xhh
19a8ac4841 Add unit tests 2015-05-25 12:32:24 +08:00
xhh
85d0e08a80 Rebuild Java Petstore client 2015-05-25 12:31:54 +08:00
xhh
fff8972a77 Extract utility methods to the StringUtil class
and ignore case when comparing Accept/Content-Type
2015-05-25 12:29:41 +08:00
wing328
92dd5cab93 add restsharp.dll, update compile.bat 2015-05-25 11:44:08 +08:00
xhh
141b580c8c Minor improvement to Java API client accept and content-type header 2015-05-24 08:52:14 +08:00
Tony Tam
095771d345 Merge pull request #738 from tomtit/issue429
Fixes #429: Handling of composed models has been added.
2015-05-23 15:10:38 -07:00
Alexey Nechaev
5d581c3b03 Fixes #429: Handling of composed models has been added. 2015-05-24 00:54:25 +03:00
Tony Tam
087c28dae4 rebuilt client 2015-05-23 09:04:46 -07:00
Tony Tam
85c37fbe27 fix for #781 2015-05-23 09:04:40 -07:00
Tony Tam
ad9b790712 updated sample 2015-05-23 09:04:06 -07:00
Tony Tam
82436c5b44 Merge pull request #780 from geekerzp/develop_2.0_objc_contenttype
Minor improvement to Objc API Client 'accept' and 'content-type' header
2015-05-23 08:54:53 -07:00
Tony Tam
156afa7795 Merge pull request #778 from wing328/php_apiclient_instance
[PHP] Make API client more pluggable
2015-05-23 08:54:33 -07:00
Tony Tam
74dc05bbf5 Merge pull request #776 from wing328/php53_fix_warning
[PHP] Fix warning/error related to PHP5.3
2015-05-23 08:53:52 -07:00
Tony Tam
b6d206aff7 Merge pull request #774 from geekerzp/develop_2.0_python_contenttype
Minor improvement to Python API Client 'accept' and 'content-type' header
2015-05-23 08:53:34 -07:00
Tony Tam
e3c116312b Merge pull request #773 from hyperworks/master
Adds isPrimitiveType flag to CodegenParameter.
2015-05-23 08:53:06 -07:00
Tony Tam
5527932a8e Merge branch 'xhh-ruby-void-response' into develop_2.0 2015-05-23 08:52:15 -07:00
Tony Tam
3cb9d094d3 Merge branch 'ruby-void-response' of ssh://github.com/xhh/swagger-codegen into xhh-ruby-void-response 2015-05-23 08:49:28 -07:00
Tony Tam
d83a275b6e Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-05-23 08:48:40 -07:00
Tony Tam
98d5dd727b Merge branch 'tkQubo-feature/swift-PromiseKit' into develop_2.0 2015-05-23 08:48:28 -07:00
Tony Tam
565f054b79 merged 2015-05-23 08:48:18 -07:00
Tony Tam
f4aee62fb4 Merge pull request #775 from wing328/csharp_fix_object_type
[C#] Fix "object' type for response
2015-05-23 08:43:14 -07:00
Tony Tam
864f0f5a3a Merge branch 'sosso-origin/develop_2.0' into develop_2.0 2015-05-23 08:34:01 -07:00
Tony Tam
d447c423b5 updated test to get expected value 2015-05-23 08:33:48 -07:00
Tony Tam
f9ed8a9a08 updated test to get expected value 2015-05-23 08:33:40 -07:00
Tony Tam
3638d79291 updated test to get expected value 2015-05-23 08:33:27 -07:00
geekerzp
2514f3aa08 update SWGApiClient.h of objc client. 2015-05-23 15:29:38 +08:00
geekerzp
3d3cbe115e minor improvement to objc client accept and content-type header 2015-05-23 15:22:12 +08:00
wing328
691838c47d add test case for api client instance 2015-05-23 10:35:19 +08:00
wing328
612abf134b api client as instance (not static class) 2015-05-22 22:09:51 +08:00
geekerzp
87a730b5a2 Merge branch 'develop_2.0' into develop_2.0_objc_contenttype
Conflicts:
	samples/client/petstore/objc/client/SWGPetApi.m
2015-05-22 17:32:57 +08:00
geekerzp
8d0efd812c updated unittests of python client 2015-05-22 15:50:09 +08:00
geekerzp
245ce642ce add test cases for ApiClient.select_header_accept and
ApiClient.select_header_content_type of python client.
2015-05-22 15:28:36 +08:00
wing328
df4b952312 fix object type without ref for CSharp 2015-05-22 14:12:53 +08:00
xhh
43cfc7d401 Setup authentications in test cases 2015-05-22 12:07:08 +08:00
xhh
16ba2a54ea Add test cases for API key and HTTP basic auth 2015-05-22 11:17:44 +08:00
geekerzp
bc9abceef3 removed temp files from python client 2015-05-22 11:12:35 +08:00
geekerzp
8a311d693b updated python client samples 2015-05-22 10:50:11 +08:00
geekerzp
52807c0724 minor improvement to python client accept and content-type header 2015-05-22 10:45:38 +08:00
William Cheng
fa15f58506 fix warning/error in php5.3 2015-05-22 05:15:46 +08:00
xhh
f616605e7e Regenerate Java Petstore sample 2015-05-21 22:09:08 +08:00
xhh
3d4b5a10c9 Add support of HTTP basic and API key auth to Java codegen 2015-05-21 22:05:46 +08:00
Ron
2b7bbd9513 Merge pull request #772 from tomtit/issue771
Fixes #771: Unit test has been fixed after merge.
2015-05-21 06:07:00 -06:00
Chakrit Wichian
89e3bcc4bb Adds isPrimitiveType flag to CodegenParameter.
This is required in some languages like Obj-C where there is no automatic value boxing and
handling of primitive types require extra work compared to non-primitive types.

Case in point: BOOL type. To assign BOOL into a dictionary, one needs to box it into an
(NSValue *) instance, so to build a dictionary for sending form data, for example, you
cannot do this in the template:

    dict["{{paramName}}"] = {{paramName}};

Because if the parameter ends up being of type BOOL, an error about boxing values will be
generated:

    BOOL boolValue = NO;
    dict["boolValue"] = boolValue;
                        ^---------------- Cannot do the assignment here.

The fix is to wrap it in @() like so:

    BOOL boolValue = NO;
    dict["boolValue"] = @(boolValue);

So a flag is needed in CodegenParameter so we can selectively emit the right boxing or
non-boxing assignment in the templates.
2015-05-21 15:28:57 +07:00
Alexey Nechaev
a590239df9 Fixes #771: Unit test has been fixed after merge. 2015-05-21 10:49:20 +03:00
Tony Tam
0c3f7a54cd Merge pull request #770 from swagger-api/jaxrs-interface-generation
Jaxrs interface generation
2015-05-20 22:52:00 -07:00
Tony Tam
99a11636da rebuilt 2015-05-20 22:51:30 -07:00
Tony Tam
3a2f258517 Merge branch 'geekerzp-develop_2.0_python_urllib3' into develop_2.0 2015-05-20 22:51:09 -07:00
Tony Tam
3629a190ae merged 2015-05-20 22:50:59 -07:00
Tony Tam
715a9b8678 merged 2015-05-20 22:50:41 -07:00
Tony Tam
4187be2dc3 Merge pull request #767 from geekerzp/develop_2.0_python_model
Pretty print for models of python client
2015-05-20 22:46:41 -07:00
Tony Tam
dd70a13c02 Merge branch 'wing328-php_auth_setting' into develop_2.0 2015-05-20 22:46:02 -07:00
Tony Tam
c8a56add5d merged 2015-05-20 22:45:52 -07:00
Tony Tam
01ebdb6122 Merge pull request #763 from tomtit/issue728
Fixed #728: Handling of recursive model definitions has been improved.
2015-05-20 22:42:37 -07:00
Tony Tam
e66f9d7fce Merge pull request #760 from geekerzp/develop_2.0_objc_required_parameter
Fix required parameter validation for Objc
2015-05-20 22:42:10 -07:00
Tony Tam
35f63b3f6a Merge branch 'wing328-php-improve-header' into develop_2.0 2015-05-20 22:41:23 -07:00
Tony Tam
9bf9b3edb7 rebuilt 2015-05-20 22:41:09 -07:00
Tony Tam
92b1a13438 Merge branch 'swinz-develop_2.0_fixSpringMVCRequestParamDefaultValue' into develop_2.0 2015-05-20 22:37:59 -07:00
Tony Tam
515f5440a1 merged 2015-05-20 22:37:51 -07:00
Tony Tam
632480787d Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-05-20 22:35:23 -07:00
Tony Tam
e4faa82cfa Merge branch 'geekerzp-develop_2.0_objc_iso8601' into develop_2.0 2015-05-20 22:35:12 -07:00
Tony Tam
779915a51f rebuilt 2015-05-20 22:34:54 -07:00
Tony Tam
c509bbcb99 updated 2015-05-20 22:34:29 -07:00
Tony Tam
8231e7e36a Merge branch 'develop_2.0_objc_iso8601' of ssh://github.com/geekerzp/swagger-codegen into geekerzp-develop_2.0_objc_iso8601 2015-05-20 22:29:26 -07:00
Tony Tam
ee145aebe7 Merge pull request #743 from lugaru1234/model_ids_with_dots
Fixed #593: Python code failure caused by Model IDs with dots has been fixed
2015-05-20 22:27:53 -07:00
Tony Tam
11dd7784f8 rebuilt 2015-05-20 22:20:51 -07:00
Tony Tam
6fe6a6daa7 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-05-20 22:16:55 -07:00
Tony Tam
e921b7cbdc Merge branch 'Helmsdown-mime-type-fixes' into develop_2.0 2015-05-20 22:16:38 -07:00
Tony Tam
fd928a3d16 merged 2015-05-20 22:16:24 -07:00
Tony Tam
5a4d3317c2 Merge pull request #723 from swinz/develop_2.0_fixSpringMVCHeaderRequired
SpringMVC template is ignoring the required attribute in swagger definition when generating RequestHeader annotation
2015-05-20 22:14:29 -07:00
Tony Tam
ab23cccab4 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-05-20 22:13:03 -07:00
Tony Tam
7d4cc82077 Merge branch 'who-feature/android-maven-artifact-publishing' into develop_2.0 2015-05-20 22:12:45 -07:00
Tony Tam
e58f8db9aa merged 2015-05-20 22:12:37 -07:00
Tony Tam
b059910a01 Merge pull request #700 from wing328/csharp_restcsharp
Use RestSharp for CSharp API client
2015-05-20 21:52:28 -07:00
Ole Lensmar
19de558f4a Merge branches 'develop_2.0' and 'jaxrs-interface-generation' of https://github.com/swagger-api/swagger-codegen into jaxrs-interface-generation
Conflicts:
	modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java
2015-05-20 22:51:49 -06:00
Tony Tam
2d9772e7a9 Merge branch 'tomtit-issue646' into develop_2.0 2015-05-20 21:48:14 -07:00
Tony Tam
0c1bdc0fd6 merged 2015-05-20 21:48:03 -07:00
Tony Tam
e592d1b46b Merge pull request #660 from denyago/master
Improve README for OS X Users with random Java versions
2015-05-20 21:42:40 -07:00
Tony Tam
8dbb1aa8e9 Merge pull request #654 from kvelakur/master
Issue #642 - Removing the unnecesary \n added to generated example reque...
2015-05-20 21:42:25 -07:00
Tony Tam
ef5cb5021b Merge branch 'cchafer-akka-scala' into develop_2.0 2015-05-20 21:41:24 -07:00
Tony Tam
ff81789b37 merged 2015-05-20 21:41:17 -07:00
Tony Tam
e6efcdb6af added files, updated parser version 2015-05-20 21:39:09 -07:00
xhh
9cf4c66331 Update method returning value comment 2015-05-21 11:30:30 +08:00
Tony Tam
956a3c024c Merge pull request #766 from swagger-api/core-1.5.2-M2-compatibility
updated core dependency version to 1.5.2-M2 with related fixes
2015-05-20 17:55:01 -07:00
Ole Lensmar
efb40e149f brought back scala tests 2015-05-20 18:23:44 -06:00
Ole Lensmar
a6876b8028 Merge branches 'core-1.5.2-M2-compatibility' and 'jaxrs-interface-generation' of https://github.com/swagger-api/swagger-codegen into jaxrs-interface-generation 2015-05-20 18:14:54 -06:00
Ole Lensmar
713e7a6584 updated core dependency version to 1.5.2-M2 with related fixes 2015-05-20 18:06:37 -06:00
Ole Lensmar
778ce0b9f6 Merge branches 'develop_2.0' and 'jaxrs-interface-generation' of https://github.com/swagger-api/swagger-codegen into jaxrs-interface-generation 2015-05-20 17:03:51 -06:00
Ole Lensmar
05268c2742 added system property for setting impl folder 2015-05-20 16:50:26 -06:00
Ole Lensmar
17d8d14cc8 defaulted sources to go to src/gen/main and added possibility to set impl folder via system property at command-line 2015-05-20 16:49:50 -06:00
wing328
4f310cd7b1 update function comment 2015-05-20 22:13:24 +08:00
geekerzp
9ff0d90853 Updated python models.
Overwrite the instance method `__repr__`,
make the `pprint` method output properties infos of the models.
2015-05-20 22:05:34 +08:00
wing328
6e13403a37 fix http basic auth, add test cases for new api client without host 2015-05-20 21:55:16 +08:00
xhh
8bf84aabe5 Add test case for nil return value 2015-05-20 21:13:20 +08:00
xhh
50a767ef03 Regenerate Ruby Petstore sample 2015-05-20 21:13:02 +08:00
xhh
4702285184 Correct indentation 2015-05-20 21:08:14 +08:00
xhh
dde73d592d Return nil in Ruby clients for operations that have no response type defined 2015-05-20 21:06:42 +08:00
wing328
9a1dedbe76 add test case (getPetbyId), remove old authenetication (only supports header) 2015-05-20 18:43:34 +08:00
wing328
20439e646f add test case and prefix support 2015-05-20 18:25:35 +08:00
wing328
06c7a6a109 add todo for oauth, support multiple api key 2015-05-20 17:13:52 +08:00
wing328
278a653154 add authentication 2015-05-20 17:13:52 +08:00
geekerzp
3a8b149f09 minor improvement to objc api client accept and content-type header 2015-05-20 15:52:00 +08:00
Tony Tam
deca6a0329 Merge pull request #662 from xhh/ruby-module-structure
Organize the generated Ruby code into a module structure
2015-05-19 20:16:52 -07:00
kubo_takaichi
7205407818 Add another date formatter (which should be externalized though) 2015-05-20 11:27:45 +09:00
kubo_takaichi
2f6b975669 Remove final mark 2015-05-20 11:27:45 +09:00
kubo_takaichi
16a4b60526 Handle NSNull 2015-05-20 11:27:45 +09:00
kubo_takaichi
9cf1835230 Fix bug 2015-05-20 11:27:45 +09:00
kubo_takaichi
3623a0dd56 Modify Cartfile 2015-05-20 11:27:45 +09:00
kubo_takaichi
e0c0d2a72a Remove dependency on SwiftyJSON 2015-05-20 11:27:45 +09:00
kubo_takaichi
dbfc46658f Add once-removed Array extension method 2015-05-20 11:27:45 +09:00
kubo_takaichi
bb3ec04ed1 Introduce Decoders class 2015-05-20 11:27:45 +09:00
kubo_takaichi
be7fccce68 Update JSONEncodable implementations 2015-05-20 11:27:45 +09:00
kubo_takaichi
f21d8503d5 Add manager storage to prevent request cancellation 2015-05-20 11:27:45 +09:00
kubo_takaichi
063e6d062d Introduce decodable array and dictionary 2015-05-20 11:27:45 +09:00
kubo_takaichi
0b7d758077 Add extension methods for primitives 2015-05-20 11:27:45 +09:00
kubo_takaichi
5dfa753f5c Do refactor and add extension methods 2015-05-20 11:27:45 +09:00
kubo_takaichi
23d714f2f1 Add swift code generator 2015-05-20 11:27:45 +09:00
kubo_takaichi
f627c81399 Remove some characters from param name and operation id
(since swagger-doc emits improper characters)
2015-05-20 11:27:45 +09:00
xhh
0fb1918196 Revert unnecessary changes on whitespace 2015-05-20 10:13:29 +08:00
xhh
312f1c6f25 Avoid the importPath field 2015-05-20 09:23:45 +08:00
xhh
792059f195 Avoid warnings for ruby gem building 2015-05-20 09:23:45 +08:00
xhh
70c74d282f Fix tests 2015-05-20 09:23:45 +08:00
xhh
ab4975b7f1 Regenerate petstore ruby sample 2015-05-20 09:23:44 +08:00
xhh
6eaaa5cc69 Include base_object model into module structure 2015-05-20 09:23:44 +08:00
xhh
f766614b4d Clean old files generated 2015-05-20 09:23:44 +08:00
xhh
fcf1327c1f Rename swagger-client to swagger_client
according to guides from rubygems: http://guides.rubygems.org/name-your-gem/
2015-05-20 09:23:44 +08:00
xhh
b140f1f152 Fix example code in README.md of Ruby petstore sample 2015-05-20 09:23:44 +08:00
xhh
87904e8b69 Set version dynamically in ruby codegen
Conflicts:
	modules/swagger-codegen/src/main/resources/ruby/swagger/version.mustache
	samples/client/petstore/ruby/lib/swagger/version.rb
2015-05-20 09:23:44 +08:00
xhh
194e9e6f05 Make petstore tests pass 2015-05-20 09:23:43 +08:00
xhh
8dd7d3aacd Regenerate ruby petstore sample code 2015-05-20 09:23:43 +08:00
xhh
104bcc1f89 Organize generated Ruby code into a module 2015-05-20 09:23:43 +08:00
Fake Bob Dobbs
a55c03013d use the defaultValue for spring mvc RequestHeader annotations; carry over the required value if set for RequestPart annotations 2015-05-19 11:47:34 -04:00
Fake Bob Dobbs
b783363c56 move the defaultValues for Forms and Headers as well 2015-05-19 11:45:48 -04:00
Alexey Nechaev
f0e4ea1780 Fixed #728: Handling of recursive model definitions has been improved. 2015-05-19 18:36:03 +03:00
Tony Tam
6a336f2e1e Merge pull request #758 from xhh/fix-android-form-test
Fix test of updatePetWithForm for Android Petstore sample
2015-05-19 08:29:48 -07:00
Ron
312637c94b Merge pull request #762 from wing328/update_readme
Update README.md with new generators
2015-05-19 07:21:52 -06:00
William Cheng
e717f74a0a update readme with new generators 2015-05-19 21:15:09 +08:00
Nadezhda Makarkina
3dde19bb59 Fixed #593: Python code failure caused by Model IDs with dots has been fixed 2015-05-19 14:31:42 +03:00
geekerzp
a0abea4b72 added required parameters check for objc 2015-05-19 17:12:46 +08:00
wing328
5744bd0138 better exception using InvalidArgumentException 2015-05-19 16:21:06 +08:00
xhh
db9ca1a485 Fix test of updatePetWithForm for Android Petstore sample 2015-05-19 15:42:29 +08:00
wing328
af260cba41 update api client to support default header 2015-05-19 15:33:03 +08:00
geekerzp
a77ae51318 update python tests 2015-05-19 15:21:09 +08:00
wing328
5aad44e628 added back test case for updatePetWithForm 2015-05-19 10:15:36 +08:00
wing328
41e178e268 better accept and content-type for php, added test cases 2015-05-18 22:16:54 +08:00
Tony Tam
e068ad4494 Merge pull request #756 from wing328/perl_improve_accept_header
[Perl] better logic for accept and content-type, added test cases
2015-05-18 06:36:11 -07:00
wing328
7fc2f74851 remove commented code 2015-05-18 16:39:33 +08:00
wing328
abbea5ec4c better logic for accept and content-type, added test cases 2015-05-18 16:23:46 +08:00
Tony Tam
72a4d2df2f Merge pull request #755 from wing328/ruby_cleanup_sample
[Ruby] Cleanup Ruby Petstore sample and bug fix
2015-05-17 21:41:21 -07:00
William Cheng
05ac516ffa clean up ruby sample, remove commented code, bug fix 2015-05-18 04:30:26 +08:00
Tony Tam
01423d4a6b Merge pull request #753 from wing328/ruby_model_improve
[Ruby] bug fixes for posting with sub-models and enhancements (refactoring)
2015-05-17 09:34:20 -07:00
William Cheng
3de9b4bfc8 remove (duplicated) object_to_http_body and object_to_hash from swagger.rb 2015-05-17 23:47:55 +08:00
William Cheng
92a2011207 fix post model, update rspec 2015-05-17 23:38:51 +08:00
William Cheng
8710fbfde7 add base object 2015-05-17 23:36:13 +08:00
Ron
0c94b89e42 Merge pull request #750 from sebest/patch-1
Fix a typo in the README
2015-05-17 07:33:48 +02:00
Sebastien Estienne
9e382ecf9a Fix a typo in the README 2015-05-16 22:05:44 -07:00
Tony Tam
0e0e265a2a Merge pull request #746 from wing328/ruby_fix_contenttype
Minor improvement to Ruby API Client 'accept' and 'content-type' header
2015-05-16 09:13:58 -07:00
Tony Tam
d6ac7c5ecf Merge pull request #659 from wing328/add_php_unit_test
Bug fix for PHP client POST (model) and add more PHP test cases
2015-05-16 09:13:35 -07:00
Tony Tam
8501ffe240 Merge pull request #716 from ponelat/fix/click-on-return-type-in-dynamic-html
Fix/click on return type in dynamic html
2015-05-16 09:11:26 -07:00
Tony Tam
919bab0765 Merge pull request #717 from ponelat/fix/dyn-html-pos-error
Fix dynamic-html positioning of parameters
2015-05-16 08:56:51 -07:00
Ron
3e719d087f Merge pull request #715 from ponelat/fix/dead-css-include
html: build and remove dead css include
2015-05-16 17:23:49 +02:00
Tony Tam
472e2afd8e Merge pull request #749 from wing328/perl_add_unittest
Add unit testing for Perl
2015-05-16 06:56:53 -07:00
geekerzp
68b0259c47 updated readme.md of python 2015-05-16 18:05:06 +08:00
geekerzp
9809ce1d18 updated python unittests 2015-05-16 17:30:42 +08:00
William Cheng
7a5db5e665 add pom.xml for perl integration test 2015-05-16 16:44:32 +08:00
Tony Tam
6ec7cf5a9d updated request process 2015-05-16 01:09:01 -07:00
Tony Tam
f4cbd88e2c fixed ordering 2015-05-16 00:45:42 -07:00
William Cheng
9904c0e09f add unit testing for pet 2015-05-16 15:37:58 +08:00
Fake Bob Dobbs
e4f5243e54 add defaultValues value to the SpringMVC RequestParam annotation 2015-05-15 17:17:46 -04:00
Fake Bob Dobbs
33138c139f A parameter's default value is not flowing from the swagger definition to the actual API implementation. This change makes the property from the swagger def json available to the templates. 2015-05-15 16:55:49 -04:00
Tony Tam
a2d2deeb0c Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-05-15 11:27:16 -07:00
Tony Tam
b4674d6fc5 template updates, tests 2015-05-15 11:27:03 -07:00
wing328
1f6a19b684 minor improvement to ruby api client accept and content-type header 2015-05-15 20:58:59 +08:00
geekerzp
c06cb38d64 updated objc client to support iso8601 datetime format 2015-05-15 17:49:56 +08:00
Josh Ponelat
3bc319d534 dynamic-html: refactor parameters view 2015-05-15 09:28:57 +02:00
Josh Ponelat
30496ffdc3 html: remove dead css line 2015-05-15 09:22:40 +02:00
Josh Ponelat
3544136ab1 dynamic-html: make sure clicking on return type works 2015-05-15 09:21:54 +02:00
geekerzp
6826a1d7df updated readme.mustache in python client 2015-05-15 14:51:51 +08:00
geekerzp
d798b943f5 added python 2.7 and python 3.4 test environments 2015-05-15 14:38:06 +08:00
wing328
4466b6e15e add test case for upload file, improve error handling 2015-05-15 11:08:33 +08:00
Tony Tam
0248d6fd9f Merge pull request #677 from wing328/fix_swagger_type2
Fix PHP swagger type
2015-05-14 11:50:57 -04:00
Tony Tam
bc66894553 Merge pull request #688 from xhh/scala-form-params
Add form parameters support to Scala codegen
2015-05-14 11:50:42 -04:00
wing328
c12673a407 fix error handling for 4xx, 5xx returned by server 2015-05-14 14:16:12 +08:00
geekerzp
86e48ceef8 refactor python client using urllib3 2015-05-14 10:45:05 +08:00
Ole Lensmar
adcd0f4bb8 changed interface to abstract class instead so we can use Override annotation to warn if we get dead methods when the definitions changes 2015-05-13 15:58:20 -07:00
Ole Lensmar
75b39e812e refactored to create separate serviceinterface, implementation and corresponding factory. JaxRs class uses the factory to find the implementation. Also fixed possibility for a code generator to control which API files that should be overwritten 2015-05-12 13:18:35 -04:00
Tony Tam
622d883344 fixed input type 2015-05-12 06:57:37 -04:00
Tony Tam
8519480f2c removed some cruft 2015-05-12 06:50:45 -04:00
Tony Tam
f9db729e75 added qt5 2015-05-12 06:05:09 -04:00
Tony Tam
0b2eced6a3 rebuilt 2015-05-12 06:05:00 -04:00
Tony Tam
dae01b5043 template update 2015-05-12 06:04:44 -04:00
Tony Tam
1912973d36 enabled qt5 2015-05-12 06:04:23 -04:00
Tony Tam
037a00720f added qt5 samples, script 2015-05-12 06:04:10 -04:00
Tony Tam
c2ee64e669 fixed version 2015-05-12 06:03:45 -04:00
Tony Tam
e703fc7982 fixed version 2015-05-12 06:03:37 -04:00
Tony Tam
5a1fa6ee65 added qt5 c++ templates 2015-05-12 05:56:12 -04:00
Tony Tam
d6016757cb Merge pull request #705 from wing328/fix_required_parameter
Fix required parameter validation for Java, Android, PHP and Ruby
2015-05-12 05:48:22 -04:00
Tony Tam
08184aab1d Merge pull request #679 from xhh/petstore-scala-tests
Fix tests for Scala petstore sample
2015-05-12 05:48:11 -04:00
Tony Tam
e33fbc67ad Merge pull request #648 from geekerzp/develop_2.0_objc_naming
Updated naming convention in objc client.
2015-05-12 05:47:51 -04:00
Tony Tam
f80238ae2d Merge pull request #737 from wing328/perl_codegen
Add templates for Perl
2015-05-12 05:47:25 -04:00
Ron
75ff9089af Merge pull request #739 from tomtit/revert726
Reverted JsonUtil.mustache for JavaClientCodegen after PR #726.
2015-05-12 09:42:37 +02:00
wing328
2f5f2b367b update package name to confirm to csharp convention, fix default header 2015-05-12 12:45:59 +08:00
Alexey Nechaev
66dea18b61 Reverted JsonUtil.mustache after PR #726. 2015-05-08 12:47:35 +00:00
Lorinda Brandon
bae40ded74 Update README.md 2015-05-07 19:23:49 -04:00
William Cheng
fc43828c20 update type mapping, update test.pl to use local file for testing upload 2015-05-08 03:58:02 +08:00
William Cheng
063a1ffd36 update type list in deserialize 2015-05-08 03:58:02 +08:00
William Cheng
1d4735f76d update subroutine argument 2015-05-08 03:58:01 +08:00
William Cheng
c03250132d update error message, update test script 2015-05-08 03:58:01 +08:00
William Cheng
48844442fc test post body (model), fix to_hash attribute mapping 2015-05-08 03:58:01 +08:00
William Cheng
f69fb40c71 add methods for static variable 2015-05-08 03:58:01 +08:00
William Cheng
0a34793f5a add inheritance to object (model) 2015-05-08 03:58:00 +08:00
William Cheng
07cd23edac seralization and deserialization work, get_pet_by_id and
update_pet_with_form work
2015-05-08 03:58:00 +08:00
William Cheng
a7ef1262e5 fix all swagger.pl syntax issue 2015-05-08 03:58:00 +08:00
William Cheng
c5fcf3ba2c remove pl files 2015-05-08 03:58:00 +08:00
William Cheng
d206035e0f add perl support - api template, bin, codegen 2015-05-08 03:57:59 +08:00
russellb337
2eeb96116d simplifying diff 2015-05-07 12:16:44 -07:00
russellb337
2edfb96c36 swagger codegen should honor global mime types 2015-05-07 12:02:25 -07:00
Tony Tam
c7e22b7a3b Merge pull request #726 from who/feature/gson-for-android-client
Feature: Use gson for android-client instead of jackson
2015-05-07 06:26:37 -07:00
Andrew B
20ced771ba Restoring the pom.xml so integration tests work 2015-05-07 01:09:25 -07:00
Andrew B
01b7385a5e Implementing gson in android client templates 2015-05-06 22:54:25 -07:00
wing328
070a6203e0 remove php comment 2015-05-07 13:35:19 +08:00
who
902c56f09b Initial commit of jackson-to-gson 2015-05-06 17:46:54 -07:00
russellb337
129086eea7 merge latest from develop_2.0 to fork 2015-05-06 13:44:10 -07:00
Tony Tam
157da246c0 added async test sample 2015-05-06 12:56:45 -07:00
Fake Bob Dobbs
321dfb7311 For SpringMVC, RequestHeader annotations are not setting the required attribute, even when required is false (RequestHeader uses default of true). This change always sets the required param 2015-05-06 09:05:57 -04:00
Tony Tam
65097a4908 Merge pull request #680 from geekerzp/develop_2.0_python_testing
Bug fix for deserialize model issue and added unit tests for python client
2015-05-04 21:11:35 -07:00
Tony Tam
df2cbfd0e9 Merge pull request #720 from akras14/master
Fixes a bug with Node.js example generating invalid package.json and swa...
2015-05-04 16:07:26 -07:00
Alex Kras
df95114a93 Fixes a bug with Node.js example generating invalid package.json and swagger.json
Currently string "... You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or ... " gets URL encoded, resuling in Node js throwing "Unable to parse" error.

Use of {{{ }}} forces mustache to skip URL encoding
http://mustache.github.io/mustache.5.html#Partials
2015-05-04 15:07:03 -07:00
Anthony Sosso
f7d30c847f Java: support x-www-form-urlencoded for PUT, POST, DELETE 2015-05-01 15:25:54 -07:00
who
b94eb443ea Adding some tests that were accidentally deleted 2015-04-30 12:52:21 -07:00
Ron
b70f5bc98b Merge pull request #709 from eerwitt/update_documentation_links
Found the 2.0.17 tag under 2.0.17 instead of v2.0.17.
2015-04-30 21:27:15 +03:00
e3
9876e792f1 Found the 2.0.17 tag under 2.0.17 instead of v2.0.17. 2015-04-30 11:22:45 -07:00
Ron
e3f09ae4cc Merge pull request #708 from eerwitt/update_documentation_links
Linked to the 2.0.18 tag instead of the no longer existing 2.0.17.
2015-04-30 21:21:32 +03:00
e3
cd2e030dc1 Linked to the 2.0.18 tag instead of the no longer existing 2.0.17. 2015-04-30 11:16:16 -07:00
who
6be2c06ed3 Adding maven publish functionality for android client 2015-04-30 10:34:43 -07:00
wing328
2e85871a4b remove hello.txt (created by mvn test) 2015-04-30 17:12:25 +08:00
wing328
47a8ef3031 fix required parameters in ruby 2015-04-30 17:01:36 +08:00
wing328
93e4ef0eec fix required parameters check for php 2015-04-30 16:52:33 +08:00
wing328
303378c5eb fix android required parameter check 2015-04-30 16:29:21 +08:00
Andrew B
5082f69631 Adding maven publish functionality for android client 2015-04-29 22:08:27 -07:00
Tony Tam
abe072c83d Merge pull request #703 from MaorBril/master
Added support for Basic Auth
2015-04-29 21:09:48 -07:00
maorb
5fbd0afdc5 Added support for Basic Auth 2015-04-29 18:19:16 -07:00
Tony Tam
4725dfb121 Merge pull request #702 from 0legg/feature/android-gradle
Jar and aar support for Android
2015-04-29 17:50:09 -07:00
Oleg Godovykh
14c2d14fc2 provide both jar and aar 2015-04-29 14:18:44 -04:00
Oleg Godovykh
119a981701 add possibility to create aar library 2015-04-29 13:39:00 -04:00
wing328
fb3088b765 fixed required parameter in java api 2015-04-29 17:31:38 +08:00
wing328
e7b170bf3c better comment on csharp api, add ParameterToString to handle date 2015-04-29 16:27:08 +08:00
wing328
96d837274e udpate csharp template with better comment and ParameterToString 2015-04-29 11:00:05 +08:00
wing328
8818c209df udpate csharp client with restsharp 2015-04-29 10:56:24 +08:00
wing328
5c057e1306 refactor csharp client using restsharp, getpetbyid working 2015-04-29 10:55:49 +08:00
Tony Tam
6c23a21312 Merge pull request #675 from marcinkiewiczblazej/issue-674
Fix for issue #674
2015-04-28 15:21:51 -07:00
Tony Tam
2f8e0bb09c Merge pull request #699 from 0legg/feature/android-gradle
Replace maven settings for Android client with gradle
2015-04-28 15:13:23 -07:00
Oleg Godovykh
b6495a9fc2 replace maven settings for Android client with gradle 2015-04-28 17:49:59 -04:00
Tony Tam
8952759eda Merge pull request #693 from lugaru1234/multiple_tags_operations
Generation of operations with multiple tags has been fixed #356
2015-04-28 07:03:23 -07:00
Tony Tam
c96f5f6fa8 added excludes for logback.xml per https://github.com/swagger-api/swagger-codegen/issues/689 2015-04-27 22:51:52 -07:00
Nadezhda Makarkina
b0d2d1116b Generation of operations with multiple tags has been fixed #356 2015-04-27 13:25:08 +03:00
xhh
4a55223a8f Add form parameters support to Scala codegen 2015-04-24 23:57:17 +08:00
geekerzp
3aa9982b23 Fixed issue that it will throw error when deserialize model in python client. 2015-04-23 18:19:08 +08:00
geekerzp
7d706f6a00 Added pom.xml for python client. 2015-04-23 18:09:32 +08:00
geekerzp
161aeb393b Add image file for python unit tests. 2015-04-23 17:38:57 +08:00
geekerzp
f9195a8a0e Added unit tests for python client. 2015-04-23 17:13:26 +08:00
Alexey Nechaev
9a36174685 Clean up of '\n' escaping. 2015-04-23 11:50:07 +03:00
xhh
4f5f6a9e8f Include Scala petstore sample into integration test 2015-04-23 15:27:44 +08:00
xhh
78072f753c Fix tests for Scala petstore sample 2015-04-23 09:38:27 +08:00
wing328
d5a3cc7300 fix php swagger type 2015-04-23 00:42:36 +08:00
Alexey Nechaev
fc0be6d503 Fixes #646: Example field handling has been fixed. 2015-04-22 16:17:28 +03:00
Alexey Nechaev
699973dcfe Group and version are avaiable from parent pom. 2015-04-22 16:11:16 +03:00
Blazej Marcinkiewicz
465266e219 Updated Java Spring MVC query param generation to include 'required' parameter if it's available. 2015-04-22 11:52:46 +02:00
Tony Tam
5c935a4c29 Merge pull request #668 from wing328/fix_swagger_type
[CSharp] Bug fix for swagger type
2015-04-21 10:01:35 -07:00
wing328
95ff0b9313 remove pettest, which is for testing only 2015-04-21 23:16:54 +08:00
wing328
eed04560c0 fix string? 2015-04-21 23:16:17 +08:00
William Cheng
2c0e8f6079 fix csharp model name issue 2015-04-21 22:42:13 +08:00
geekerzp
152eabbd6a Fixed PetstoreClient.xccheckout. 2015-04-21 16:33:28 +08:00
geekerzp
60ab624b23 Updated xcode project for petstore 2015-04-21 16:23:08 +08:00
geekerzp
4dd793c0ac Updated naming convention in objc client. 2015-04-21 16:23:08 +08:00
Tony Tam
7f4916f333 Merge pull request #664 from geekerzp/develop_2.0_python_content_type
Fixed encoding issue for request json body in python client.
2015-04-20 21:46:06 -07:00
Tony Tam
bf4d0a5466 Merge pull request #663 from wing328/better_method_doc
Better method documentation
2015-04-20 21:43:41 -07:00
geekerzp
d053d464dd Fixed encoding issue for request json body in python client. 2015-04-20 18:05:16 +08:00
William Cheng
5465708a42 add method documentation to android and scala 2015-04-19 23:51:46 +08:00
William Cheng
3622cfd169 add method documentation for objc client 2015-04-19 23:41:26 +08:00
William Cheng
ae389a8993 update python method documentation 2015-04-19 23:23:09 +08:00
Denis Yagofarov
1d175c1c7d + advices for OS X Users 2015-04-18 22:41:18 +03:00
wing328
7e37f3294a bug fix for post (model) and update php test cases 2015-04-17 20:01:58 +08:00
Karthik Velakur
1e273640b4 Issue #642 - Removing the unnecesary \n added to generated example requests 2015-04-16 13:26:52 -04:00
Tony Tam
cbbe29cf70 Merge pull request #651 from wing328/method_name_style
Update method name based on style guide
2015-04-16 10:09:47 -07:00
wing328
c87579e1f7 fix rspec due to change of optional parameter in ruby method 2015-04-17 01:03:15 +08:00
wing328
c30ed059fe update php api test with SwaggerClient.php 2015-04-17 00:26:06 +08:00
wing328
676c4d0835 add back php unit testing and readme to PHP SwaggerClient sample code 2015-04-17 00:26:06 +08:00
wing328
4c717829b3 update test.php, remove old SwaggerPetstore-php 2015-04-17 00:26:06 +08:00
wing328
8512259d02 update method name based on style guide, update petstore sample 2015-04-17 00:26:06 +08:00
Tony Tam
e45b04ef32 Merge pull request #649 from xhh/ruby-optional-params
Add support of optional parameters to Ruby codegen
2015-04-16 09:11:28 -07:00
xhh
de21088619 Support optional body parameter 2015-04-16 18:20:36 +08:00
xhh
61bf7f49cc Remove redundant blank lines 2015-04-16 15:56:08 +08:00
xhh
a819e4d523 Support optional parameters in Ruby client
* Pass optional parameters via the `opts` Hash
* Handle query parameters in a way similar to header/form parameters to
  support parameter name normalization, e.g. the "additional_metadata"
  key is passed for "additionalMetadata"
* Rename variables to be consistent: `query_params`, `header_params` and
  `form_params`
* Remove unnecessary blank lines
2015-04-16 15:56:08 +08:00
Tony Tam
57ca71fcc9 Merge pull request #626 from wing328/fix_ruby_rspec
Fixed Ruby rspec
2015-04-15 22:56:54 -07:00
Tony Tam
a03574e119 Merge pull request #631 from xhh/ruby-config
Fix hard-coded values in Ruby client: scheme, host and base_path
2015-04-15 22:54:46 -07:00
Tony Tam
19d7dad33c Merge pull request #618 from wing328/python3_codegen
Added back python 3 codegen
2015-04-15 22:53:15 -07:00
Tony Tam
2cd8ba9875 Merge branch 'geekerzp-develop_2.0_objc_tests' into develop_2.0 2015-04-15 22:49:05 -07:00
Tony Tam
dc11c94514 Merge branch 'develop_2.0_objc_tests' of https://github.com/geekerzp/swagger-codegen into geekerzp-develop_2.0_objc_tests 2015-04-15 22:46:46 -07:00
Tony Tam
037fe442dc Merge branch 'geekerzp-develop_2.0_objc_optional_property' into develop_2.0 2015-04-15 22:44:03 -07:00
Tony Tam
0525d66b86 regenerated 2015-04-15 22:43:48 -07:00
Tony Tam
a168c4bf06 Merge branch 'develop_2.0_objc_optional_property' of https://github.com/geekerzp/swagger-codegen into geekerzp-develop_2.0_objc_optional_property 2015-04-15 22:12:01 -07:00
Tony Tam
a465edd890 Merge pull request #645 from who/develop_2.0
[PHP Templates] Fixing a bug which was preventing payloads to serialize into JSON
2015-04-15 16:51:24 -07:00
who
164a01ed12 Fixing a bug which was preventing payloads to serialize into JSON 2015-04-15 16:17:21 -07:00
Tony Tam
39602c4b2b Merge pull request #644 from hyeghiazaryan/develop_2.0
Adding defaultHeaders dictionary to generated API classes.
2015-04-15 14:24:20 -07:00
hrachya
33dfcd247d Adding defaultHeaders dictionary to generated API classes. defaultHeaders will be merged with headerParams before sending the request.
fix for https://github.com/swagger-api/swagger-codegen/issues/638
2015-04-15 13:02:09 -07:00
Tony Tam
1617b76e27 Merge pull request #637 from hyeghiazaryan/develop_2.0
Adding import for Foundation.h to SWGQueryParamCollection.h
2015-04-15 10:08:21 -07:00
geekerzp
0a9df88e53 Using propertyIsOptional to implement optional property instead of
using `Optional` protocol in objc client.
2015-04-15 17:53:45 +08:00
geekerzp
989641892e Remove outdated tests in objc client 2015-04-15 15:10:46 +08:00
hrachya
21fcbc7acb Adding import for Foundation.h to SWGQueryParamCollection.h
fix for https://github.com/swagger-api/swagger-codegen/issues/636
2015-04-14 13:20:38 -07:00
Tony Tam
dfa17d2291 Merge pull request #630 from who/develop_2.0
Making default PHP namespace generic and fix issues 628 and 635
2015-04-14 12:35:44 -07:00
who
f4a2eff4b7 Fixing nested model deserialization - Issue #635 2015-04-14 12:24:59 -07:00
Tony Tam
f9fd511eb0 Merge pull request #634 from hyeghiazaryan/develop_2.0
Adding toParamName override to ObjcClientCodegen.java
2015-04-14 11:36:25 -07:00
hrachya
ff71a2cc60 Adding toParamName override to ObjcClientCodegen.java
fix for https://github.com/swagger-api/swagger-codegen/issues/633
2015-04-14 11:23:09 -07:00
xhh
41371bd901 Initialize a default configuration object 2015-04-14 15:03:21 +08:00
xhh
7db7b146be Fix hard-coded values in Ruby client: scheme, host and base_path 2015-04-14 12:32:25 +08:00
who
de25d63838 Making the default PHP package name more generic instead of being specific to Petstore 2015-04-13 16:27:30 -07:00
who
42829ffb13 A proposed fix for Issue #628 2015-04-13 13:14:10 -07:00
Tony Tam
444666a365 Merge pull request #629 from who/develop_2.0
Correct usage of strpos in PHP APIClient mustache template
2015-04-13 12:30:41 -07:00
who
41db8798af correct usage of strpos 2015-04-13 12:22:38 -07:00
Tony Tam
33bd614a42 Merge pull request #625 from geekerzp/develop_2.0_python_form_params
Fixed request content-type in python client
2015-04-13 10:26:17 -07:00
Tony Tam
10ad0b48dc Merge pull request #623 from wing328/php_fix_double
Fixed "double" response type in PHP client
2015-04-13 10:24:54 -07:00
wing328
4a0314849e fix ruby spec 2015-04-13 22:23:52 +08:00
geekerzp
10a9d298d7 Fixed request content-type in objc client.
In api.mustache the name of content-type is `Content-Type`,
but in swagger.mustache the name of content-type is `Content-type`.
2015-04-13 17:30:43 +08:00
William Cheng
13d513f02b fix double in php client response 2015-04-12 23:06:07 +08:00
Tony Tam
7f84deaf30 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-04-10 23:07:27 -07:00
Tony Tam
765a5c6aa1 added uniqueness for nickname, #612 2015-04-10 23:07:00 -07:00
Tony Tam
f7c195a7ac updated pom for #612 2015-04-10 23:06:47 -07:00
Tony Tam
252cb18aeb Merge pull request #619 from geekerzp/develop_2.0_python_package
Update Python codegen to support packaging via Setuptools
2015-04-10 21:03:08 -07:00
Tony Tam
54a5ecb101 Merge pull request #620 from geekerzp/develop_2.0_objc_content_type
Fixed request content-type in objc client
2015-04-10 21:01:25 -07:00
geekerzp
63ca000482 fixed request content-type to multipart/form-data when upload file is null 2015-04-11 11:46:55 +08:00
geekerzp
00aa844964 update readme.md 2015-04-11 10:38:32 +08:00
geekerzp
e6bf58a707 package python sdk using setuptools 2015-04-11 10:38:32 +08:00
William Cheng
ccc0653923 add python 3 codegen 2015-04-10 19:42:09 +08:00
Tony Tam
70c14092f9 Merge pull request #610 from xhh/ruby-gemspec
Generate Ruby gemspec
2015-04-09 07:37:26 -06:00
Tony Tam
a1e62ea4b1 Merge pull request #611 from wing328/csharp_date_iso8601
Updated CSharp client to support ISO8601 format
2015-04-09 07:26:12 -06:00
wing328
22f72e2b23 update comment for escapeString 2015-04-09 16:05:13 +08:00
wing328
a0756bf6f2 remove composer.lock 2015-04-09 15:57:25 +08:00
wing328
78e1fb231e remove php vendor 2015-04-09 15:56:19 +08:00
wing328
5cbe5d60aa add iso8601 support to csharp, add more comments, add PATCH support 2015-04-09 15:55:13 +08:00
xhh
e9c5c1434b Fix spec 2015-04-09 11:37:48 +08:00
xhh
817a74d4df Add README.md file containing instructions on Ruby petstore sample 2015-04-09 11:34:10 +08:00
xhh
02fa04aec8 Generate gemspec for Ruby client 2015-04-09 11:34:09 +08:00
xhh
7cd8d0a1ac Restructure gemspec related files to ease importing the files 2015-04-09 11:34:09 +08:00
Tony Tam
7dcdaca288 Merge pull request #609 from geekerzp/develop_2.0_python_better_import
Better import for python client
2015-04-08 21:15:38 -06:00
geekerzp
3259a1d814 Fixed module name in __init__.py in python client. 2015-04-09 10:37:15 +08:00
geekerzp
806c26d54f Merge branch 'develop_2.0' into develop_2.0_python_better_import
Conflicts:
	modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PythonClientCodegen.java
2015-04-09 09:31:50 +08:00
geekerzp
f2ecc271b5 Better import for python client. 2015-04-09 09:21:21 +08:00
Tony Tam
a05251da51 Merge pull request #601 from geekerzp/develop_2.0_python_unicode
Support unicode string in python client.
2015-04-08 06:56:19 -06:00
Tony Tam
555ef7677d Merge pull request #600 from wing328/python_variable_naming
Fixed parameter name, better naming convention for python client
2015-04-08 05:04:02 -06:00
Tony Tam
eb2ec92b66 Merge pull request #604 from wing328/php_fix_warning
Fixed PHP5.3 warning
2015-04-08 05:01:54 -06:00
Tony Tam
e1a3540caf fixed version 2015-04-08 05:00:10 -06:00
Tony Tam
c1d51266b3 fixed version 2015-04-08 04:51:54 -06:00
William Cheng
9de22c8146 update petstore php sample 2015-04-08 12:00:37 +08:00
William Cheng
eb0fccd1d2 fixed content-type check for model 2015-04-08 11:54:57 +08:00
William Cheng
cb2f5d3e25 fix php warning in php5.3 2015-04-08 11:33:09 +08:00
Tony Tam
73665a2b67 Merge pull request #602 from wing328/php_unit_test
Added unit testing for PHP Petstore client
2015-04-07 09:41:56 -06:00
geekerzp
24d5dc093f Support unicode string in python client. 2015-04-07 15:33:05 +08:00
William Cheng
18476114b9 update test case for php, add readme.md 2015-04-07 04:02:09 +08:00
William Cheng
bd07425b25 update php test case for PetApi 2015-04-07 03:59:20 +08:00
William Cheng
49ad6f47a5 fix parameter name, better naming convention for python client 2015-04-07 01:37:32 +08:00
Tony Tam
b85c8bbe7f rebuilt client 2015-04-06 08:08:36 -06:00
Tony Tam
e8ae9178af merged 2015-04-06 08:02:37 -06:00
Tony Tam
12d4e812a6 removed samples 2015-04-06 08:02:02 -06:00
Tony Tam
07030e1f42 Merge branch 'develop_2.0' 2015-04-06 08:01:24 -06:00
Tony Tam
c04f947a85 prepare for release 2015-04-06 08:00:16 -06:00
Tony Tam
d55aaffc48 Merge pull request #597 from wing328/php_package
Updated PHP codegen to support packaging via Composer
2015-04-06 07:44:00 -06:00
Tony Tam
b9514a40de Merge pull request #585 from wing328/ruby_fix_path_variable
Fixed Ruby path variable url-encoded twice, removed duplicated path variable replacement
2015-04-06 07:42:58 -06:00
William Cheng
ed43a38db2 Merge branch 'ruby_fix_path_variable' of https://github.com/wing328/swagger-codegen into ruby_fix_path_variable 2015-04-06 19:06:50 +08:00
William Cheng
2967cc3801 moved store spec into a separate file, update order id to 5 (as the
order with ID 2 is no longer found)
2015-04-06 19:05:19 +08:00
William Cheng
9c5153e8c8 fix test cases 2015-04-06 18:52:30 +08:00
William Cheng
0a4fc6a40f update ruby petstore sample 2015-04-06 18:52:30 +08:00
William Cheng
a717aba826 fixed path variable double uri-encoded issue 2015-04-06 18:52:30 +08:00
wing328
5c335beb60 removed description testing for Category 2015-04-06 18:28:43 +08:00
wing328
8d6d1cb329 recovered APIclient due to merge 2015-04-06 18:10:43 +08:00
wing328
6b2035e353 Merge branch 'php_package' of https://github.com/wing328/swagger-codegen into php_package
Conflicts:
	modules/swagger-codegen/src/main/resources/php/APIClient.mustache
	samples/client/petstore/php/SwaggerPetstore-php/lib/APIClient.php
	samples/client/petstore/php/SwaggerPetstore-php/lib/PetApi.php
	samples/client/petstore/php/SwaggerPetstore-php/lib/StoreApi.php
	samples/client/petstore/php/SwaggerPetstore-php/lib/UserApi.php
	samples/client/petstore/php/SwaggerPetstore-php/lib/models/Category.php
	samples/client/petstore/php/SwaggerPetstore-php/lib/models/Order.php
	samples/client/petstore/php/SwaggerPetstore-php/lib/models/Pet.php
	samples/client/petstore/php/SwaggerPetstore-php/lib/models/Tag.php
	samples/client/petstore/php/SwaggerPetstore-php/lib/models/User.php
2015-04-06 18:05:10 +08:00
wing328
3811a5a209 resolve conflict during rebase 2015-04-06 18:03:15 +08:00
wing328
c1046cc87b add php packaging support 2015-04-06 17:59:42 +08:00
Tony Tam
2bb42a1147 updated version 2015-04-05 16:12:04 -07:00
Tony Tam
1b4367ffba updated readme 2015-04-05 13:50:49 -07:00
Tony Tam
b4df8477d8 updated parser version 2015-04-05 13:48:48 -07:00
Tony Tam
27c7e69fba updated templates 2015-04-05 13:42:20 -07:00
Tony Tam
5a5bb6edbf Merge branch 'geekerzp-develop_2.0_objc_form_params' into develop_2.0 2015-04-04 22:12:41 -07:00
Tony Tam
448462552f updated logic, merged 2015-04-04 22:12:30 -07:00
Tony Tam
14cbc2d90d Merge branch 'develop_2.0_objc_form_params' of https://github.com/geekerzp/swagger-codegen into geekerzp-develop_2.0_objc_form_params 2015-04-04 21:34:26 -07:00
Tony Tam
dfa2c22e0c Merge pull request #566 from geoand/Apache_HttpClient_Connection_Manager
Switched SingleClientConnManager with ThreadSafeClientConnManager.
2015-04-04 21:33:38 -07:00
Tony Tam
a57588caa1 Merge pull request #588 from wing328/csharp_response_warning
Eliminated warning related to response in CSharp API files
2015-04-04 21:00:31 -07:00
Tony Tam
fad7246e05 removed file 2015-04-04 20:59:57 -07:00
Tony Tam
a0c9296ee8 name rebuilds, tests 2015-04-04 20:04:10 -07:00
Tony Tam
0c2e464c71 updated jetty version 2015-04-04 17:49:36 -07:00
Tony Tam
15236ef376 updated ruby template 2015-04-04 17:45:22 -07:00
Tony Tam
950bfff1c1 fixed serialization of arrays 2015-04-04 17:20:18 -07:00
Tony Tam
bba91c7e92 added android tests 2015-04-04 17:20:04 -07:00
Tony Tam
33c87e8e72 added sample 2015-04-04 17:02:16 -07:00
Tony Tam
ba2ccf788c name rebuilds, tests 2015-04-04 17:00:22 -07:00
Tony Tam
e114875f02 updated test 2015-04-04 16:58:28 -07:00
Tony Tam
09346c761b added script 2015-04-04 16:28:53 -07:00
Tony Tam
f0e41bf43e template updates 2015-04-04 16:28:43 -07:00
Tony Tam
9c75304832 updated to overwrite files 2015-04-04 16:28:33 -07:00
Tony Tam
02fd96a24a added spring-mvc sample 2015-04-04 13:46:35 -07:00
Tony Tam
568ca26747 renamed folder 2015-04-04 11:53:02 -07:00
Tony Tam
1e82fc5d24 removed old code 2015-04-04 11:49:40 -07:00
Tony Tam
d9f8fcb7a4 fixes for #501 2015-04-04 00:02:34 -07:00
Tony Tam
17ca7c4648 ahhhh scala 2015-04-03 23:18:03 -07:00
Tony Tam
acf2c8cc9d removed printlns 2015-04-03 23:12:50 -07:00
Tony Tam
43c88f51c6 fixed #497 2015-04-03 23:04:18 -07:00
Tony Tam
60e5899dc3 updated codegen 2015-04-03 23:02:38 -07:00
Tony Tam
f75312105d added property file 2015-04-03 22:41:00 -07:00
Tony Tam
610143f4ad fix for #577, added newline replacement 2015-04-03 22:22:31 -07:00
Tony Tam
2cc9b10a1e Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-04-03 22:15:10 -07:00
Tony Tam
f3ab28b92d fix for #589, escape text for parameter description 2015-04-03 22:15:00 -07:00
wing328
660d336646 fix warning related to csharp response, better code format for csharp api 2015-04-03 23:10:10 +08:00
Tony Tam
15c25c8277 Merge pull request #587 from geekerzp/develop_2.0_python_user_agent
Fixed user agent in python client
2015-04-03 07:34:19 -07:00
geekerzp
b4d4fa1a43 Update python sample code. 2015-04-03 18:21:33 +08:00
geekerzp
d4ac668cd4 Set default User-Agent for Python client. 2015-04-03 18:04:05 +08:00
Tony Tam
38e34e0dd6 Merge pull request #584 from wing328/ruby_fix_accept
Fixed Ruby header: "Accept", "Content-Type"
2015-04-02 21:56:44 -07:00
Tony Tam
9159892965 updated templates 2015-04-02 18:32:16 -07:00
Tony Tam
eda1a44fa3 updated parser 2015-04-02 18:30:00 -07:00
Camille Chafer
65b6d210bc Examples updated with names lower-camelized 2015-04-02 18:02:21 +02:00
Camille Chafer
6c4765fd00 Parameters names where camelized with first letter not lower 2015-04-02 18:00:25 +02:00
Camille Chafer
ef3811390f Some fixes for Wordnik & Petstore examples 2015-04-02 17:46:26 +02:00
Camille Chafer
2ce55115a6 Add wordnik and petstore examples 2015-04-02 16:26:16 +02:00
Camille Chafer
0811e0bce3 Add Akka-Scala client generator. This client uses Spray as Http Client. 2015-04-02 16:22:52 +02:00
William Cheng
40d512fe43 fix test cases 2015-04-02 21:37:54 +08:00
William Cheng
e73957e790 update ruby petstore sample 2015-04-02 21:12:01 +08:00
William Cheng
b773d40034 fixed path variable double uri-encoded issue 2015-04-02 16:15:08 +08:00
Tony Tam
b6be19b266 Merge pull request #582 from guptasu/develop_2.0
Fixed the compile time error in the generated code caused due to unescaped new line characters.
2015-04-01 20:58:01 -07:00
William Cheng
1c0cb7f884 fix syntax 2015-04-02 06:12:07 +08:00
William Cheng
bc24e5e290 update ruby accept header 2015-04-02 05:23:53 +08:00
Sunny Gupta
80259fbcc4 Fixed the compile time error in the generated code caused due to unescaped new line characters.
Since the description text is not being escaped, if there is a new line character, it will cause a new line to be added to the source code. This can cause compile time error if the new line character is part of a string (e.g. java string) and there is no '+' sign explicitly added to the code. Note: The code was doing escapeText for properties but not for models. This patch fixes that.
2015-04-01 12:33:44 -07:00
Tony Tam
64292cdc9b Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-04-01 07:41:54 -07:00
Tony Tam
df771b5a4d updated springfox templates 2015-04-01 07:41:45 -07:00
Tony Tam
8b8e8d70f9 Merge pull request #580 from wing328/php_content_type
Fix content-type and accept in PHP API
2015-04-01 07:29:57 -07:00
William Cheng
27dfa12335 remove csharp model files (lower case) 2015-04-01 17:43:36 +08:00
Tony Tam
13ee40a4b8 added test script 2015-03-31 21:48:12 -07:00
Tony Tam
df9efe5734 added script 2015-03-31 21:48:04 -07:00
Tony Tam
f142474a54 updated templates 2015-03-31 21:47:30 -07:00
Tony Tam
084d448fd4 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-03-31 21:00:34 -07:00
Tony Tam
1385a157e9 moved count 2015-03-31 21:00:15 -07:00
Tony Tam
fe3c3cc8bc fix for #578 2015-03-31 20:59:57 -07:00
Tony Tam
97e44679d3 Merge pull request #579 from xhh/fix-android-datetime-pattern
Fix date time format for Android client
2015-03-31 20:12:59 -07:00
xhh
d5ad4c4ae7 Fix date time format for Android client
According to Android's docs (https://developer.android.com/reference/java/text/SimpleDateFormat.html)
the `SimpleDateFormat` class in Android does not accept `XXX` as the timezone, it uses `Z` instead.

Also updated the date time format of Android and Java clients to include milliseconds.
2015-04-01 10:22:04 +08:00
Tony Tam
6ac497d774 rebuilt 2015-03-31 16:12:42 -07:00
Tony Tam
cd2c8f6527 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-03-31 16:08:53 -07:00
Tony Tam
d4b9a41786 added ruby 2015-03-31 16:08:47 -07:00
Tony Tam
93fef67c7e added required check 2015-03-31 16:08:37 -07:00
Tony Tam
f72e5907bb formatting 2015-03-31 16:08:09 -07:00
Tony Tam
01c956caba cleanup 2015-03-31 16:07:56 -07:00
Tony Tam
5f07fb0b03 sorted 2015-03-31 16:07:37 -07:00
Tony Tam
f17968d5b3 fixed required flag 2015-03-31 16:07:24 -07:00
Tony Tam
055c4397e9 renamed 2015-03-31 16:07:07 -07:00
Tony Tam
62a99115fc renamed 2015-03-31 16:06:52 -07:00
Tony Tam
7483a06226 renamed 2015-03-31 16:06:46 -07:00
Tony Tam
f265ce361a Merge pull request #556 from FindTheBest/develop_2.0
Python Binding Request Headers
2015-03-31 15:58:34 -07:00
Tony Tam
744952aee4 formatting 2015-03-31 15:57:50 -07:00
Tony Tam
66591f567c Merge pull request #576 from wing328/ruby_petstore_test
Fix Ruby rspec
2015-03-31 15:47:54 -07:00
William Cheng
03c48af9e6 Fix content-type and accept in PHP API 2015-04-01 04:26:32 +08:00
Tony Tam
3096c6c3ce updated versions 2015-03-31 08:47:35 -07:00
William Cheng
cb2f1e1bb1 update test case for StoreApi.getOrderById (id: 1 => 2) 2015-03-31 14:37:59 +08:00
William Cheng
59140bd3f3 remove commented unused code from response spec 2015-03-31 14:17:58 +08:00
James Ebentier
ce700b9421 Fixing one more issue with the defaultHeaders merging and removing unnecessary code 2015-03-30 12:47:56 -07:00
James Ebentier
761ab22f08 Adding Self to setDefaultHeader method signature 2015-03-30 12:28:17 -07:00
William Cheng
0ee39c67fe fix rspec, update ruby client default configuration 2015-03-31 01:28:33 +08:00
James Ebentier
148b2daaa3 Python Formatting: removing semicolons from the python code 2015-03-30 08:42:12 -07:00
geekerzp
a927d679f0 fixed issue that it throw exceptions when request with form parameters
in objective-c client
2015-03-30 17:42:47 +08:00
Tony Tam
a4ce6d7074 updated scripts 2015-03-29 20:55:26 -07:00
Tony Tam
3739d2876e removed file 2015-03-29 20:50:23 -07:00
Tony Tam
0c50d9807e added jaxrs 2015-03-29 20:50:10 -07:00
Tony Tam
5e83b6602e updated templates for baseName 2015-03-29 20:49:51 -07:00
Tony Tam
5ab425e82d rebuilt 2015-03-29 20:42:20 -07:00
Tony Tam
b5be12a25b Merge branch 'wing328-add_csharp_codegen' into develop_2.0 2015-03-29 20:03:25 -07:00
Tony Tam
367f81d52d Merge branch 'add_csharp_codegen' of https://github.com/wing328/swagger-codegen into wing328-add_csharp_codegen 2015-03-29 20:03:16 -07:00
Tony Tam
b10445f3f6 Merge pull request #561 from wing328/ruby_doc
Update ruby api files with better documentation
2015-03-29 19:58:21 -07:00
Tony Tam
1e7862a466 Merge pull request #574 from geekerzp/develop_2.0_python_urlencode
Fixed issue that query parameters double url encoded in python client
2015-03-29 19:56:02 -07:00
Tony Tam
943efce971 rebuilt 2015-03-29 19:43:29 -07:00
Tony Tam
e7675e48ed updated snapshot 2015-03-29 19:42:12 -07:00
Tony Tam
63efc4f442 removed println 2015-03-29 19:41:58 -07:00
Tony Tam
a5c92be360 updated sample 2015-03-29 19:41:37 -07:00
Tony Tam
8de8f48679 fix for Optional 2015-03-29 19:41:24 -07:00
Tony Tam
63fae85ff4 updated sample 2015-03-29 19:40:54 -07:00
geekerzp
8f6afda99a fixed issue that query parameters double url encoded 2015-03-30 10:34:01 +08:00
Tony Tam
510254e5a3 fixed required flag 2015-03-29 19:17:54 -07:00
wing328
9981daad61 add back php petstore samples 2015-03-30 09:39:37 +08:00
wing328
c1824b5387 fix parameter name in API, update petstore sample 2015-03-30 09:31:49 +08:00
Tony Tam
517c0a4f52 Merge pull request #558 from geekerzp/develop_2.0_objc_jsonmodel
Add JSONModel to objective-c client
2015-03-29 08:53:14 -07:00
Tony Tam
cab50ccb59 Merge pull request #548 from xhh/java-android-user-agent
Set default User-Agent for Java and Android clients
2015-03-29 08:52:56 -07:00
Tony Tam
e51f548807 Merge pull request #559 from wing328/java_doc
Update Java documentation for methods (endpoints)
2015-03-29 08:52:32 -07:00
Tony Tam
8a214838e5 Merge pull request #565 from wing328/php_doc
Update PHP documentation for method
2015-03-29 08:52:01 -07:00
geekerzp
37118cab47 Merge branch 'develop_2.0' into develop_2.0_objc_jsonmodel
Conflicts:
	samples/client/petstore/objc/PetstoreClient/PetstoreClientTests/PetApiTest.m
2015-03-29 18:15:02 +08:00
geekerzp
e6d7517e63 Update api-body.mustache, api-header.mustache,
apiBodyResponseWithContainer.mustache and apiNonPrimitiveResponse.mustache
templates in objective-c client.

* Update `asDictionary` method to `toDictionary` method which provided by
  JSONModel.
* Update `initWithValues` method to `initWithDictionary` method which
  provided by JSONModel.
2015-03-29 18:06:52 +08:00
xhh
90db8e2147 Add setUserAgent method to Java and Android clients 2015-03-29 09:55:20 +08:00
xhh
65883a5d85 Set default User-Agent for Java and Android clients 2015-03-29 09:55:19 +08:00
Tony Tam
7383520639 added objc target 2015-03-28 10:48:18 -07:00
Tony Tam
49e9c74324 Merge pull request #572 from swagger-api/issue-567
Issue 570
2015-03-28 10:46:17 -07:00
Tony Tam
492ab20c00 fix for issue 567, added reserved words, rebuilt client 2015-03-28 10:42:02 -07:00
Tony Tam
92621f2f2d fix for issue 567, added reserved words, rebuilt client 2015-03-28 10:41:51 -07:00
Tony Tam
f2ce5ef273 Merge pull request #571 from lanwen/cli-doc
update docs and bash about CLI usage, deprecate old cli classes
2015-03-28 08:50:46 -07:00
William Cheng
836f7ecb95 rebase with develop_2.0 2015-03-28 22:55:15 +08:00
MerkushevKirill
0dcd307333 update docs and bash about CLI usage, deprecate old cli classes
(after #547)
2015-03-28 12:34:44 +03:00
William Cheng
c2b3e68f8c rebase on develop_2.0 2015-03-28 16:48:07 +08:00
William Cheng
11c8e2268a Merge branch 'java_doc' of https://github.com/wing328/swagger-codegen into java_doc 2015-03-28 16:48:02 +08:00
William Cheng
a12cc1c544 remove {{newline}} as it has no impact at all 2015-03-28 16:43:16 +08:00
William Cheng
27e1b1c4b2 update java doc 2015-03-28 16:43:15 +08:00
Tony Tam
a62cd193ad Merge pull request #569 from swagger-api/issue-567
updated camelize function for #567
2015-03-27 23:23:02 -07:00
Tony Tam
0686a91690 updated camelize function for #567 2015-03-27 23:18:54 -07:00
Tony Tam
4f6d5f6265 Merge pull request #568 from swagger-api/feature/objc-templates
Feature/objc templates
2015-03-27 23:04:16 -07:00
Tony Tam
99271e77ab added multi-param args 2015-03-27 22:55:06 -07:00
Tony Tam
c9a2a14da5 added queryParamCollection 2015-03-27 22:17:50 -07:00
Tony Tam
236a1147b7 minor comment 2015-03-27 09:53:40 -07:00
gandrianakis
7eba8670e3 Switched SingleClientConnManager with ThreadSafeClientConnManager.
The SingleClientConnManager cannot be used safely in multi-threaded environments
2015-03-27 18:41:16 +02:00
William Cheng
bdd1d1621f remove {{newLine}} and replace tab wtih 2 spaces 2015-03-27 23:55:26 +08:00
Tony Tam
98c8f867e5 enabled java test 2015-03-27 08:52:22 -07:00
William Cheng
bfb35aa3ee remove {{newline}} as it has no impact at all 2015-03-27 23:49:27 +08:00
William Cheng
6ab51bcb4e remove tab with 2 spaces in php api template 2015-03-27 23:11:13 +08:00
William Cheng
1c547e9598 update php documentation 2015-03-27 22:40:59 +08:00
geekerzp
19c05eefab Merge branch 'develop_2.0' into develop_2.0_objc_jsonmodel
Conflicts:
	pom.xml
2015-03-27 17:27:58 +08:00
Tony Tam
3d12c8847f Merge pull request #562 from swagger-api/feature/java-client
Feature/java client
2015-03-26 23:31:47 -07:00
Tony Tam
5d6d563a8e updated versions 2015-03-26 23:17:17 -07:00
Tony Tam
442be8624c rebuilt client, added tests 2015-03-26 23:10:10 -07:00
Tony Tam
287bb7d936 fixed builder, error msg 2015-03-26 23:09:47 -07:00
Tony Tam
ddb1d6e0d3 removed 404 handling 2015-03-26 23:09:29 -07:00
Tony Tam
8b98a92805 adds tests, fixes for java templates 2015-03-26 20:32:59 -07:00
William Cheng
8b4a077f8a Merge branch 'ruby_doc' of https://github.com/wing328/swagger-codegen into ruby_doc 2015-03-27 02:12:33 +08:00
William Cheng
3d53cfc298 better ruby method argument format 2015-03-27 02:11:49 +08:00
William Cheng
fb2ab79455 update ruby doc 2015-03-27 02:11:49 +08:00
William Cheng
731bfc1fc6 Merge branch 'java_doc' of https://github.com/wing328/swagger-codegen into java_doc 2015-03-27 02:00:05 +08:00
William Cheng
ae52a62c09 update java doc 2015-03-27 01:59:05 +08:00
russellb337
62d4516fe7 Merge remote-tracking branch 'upstream/develop_2.0' into develop_2.0 2015-03-26 09:06:35 -07:00
William Cheng
9ba1398831 better ruby method argument format 2015-03-26 20:20:28 +08:00
William Cheng
a4690d76db update ruby doc 2015-03-26 19:55:48 +08:00
William Cheng
fe11b064af update java doc 2015-03-26 16:27:00 +08:00
Tony Tam
a2dc767559 Update .travis.yml 2015-03-25 20:57:48 -07:00
geekerzp
93e19e48db update swagger-core version to 1.5.4-M1-SNAPSHOT 2015-03-26 11:23:47 +08:00
geekerzp
fbe069cf5c add jsonmodel in objective-c client 2015-03-26 10:07:33 +08:00
Tony Tam
20add5b58e updated tests, jetty 2015-03-25 16:16:03 -07:00
Tony Tam
b7c2c3448e renamed package 2015-03-25 12:12:04 -07:00
Tony Tam
f577345b14 fixed examples, readme 2015-03-25 12:11:40 -07:00
James Ebentier
bf46da7c14 Python: modifying request headers in ApiClient to act like those in Java and PHP 2015-03-25 11:44:46 -07:00
Tony Tam
d2f5b9ea65 added recursion check 2015-03-25 11:11:04 -07:00
Tony Tam
e8052f0505 Merge pull request #550 from swagger-api/feature/ios-templates
added command-line tests
2015-03-25 09:27:42 -07:00
Tony Tam
be373f88d4 fixed test errors 2015-03-25 09:27:12 -07:00
Tony Tam
ceffa10ab7 added command-line tests 2015-03-24 23:24:13 -07:00
Tony Tam
b36f3c98ca Merge pull request #547 from lanwen/cli
add - new command line interface in distribution module
2015-03-24 20:34:34 -07:00
Tony Tam
f459982560 Merge pull request #549 from swagger-api/feature/ios-templates
Feature/ios templates
2015-03-24 19:59:54 -07:00
Tony Tam
56104566fc added void response 2015-03-24 19:57:51 -07:00
Tony Tam
85463f049c rebuilt sample 2015-03-24 19:56:45 -07:00
Tony Tam
30acfc1869 added sys property 2015-03-24 19:56:38 -07:00
Tony Tam
2ce0049ce4 updated templates to fix petstore build error 2015-03-24 19:56:28 -07:00
Tony Tam
e82ecf695d added array support 2015-03-24 19:56:04 -07:00
Tony Tam
dc9a00809c Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-03-24 17:13:02 -07:00
Tony Tam
31418b3936 added property for app name 2015-03-24 17:12:20 -07:00
Tony Tam
db14a3fd05 added property for app name 2015-03-24 17:02:12 -07:00
Tony Tam
de0e108d27 added property for app name 2015-03-24 17:02:03 -07:00
Tony Tam
b8cd52aa07 Merge pull request #540 from lanwen/develop_2.0
rft - only codestyle, remove wildcard imports and use string-utils from apache
2015-03-24 16:56:01 -07:00
Tony Tam
16403950d5 Merge pull request #545 from wing328/ruby_better_naming
Update ruby codgen for better naming convention
2015-03-24 16:53:20 -07:00
MerkushevKirill
8ba444141e add - new command line interface in distribution module
can replace Codegen and MetaGenerator classes. Provides a bit different cli interface
based on refactored pom from #541,
affects #349

```
usage: swagger <command> [<args>]

The most commonly used swagger commands are:
    generate   Generate code with chosen lang
    help       Display help information
    langs      Shows available langs
    meta       MetaGenerator. Generator for creating a new template set and configuration for Codegen.  The output will be based on the language you specify, and includes default templates to include.
 ```
  **generate** and **meta** commands have same as current cli options
2015-03-25 01:59:55 +03:00
William Cheng
fb3e44ecc4 break down ruby reservedWord list into multiple lines 2015-03-24 16:34:41 +08:00
William Cheng
8107162540 update ruby codgen for better naming convention 2015-03-24 16:24:31 +08:00
MerkushevKirill
ee096569c4 rft - only codestyle with indents, remove wildcard imports and use string-utils from apache 2015-03-24 11:13:01 +03:00
Tony Tam
81e1fd53e2 Merge pull request #544 from geekerzp/develop_2.0_python_key_map
Support attribute key mapping in python client
2015-03-23 22:18:25 -07:00
geekerzp
07237f8eb9 add model attribute name json key mapping in python clent 2015-03-24 11:55:20 +08:00
Tony Tam
9442e23fd9 Merge pull request #543 from wing328/remove_old_php_sample
Remove old model files in PHP petstore
2015-03-23 20:35:13 -07:00
russellb337
970facaa8a merge latest from develop_2.0 to fork 2015-03-23 17:01:49 -07:00
russellb337
fe92889b10 merge latest from develop_2.0 to to fork 2015-03-23 17:01:35 -07:00
Tony Tam
fe82d7dc05 Merge pull request #542 from mrwanny/fix_MissingTag_StringIndexOutOfBoundsException
fix StringIndexOutOfBoundsException when tag is not provided
2015-03-23 16:22:01 -07:00
Wanny
915fcf9b92 fix cleanup 2015-03-23 16:08:26 -07:00
Wanny
31e8d58b1d fix StringIndexOutOfBoundsException when tag is not provided 2015-03-23 15:29:39 -07:00
William Cheng
87b85e5b93 remove old php model files 2015-03-24 02:33:08 +08:00
Tony Tam
823ac04abb Merge pull request #534 from Juliens/master
add version in properties
2015-03-23 08:47:06 -07:00
Tony Tam
0cf1c3c74a Merge pull request #536 from wing328/android_better_naming
better naming convention for android-java codegen
2015-03-23 08:44:01 -07:00
William Cheng
fd602af180 better naming convention for android-java codegen 2015-03-23 15:41:24 +08:00
Tony Tam
048bea6249 Merge pull request #535 from wing328/java_beter_naming
Better variable and model property naming for Java
2015-03-22 21:19:01 -07:00
Tony Tam
601a519cb6 Merge pull request #530 from FindTheBest/master
PHP Request Headers and Deserialization
2015-03-22 21:17:10 -07:00
Tony Tam
f1f9805a01 Merge pull request #527 from geekerzp/develop_2.0_python
Support iso8601 datetime format in Python client
2015-03-22 19:35:18 -07:00
William Cheng
62d28ebca5 better variable and model property naming for java 2015-03-22 23:24:43 +08:00
Julien SALLEYRON
c46f3f9ee4 add version in properties 2015-03-21 20:12:44 +01:00
Tony Tam
f008b75e99 Merge pull request #528 from wing328/php_better_variable_naming
PHP better naming convention
2015-03-21 08:18:46 -07:00
Tony Tam
38204b2237 Merge pull request #531 from geekerzp/develop_2.0_python_datetime
Update santizeForSerialization to normalize parameters for Python client
2015-03-21 08:18:00 -07:00
Tony Tam
d71785470b Merge pull request #532 from xhh/android-form-params
Add support of form parameter to Android client
2015-03-21 08:16:20 -07:00
xhh
b5a4d5be04 Add support of form parameter to Android client
* Handle form parameters in a way similar to Java client.
* Handle file uploading.
* Normalize query, header and form parameters with the
  ApiInvoker.parameterToString method, which formats Date value to ISO 8601.
2015-03-21 22:20:28 +08:00
geekerzp
f085860eb1 Update sanitizeForSerialization to sanitize parameters to Python client
* Refactor santizeForSerialzation to static method.
* Sanitize header/query/form/body parameters.
* Sanitize datetime.datetime and datetime.date to iso8601 format string.
* Sanitize swagger model to dict.
2015-03-21 14:58:32 +08:00
James Ebentier
8323fdf8e8 Fixing deserialization bug in PHP bindings 2015-03-20 15:35:09 -07:00
James Ebentier
0c3f06604d Correcting spelling error in comment 2015-03-20 14:54:53 -07:00
James Ebentier
e782ea2c05 Default Headers: allowing the setting of defaultHeaders on ApiClient 2015-03-20 14:45:12 -07:00
Tony Tam
9062016bf0 Merge pull request #529 from mrwanny/add_springdox
Add server codegen for springdox
2015-03-20 14:17:31 -07:00
Wanny
2301e604b3 clean up README.md 2015-03-20 13:53:07 -07:00
Wanny
34eab98ce4 Merge branch 'develop_2.0' into add_springdox 2015-03-20 13:47:08 -07:00
Wanny
00c1018d79 add basi Springdox server generation 2015-03-20 13:45:01 -07:00
William Cheng
c36e5a96fe update php codegen with better naming convention 2015-03-20 21:56:41 +08:00
geekerzp
c024a4c099 use dateutil to parse string to datetime in python 2015-03-20 14:38:18 +08:00
Tony Tam
92e5574ec1 Merge pull request #526 from swagger-api/feature/example-generator
Feature/example generator
2015-03-19 15:49:47 -07:00
Tony Tam
cdf8648d3b made noservice option 2015-03-19 14:59:32 -07:00
Tony Tam
de56f76284 rebuilt sample 2015-03-19 14:52:45 -07:00
Tony Tam
ae1d43dc84 added more instructions, service template 2015-03-19 14:47:43 -07:00
Tony Tam
531e2d7032 added example generator, updated signatures to match 2015-03-19 14:45:22 -07:00
Tony Tam
32fe6b0333 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-03-19 09:04:16 -07:00
Tony Tam
75714ac518 added default for filename generation 2015-03-19 09:04:12 -07:00
Tony Tam
8262d30202 Merge pull request #459 from geoand/objc-dictionary-fix-dev2_0
Fixed bug that prevented Objective-C code from compiling when using a Sw...
2015-03-19 08:52:25 -07:00
Tony Tam
d332cdf200 Merge pull request #522 from wing328/ruby_user_agent
Fix User-Agent in Ruby API cleint
2015-03-19 08:32:59 -07:00
Tony Tam
f6c18cd50f Merge pull request #524 from wing328/php_property_mapping
Add Attribute Mapping to PHP model
2015-03-19 08:28:02 -07:00
William Cheng
ab8d62214a add attributemap to php model, update php petstore sample 2015-03-19 20:58:22 +08:00
William Cheng
a149bb9120 update ruby petstore example 2015-03-19 17:17:39 +08:00
William Cheng
02283fae46 udpate ruby api client to support user-agent 2015-03-19 17:09:27 +08:00
gandrianakis
c82b31aa61 Reintroduce objc dictionary fix to updated develop_2.0 branch 2015-03-19 11:07:54 +02:00
gandrianakis
37303745df Merge branch 'develop_2.0' into objc-dictionary-fix-dev2_0
Conflicts:
	modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java
2015-03-19 10:59:47 +02:00
gandrianakis
e5357df67a Merge remote-tracking branch 'upstream/master' into objc-dictionary-fix-dev2_0 2015-03-19 10:45:27 +02:00
Tony Tam
c109c11bea added yaml output 2015-03-18 23:26:45 -07:00
Tony Tam
3a8c798596 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-03-18 23:25:48 -07:00
Tony Tam
9311bdf972 added yaml generator 2015-03-18 23:24:47 -07:00
Tony Tam
925caa223a Merge pull request #482 from FindTheBest/master
Python: fixing an issue in swagger python code generation
2015-03-18 22:59:26 -07:00
Tony Tam
95e7265bd7 Merge pull request #498 from burmanm/issue_495
Fix NPE with resourcePath = /, issue #495
2015-03-18 22:58:45 -07:00
Tony Tam
93afc3bd95 Merge pull request #516 from wing328/ruby_header_param
Bug fix for ruby header parameter and better code format
2015-03-18 22:58:31 -07:00
Tony Tam
cbdb31048e updated to release version 2015-03-18 22:40:41 -07:00
Tony Tam
6b1f176a66 Merge pull request #417 from Helmsdown/additional-codegen-properties
Add API Version to Codegen Additional Properties
2015-03-18 17:05:59 -07:00
Tony Tam
f2ee9b39e9 Merge pull request #519 from swagger-api/feature/swagger-tools
updated nodejs server to swagger-tools, supports 2.0 spec
2015-03-18 16:30:57 -07:00
Tony Tam
b6e5c55817 updated nodejs server to swagger-tools, supports 2.0 spec 2015-03-18 16:10:54 -07:00
Tony Tam
963d92e23f Merge pull request #518 from cchafer/add_response_headers
Add defined response headers in CodegenResponse. at this time, only the ...
2015-03-18 14:10:08 -07:00
Camille Chafer
081757c592 headers list is CodegenResponse is always defined (no null list) 2015-03-18 19:01:45 +01:00
Camille Chafer
ac78c15fbf Add defined response headers in CodegenResponse. at this time, only the headers of the 'default' response are included in the operation. 2015-03-18 18:38:27 +01:00
Tony Tam
dd78de1ed8 updated basePath, contextPath 2015-03-18 09:34:38 -07:00
Tony Tam
64fbcb6045 rebuilt client 2015-03-18 09:34:19 -07:00
Tony Tam
86c6892eb6 rebuilt samples 2015-03-18 09:32:45 -07:00
Tony Tam
9cfbd8bde0 updated sample 2015-03-18 09:32:18 -07:00
Tony Tam
1e1d193556 Merge pull request #517 from xhh/java-param-to-str
Add parameterToString to normalize parameters for Java client
2015-03-18 07:12:32 -07:00
xhh
f8a5e900f8 Add parameterToString to normalize parameters for Java client
* Convert values to string for query/header/form parameters.
* For parameter of type Date, convert to ISO 8601 format.
* Also add utility methods to parse date in ISO 8601 format.
2015-03-18 18:58:13 +08:00
William Cheng
d0dcb2fb43 fix bug with ruby header parameter, remove extra linebreak in generated
code
2015-03-18 16:33:00 +08:00
Tony Tam
bb45790375 Merge pull request #513 from wing328/add_ruby_to_readme
update README with ruby on the codegen usage
2015-03-17 17:51:54 -07:00
Tony Tam
369689d001 merged 2015-03-17 16:30:59 -07:00
Tony Tam
df39fe5d08 added Json schema fields 2015-03-17 16:30:42 -07:00
sosso
b73340ab83 Java: properly add request headers
https://jersey.java.net/nonav/apidocs/1.8/jersey/com/sun/jersey/api/client/PartialRequestBuilder.html#header(java.lang.String, java.lang.Object)

We were running into issues with our headers not making it into our requests.  Upon some research, it appears that Jersey's header() method returns the builder object, meaning we have to do this assignment to properly construct the request.  After making the change, our requests work as expected.
2015-03-17 11:39:32 -07:00
William Cheng
a1d02785af update README with ruby on the codegen usage 2015-03-18 00:14:39 +08:00
Tony Tam
4f32e9dbff Merge pull request #502 from FindTheBest/develop_2.0
PHP Generated Models
2015-03-17 08:51:02 -07:00
Tony Tam
b6ca69f57a Merge pull request #510 from xhh/patch-2
update null comparison for query params in Java
2015-03-17 07:10:52 -07:00
Tony Tam
62992c2de1 Merge pull request #509 from wing328/ruby_form_parameter
update ruby client to support form parameters, add PATCH support
2015-03-17 07:05:09 -07:00
Xu Hui Hui
b2da6dc8a2 update null comparison for query params in Java
to make it clear and also allow a query parameter to be set with string value: "null" (4 characters string)
2015-03-17 16:34:01 +08:00
Tony Tam
c96853d5aa Merge pull request #507 from cchafer/security_schemes_definition
Adding defintion of security schemes in CodegenSecurity
2015-03-16 22:13:19 -07:00
Tony Tam
c215d8ab91 fix and tests for #503 2015-03-16 22:10:35 -07:00
Tony Tam
46d1950fbd removed unnecessary file 2015-03-16 21:04:21 -07:00
Tony Tam
03b764d404 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-03-16 20:54:14 -07:00
Tony Tam
a8aebec9ba removed description 2015-03-16 20:54:08 -07:00
Tony Tam
fd72ff56bf fixed context path 2015-03-16 20:54:01 -07:00
Tony Tam
ebec85fd54 added context path 2015-03-16 20:53:48 -07:00
Tony Tam
fd792ef180 added more helpful error trace 2015-03-16 20:53:34 -07:00
Tony Tam
486186e042 Merge pull request #505 from wing328/php_support_user_agent
update User-agent in PHP API client
2015-03-16 20:44:46 -07:00
Tony Tam
8111d4e909 Merge pull request #506 from wing328/ruby_codegen
Add ruby codegen, update sample (petstore) for ruby
2015-03-16 19:49:21 -07:00
William Cheng
fc9d632522 update ruby client to support form parameters, add PATCH support, update
ruby petstore client
2015-03-17 05:24:43 +08:00
Camille Chafer
d580d294b6 Adding defintion of security schemes in CodegenSecurity 2015-03-16 11:58:29 +01:00
William Cheng
e9227ad7e5 add ruby codegen, update sample (petstore) for ruby 2015-03-16 18:47:22 +08:00
Tony Tam
156ec2a2dd Merge pull request #485 from wing328/fix_php_string_response
minor bug fixes and enhancement to Swagger.php
2015-03-15 21:02:37 -07:00
William Cheng
186310b553 Merge branch 'fix_php_string_response' of https://github.com/wing328/swagger-codegen into fix_php_string_response
Conflicts:
	modules/swagger-codegen/src/main/resources/php/Swagger.mustache
	samples/client/petstore/php/Swagger.php
2015-03-15 22:08:44 +08:00
William Cheng
bcdee4e038 update php petstore sample code 2015-03-15 22:06:42 +08:00
William Cheng
6bc8de1230 rebase on develop_2.0 2015-03-15 22:02:16 +08:00
William Cheng
b8166f283a update php to support user agent 2015-03-15 16:33:57 +08:00
Tony Tam
ad7a5967ff Merge pull request #504 from wing328/php_param_supppor_datetime
PHP parameters to suppport datetime (ISO8601)
2015-03-14 22:41:54 -07:00
William Cheng
a0dc2097eb update php api client to support datetime (iso8601) for parameters
(header, path, url, form)
2015-03-14 23:48:05 +08:00
James Ebentier
24842d4a29 PHP Models: fixing an issue with commas being where they shouldn't 2015-03-13 10:53:42 -07:00
James Ebentier
0854ca5ce5 PHP Models: updating the models generated for PHP styling 2015-03-13 10:53:19 -07:00
James Ebentier
6ca34e362d PHP Models: updating the models generated for PHP to be array accessable and have a simple constructor 2015-03-13 10:51:45 -07:00
Tony Tam
470ba201d8 build error fix 2015-03-13 10:45:12 -07:00
Tony Tam
fc52ab972b Merge pull request #494 from FindTheBest/develop_2.0
Fixing bug in new APIClientException
2015-03-13 09:44:02 -07:00
Tony Tam
7aca1cfb3f Merge pull request #486 from wing328/php_fix_deserialize
Bug fixes for Swagger.php deserialize function
2015-03-13 09:39:50 -07:00
Ron
d9b247f302 Merge pull request #500 from jwyterlin/patch-1
Update README.md
2015-03-13 09:38:18 -04:00
Jhonathan Wyterlin
c1e45a5931 Update README.md 2015-03-13 10:35:59 -03:00
Michael Burman
4748af4d59 Fix NPE with resourcePath = /, issue #495
(cherry picked from commit 01515e4ded6fa59da87d109dd8056c1b4a64e0f7)
2015-03-13 14:38:19 +02:00
James Ebentier
575967b5de Fixing bug in new APIClientException
This new exception had a typo in it for the construct class declaration.
2015-03-12 13:23:46 -07:00
Tony Tam
6c57d6a76e Merge pull request #491 from FindTheBest/develop_2.0
PHP Bindings: exposing response and response info in Exceptions
2015-03-12 12:23:34 -07:00
James Ebentier
56ff34dc47 PHP Bindings: exposing response and response info to be accessible through thrown exceptions when non 200 response code is received 2015-03-12 12:12:07 -07:00
David Valdez
5b72653d7f Update README.md 2015-03-12 12:07:24 -07:00
Tony Tam
0a949e26f0 Merge pull request #487 from wing328/update_php_form
form parameter(single quote), add more comments
2015-03-11 08:44:26 -07:00
William Cheng
5347915c12 form parameter(single quote), add more comment 2015-03-11 21:14:17 +08:00
William Cheng
d0edb836ac fix syntax error at 223, update array comparision (case insensitive) 2015-03-11 15:47:28 +08:00
James Ebentier
c75cd55e2c Merge remote-tracking branch 'wordnik/master' 2015-03-10 13:05:16 -07:00
Tony Tam
911be4360a Merge pull request #483 from wing328/add_patch_php
Add PATCH support to PHP API client
2015-03-10 11:42:57 -07:00
Tony Tam
939b4c713d per #458 2015-03-10 11:42:31 -07:00
Tony Tam
e6abc2a881 Merge pull request #458 from djvaldez/master
Update README.md - fixed incorrect flag for custom generator class
2015-03-10 11:40:34 -07:00
Tony Tam
b2977cd29b Merge pull request #477 from wing328/fix_php_basename
use baseName for parameter name in PHP api
2015-03-10 11:39:28 -07:00
Tony Tam
da6f0eec84 Merge pull request #481 from godaddy/develop_2.0
Develop 2.0 - Fix for python3 client deserialize passing wrong parameter
2015-03-10 11:38:59 -07:00
William Cheng
7555dda2bf add logic to handle all 2xx response code, bug fix for string response,
bug fix for showing error message using serialize
2015-03-11 01:37:39 +08:00
William Cheng
941f6e7757 add PATCH support to PHP API client 2015-03-10 18:13:55 +08:00
Tony Tam
1887170dad updated links 2015-03-09 18:50:23 -07:00
James Ebentier
b2cfb77222 Python: fixing an issue in swagger python code generation where attribute classes aren't respected 2015-03-09 18:18:20 -07:00
Brad Figler
5d77321dca syncing remote 2.0 branch 2015-03-09 20:47:48 +00:00
Brad Figler
f20522a586 Merge remote branch 'upstream/master' 2015-03-09 19:10:14 +00:00
Brad Figler
17435212ed Properly serailze the correct object type versus the parent objClass 2015-03-09 19:00:35 +00:00
Tony Tam
6207c2b5e9 fix for #475 building on java8 2015-03-09 10:09:33 -07:00
Tony Tam
b6f7f85baa updated links 2015-03-09 09:32:22 -07:00
Tony Tam
9c77742046 updated links 2015-03-09 09:31:34 -07:00
Tony Tam
e9d0619358 updated versions 2015-03-09 08:59:16 -07:00
William Cheng
7c23eedf07 use baseName for parameter name in PHP api 2015-03-09 23:15:12 +08:00
Ron
27c6af3491 Update README.md 2015-03-07 16:34:39 -05:00
Tony Tam
dc5ee9dcf5 added reserved words 2015-03-04 20:44:26 -08:00
Tony Tam
07ff6a2278 Merge pull request #468 from cor3ntin/fix_base_path_upstream
Fix {{basePath}} value in support files.
2015-03-04 07:25:29 -08:00
Tony Tam
dce9a81536 Merge pull request #467 from cor3ntin/security_upstream
Expose Security schemes of operations.
2015-03-04 07:25:00 -08:00
Corentin Jabot
156055fdd5 Fix {{basePath}} value in support files.
Make {{basePath}} value in support files be the
same as in operation files, aka host/path, instead of /path.
2015-03-04 15:01:07 +01:00
Corentin Jabot
3a5c03c778 Expose Security schemes of operations.
A template can now refer to the type ( oath2.0, apiKey, basic )
as well as the name of the security schemes it rquires.

Usage :

{{#operations}}
{{#authMethods}}
{{type}}  {{name}}
{{/authMethods}}
{{/operations}}
2015-03-04 14:54:48 +01:00
Tony Tam
9ce4156e4c Merge pull request #455 from cchafer/responses
Implements CodegenResponse, and return default response in Operaiton.Responses (#293)
2015-03-03 17:34:47 -08:00
Tony Tam
f82afe0026 Merge pull request #452 from herveDarritchon/develop_2.0
Defect (Issue #445) : change the call of initialCaps for getter and setter proper generation
2015-03-03 17:33:01 -08:00
Ron
c3bb458ed9 Merge pull request #463 from yzats/patch-3
Fixed spelling errors in README.md
2015-03-03 18:45:46 -05:00
yzats
5c2c8e1d76 Update README.md
Fix spelling errors
2015-03-03 12:42:15 -08:00
Tony Tam
ced95d658f added instructions for the meta generator 2015-03-02 23:37:21 -08:00
Tony Tam
a724cd0780 added meta generator 2015-03-02 23:28:59 -08:00
Tony Tam
6b823b88d9 moved logic into abstract class for extensions 2015-03-02 17:29:29 -08:00
Tony Tam
8fb180133a merged from master 2015-03-02 10:59:35 -08:00
Tony Tam
e877abf153 Merge pull request #461 from natechadwick/master
The --auth parameter was setup to ignore values.
2015-03-01 13:45:50 -08:00
nate
dd0ccff58a Minor typo in help text. 2015-03-01 14:18:11 -05:00
nate
a793d5c6cc Changed the --auth parameter to require a value so it is not ignored. 2015-03-01 14:13:08 -05:00
gandrianakis
d313d4da3f Fixed bug that prevented Objective-C code from compiling when using a Swagger 'map' type 2015-02-27 10:11:35 +02:00
David Valdez
dfc8f7c60f Update README.md 2015-02-26 12:42:41 -08:00
Camille Chafer
c15ac0b6d4 Each type used by any response is now added to the imports list 2015-02-25 17:12:28 +01:00
Camille Chafer
f9a16d856c Add 'default' response (200) to responses list, and add Types to the CodegenResponse object (#293). In the same time, clarify, simplfy and factorize code. 2015-02-25 16:46:33 +01:00
Camille Chafer
5713dce00a add missing types on the Responses Object implementation( CodegenResponse.java) (part of #293) 2015-02-25 16:39:10 +01:00
Tony Tam
23e848b437 added ignored test for #453, nested containers 2015-02-25 07:35:05 -08:00
Tony Tam
5b01e78a72 Merge branch 'godaddy-master' into develop_2.0 2015-02-24 23:23:40 -08:00
Tony Tam
eb68d0bdbd Merge branch 'master' of https://github.com/godaddy/swagger-codegen into godaddy-master 2015-02-24 23:23:19 -08:00
Tony Tam
05297e05a5 made annotations FQ to avoid collisions 2015-02-24 21:12:08 -08:00
Tony Tam
1a0d2d19f5 updated template 2015-02-24 18:07:13 -08:00
Tony Tam
292fc99bd5 fixed response types 2015-02-24 11:03:00 -08:00
Hervé Darritchon
b339db65be Pull request #452 : Add some unit tests for this PR 2015-02-24 09:23:07 +01:00
Tony Tam
e5c70d5961 updated online version, added tag example 2015-02-23 23:23:37 -08:00
Hervé Darritchon
69be95d586 Defect (Issue #445) : change the call of initialCaps for getter and setter with Introspector.decapitalize from pakage java.beans. 2015-02-24 08:20:49 +01:00
Tony Tam
c82dfa3a64 updated version 2015-02-23 23:03:18 -08:00
Tony Tam
4fd4c17036 Merge pull request #451 from swagger-api/develop_2.0
Merged from develop_2.0
2015-02-23 22:51:46 -08:00
Tony Tam
4bd227271a updated version 2015-02-23 22:45:06 -08:00
Tony Tam
5c31d68fee updated to add resolve flag 2015-02-23 22:42:45 -08:00
Tony Tam
bfc1ed3081 added async scala generator #440 2015-02-22 08:57:40 -08:00
Tony Tam
1c7c39c1ab added logback 2015-02-22 08:56:31 -08:00
Tony Tam
4ce0a65ad5 fix for #444, paths on windows 2015-02-22 08:56:03 -08:00
Tony Tam
784afee7b7 prepare for next dev version 2015-02-17 22:06:25 -08:00
Tony Tam
f89e04d210 Update README.md 2015-02-17 22:04:12 -08:00
Tony Tam
12531943d0 Merge pull request #438 from swagger-api/develop_2.0
merged to master for patch release
2015-02-17 21:48:20 -08:00
Tony Tam
3061cd8277 put parser back to 1.0.0 2015-02-17 21:41:36 -08:00
Tony Tam
686f3656c5 updated to new patch 2015-02-17 21:38:02 -08:00
Tony Tam
9ae106affd rebuilt clients 2015-02-17 21:37:51 -08:00
Tony Tam
2550539495 added shade plugin to properly include service descriptions 2015-02-17 18:54:57 -08:00
Tony Tam
06164cdc51 updated file separator replacement 2015-02-17 15:04:06 -08:00
Tony Tam
583a932fba Merge pull request #436 from kreymerman/patch-python-codegen
Fix StringIndexOutOfBoundsException on Windows
2015-02-17 15:02:58 -08:00
Mikhail Kreymerman
fdd485608f fixed StringIndexOutOfBoundsException on Windows 2015-02-17 23:00:23 +01:00
Tony Tam
0307d3818a added friendly download links 2015-02-17 12:59:31 -08:00
Tony Tam
9a473ceae6 enabled url-only reading of specs 2015-02-17 12:43:10 -08:00
Tony Tam
12365b9591 removed cruft 2015-02-17 12:43:01 -08:00
Tony Tam
c832889db8 added slf4j, updated server gen logic 2015-02-17 11:15:08 -08:00
Tony Tam
39487d9917 disabled outdated routes, made languages GET method dynamic 2015-02-17 10:29:35 -08:00
Tony Tam
aa37542411 added version to make swagger valid 2015-02-17 10:29:06 -08:00
Tony Tam
279f43d697 Update README.md 2015-02-17 08:57:39 -08:00
Tony Tam
fee6de5974 Merge branch 'geoand-jackson_array' into develop_2.0 2015-02-17 07:08:55 -08:00
gandrianakis
5fa98b12b8 Fixed bug that did not allow json arrays to be deserialized by Jackson 2015-02-17 15:17:32 +02:00
Tony Tam
ff94196295 updated to snapshot version 2015-02-16 22:16:40 -08:00
Tony Tam
0195749f3b merged 2015-02-16 22:08:52 -08:00
Tony Tam
97fca910a1 removed cruft 2015-02-16 22:06:10 -08:00
Tony Tam
577aad3364 added file 2015-02-16 22:02:27 -08:00
Tony Tam
05c6cc756c remove cruft 2015-02-16 22:01:33 -08:00
Tony Tam
66c6662f42 cleaned up poms 2015-02-16 21:53:51 -08:00
Tony Tam
6319167464 added placeholder for javadocs 2015-02-16 21:53:43 -08:00
Tony Tam
aea2909490 Merge pull request #434 from swagger-api/develop_2.0
Merged from develop_2.0
2015-02-16 21:16:09 -08:00
Tony Tam
842421bb44 Merge pull request #433 from tfoxcroft/develop_2.0
Minor fix to cater for empty array in php
2015-02-16 21:14:56 -08:00
Terence Foxcroft
c6f10ef1ea Minor fix to cater for empty array 2015-02-17 07:10:08 +02:00
Tony Tam
3df04839a6 Update README.md 2015-02-16 21:03:36 -08:00
Tony Tam
618b4698c2 Merge branch 'develop_2.0'
Conflicts:
	README.md
	bin/Version.scala
	build.sbt
	modules/swagger-codegen/src/main/resources/Java/api.mustache
	modules/swagger-codegen/src/main/resources/android-java/api.mustache
	modules/swagger-codegen/src/main/resources/nodejs/api.mustache
	modules/swagger-codegen/src/main/resources/objc/SWGApiClient.h
	modules/swagger-codegen/src/main/resources/objc/SWGApiClient.m
	modules/swagger-codegen/src/main/resources/objc/SWGDate.h
	modules/swagger-codegen/src/main/resources/objc/SWGDate.m
	modules/swagger-codegen/src/main/resources/objc/SWGFile.m
	modules/swagger-codegen/src/main/resources/objc/SWGObject.h
	modules/swagger-codegen/src/main/resources/objc/SWGObject.m
	modules/swagger-codegen/src/main/resources/objc/api-header.mustache
	modules/swagger-codegen/src/main/resources/php/api.mustache
	modules/swagger-codegen/src/main/resources/python/api.mustache
	modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache
	modules/swagger-codegen/src/main/resources/scala/pom.mustache
	project/build.properties
	samples/client/petstore/android-java/src/main/java/io/swagger/client/api/PetApi.java
	samples/client/petstore/android-java/src/main/java/io/swagger/client/api/StoreApi.java
	samples/client/petstore/android-java/src/main/java/io/swagger/client/api/UserApi.java
	samples/client/petstore/scala/pom.xml
	samples/client/petstore/scala/src/test/scala/PetApiTest.scala
	samples/client/petstore/scala/src/test/scala/StoreApiTest.scala
	samples/client/petstore/scala/src/test/scala/UserApiTest.scala
	samples/client/wordnik-apiobjc/client/SWGAccountApi.h
	samples/client/wordnik-apiobjc/client/SWGAccountApi.m
	samples/client/wordnik-apiobjc/client/SWGApiClient.h
	samples/client/wordnik-apiobjc/client/SWGApiClient.m
	samples/client/wordnik-apiobjc/client/SWGApiTokenStatus.h
	samples/client/wordnik-apiobjc/client/SWGAudioFile.h
	samples/client/wordnik-apiobjc/client/SWGAuthenticationToken.h
	samples/client/wordnik-apiobjc/client/SWGBigram.h
	samples/client/wordnik-apiobjc/client/SWGCitation.h
	samples/client/wordnik-apiobjc/client/SWGCitation.m
	samples/client/wordnik-apiobjc/client/SWGContentProvider.h
	samples/client/wordnik-apiobjc/client/SWGContentProvider.m
	samples/client/wordnik-apiobjc/client/SWGDate.h
	samples/client/wordnik-apiobjc/client/SWGDate.m
	samples/client/wordnik-apiobjc/client/SWGDefinition.h
	samples/client/wordnik-apiobjc/client/SWGDefinition.m
	samples/client/wordnik-apiobjc/client/SWGDefinitionSearchResults.h
	samples/client/wordnik-apiobjc/client/SWGDefinitionSearchResults.m
	samples/client/wordnik-apiobjc/client/SWGExample.h
	samples/client/wordnik-apiobjc/client/SWGExample.m
	samples/client/wordnik-apiobjc/client/SWGExampleSearchResults.h
	samples/client/wordnik-apiobjc/client/SWGExampleSearchResults.m
	samples/client/wordnik-apiobjc/client/SWGExampleUsage.h
	samples/client/wordnik-apiobjc/client/SWGExampleUsage.m
	samples/client/wordnik-apiobjc/client/SWGFacet.h
	samples/client/wordnik-apiobjc/client/SWGFacet.m
	samples/client/wordnik-apiobjc/client/SWGFacetValue.h
	samples/client/wordnik-apiobjc/client/SWGFacetValue.m
	samples/client/wordnik-apiobjc/client/SWGFile.h
	samples/client/wordnik-apiobjc/client/SWGFile.m
	samples/client/wordnik-apiobjc/client/SWGFrequency.h
	samples/client/wordnik-apiobjc/client/SWGFrequency.m
	samples/client/wordnik-apiobjc/client/SWGFrequencySummary.h
	samples/client/wordnik-apiobjc/client/SWGFrequencySummary.m
	samples/client/wordnik-apiobjc/client/SWGLabel.h
	samples/client/wordnik-apiobjc/client/SWGLabel.m
	samples/client/wordnik-apiobjc/client/SWGNote.h
	samples/client/wordnik-apiobjc/client/SWGObject.h
	samples/client/wordnik-apiobjc/client/SWGObject.m
	samples/client/wordnik-apiobjc/client/SWGRelated.h
	samples/client/wordnik-apiobjc/client/SWGScoredWord.h
	samples/client/wordnik-apiobjc/client/SWGSentence.h
	samples/client/wordnik-apiobjc/client/SWGSentence.m
	samples/client/wordnik-apiobjc/client/SWGSimpleDefinition.h
	samples/client/wordnik-apiobjc/client/SWGSimpleExample.h
	samples/client/wordnik-apiobjc/client/SWGStringValue.h
	samples/client/wordnik-apiobjc/client/SWGStringValue.m
	samples/client/wordnik-apiobjc/client/SWGSyllable.h
	samples/client/wordnik-apiobjc/client/SWGTextPron.h
	samples/client/wordnik-apiobjc/client/SWGUser.h
	samples/client/wordnik-apiobjc/client/SWGWordApi.h
	samples/client/wordnik-apiobjc/client/SWGWordList.h
	samples/client/wordnik-apiobjc/client/SWGWordList.m
	samples/client/wordnik-apiobjc/client/SWGWordListApi.h
	samples/client/wordnik-apiobjc/client/SWGWordListApi.m
	samples/client/wordnik-apiobjc/client/SWGWordListWord.h
	samples/client/wordnik-apiobjc/client/SWGWordListsApi.h
	samples/client/wordnik-apiobjc/client/SWGWordListsApi.m
	samples/client/wordnik-apiobjc/client/SWGWordObject.h
	samples/client/wordnik-apiobjc/client/SWGWordOfTheDay.h
	samples/client/wordnik-apiobjc/client/SWGWordOfTheDay.m
	samples/client/wordnik-apiobjc/client/SWGWordSearchResult.h
	samples/client/wordnik-apiobjc/client/SWGWordSearchResults.h
	samples/client/wordnik-apiobjc/client/SWGWordSearchResults.m
	samples/client/wordnik-apiobjc/client/SWGWordsApi.h
	samples/client/wordnik-apiobjc/client/SWGWordsApi.m
	samples/client/wordnik-api-objc/Podfile
	samples/client/wordnik-api-objc/client/SWGAccountApi.h
	samples/client/wordnik-api-objc/client/SWGAccountApi.m
	samples/client/wordnik-api-objc/client/SWGApiClient.h
	samples/client/wordnik-api-objc/client/SWGApiClient.m
	samples/client/wordnik-api-objc/client/SWGApiTokenStatus.h
	samples/client/wordnik-api-objc/client/SWGApiTokenStatus.m
	samples/client/wordnik-api-objc/client/SWGAudioFile.h
	samples/client/wordnik-api-objc/client/SWGAudioFile.m
	samples/client/wordnik-api-objc/client/SWGAuthenticationToken.h
	samples/client/wordnik-api-objc/client/SWGAuthenticationToken.m
	samples/client/wordnik-api-objc/client/SWGBigram.h
	samples/client/wordnik-api-objc/client/SWGBigram.m
	samples/client/wordnik-api-objc/client/SWGCitation.h
	samples/client/wordnik-api-objc/client/SWGCitation.m
	samples/client/wordnik-api-objc/client/SWGContentProvider.h
	samples/client/wordnik-api-objc/client/SWGContentProvider.m
	samples/client/wordnik-api-objc/client/SWGDate.h
	samples/client/wordnik-api-objc/client/SWGDate.m
	samples/client/wordnik-api-objc/client/SWGDefinition.h
	samples/client/wordnik-api-objc/client/SWGDefinition.m
	samples/client/wordnik-api-objc/client/SWGDefinitionSearchResults.h
	samples/client/wordnik-api-objc/client/SWGDefinitionSearchResults.m
	samples/client/wordnik-api-objc/client/SWGExample.h
	samples/client/wordnik-api-objc/client/SWGExample.m
	samples/client/wordnik-api-objc/client/SWGExampleSearchResults.h
	samples/client/wordnik-api-objc/client/SWGExampleSearchResults.m
	samples/client/wordnik-api-objc/client/SWGExampleUsage.h
	samples/client/wordnik-api-objc/client/SWGExampleUsage.m
	samples/client/wordnik-api-objc/client/SWGFacet.h
	samples/client/wordnik-api-objc/client/SWGFacet.m
	samples/client/wordnik-api-objc/client/SWGFacetValue.h
	samples/client/wordnik-api-objc/client/SWGFacetValue.m
	samples/client/wordnik-api-objc/client/SWGFile.h
	samples/client/wordnik-api-objc/client/SWGFile.m
	samples/client/wordnik-api-objc/client/SWGFrequency.h
	samples/client/wordnik-api-objc/client/SWGFrequency.m
	samples/client/wordnik-api-objc/client/SWGFrequencySummary.h
	samples/client/wordnik-api-objc/client/SWGFrequencySummary.m
	samples/client/wordnik-api-objc/client/SWGLabel.h
	samples/client/wordnik-api-objc/client/SWGLabel.m
	samples/client/wordnik-api-objc/client/SWGNote.h
	samples/client/wordnik-api-objc/client/SWGNote.m
	samples/client/wordnik-api-objc/client/SWGObject.h
	samples/client/wordnik-api-objc/client/SWGObject.m
	samples/client/wordnik-api-objc/client/SWGRelated.h
	samples/client/wordnik-api-objc/client/SWGRelated.m
	samples/client/wordnik-api-objc/client/SWGScoredWord.h
	samples/client/wordnik-api-objc/client/SWGScoredWord.m
	samples/client/wordnik-api-objc/client/SWGScrabbleScoreResult.h
	samples/client/wordnik-api-objc/client/SWGScrabbleScoreResult.m
	samples/client/wordnik-api-objc/client/SWGSentence.h
	samples/client/wordnik-api-objc/client/SWGSentence.m
	samples/client/wordnik-api-objc/client/SWGSimpleDefinition.h
	samples/client/wordnik-api-objc/client/SWGSimpleDefinition.m
	samples/client/wordnik-api-objc/client/SWGSimpleExample.h
	samples/client/wordnik-api-objc/client/SWGSimpleExample.m
	samples/client/wordnik-api-objc/client/SWGStringValue.h
	samples/client/wordnik-api-objc/client/SWGStringValue.m
	samples/client/wordnik-api-objc/client/SWGSyllable.h
	samples/client/wordnik-api-objc/client/SWGSyllable.m
	samples/client/wordnik-api-objc/client/SWGTextPron.h
	samples/client/wordnik-api-objc/client/SWGTextPron.m
	samples/client/wordnik-api-objc/client/SWGUser.h
	samples/client/wordnik-api-objc/client/SWGUser.m
	samples/client/wordnik-api-objc/client/SWGWordApi.h
	samples/client/wordnik-api-objc/client/SWGWordApi.m
	samples/client/wordnik-api-objc/client/SWGWordList.h
	samples/client/wordnik-api-objc/client/SWGWordList.m
	samples/client/wordnik-api-objc/client/SWGWordListApi.h
	samples/client/wordnik-api-objc/client/SWGWordListApi.m
	samples/client/wordnik-api-objc/client/SWGWordListWord.h
	samples/client/wordnik-api-objc/client/SWGWordListWord.m
	samples/client/wordnik-api-objc/client/SWGWordListsApi.h
	samples/client/wordnik-api-objc/client/SWGWordListsApi.m
	samples/client/wordnik-api-objc/client/SWGWordObject.h
	samples/client/wordnik-api-objc/client/SWGWordObject.m
	samples/client/wordnik-api-objc/client/SWGWordOfTheDay.h
	samples/client/wordnik-api-objc/client/SWGWordOfTheDay.m
	samples/client/wordnik-api-objc/client/SWGWordSearchResult.h
	samples/client/wordnik-api-objc/client/SWGWordSearchResult.m
	samples/client/wordnik-api-objc/client/SWGWordSearchResults.h
	samples/client/wordnik-api-objc/client/SWGWordSearchResults.m
	samples/client/wordnik-api-objc/client/SWGWordsApi.h
	samples/client/wordnik-api-objc/client/SWGWordsApi.m
	samples/client/wordnik-api-php/wordnik/AccountApi.php
	samples/client/wordnik-api/scala/src/test/scala/AccountApiTest.scala
	samples/client/wordnik-api/scala/src/test/scala/WordApiTest.scala
	samples/client/wordnik-api/scala/src/test/scala/WordListApiTest.scala
	samples/client/wordnik-api/scala/src/test/scala/WordsApiTest.scala
	samples/client/wordnik/objc/client/SWGAccountApi.h
	samples/client/wordnik/objc/client/SWGAccountApi.m
	samples/client/wordnik/objc/client/SWGApiTokenStatus.h
	samples/client/wordnik/objc/client/SWGAudioFile.h
	samples/client/wordnik/objc/client/SWGAuthenticationToken.h
	samples/client/wordnik/objc/client/SWGBigram.h
	samples/client/wordnik/objc/client/SWGCitation.h
	samples/client/wordnik/objc/client/SWGCitation.m
	samples/client/wordnik/objc/client/SWGContentProvider.h
	samples/client/wordnik/objc/client/SWGContentProvider.m
	samples/client/wordnik/objc/client/SWGDefinition.h
	samples/client/wordnik/objc/client/SWGDefinition.m
	samples/client/wordnik/objc/client/SWGDefinitionSearchResults.h
	samples/client/wordnik/objc/client/SWGDefinitionSearchResults.m
	samples/client/wordnik/objc/client/SWGExample.h
	samples/client/wordnik/objc/client/SWGExample.m
	samples/client/wordnik/objc/client/SWGExampleSearchResults.h
	samples/client/wordnik/objc/client/SWGExampleSearchResults.m
	samples/client/wordnik/objc/client/SWGExampleUsage.h
	samples/client/wordnik/objc/client/SWGExampleUsage.m
	samples/client/wordnik/objc/client/SWGFacet.h
	samples/client/wordnik/objc/client/SWGFacet.m
	samples/client/wordnik/objc/client/SWGFacetValue.h
	samples/client/wordnik/objc/client/SWGFacetValue.m
	samples/client/wordnik/objc/client/SWGFile.h
	samples/client/wordnik/objc/client/SWGFrequency.h
	samples/client/wordnik/objc/client/SWGFrequency.m
	samples/client/wordnik/objc/client/SWGFrequencySummary.h
	samples/client/wordnik/objc/client/SWGFrequencySummary.m
	samples/client/wordnik/objc/client/SWGLabel.h
	samples/client/wordnik/objc/client/SWGLabel.m
	samples/client/wordnik/objc/client/SWGNote.h
	samples/client/wordnik/objc/client/SWGRelated.h
	samples/client/wordnik/objc/client/SWGScoredWord.h
	samples/client/wordnik/objc/client/SWGSentence.h
	samples/client/wordnik/objc/client/SWGSentence.m
	samples/client/wordnik/objc/client/SWGSimpleDefinition.h
	samples/client/wordnik/objc/client/SWGSimpleExample.h
	samples/client/wordnik/objc/client/SWGStringValue.h
	samples/client/wordnik/objc/client/SWGStringValue.m
	samples/client/wordnik/objc/client/SWGSyllable.h
	samples/client/wordnik/objc/client/SWGTextPron.h
	samples/client/wordnik/objc/client/SWGUser.h
	samples/client/wordnik/objc/client/SWGWordApi.h
	samples/client/wordnik/objc/client/SWGWordList.h
	samples/client/wordnik/objc/client/SWGWordList.m
	samples/client/wordnik/objc/client/SWGWordListApi.h
	samples/client/wordnik/objc/client/SWGWordListApi.m
	samples/client/wordnik/objc/client/SWGWordListWord.h
	samples/client/wordnik/objc/client/SWGWordListsApi.h
	samples/client/wordnik/objc/client/SWGWordListsApi.m
	samples/client/wordnik/objc/client/SWGWordObject.h
	samples/client/wordnik/objc/client/SWGWordOfTheDay.h
	samples/client/wordnik/objc/client/SWGWordOfTheDay.m
	samples/client/wordnik/objc/client/SWGWordSearchResult.h
	samples/client/wordnik/objc/client/SWGWordSearchResults.h
	samples/client/wordnik/objc/client/SWGWordSearchResults.m
	samples/client/wordnik/objc/client/SWGWordsApi.h
	samples/client/wordnik/objc/client/SWGWordsApi.m
	samples/server-generator/node/README.md
	samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Pet.java
	samples/server/petstore/nodejs/app/apis/PetApi.js
	samples/server/petstore/nodejs/app/apis/StoreApi.js
	samples/server/petstore/nodejs/app/apis/UserApi.js
	sbt
	src/main/resources/objc/api-body.mustache
	src/main/resources/php/Swagger.mustache
	src/main/resources/python/swagger.mustache
	src/main/scala/com/wordnik/swagger/codegen/BasicAndroidJavaClient.scala
	src/main/scala/com/wordnik/swagger/codegen/BasicGenerator.scala
	src/main/scala/com/wordnik/swagger/codegen/BasicPythonGenerator.scala
	src/main/scala/com/wordnik/swagger/codegen/BasicScalaGenerator.scala
	src/main/scala/com/wordnik/swagger/codegen/Codegen.scala
	src/main/scala/com/wordnik/swagger/codegen/ScalaAsyncClientGenerator.scala
	src/main/scala/com/wordnik/swagger/codegen/model/AuthorizationModels.scala
	src/main/scala/com/wordnik/swagger/codegen/spec/SwaggerSpecValidator.scala
	src/main/scala/com/wordnik/swagger/codegen/util/RemoteUrl.scala
	src/test/scala/CodegenTest.scala
2015-02-16 21:01:17 -08:00
Tony Tam
72feda8346 updated readme 2015-02-16 20:53:26 -08:00
Tony Tam
2e88dea3ac updated versions 2015-02-16 20:44:22 -08:00
Tony Tam
678bbd6676 made dynamic swagger config example 2015-02-16 20:17:00 -08:00
Tony Tam
5853326f6a removed file 2015-02-16 20:15:24 -08:00
Tony Tam
8befb95986 added type tag 2015-02-16 18:19:06 -08:00
Tony Tam
026c93a104 fixed models 2015-02-16 18:03:15 -08:00
Tony Tam
15fde46ca5 removed debug 2015-02-16 17:56:28 -08:00
Tony Tam
f3455397ec rebuilt clients 2015-02-16 17:56:13 -08:00
Tony Tam
4f0823bffa rebuilt client 2015-02-16 17:55:59 -08:00
Tony Tam
31eb392d40 rebuild client 2015-02-16 17:55:15 -08:00
Tony Tam
fde5014bf9 fix for #224, added safe php comparison 2015-02-16 17:49:22 -08:00
Tony Tam
39b2bf4204 fixed test errors from updating sample json 2015-02-16 17:38:04 -08:00
Tony Tam
a1cf365288 rebuilt 2015-02-16 17:37:45 -08:00
Tony Tam
166a18bfc8 pulled from live server 2015-02-16 17:37:25 -08:00
Tony Tam
a0ea195ffc rebuilt client 2015-02-16 17:37:05 -08:00
Tony Tam
0563be891c made scripts call local file to avoid transient server issues 2015-02-16 17:36:48 -08:00
Tony Tam
5790c7d289 fix for #191, not detecting correct file name 2015-02-16 17:18:19 -08:00
Tony Tam
c7c3c969db moved output 2015-02-15 22:22:42 -08:00
Tony Tam
04074bd853 updated client 2015-02-15 22:20:56 -08:00
Tony Tam
76a367072c updated client 2015-02-15 22:20:26 -08:00
Tony Tam
e4cf9c5d55 updated scripts 2015-02-15 22:20:08 -08:00
Tony Tam
a4bde0368e updated for separation with enums 2015-02-15 22:19:43 -08:00
Tony Tam
da8176e170 updated templates 2015-02-15 22:19:26 -08:00
Tony Tam
bd276f5680 rebuilt client 2015-02-15 22:18:13 -08:00
Tony Tam
f10da06188 updated client 2015-02-15 22:17:32 -08:00
Tony Tam
13ef879703 rebuilt client 2015-02-15 22:14:38 -08:00
Tony Tam
8cbba12282 rebuilt client 2015-02-15 22:14:25 -08:00
Tony Tam
d98e894b41 rebuilt client 2015-02-15 22:12:48 -08:00
Tony Tam
73a6c0c42d rebuilt client 2015-02-15 22:09:07 -08:00
Tony Tam
7363365447 rebuilt client 2015-02-15 22:06:22 -08:00
Tony Tam
3b501f4134 added better enum support 2015-02-15 22:05:45 -08:00
Tony Tam
ffe5353987 rebuilt client 2015-02-15 22:04:50 -08:00
Tony Tam
1556bf16a9 rebuilt client 2015-02-15 21:26:35 -08:00
Tony Tam
88351ed844 rebuilt client 2015-02-15 21:25:41 -08:00
Tony Tam
9707f0a1ab updated client 2015-02-15 21:18:54 -08:00
Tony Tam
4daac48c6b added readme, rebuilt client 2015-02-15 19:50:41 -08:00
Tony Tam
e943f5c864 added readme, rebuilt client 2015-02-15 19:50:23 -08:00
Tony Tam
719820c089 added help response if args not set 2015-02-15 19:11:15 -08:00
Tony Tam
fe06652931 removed scala compile step #205 2015-02-15 19:04:53 -08:00
Tony Tam
098f7930eb added script 2015-02-15 18:07:05 -08:00
Tony Tam
f942e82691 updated templates 2015-02-15 18:06:50 -08:00
Tony Tam
db5259b913 updated script, addressed #189 with type mapping 2015-02-15 18:06:40 -08:00
Tony Tam
dfc7750dda rebuilt client 2015-02-15 18:05:56 -08:00
Tony Tam
dd971f19e7 added support for headers when generating per #102 2015-02-15 17:15:40 -08:00
Tony Tam
785cc4e29a fixed file suffix 2015-02-14 17:49:33 -08:00
Tony Tam
0c3e82e375 updated templates 2015-02-14 17:49:19 -08:00
Tony Tam
a6744507ef updated version 2015-02-14 17:49:10 -08:00
Tony Tam
9614dd8b95 added sample 2015-02-14 17:48:55 -08:00
Tony Tam
5208b36939 updated client 2015-02-14 17:36:52 -08:00
Tony Tam
779bdb23eb rebuilt client 2015-02-14 17:36:39 -08:00
Tony Tam
4bd1b99213 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-02-14 17:34:27 -08:00
Tony Tam
4841485456 Merge pull request #427 from lucamilanesio/scala-mustache-backward-compatibility
Scala api.mustache: make new constructor backward compatible
2015-02-14 17:34:23 -08:00
Tony Tam
d5ddf0c404 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-02-14 17:33:46 -08:00
Tony Tam
7d4cc6bdde Merge pull request #425 from lucamilanesio/develop_2.0
SPNEGO auth fix: Authentication scheme should be set as String
2015-02-14 17:33:30 -08:00
Tony Tam
a0d74531f7 added petstore script 2015-02-14 17:09:07 -08:00
Tony Tam
feb6119572 added supporting data post processing 2015-02-14 17:08:51 -08:00
Tony Tam
dbc4ab51b1 removed deprecated call 2015-02-14 17:08:37 -08:00
Tony Tam
8daebf78f4 updated sample 2015-02-14 17:06:32 -08:00
Tony Tam
391806570c updated script 2015-02-14 16:30:38 -08:00
Tony Tam
ed1e082896 updated versions 2015-02-13 22:16:54 -08:00
Tony Tam
0640c63573 updated readme 2015-02-12 22:32:00 -08:00
Tony Tam
9985d9e2d9 removed template path 2015-02-12 22:26:42 -08:00
Tony Tam
cd3dfe164b rebuilt 2015-02-12 22:25:29 -08:00
Tony Tam
85b396ce88 rebuilt sample 2015-02-12 22:24:17 -08:00
Tony Tam
241c69fef7 updated templates 2015-02-12 22:24:04 -08:00
Tony Tam
20deb15c8c updated client 2015-02-12 21:54:34 -08:00
Tony Tam
2bc5e71f91 updated year in comments 2015-02-12 21:53:37 -08:00
Tony Tam
dd9da67f51 made match case insensitive 2015-02-12 21:51:44 -08:00
Tony Tam
10e9e8a51d rebuilt 2015-02-12 21:40:42 -08:00
Tony Tam
c3978d2ea3 updated dependencies for compat 2015-02-12 21:38:52 -08:00
Tony Tam
54db9f8f24 updated scripts 2015-02-12 21:38:31 -08:00
Tony Tam
8785759fdf Merge pull request #431 from devnulled/develop_2.0
Fixed The html.sh Sample Generation Script
2015-02-12 16:26:30 -08:00
Brandon Harper
59b0a062a0 Fixed/updated the swagger.json URL in the html.sh script so that it would generate a sample again. 2015-02-12 14:46:02 -07:00
Tony Tam
95155f07d8 added snapshots back 2015-02-11 08:27:52 -08:00
Luca Milanesio
14795df85d Scala api.mustache: make new constructor backward compatible
When default values have been provided with the api.mustache
constructor, backward compatibility was broken because of the public
instance variables becoming immutable vals whilst they were vars before.

We can now use the constructor arguments as default values for the internal
vars and establish backward compatibility with existing code.
2015-02-11 11:00:41 +00:00
Tony Tam
d821a897b3 Merge pull request #426 from lucamilanesio/scala-mustache-easy-override
Scala api.mustache: allow easy basePath and ApiInvoker override
2015-02-10 08:22:39 -08:00
Luca Milanesio
fd560f4dc1 Scala api.mustache: allow easy basePath and ApiInvoker override
Gets rid of the smelly vars inside Scala api.mustache allowing the
override of default basePath and ApiInvoker on the constructor.

Previously the code for overriding was:

  val myApi = new MyApi()
  myApi.basePath = "http://myapi.endpoint.com"
  myApi.apiInvoker = new ApiInvoker(authScheme = "SPNEGO")

after the change everything can be simply declared in the constructor:

  val myApi = new MyApi("http://myapi.endpoint.com",
                         new ApiInvoker(authScheme = "SPNEGO"))
2015-02-10 14:07:13 +00:00
Luca Milanesio
6ecc569abd SPNEGO auth fix: Authentication scheme should be set as String
Default authentication scheme is a String and must be later
on decoded as Realm enum
2015-02-10 12:17:27 +00:00
Tony Tam
ece072aee3 Merge pull request #418 from lucamilanesio/scala-async-http-support
Support for HTTP Async client transport for Jersey on Scala (legacy master)
2015-02-09 13:43:07 -08:00
Tony Tam
759c0aea80 Merge pull request #421 from lucamilanesio/scala-spnego-preemptive-auth-2.0
Support Secure SPNEGO kerberos negotiation for Scala
2015-02-09 12:33:59 -08:00
Luca Milanesio
8e327aa24b Support for Secure SPNEGO kerberos negotiation
Ability to integrate with a SPNEGO-protected REST API
with KerberosV5 ticket preemptive authentication.
2015-02-09 20:14:13 +00:00
Luca Milanesio
592d59ceb2 Support for HTTP Async client transport for Jersey on Scala
When generating Scala client, the ApiInvoker is a class with
overridable options, avoiding the need of public vars to be
manually modified.

Additionally it is possible to plug the AsyncHttp protocol
for Jersey in order to achieve Netty support and maximum scalability.

NOTE: Support for Scala 2.10.0-3 removed as largely obsolete
2015-02-09 19:59:26 +00:00
Luca Milanesio
2386e394ae Support for HTTP Async client transport for Jersey on Scala
When generating Scala client, the ApiInvoker is a class with
overridable options, avoiding the need of public vars to be
manually modified.

Additionally it is possible to plug the AsyncHttp protocol
for Jersey in order to achieve Netty support and maximum scalability.

NOTE: Support for Scala 2.10.0-3 removed as largely obsolete
2015-02-09 19:36:28 +00:00
Tony Tam
781c9f7d83 Merge pull request #416 from FindTheBest/develop_2.0
PHP/Python Enhancements
2015-02-08 22:15:34 -08:00
Tony Tam
70803a1d09 Update README.md 2015-02-07 15:32:06 -08:00
Tony Tam
ffe5fc7fd2 changed signature for usage in generator 2015-02-07 14:59:35 -08:00
Tony Tam
cbc9fdbe34 updated annotations 2015-02-07 11:08:21 -08:00
russellb337
bd91922072 Add API Version to Codeine Additional Properties
Also updated htmlDocs template so html documentation shows API version.
2015-02-06 16:26:33 -08:00
Tony Tam
416c087be0 removed old files 2015-02-06 11:36:58 -08:00
James Ebentier
09bfecf76e Python: adding in support for formParams as well as multipart-form requests 2015-02-06 11:32:15 -08:00
James Ebentier
8b4180ca4a PHP: moving over the addition of a setTimeout function for the APIClient 2015-02-06 11:16:16 -08:00
James Ebentier
73a702f91e PHP: adding the ability to use multipart-form submissions as well as adding formParams to the api 2015-02-06 11:15:22 -08:00
Tony Tam
f55d9eaa68 Merge pull request #412 from FindTheBest/master
Python/PHP Multipart-Form request support
2015-02-06 10:47:10 -08:00
Tony Tam
7315b0ce2c changed scope per #414 2015-02-06 05:55:30 -08:00
Tony Tam
de4534475c removed old samples 2015-02-06 05:52:57 -08:00
Tony Tam
0bf660ebe8 added podfile 2015-02-06 05:52:15 -08:00
Tony Tam
8b32db73c2 formatting 2015-02-06 05:52:05 -08:00
Tony Tam
bffd43c8fc fixed container type 2015-02-06 05:51:56 -08:00
Tony Tam
6f7a1bb7e3 added reserved words 2015-02-06 05:51:23 -08:00
Tony Tam
eb1dce3d11 fixed paths 2015-02-06 05:50:43 -08:00
Tony Tam
a841f94273 updated response types 2015-02-06 05:50:12 -08:00
Tony Tam
a7f12c04e6 updated samples 2015-02-06 05:49:38 -08:00
Tony Tam
422cd88b51 rebuilt samples 2015-02-06 05:49:08 -08:00
Tony Tam
eb9e95952d updated templates 2015-02-06 05:48:47 -08:00
Tony Tam
1e717addf4 removed old samples 2015-02-06 05:48:27 -08:00
Tony Tam
3885991439 rebuilt samples 2015-02-05 21:45:48 -08:00
Tony Tam
3815dfa6a2 updated packages 2015-02-05 21:06:35 -08:00
Tony Tam
5f65c5aa49 added client 2015-02-05 21:06:22 -08:00
Tony Tam
e86837dd9a added samples 2015-02-05 21:02:12 -08:00
Tony Tam
585311c06a added files 2015-02-05 21:00:24 -08:00
Tony Tam
69dceb7f69 updated samples 2015-02-05 20:58:32 -08:00
Tony Tam
f1ac82f8a0 updated dependencies 2015-02-05 20:58:21 -08:00
Tony Tam
2c55649797 renamed package 2015-02-05 20:57:21 -08:00
Tony Tam
5c519f6429 revert last commit 2015-02-05 16:17:53 -08:00
Tony Tam
20e600c80e updated multi-module pom 2015-02-05 16:16:19 -08:00
Tony Tam
2ed8e10fe4 added null check for simple definitions with no models 2015-02-05 16:16:04 -08:00
Tony Tam
caaa753f58 Merge pull request #413 from swagger-api/assembly
Created assembly and submodules
2015-02-05 11:51:00 -08:00
Tony Tam
f7c6810757 updated samples 2015-02-05 11:35:13 -08:00
Tony Tam
2f16ee3b29 renamed package 2015-02-05 11:34:23 -08:00
Tony Tam
d97c7c7668 updated bin scripts 2015-02-05 10:22:28 -08:00
Tony Tam
11df3530f3 added wordnik sample 2015-02-05 10:22:19 -08:00
Tony Tam
6bb2e4ccb4 moved to modules per #411 2015-02-05 07:17:38 -08:00
Tony Tam
450894c52e moved to modules 2015-02-05 07:16:56 -08:00
James Ebentier
0f041dae90 MultipartForm: adding support for php 2015-02-04 12:48:00 -08:00
James Ebentier
6c97a9c6c7 MultipartForm: some more fixing of formating 2015-02-04 10:54:55 -08:00
James Ebentier
257d67346c MultipartForm: fixing some spacing issues 2015-02-04 10:41:25 -08:00
James Ebentier
e955c9dcfd MultipartForm: getting the file uploading working 2015-02-04 09:56:10 -08:00
Tony Tam
8414046fc5 added test for form params 2015-02-04 07:21:26 -08:00
Tony Tam
fd270d7733 added copy function 2015-02-04 07:21:17 -08:00
Tony Tam
67a3fffad7 added copy function 2015-02-04 07:21:08 -08:00
Tony Tam
7d0e003bf2 added form params template 2015-02-04 06:51:16 -08:00
Tony Tam
bad6798433 added consumes, produces 2015-02-03 23:54:37 -08:00
Tony Tam
949b321e13 updated path 2015-02-03 21:52:03 -08:00
Tony Tam
c84fd54215 updated to m1 version 2015-02-03 21:51:38 -08:00
Tony Tam
5acb01eb6b moved to 2_0 folder 2015-02-03 21:51:20 -08:00
Tony Tam
568504ffb4 move to 2_0 folder 2015-02-03 21:51:05 -08:00
Tony Tam
eec525a40f shortened line breaks 2015-02-03 21:50:28 -08:00
Tony Tam
f8624dbcaa update to m1 release 2015-02-03 21:50:02 -08:00
Tony Tam
5fdb609767 changed package to io.swagger 2015-02-03 21:49:45 -08:00
Tony Tam
4c53d7b8c4 added formParam values 2015-02-03 21:49:21 -08:00
Tony Tam
3b96894e75 added file & forms 2015-02-03 21:49:05 -08:00
James Ebentier
63bb20238b MultipartForm: fixing syntax error 2015-02-03 19:01:31 -08:00
James Ebentier
55575541d8 MultipartForm: better formatting 2015-02-03 18:28:56 -08:00
James Ebentier
33e6105822 MultipartForm: adding in basic support for multipart form submissions on python bindings 2015-02-03 18:03:20 -08:00
Tony Tam
87be442ad9 Merge pull request #409 from ethanjcohen/master
Fix "properties" name in node server example template
2015-02-02 22:42:56 -08:00
Tony Tam
33834d6cce Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-02-02 06:28:24 -08:00
Tony Tam
212b7cee72 added void to default includes 2015-02-02 06:28:17 -08:00
Tony Tam
d9ca26c40d updated to m1 2015-02-02 06:27:58 -08:00
Ethan Cohen
65b3b594e3 Renamed the "params" operation property to "parameters" to conform to the swagger spec 2015-02-01 16:02:27 -06:00
Ethan Cohen
94ceb504b8 Changed the "params" operation property to "parameters" to conform to the swagger spec 2015-02-01 15:54:47 -06:00
Tony Tam
fcb21da7f9 Merge pull request #392 from ikuo/develop_2.0-support-upper-case-property-name
Support upper case-proprty names
2015-01-30 12:26:56 -08:00
Tony Tam
124e17fb8a Merge pull request #401 from fleque/fleque-fix-response-selection
Fix for the selection of the methodResponse during code-generation
2015-01-28 22:07:06 -08:00
Tony Tam
f914f26f3b Merge pull request #400 from FindTheBest/master
Fixing curl $postData for php bindings
2015-01-28 22:06:23 -08:00
Tony Tam
1bc5fcc29e Merge pull request #397 from fleque/fleque-python-codegen
[WIP] Support Python code generation
2015-01-28 21:53:14 -08:00
James Ebentier
4a6e719d6a APIClient: making the cURL timeout able to be variably set for better dynamic api calls 2015-01-28 16:04:11 -08:00
Fleque
35dc8d4e5d Fix for the selection of the methodResponse from an operation during code generation. Now all the smallest 2xx code is used 2015-01-27 23:01:21 +01:00
James Ebentier
61ea9564f8 building a fix for postData that will pass TravisCI build 2015-01-27 13:48:59 -08:00
James Ebentier
bfc14938d0 Fixing curl $postData for php bindings 2015-01-27 13:16:20 -08:00
Tony Tam
c98a78062f Merge pull request #398 from FindTheBest/master
Fixing issue with deserialization in PHP
2015-01-27 12:50:24 -08:00
James Ebentier
fd128cbab0 Update Swagger.mustache 2015-01-27 12:28:28 -08:00
James Ebentier
59568915de Fixing minor typo 2015-01-27 12:08:41 -08:00
James Ebentier
bff2515bf2 Fixing issue with deserialization in PHP
No longer will deserialize throw errors when converting a json response to a string
2015-01-27 11:48:20 -08:00
Tony Tam
d196c6656e added test for #393 2015-01-25 20:21:40 -08:00
Tony Tam
a2b01e9599 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2015-01-25 20:20:36 -08:00
Tony Tam
34a61e1256 added scala client support for #393 2015-01-25 20:20:27 -08:00
Dan Peschman
ec995838fb python3: support PATCH verb for partial updates - http://tools.ietf.org/html/rfc5789 2015-01-24 21:58:33 +00:00
Ikuo Matsumura
b49572005b Fix typo name{ -> s} 2015-01-24 16:32:38 +09:00
Ikuo Matsumura
ea11b4fc35 Added spec on upper-case property name 2015-01-24 16:17:40 +09:00
Ikuo Matsumura
556485538f Added @JsonProperty to Java/model.mustache 2015-01-24 16:17:18 +09:00
Tony Tam
53e8683a5d Merge pull request #388 from fleque/template-resolving-fix
Fix for template resolving from classpath on windows
2015-01-23 16:55:09 -08:00
Fleque
6491223ed9 First attempt to port pythong code generation 2015-01-22 23:01:44 +01:00
Fleque
29a7375082 Applied import style of swagger-codegen project 2015-01-22 11:50:05 +01:00
Fleque
8f9947a20a Fix for the template resovling from classpath on Windows 2015-01-22 11:38:42 +01:00
Tony Tam
dcaf639bec Merge branch 'STRML-fixPHPFormParams' 2015-01-21 23:19:19 -08:00
Tony Tam
2f6bf95fa2 merged 2015-01-21 23:19:13 -08:00
Tony Tam
154c28b062 Merge pull request #385 from STRML/fixPHPComments
Rework generated PHP function comments.
2015-01-21 22:10:20 -08:00
Samuel Reed
8106de95dc Rework PHP function comments to match PHPDoc style.
Also eliminated bad newline.
2015-01-21 10:58:57 +01:00
Samuel Reed
7c342a060a Add missing formParams to PHP api.mustache. Fixes #383.
Also fixed mixed tabs and spaces in template.
2015-01-21 10:01:41 +01:00
Tony Tam
a15eb6f905 updated java version 2015-01-20 11:23:31 -08:00
Dan Peschman
4198779b5b python3: support datetime produced by datetime.isoformat like '2015-01-17T00:15:29.515' 2015-01-17 00:41:37 +00:00
Dan Peschman
711d2c8cf4 revert previous: no special handling for '' in python3 parseDatetime 2015-01-16 23:44:02 +00:00
Dan Peschman
42ad403e5e python3 parseDatetime: return None if passed '' 2015-01-16 23:09:54 +00:00
Dan Peschman
527fca5a8b python3 parseDatetime: return None if passed None 2015-01-15 23:19:01 +00:00
Dan Peschman
60bd56b91c python3: support more iso8601 datetime formats - http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#date.and.time.format.examples 2015-01-15 22:42:59 +00:00
Tony Tam
89c776a3b9 Update README.md 2015-01-14 11:16:06 -08:00
Tony Tam
6a5b4e2fb4 Merge pull request #364 from Helmsdown/jaxrs-path-annotation-fix
JAXRS Codegen should omit @PATH variable when it is not necessary
2015-01-11 22:55:36 -08:00
Tony Tam
fd39402116 Merge pull request #371 from cantecim/develop_2.0
Fixed apiFileFolder and modelFileFolder function results for android-java Fixes #369
2015-01-10 12:37:55 -08:00
Can Tecim
f6055dde30 Fixed apiFileFolder and modelFileFolder function results for android-java Fixes #369 2015-01-10 22:31:38 +02:00
Tony Tam
3abc42eee9 Merge pull request #368 from amandaducrou/master
Adding first and hasRequiredParams parameters to Codegen
2015-01-09 10:26:50 -08:00
Amanda Ducrou
2d81c71b52 Adding first and hasRequiredParams parameters to Codegen 2015-01-09 10:59:21 +10:00
Tony Tam
52db5b0925 Update README.md 2015-01-07 10:40:16 -08:00
russellb337
9aa9f4e842 fix JaxRS code gen to only generated @PATH annotation on a given resource function when that function is a "sub resource" (e.g. @PATH("/{id}") or @PATH("/{id}/operation") 2015-01-02 13:52:36 -08:00
Tony Tam
21396d0797 added map support for #360 2014-12-25 08:17:41 -08:00
Tony Tam
93eca2a6b6 php fixes 2014-12-24 19:29:25 -08:00
Tony Tam
74b9257de4 variable type fixes 2014-12-24 15:00:10 -08:00
Tony Tam
a921278650 added php generator 2014-12-24 10:19:42 -08:00
Tony Tam
2d193a0e92 Merge pull request #218 from JDiPierro/output_resource_path_for_no_models_found
Output the resourcePath when no models are found rather than the basePath
2014-12-23 22:23:14 -08:00
Tony Tam
09e7bd9c43 Merge pull request #286 from jebentier/master
Java binding comment creation issue fixed
2014-12-23 22:17:35 -08:00
Tony Tam
0ece4a084f Merge pull request #303 from butlermh/master
Can't run ./bin/scala-petstore.sh as instructed at README
2014-12-23 22:16:35 -08:00
Tony Tam
0821d1859b Merge pull request #321 from Laurent-Sarrazin/patch-doc
Fix a typo
2014-12-23 22:14:39 -08:00
Tony Tam
25aef5fd6e Merge pull request #240 from GerardSoleCa/master
Edit line 76 to place pom.xml correctly and dependency-jar generation
2014-12-23 20:31:26 -08:00
Tony Tam
20c21cb2f7 added debug info per #330 2014-12-23 19:56:32 -08:00
webron
3a77287f8b Update README.md 2014-12-23 17:29:49 +02:00
webron
d2111a8e68 Merge pull request #352 from FMJaguar/patch-2
Update README.md
2014-12-23 17:28:59 +02:00
Tony Tam
8fa4b196b4 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2014-12-19 14:49:51 -08:00
Tony Tam
3bf45de1f7 added null check 2014-12-19 14:49:32 -08:00
Rich DeLauder
3c0d639d0e Update README.md 2014-12-19 13:10:02 -08:00
Tony Tam
ed1d0948a3 Merge pull request #351 from earldouglas/exec-maven-plugin
Add the Exec Maven Plugin
2014-12-18 11:01:52 -08:00
James Earl Douglas
83699e5324 Add the Exec Maven Plugin
This allows execution of the Codegen class via `mvn exec:java`,
with optional args passed via `-Dexec.args="..."`:

mvn exec:java -Dexec.args="-i .../swagger.json -l html -o samples/..."
2014-12-18 10:58:25 -08:00
Tony Tam
1f30c65464 Update README.md 2014-12-12 12:47:30 -08:00
Tony Tam
45d5e480c0 configured scala version #344 2014-12-11 09:42:39 -08:00
Tony Tam
5ecada11ef moved java-specific reserved words out of default 2014-12-08 13:13:29 -08:00
Tony Tam
4f6878a278 fallbacks for unmatched inner types 2014-12-08 11:49:47 -08:00
Tony Tam
50e0445ab4 Merge pull request #342 from martoe/codegenfactory
Introduced a factory for codegen data containers
2014-12-08 07:22:22 -08:00
Martin Ehrnhoefer
78b36e0ba9 Introduced a factory for codegen data containers
Moved parameter/response generation code to
dedicated methods so that subclasses may extend it
2014-12-08 11:21:17 +01:00
Martin Ehrnhoefer
7a5068d632 Introduced a factory for codegen data containers
Missing model elements added
2014-12-08 10:27:29 +01:00
Tony Tam
c010b4c9c6 Merge pull request #341 from martoe/responseheaders
Make response headers available to the code generator
2014-12-07 21:30:57 -08:00
Tony Tam
cc9029236b Merge pull request #340 from martoe/codegenfactory
Introduced a factory for codegen data containers
2014-12-07 21:29:18 -08:00
Martin Ehrnhoefer
3f0b71b3e0 Make response headers available to the code generator 2014-12-07 10:08:42 +01:00
Martin Ehrnhoefer
0eb467e46e Introduced a factory for codegen data containers
implementation completed
2014-12-07 09:52:52 +01:00
Tony Tam
f2c64a0fbb removed comments 2014-12-06 15:55:42 -08:00
Martin Ehrnhoefer
f4424a5eae Introduced a factory for codegen data containers
This enables users to extend the Codegen* classes
and add their own methods there (which then can
be accessed from the mustache templates)
2014-12-06 16:07:45 +01:00
webron
1b68671e98 Update README.md 2014-12-04 16:27:44 +02:00
Tony Tam
f3ac9a579f Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2014-12-03 00:55:55 -08:00
Tony Tam
6e858ee645 updated samples 2014-12-03 00:55:38 -08:00
Tony Tam
96ea15a4d0 updated readme 2014-12-03 00:55:25 -08:00
Tony Tam
586420b919 Merge pull request #335 from wing328/master
update deserialize to handle both array(primitive) and Array(model)
2014-12-02 22:07:24 -08:00
Tony Tam
c05e07c8aa Merge pull request #331 from yutenglei/develop_2.0
Assigned Accept and Content-Type request-header for python's api.mustach...
2014-12-02 21:44:51 -08:00
Tony Tam
43a5ece5b3 Merge pull request #312 from idosh/master
add support to multipart form data and urlencoded for android client
2014-12-02 20:40:02 -08:00
William Cheng
9f6d883e68 update deserialize to handle both array(primitive) and Array(model) 2014-11-29 18:23:44 +08:00
Tony Tam
23d2d09136 added help, dynamic loading 2014-11-26 16:37:44 -10:00
Tony Tam
f35c748fb2 added help, dynamic loading 2014-11-26 15:20:50 -10:00
Tony Tam
a24556f0be added static, updated reference to swagger parser 2014-11-26 14:06:00 -10:00
Tony Tam
a1d604feb3 updated to use swagger parser 2014-11-25 12:01:13 -10:00
webron
524497a606 Merge pull request #332 from mhurne/patch-1
Fix spelling errors and improve sentence in Compatibility section
2014-11-24 22:13:29 +02:00
Matt Hurne
665ba22c7a Fix spelling errors and improve sentence in Compatibility section 2014-11-24 15:11:38 -05:00
Yu Teng Lei
9085a0d148 Assigned Accept and Content-Type request-header for python's api.mustache
This was done in PHP but not in python
2014-11-23 16:39:35 -05:00
Tony Tam
74d4ff0fc9 added swagger output for conversion 2014-11-21 08:30:21 -10:00
Tony Tam
29d956d424 added static html generator 2014-11-21 08:14:33 -10:00
Tony Tam
06031a0a34 added 1.2 conversion 2014-11-21 08:14:14 -10:00
Tony Tam
9ffece910d added basePath 2014-11-19 13:36:59 -08:00
Tony Tam
d12a565032 added debug mode 2014-11-19 13:36:52 -08:00
Tony Tam
9d6e6b56c6 added tizen c++ support 2014-11-13 09:29:13 -08:00
Tony Tam
acc0bad668 changed permissions 2014-11-13 09:28:32 -08:00
Tony Tam
697457415d updated spec with auth 2014-11-10 21:18:19 -08:00
Tony Tam
bcfd2e8ab6 println 2014-11-10 21:17:29 -08:00
Tony Tam
5adb82f6f6 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0 2014-11-10 13:15:36 -08:00
Tony Tam
4415cfe30d added escape 2014-11-10 13:15:27 -08:00
Ido Shamun
0614d1b221 update pom.xml with dependencies
fix Codegen.scala to support file as a param type
2014-11-08 01:19:53 +02:00
Ido Shamun
fb3f331e3c Merge remote-tracking branch 'upstream/master'
merge fork with master
2014-11-07 18:27:58 +02:00
Tony Tam
4e9378965b Merge pull request #324 from FindTheBest/pull_request
Adding the casting of integer -> int for python generated code
2014-11-05 15:47:44 -08:00
James Ebentier
d1fe146522 Adding the casting of integer -> int for python generated code 2014-11-05 15:37:22 -08:00
Tony Tam
718e6ba7b4 Merge pull request #302 from martoe/externalDocs
"External Documentation Object" implemented (according to spec)
2014-11-04 20:25:41 -08:00
Tony Tam
b9758107c3 Merge pull request #322 from Laurent-Sarrazin/patch-php-server-generator
Add a basic PHP server-generator example
2014-10-31 09:32:08 -07:00
Laurent Sarrazin
06332e5dce Add a basic PHP server-generator example 2014-10-31 17:00:34 +01:00
Laurent Sarrazin
aa262f6021 Fix a typo 2014-10-30 14:30:55 +01:00
Martin Ehrnhoefer
436d2530e4 "External Documentation Object" implemented (according to spec)
Depends on https://github.com/wordnik/swagger-core/pull/716
2014-10-30 10:22:00 +01:00
Tony Tam
77053fa855 added test case, update for #316 2014-10-28 13:21:50 -07:00
Tony Tam
810c7f9ed2 added test case, update for #316 2014-10-28 13:21:32 -07:00
Tony Tam
59b477d2da added test case, update for src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java 2014-10-28 13:08:41 -07:00
Tony Tam
4c674ca94b rebuilt samples 2014-10-26 21:46:26 -07:00
Tony Tam
63c428d048 updated templates 2014-10-26 21:46:14 -07:00
Tony Tam
2454bfa225 updated templates per #316 2014-10-26 21:40:13 -07:00
Tony Tam
d6bdd09273 removed unimplemented scripts 2014-10-24 14:50:40 -07:00
Tony Tam
73425fe582 rebuilt client 2014-10-23 21:22:19 -07:00
Tony Tam
bc974e6514 added bodyParam 2014-10-23 21:21:58 -07:00
Tony Tam
237f00e2e3 updated references 2014-10-22 15:46:47 -07:00
Tony Tam
88692ec42d updated references 2014-10-22 15:45:21 -07:00
Tony Tam
ee833da0ca fixed notes 2014-10-22 14:06:59 -07:00
Tony Tam
36aad8bc0a updated examples 2014-10-22 13:54:28 -07:00
Ivan Porto Carrero
a656ea301e updates the codegen to also include the project name for sbt 2014-10-21 10:59:35 -07:00
Tony Tam
e2ae99acac fixed import types 2014-10-21 00:02:28 -07:00
Tony Tam
461cb51f6a fixed summary/description mapping 2014-10-20 17:34:48 -07:00
Tony Tam
681628dba2 added model pacakge 2014-10-20 17:11:28 -07:00
Tony Tam
7167bf28c7 changed to Boolean to allow null values 2014-10-20 17:11:19 -07:00
Ido Shamun
5e4e838a48 add support to multipart form data and urlencoded for android client 2014-10-21 01:58:31 +03:00
Ivan Porto Carrero
f3dc69a7e7 update dependencies in async scala project 2014-10-20 15:42:10 -07:00
Tony Tam
86f9a0a58a fixed build error 2014-10-20 08:42:35 -07:00
Tony Tam
df1a987e2d Merge branch 'develop_2.0' of github.com:wordnik/swagger-codegen into develop_2.0 2014-10-20 08:24:46 -07:00
Tony Tam
40b4d34870 added required flag for parameter 2014-10-20 08:24:34 -07:00
Tony Tam
c6e3608ffa Merge pull request #310 from martoe/param_required
Parameter.required flag implemented
2014-10-20 07:07:50 -07:00
Martin Ehrnhoefer
0aa87cfbeb Parameter.required flag implemented
Made the "required" flag for Parameter objects available to the code generator templates
2014-10-20 15:56:25 +02:00
Tony Tam
053419234a renamed field to avoid nested naming collisions 2014-10-19 11:18:38 -07:00
Tony Tam
12eba440ae Update README.md 2014-10-18 17:14:00 -07:00
Tony Tam
5d43282f51 fixed typo 2014-10-17 14:46:47 -07:00
Tony Tam
2826b69487 removed profile 2014-10-17 14:31:26 -07:00
Tony Tam
63c6bc28c3 Merge branch 'berngp-feature/develop_2.0/scala_2.11' into develop_2.0 2014-10-17 14:29:37 -07:00
Tony Tam
bf3eb94c51 Merge branch 'feature/develop_2.0/scala_2.11' of github.com:berngp/swagger-codegen into berngp-feature/develop_2.0/scala_2.11 2014-10-17 14:28:58 -07:00
Tony Tam
350d736706 fixed case on scheme 2014-10-16 17:43:15 -07:00
Tony Tam
e0aed88e98 added default value 2014-10-16 17:42:39 -07:00
Tony Tam
52a4370c35 added default value 2014-10-16 17:42:27 -07:00
Bernardo Gomez Palacio
5c0577aa8e Adding Echo YAML Sample 2014-10-14 15:09:55 -07:00
Bernardo Gomez Palacio
1e1abde846 Updating the Scalatra Template for Scala 2.11
* Moved to Scala 2.11.2
* Updated the dependencies to use latest Jetty as well as Akka
* Added the SBT Dependency Graph plugin
* Build Properties now use SBT 0.13.5
* Updated the sbt executable.
2014-10-14 14:39:12 -07:00
Bernardo Gomez Palacio
b2f34a152b Enabling Maven Profile gen-scalatra 2014-10-14 14:24:59 -07:00
webron
4676c4cdf7 Merge pull request #307 from catherinedodge/master
Fixed broken link in README.md
2014-10-13 16:58:22 +03:00
catherinedodge
d5674c9a7b Fixed broken link in README.md 2014-10-13 09:48:29 -04:00
Tony Tam
7c998a2d67 addressed import mappings 2014-10-10 22:07:08 -07:00
Tony Tam
5a70550a37 added scalatra support 2014-10-10 21:41:21 -07:00
Tony Tam
4d214dbcef updated client 2014-10-10 21:39:45 -07:00
Tony Tam
97623af8df added apiInfo 2014-10-10 21:26:07 -07:00
Tony Tam
b87bc2a908 added scalatra 2014-10-10 21:25:19 -07:00
Mark H. Butler
c8dac4a3cf Reverting these files, they don't need to change 2014-10-08 08:25:23 -07:00
Mark H. Butler
6f30a6d65a Modifying the pom.xml template because it defaults to building with Scala 2.9.1, but that is broken because BeanProperty moved, so instead use 2.10 as the default but add the option of using Scala 2.11 2014-10-08 08:20:02 -07:00
Mark H. Butler
9d1f0bf568 Adding ignore for gedit files (Linux) 2014-10-08 08:19:08 -07:00
Tony Tam
643c211d72 Merge pull request #296 from lloydmeta/update/fix_deprecations
Update deprecated method calls
2014-10-07 21:42:13 -07:00
Tony Tam
fb84985e9b Merge pull request #298 from dreamfactorysoftware/master
adding a space in call to completionHandler to kill latest Xcode parse errors
2014-10-02 16:45:38 -07:00
Jason Sykes
afb34b4f2f adding a space in call to completionHandler to kill latest Xcode parse errors 2014-10-02 12:20:17 -04:00
Tony Tam
5024e0bbda added root checking per #279 2014-10-02 00:32:15 -07:00
Tony Tam
e771ed3332 added scheme, host, basePath per #295 2014-10-02 00:18:36 -07:00
Tony Tam
2e81b38838 Merge branch 'develop_2.0' of github.com:wordnik/swagger-codegen into develop_2.0 2014-10-02 00:10:42 -07:00
Tony Tam
67d28e8b3c added test 2014-10-02 00:10:39 -07:00
Tony Tam
b834ba436f added nodejs server 2014-10-02 00:10:15 -07:00
Tony Tam
6da7cbf095 Merge pull request #297 from martoe/#268
Windows path problem fixed
2014-10-02 00:00:54 -07:00
Martin Ehrnhoefer
d5d1eb2833 Windows path problem fixed
see #268, #269, #288
2014-10-02 08:56:30 +02:00
Tony Tam
e66f3c48ac Merge pull request #288 from martoe/268
Windows path problem fixed (again)
2014-10-01 23:29:46 -07:00
Tony Tam
c10cf7bf7f Merge branch 'develop_2.0' of github.com:wordnik/swagger-codegen into develop_2.0 2014-10-01 23:22:43 -07:00
Tony Tam
178d7d19c4 added files 2014-10-01 23:22:39 -07:00
Tony Tam
3c2845aaa6 updated file locations 2014-10-01 23:21:59 -07:00
Tony Tam
a215e93505 Merge pull request #294 from martoe/287
[2.0 Spec] Java generator: Implement Enums #287
2014-10-01 23:13:58 -07:00
Tony Tam
bc99361100 Merge branch 'develop_2.0' of github.com:wordnik/swagger-codegen into develop_2.0 2014-10-01 22:13:50 -07:00
Tony Tam
48f8e16fb0 added models support per #291 2014-10-01 22:12:50 -07:00
Tony Tam
ffda821f68 updated imports 2014-10-01 22:12:18 -07:00
Tony Tam
1bce51de7a updated imports 2014-10-01 22:11:51 -07:00
Lloyd
1734ac2e18 Update deprecated method calls
1. Update specs to inherit via `with Matchers`
2. Update `URLEncoder.encode` to pass "UTF-8" as charset
2014-10-02 10:49:20 +09:00
Tony Tam
ddb7aad530 Merge pull request #289 from maneeshsahu/develop_2.0
Added support for Map<String, Object>
2014-10-01 08:50:06 -07:00
Martin Ehrnhoefer
31ca832bdf [2.0 Spec] Java generator: Implement Enums #287
Unittest
2014-10-01 17:42:03 +02:00
Martin Ehrnhoefer
a80af33260 [2.0 Spec] Java generator: Implement Enums #287
Very basic implementation
2014-10-01 17:10:51 +02:00
Martin Ehrnhoefer
3971bbf334 [2.0 Spec] Java generator: Implement Enums #287
Very basic implementation
2014-10-01 16:58:38 +02:00
Maneesh Sahu-SSI
8cf9cb95f5 Added support for Map<String, Object> 2014-09-30 21:57:21 -07:00
Tony Tam
2787fa82c6 added docs 2014-09-30 06:11:51 -07:00
Tony Tam
05e1d02341 added custom class loading for configurations 2014-09-30 06:06:01 -07:00
Tony Tam
277f26a5bb Merge branch 'develop_2.0' of github.com:wordnik/swagger-codegen into develop_2.0 2014-09-30 05:10:30 -07:00
Tony Tam
c05a3c3a99 updated client 2014-09-30 05:10:24 -07:00
Tony Tam
ca06241307 updated scripts 2014-09-30 05:09:47 -07:00
Martin Ehrnhoefer
cb25eb6bc0 Windows path problem fixed (again) - #268 #269 2014-09-30 09:32:52 +02:00
James Ebentier
72bef1fb68 fixing the java comments above the api calls to allow for multiline comments in the swagger docs 2014-09-29 17:53:53 -07:00
Tony Tam
b7452fa8ee Merge pull request #284 from martoe/699
[2.0 Spec] Implement Schema Object.example field
2014-09-29 10:48:57 -07:00
Martin Ehrnhoefer
89a009c411 [2.0 Spec] Implement Schema Object.example field
see issue https://github.com/wordnik/swagger-core/issues/699,
 pull-request https://github.com/wordnik/swagger-core/pull/700
2014-09-29 16:26:06 +02:00
Tony Tam
c75a951668 updated sample 2014-09-28 00:52:32 -07:00
Tony Tam
d714f097eb updated static template 2014-09-28 00:50:47 -07:00
Tony Tam
48f05b41e4 updated android sample 2014-09-27 17:00:30 -07:00
Tony Tam
f04827c6d3 updated android sample 2014-09-27 17:00:03 -07:00
Tony Tam
2729070d7f updated android sample 2014-09-27 16:59:08 -07:00
Tony Tam
9e5576d3fe added empty var check 2014-09-27 16:50:36 -07:00
Tony Tam
530ebe1f7d added map, list model types with tests 2014-09-27 09:13:26 -07:00
Tony Tam
ba45641801 updated for objc tests 2014-09-26 22:52:27 -07:00
Tony Tam
f2b03d2930 added test files 2014-09-26 14:21:43 -07:00
Tony Tam
7006c2f6e9 updated README 2014-09-26 13:59:07 -07:00
Tony Tam
108880cbe9 updated README 2014-09-26 13:56:12 -07:00
Tony Tam
64aa948445 added android client 2014-09-26 10:25:44 -07:00
Tony Tam
eb6c09bfce merged from #271 2014-09-26 09:39:39 -07:00
Tony Tam
2dd73872a4 updated with tests 2014-09-26 09:38:07 -07:00
Tony Tam
ba94dc3d68 added subclass for ArrayModel support #273, removed path param brackets for auto-generated operationId #274 2014-09-23 21:44:09 -07:00
Tony Tam
5bc907f1d4 added template variable 2014-09-23 09:14:25 -07:00
Tony Tam
1406c36ced Merge branch 'develop_2.0' of github.com:wordnik/swagger-codegen into develop_2.0 2014-09-22 16:44:23 -07:00
Tony Tam
394a064cc3 added scripts 2014-09-22 16:44:19 -07:00
Tony Tam
db29ecc8d0 added file from master 2014-09-22 16:44:01 -07:00
Tony Tam
ec99bef893 Merge pull request #266 from FindTheBest/pull_request
Python binding generation pull request
2014-09-20 13:39:07 -07:00
Tony Tam
64f7aece12 Merge pull request #269 from martoe/develop_2.0
#268 Windows path problem fixed
2014-09-20 10:42:43 -07:00
Martin Ehrnhoefer
46f5fe0611 #268 Windows path problem fixed 2014-09-20 19:39:54 +02:00
Tony Tam
923ed596ac Merge pull request #267 from martoe/develop_2.0
Issue 244 - checkout on windows fails due to special chars
2014-09-20 08:47:44 -07:00
Tony Tam
2fd29d74f2 Merge pull request #263 from wordnik/basic-auth
Adds Basic auth as an authentication mechanism
2014-09-20 08:43:30 -07:00
Tony Tam
033a9a4b97 Merge pull request #262 from xhh/patch-1
Fixes #260 convert form parameters to string for Java client
2014-09-20 08:41:33 -07:00
isf
8762f38470 Issue 244 - checkout on windows fails due to special chars 2014-09-20 11:48:50 +00:00
Tony Tam
e5392dc21a added script 2014-09-19 16:41:09 -07:00
Tony Tam
7630fd4f85 added scripts 2014-09-19 16:36:28 -07:00
Tony Tam
134c900aa1 reorded for cleanliness 2014-09-19 16:28:56 -07:00
Tony Tam
a0876f24a3 added travis file 2014-09-19 14:38:00 -07:00
Tony Tam
504e1b28c5 added model package to templates 2014-09-19 14:05:31 -07:00
Tony Tam
885e463bcb added compatibility table 2014-09-19 11:50:20 -07:00
James Ebentier
b8f3201dba fixing a minor generation issue in api.mustashe to make sure that python scripts are as clean as possible for apis 2014-09-19 10:53:03 -07:00
James Ebentier
983edbd85b Adding in the ability to post forms using swagger codegen generate bindings for python 2014-09-19 10:52:57 -07:00
Tony Tam
24268661af Merge pull request #265 from fehguy/develop_2.0
added 2.0 support
2014-09-19 07:30:13 -07:00
Tony Tam
b90742e995 updated template location, added snapshot 2014-09-18 08:28:19 -07:00
Ivan Porto Carrero
86d56b978a also work on java 7 2014-09-16 20:52:07 -07:00
Ivan Porto Carrero
ed86bfb79b adds basic auth support 2014-09-16 20:41:32 -07:00
Ivan Porto Carrero
44a73c32fa more lenient Version.scala 2014-09-16 20:15:09 -07:00
Xu Hui Hui
39662e45b1 Fixes #260 convert form parameters to string for Java client 2014-09-16 18:58:17 +08:00
Tony Tam
9ab12eeda3 added mapping 2014-09-14 22:44:29 -07:00
Tony Tam
2128741218 removed println 2014-09-14 22:44:18 -07:00
Tony Tam
4442dcf203 added operationId generator 2014-09-14 22:44:05 -07:00
Tony Tam
fff1f30dba updated the query params 2014-09-14 21:44:07 -07:00
Tony Tam
c123bb9130 template cleanup 2014-09-14 17:52:25 -07:00
Tony Tam
5112b655bd added auth and response models 2014-09-14 17:47:59 -07:00
Tony Tam
d4122d197f updated to support jaxrs 2014-09-14 17:47:36 -07:00
webron
998bf633d8 Merge pull request #261 from czenker/patch-1
Fix typo in README.md
2014-09-12 15:48:22 +03:00
Christian Zenker
b927ffbd53 Fix typo in README.md 2014-09-12 14:26:15 +02:00
Tony Tam
cab4ffa286 property renames 2014-09-10 06:13:49 -07:00
Tony Tam
1ff47393ed Merge pull request #255 from martoe/master
Issue 244 - checkout on windows fails due to special chars
2014-09-07 23:59:01 -07:00
isf
a6ecc7a65b Issue 244 - checkout on windows fails due to special chars 2014-09-08 08:50:35 +02:00
Tony Tam
d5e62086c8 added cli parser, input opts 2014-09-04 12:42:35 -07:00
Tony Tam
370c22cddb made templates same as 2.0 2014-09-03 22:17:26 -07:00
Tony Tam
fbf8398324 fixes for return types, arrays 2014-09-03 22:10:34 -07:00
Tony Tam
79c456ecfc updates for reserved words 2014-09-03 11:18:19 -07:00
Tony Tam
bc0cc567d9 updated output filenames 2014-09-03 11:07:48 -07:00
Tony Tam
ad3006d49c added support for supporting files 2014-09-03 10:20:13 -07:00
Tony Tam
73ad502251 updated 2.0 support for objc 2014-09-03 01:10:02 -07:00
Tony Tam
7901d8a7c6 fixed api filenames 2014-09-03 00:41:06 -07:00
Tony Tam
6f63ba43ad added return types, media types 2014-09-03 00:38:24 -07:00
Tony Tam
812520e29f added support for models, partial for ops 2014-09-01 13:31:01 -07:00
Tony Tam
d1daf3a0e6 added 2.0 support files 2014-08-29 09:47:46 -07:00
Tony Tam
c5ccc0a908 update to swagger 2.0 2014-08-29 09:47:17 -07:00
Tony Tam
dbf04a9563 updated scripts 2014-08-27 01:09:28 -07:00
Tony Tam
d1603ba25e updated scalatest 2014-08-27 01:04:02 -07:00
Tony Tam
d4ce57bd15 added bigdecimal support 2014-08-27 01:03:49 -07:00
Tony Tam
5e56346dc9 updated scripts to use only assembly 2014-08-27 01:03:32 -07:00
Tony Tam
05db83a067 set to petstore 2014-08-27 00:17:45 -07:00
Tony Tam
707ee1c85b set version to 2.10.4 2014-08-27 00:17:33 -07:00
Tony Tam
a54adb925f added big decimal support 2014-08-27 00:16:12 -07:00
Tony Tam
8c53837802 updated scripts for assembly 2014-08-27 00:15:26 -07:00
Tony Tam
3625b89a15 updated to snapshot build 2014-08-26 16:53:52 -07:00
Tony Tam
2ed68c2df8 version 2.0.17 2014-08-26 16:52:26 -07:00
Tony Tam
db1915ec89 Merge pull request #252 from earldouglas/path-not-optional
Drop the 'optional' param for path params
2014-08-26 14:40:14 -07:00
James Earl Douglas
77e9ce5ede Drop the 'optional' param for path params 2014-08-26 14:38:27 -07:00
Tony Tam
013c19eb36 Merge pull request #251 from earldouglas/not-so-required
Set param as 'required' iff required, else set as 'optional'
2014-08-26 14:33:00 -07:00
James Earl Douglas
61c04ddaf1 Set param as 'required' iff required, else set as 'optional' 2014-08-26 14:31:45 -07:00
Tony Tam
b4d361130c Merge pull request #247 from xoom/issues/java_pom
Issues/java pom - remove scala dependencies from Java pom files
2014-08-25 23:05:04 -07:00
Tony Tam
8e7571c34f Merge pull request #248 from xhh/patch-1
Fixes #242 - Ruby model syntax error
2014-08-25 23:03:45 -07:00
xhh
1ba42ef6cc Fixes #242 - Ruby model syntax error 2014-08-26 09:18:54 +08:00
Rob Blair
fc77521d49 Simplify java sample poms.
* remove scala references from the java client pom template files.
* regenerate the petstore sample pom.xml, verify they can build properly.
2014-08-25 17:37:36 -07:00
Rob Blair
1522069281 Regenerate the java code before modifying templates 2014-08-25 17:35:44 -07:00
Tony Tam
a13f46e781 Merge pull request #245 from ganeshs/master
Added import mappings for java.util.Set and java.sql.Timestamp
2014-08-20 23:43:05 -07:00
Ganesh Subramanian
3ad1ecf153 Added import mapping for Timestamp 2014-08-21 12:11:19 +05:30
Ganesh Subramanian
6087181634 Added import mapping for Timestamp 2014-08-21 12:10:14 +05:30
Ganesh Subramanian
c09adc4539 Fix for issue #226 2014-08-21 12:01:44 +05:30
Tony Tam
a626dea181 Update api.mustache 2014-08-11 08:58:45 -07:00
Tony Tam
454ec4b438 fix for #235 2014-08-08 16:38:38 -04:00
Gerard Solé
4a64d602a0 Add plugin to build a jar with dependencies 2014-08-07 12:17:05 -07:00
Gerard Solé
f294656073 Edit line 76 to place pom.xml correctly 2014-08-07 11:28:08 -07:00
Ivan Porto Carrero
c7da910e68 remove sample files again 2014-08-05 10:56:20 -07:00
Ivan Porto Carrero
40d33693cf add typesafe releases resolver, fixes #232 2014-08-05 10:43:28 -07:00
Tony Tam
13eaf2bf63 Merge branch 'master' of github.com:wordnik/swagger-codegen 2014-08-03 09:19:01 -07:00
Tony Tam
d4508ed112 updated resolvers 2014-08-03 09:16:30 -07:00
Tony Tam
c252e9f7c6 added sonatype as resolver 2014-08-03 09:12:16 -07:00
Tony Tam
6690b80b29 Update .travis.yml 2014-08-02 16:32:10 -07:00
Tony Tam
19bb97a725 updated travis to 2.10.4 2014-08-02 16:09:00 -07:00
Tony Tam
62ee62ebd3 Merge branch 'master' of github.com:wordnik/swagger-codegen 2014-08-02 16:04:55 -07:00
Tony Tam
87083034ee Merge pull request #215 from JDiPierro/fix_java_generator_lists
Use config.processResponseClass to determine type of returnContainer
2014-07-24 11:48:19 -07:00
Tony Tam
d9de57da6f Merge pull request #223 from darkcube/master
CSharp: Multipart form submission
2014-07-23 08:43:37 -04:00
Timothy Lusk
d0b0323925 CSharp: Implement multipart form submission 2014-07-22 17:17:54 -04:00
Tony Tam
f592414409 Merge branch 'master' of github.com:wordnik/swagger-codegen 2014-07-18 09:52:57 -06:00
Tony Tam
e1c8f58d28 added 2.10.4 2014-07-18 09:52:53 -06:00
Tony Tam
4870ed7e51 Merge pull request #220 from darkcube/master
CSharp Changes
2014-07-16 16:30:15 -06:00
Timothy Lusk
bbe48814b4 CSharp: Add optional api constructor argument to set the basePath 2014-07-15 15:41:57 -04:00
Timothy Lusk
3b6ffa4a1f CSharp: Close the WebResponse if we throw an ApiException 2014-07-15 15:41:56 -04:00
Tony Tam
527c40b996 Merge pull request #211 from wcandillon/patch-1
Link back to the swagger-js-codegen project
2014-07-13 07:21:22 -07:00
Justin DiPierro
3aa2c86991 Output the resourcePath when no models are found rather than the basePath 2014-07-10 10:14:22 -04:00
Justin DiPierro
e2a20447df Fixed comment in test 2014-07-10 10:02:18 -04:00
Tony Tam
5d42c8cc5f moved to petstore 2014-07-04 10:19:48 -07:00
Tony Tam
256485ec5b updated template 2014-07-04 10:19:28 -07:00
Tony Tam
7ab0394e76 added node.js instead of jetty 2014-07-04 10:19:09 -07:00
Tony Tam
89b04b2e10 formatting 2014-07-04 10:18:44 -07:00
Tony Tam
a019a438e0 changed to petstore sample 2014-07-04 10:08:54 -07:00
Justin DiPierro
9834059786 Fixed BasicScalaGeneratorTest to expect Some(List) 2014-07-03 11:32:37 -04:00
Justin DiPierro
550fade9e0 Codegen.apiToMap should use config.processResponseClass when setting the returnContainer property. Test passes now 2014-07-03 11:24:05 -04:00
Justin DiPierro
aa1b4fc0fb Wrote failing test for Codegen 2014-07-03 11:23:07 -04:00
Tony Tam
5a659803a8 Merge pull request #212 from darkcube/master
Various csharp codegen fixes
2014-06-29 13:59:21 -07:00
Timothy Lusk
7bc7789e81 CSharp: Invoker should handle WebException and rethrow ApiException 2014-06-27 17:55:10 -04:00
Timothy Lusk
cf0721da73 CSharp: Use nullable primitive types to allow optional parameters 2014-06-27 16:10:45 -04:00
Timothy Lusk
dcbf4d1bfd CSharp: Use the correct model package name 2014-06-27 16:01:24 -04:00
William Candillon
017b578502 Link back to the swagger-js-codegen project 2014-06-26 15:05:33 +02:00
Tony Tam
58bade3b01 Update README.md 2014-06-19 09:33:41 -07:00
Tony Tam
02631e674a Merge pull request #207 from emmekappa/master
Fixing extensions and namespaces for csharp common files.
2014-06-17 10:53:17 -07:00
Michele Cantelli
5f5e534d05 CSharp: renaming the "packages" to follow the .NET style. 2014-06-17 16:22:04 +02:00
Michele Cantelli
51deeb478d Fixing extensions for csharp common files. 2014-06-17 15:18:58 +02:00
Tony Tam
acff8229b3 Merge pull request #206 from xoom/issue/modelsFromStatus
Issue/models from status - utilize the responseModel, if present
2014-06-16 17:03:17 -07:00
Rob Blair
233555790a Regenerate sample java files with example response status codes
* none of existing examples use the responseMessage.responseModel feature, but I have tested it.
* Didn't want to muck with sample json
* update the scripts used to generate both java versions.
* see https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#525-response-message-object
2014-06-16 12:59:53 -07:00
Rob Blair
d5ddac8e7e Update java mustache to show error status codes and models in generated API, in comments.
* I wonder if there is some clever way to make exceptions based on the model thrown, and automatically fill them in with the parsed error models?
* Until then, it's comments, and roll your own.
2014-06-16 12:51:35 -07:00
Rob Blair
e8210cd5e3 allow list of models to be returned in errors
* for example, a list of validation errors with an exceptional status
2014-06-16 12:40:44 -07:00
Rob Blair
2dc6b485e0 Generate classes from the models declared in 'responseModel'
* ResponseMessage has new constructor parameter, an optional string for responseModel
* Make sure we add it to list of models
* make sure the responseModel is part of the error list available to mustache
2014-06-16 12:34:44 -07:00
Tony Tam
11bede2b7d improved validation messages 2014-06-12 00:45:27 -07:00
Tony Tam
ed51dd9dea added files 2014-06-11 06:41:59 -07:00
Tony Tam
218f514005 updated node sample 2014-06-11 06:41:31 -07:00
Tony Tam
209e8e066c Merge pull request #201 from xoom/issue/JavaSafeApiName
coerce API names for classesand files to valid Java names
2014-06-11 06:12:55 -07:00
Tony Tam
7d05b01a56 Merge pull request #202 from gonimar/patch-1
Unused local variable 'json_data'.
2014-06-11 06:12:36 -07:00
Tony Tam
64f6bedc37 Merge branch 'repackage' 2014-06-11 06:12:15 -07:00
Tony Tam
4ae4aa98bb formatting 2014-06-11 06:11:45 -07:00
Tony Tam
db8bda087b made nickname optional 2014-06-11 06:11:31 -07:00
Tony Tam
06eb52118e updated to 2.3.0 release 2014-06-11 06:03:44 -07:00
Tony Tam
63be7d0069 removed println 2014-06-11 05:50:44 -07:00
Tony Tam
c7468125fa added clientName 2014-06-10 20:37:36 -07:00
Tony Tam
7b3d8bf799 added file upload support 2014-06-10 20:37:24 -07:00
Tony Tam
c4913fe583 wrapped in apiInfo 2014-06-10 20:37:08 -07:00
Tony Tam
d3339cb087 fixed string default 2014-06-10 20:36:58 -07:00
Tony Tam
ba4fda12dc added additional params 2014-06-10 20:36:29 -07:00
Tony Tam
7a6d6d27ff enabled logging 2014-06-10 20:36:10 -07:00
Tony Tam
bcabb03225 added support for nickname generation 2014-06-10 20:05:19 -07:00
Tony Tam
a404823c54 updated copyright 2014-06-10 17:23:35 -07:00
Tony Tam
96ea70e3c9 added className key 2014-06-10 17:23:20 -07:00
Tony Tam
9a01331ddd updated copyright 2014-06-10 16:58:43 -07:00
Tony Tam
3bfa468ed1 fixed filemap 2014-06-10 16:57:39 -07:00
Tony Tam
fdf8572535 updated copyright 2014-06-10 16:57:12 -07:00
Tony Tam
cff8b1552d updated copyright 2014-06-10 16:57:01 -07:00
Tony Tam
e73dd0a7c4 updated copyrights 2014-06-10 16:56:06 -07:00
Tony Tam
9c4c2dfd37 updated copyrights 2014-06-10 16:55:57 -07:00
Tony Tam
2f8355c953 regenerated client 2014-06-10 16:55:34 -07:00
Tony Tam
3f480482b6 regenerated client 2014-06-10 16:55:17 -07:00
Tony Tam
8274196999 regenerated client 2014-06-10 16:55:13 -07:00
Tony Tam
4e8c71f754 regenerated client 2014-06-10 16:54:48 -07:00
Tony Tam
57e7b41e9c regenerated client 2014-06-10 16:52:16 -07:00
Tony Tam
58d9894f1f regenerated client 2014-06-10 16:51:41 -07:00
Tony Tam
4b4d4d32cd regenerated client 2014-06-10 16:51:36 -07:00
Tony Tam
6a2ea9f614 regenerated client 2014-06-10 16:51:10 -07:00
Tony Tam
0d6754e167 regenerated client 2014-06-10 16:50:17 -07:00
Tony Tam
cb5c2a9708 regenerated client 2014-06-10 16:48:27 -07:00
Tony Tam
dc8ad7edf5 updated client 2014-06-10 16:48:05 -07:00
Tony Tam
52bc82149f file rename 2014-06-10 16:34:40 -07:00
Tony Tam
f53b5e27e0 updated scalatra version, templates for files, forms 2014-06-10 15:51:15 -07:00
Tony Tam
ce5be3452c added patch class 2014-06-10 15:50:49 -07:00
Tony Tam
ce14c225e5 added patch 2014-06-10 10:36:46 -07:00
Tony Tam
b78721826e regenerated client 2014-06-10 10:36:13 -07:00
Tony Tam
85113df113 regenerated client 2014-06-10 08:41:44 -07:00
Tony Tam
607b56cb87 removed println 2014-06-10 08:40:19 -07:00
Tony Tam
2dbf8b7d41 regenerated 2014-06-10 08:40:03 -07:00
Tony Tam
7d4c10043d updated client 2014-06-10 08:22:40 -07:00
Tony Tam
64604124c9 added array support 2014-06-10 08:22:08 -07:00
Tony Tam
50f20ad836 updated templates 2014-06-10 08:21:51 -07:00
Tony Tam
ac40283501 updated samples 2014-06-10 08:01:53 -07:00
Sergey Gonimar
e03d4fc1a5 Unused local variable 'json_data'.
The value of the variable is not used anywhere.
2014-06-10 19:25:00 +06:00
Rob Blair
05e9443db5 coerce API names of class and file valid Java names
* Swagger allows names of apis to include characters like '-' Java does not like that
* use same replace strings as used in toVarName
2014-06-09 17:04:57 -07:00
Tony Tam
1250cc758f updated version 2014-06-09 16:34:42 -07:00
Tony Tam
a18784da6c updated file maps 2014-06-09 15:05:23 -07:00
Tony Tam
c87d637edd regenerated 2014-06-06 00:27:40 -07:00
Tony Tam
bf4a4e5296 fixed imports, nesting 2014-06-06 00:27:15 -07:00
Tony Tam
4f7b80dad2 added debug, fixed headers 2014-06-05 22:49:09 -07:00
Tony Tam
8a2f9bc7bb compatibility 2014-06-05 20:08:59 -07:00
Tony Tam
b9806c183b fixed case 2014-06-05 20:08:37 -07:00
Tony Tam
5aa4c4c999 made snapshot 2014-05-31 16:04:19 -07:00
Tony Tam
424cfac80f updated config 2014-05-30 16:27:54 -07:00
Ivan Porto Carrero
715913f3b4 Update slightly add some test files 2014-05-30 15:17:53 -07:00
Tony Tam
1c2c4fdcd3 removed function override 2014-05-30 15:03:10 -07:00
Ivan Porto Carrero
2ea6c2a3a7 Merge branch 'master' of github.com:wordnik/swagger-codegen 2014-05-30 14:25:57 -07:00
Tony Tam
d91da857a0 removed unused code 2014-05-30 09:59:27 -07:00
Tony Tam
31e65969b3 removed printlns, cruft 2014-05-30 07:53:27 -07:00
Tony Tam
df250bc056 fixed model mapping, refactoring the processing of apiMap and modelMap so it's executed just once 2014-05-30 07:29:19 -07:00
Tony Tam
1569274684 fixed package 2014-05-20 00:14:01 -07:00
Tony Tam
6d8f751da4 added model package 2014-05-19 23:23:23 -07:00
Tony Tam
c2dd00a4ab fixed return type 2014-05-19 15:08:44 -07:00
Tony Tam
9e6ae6eef8 added opts for input 2014-05-15 08:51:41 -04:00
Tony Tam
58b985ba02 moved packages to address collisions with swagger-core per #145 2014-05-14 18:23:32 -04:00
Tony Tam
b4f3143c8c Merge pull request #159 from yanoosh/php-fix-sanitize
PHP - Improved/fixed serialization and deserialize.
2014-05-01 20:31:13 -07:00
Tony Tam
84ad6b5d50 rebuilt docs 2014-05-01 20:19:40 -07:00
Tony Tam
32c14af5ce added resize 2014-05-01 20:18:23 -07:00
Tony Tam
46023c47f5 Merge branch 'master' of github.com:wordnik/swagger-codegen 2014-05-01 20:17:53 -07:00
Tony Tam
71212e5f68 reverted to artifactVersion 2014-05-01 20:16:46 -07:00
Tony Tam
6d1c34048c fix for #176 2014-05-01 20:16:27 -07:00
Tony Tam
f67006057e updated version 2014-05-01 20:14:41 -07:00
Tony Tam
e1e397a7b5 Merge pull request #179 from j-unior/scala-2.10
Added scala 2.10 support in generated maven profile.
2014-05-01 18:03:22 -07:00
Tony Tam
0f35799a77 fixed start script #188 2014-04-29 09:46:49 -07:00
Tony Tam
be44221d98 Merge pull request #187 from earldouglas/return-generated-files
Return files generated from BasicGenerator#generateClientWithoutExit
2014-04-24 16:06:12 -07:00
James Earl Douglas
94ad254a58 Return files generated from BasicGenerator#generateClientWithoutExit 2014-04-24 15:14:41 -07:00
James Earl Douglas
666a4be1f2 Return files generated from Codegen#writeSupportingClasses 2014-04-24 15:12:11 -07:00
James Earl Douglas
e542fbd0a2 De-duplicate code from Codegen#writeSupportingClasses 2014-04-24 15:07:45 -07:00
Pat
f4b2d13aa4 Update README.md 2014-04-09 10:15:08 -07:00
j-unior
abcae6da96 Added scala 2.10 support in generated maven profile. You can enable it with mvn install -P scala_2.10 on generated client 2014-04-01 16:56:08 +03:00
Tony Tam
1b9b3eaa8e Merge pull request #175 from STEAMULO/master
Filename misprint for Android generation
2014-03-25 11:33:03 -07:00
aansel
0babc4f192 Filename misprint for Android generation 2014-03-25 18:44:05 +01:00
webron
e51ffb37b4 Update README.md 2014-03-23 13:16:02 +02:00
Tony Tam
2fba96713c Merge pull request #172 from giovannibotta/master
Minor change to map used when generating supporting files
2014-03-19 08:27:49 -07:00
giodude
dccf8edc25 Minor change to map used when generating supporting files. 2014-03-19 11:18:23 -04:00
webron
d98aeac818 Create LICENSE 2014-03-19 16:08:55 +02:00
webron
62bfc4ea19 Update README.md
Updated license year.
2014-03-19 16:08:38 +02:00
Tony Tam
8d74029fba Merge pull request #170 from hsanjuan/master
Issue #168: Let runscala.sh run from everywhere without breaking
2014-03-18 18:54:28 -07:00
Hector Sanjuan
809cb5cf1f Issue #168: Let runscala.sh run from everywhere without breaking and correctly
setting the classpath
2014-03-17 16:21:36 +01:00
Tony Tam
a4196609c9 added friendly error message when SSL validation fails 2014-03-06 08:29:02 -08:00
Tony Tam
e7eedcf48d removed printlns 2014-03-05 07:54:12 -08:00
Tony Tam
8bf042b153 updated sample with form param support 2014-03-05 07:54:03 -08:00
Tony Tam
8325a12faf fixed hasMore 2014-03-04 20:05:16 -08:00
Tony Tam
03abccd8e8 fix for #154 2014-03-04 19:48:13 -08:00
Janusz Jablonski
19e79fedb2 Added backslash before DateTime object. 2014-03-03 00:40:45 +01:00
Tony Tam
71eacaa3b1 Merge pull request #160 from yanoosh/php-removed-escape
PHP - Removed escapeReservedWord method.
2014-03-02 13:30:08 -08:00
Janusz Jablonski
7cfa46d838 Removed escapeReservedWord method. 2014-03-02 18:31:35 +01:00
Janusz Jablonski
7989e78460 Improved/fixed serialization and deserialize. 2014-03-02 14:44:46 +01:00
Tony Tam
08466f615f Merge branch 'master' of github.com:wordnik/swagger-codegen 2014-02-25 12:54:12 -08:00
Tony Tam
880d14990f added patch support 2014-02-25 12:53:11 -08:00
Tony Tam
39ac8f6d46 added patch support 2014-02-25 12:52:49 -08:00
Tony Tam
685fc7066f Update README.md 2014-02-22 07:21:13 -08:00
Tony Tam
127600e728 Update README.md 2014-02-21 17:29:22 -08:00
Tony Tam
d764328026 updated readme 2014-02-21 17:22:48 -08:00
Tony Tam
cae8296999 updated readme 2014-02-21 17:21:56 -08:00
Tony Tam
86efb71124 updated readme 2014-02-21 17:21:50 -08:00
Tony Tam
0899b08b8c Merge branch 'master' of github.com:wordnik/swagger-codegen 2014-02-21 17:20:16 -08:00
Tony Tam
a770db9d3e added readme 2014-02-21 17:20:06 -08:00
Tony Tam
87b5c43166 Merge pull request #158 from mkantor/objc-safe-var-names
Prevent ObjC generator from producing invalid var names.
2014-02-21 13:41:26 -08:00
Matt Kantor
d14ab2aeff Prevent ObjC generator from producing invalid var names. 2014-02-21 13:35:13 -08:00
Ivan Porto Carrero
b39a609226 Merge branch 'master' of github.com:wordnik/swagger-codegen 2013-11-09 12:18:42 -08:00
Ivan Porto Carrero
d25f64cca0 change to return transpor client in async scala client 2013-11-09 12:18:20 -08:00
2536 changed files with 169566 additions and 82107 deletions

47
.dockerignore Normal file
View File

@@ -0,0 +1,47 @@
*.iml
out/
*.ipr
*.iws
classpath.txt
version.properties
.project
.classpath
lib/*
build/*
generated-files/*
generated-sources/*
generated-code/*
*.swp
*.swo
/target
/generated-files
/nbactions.xml
*.pyc
__pycache__
samples/server-generator/scalatra/output
samples/server-generator/node/output/node_modules
samples/server-generator/scalatra/target
samples/server-generator/scalatra/output/.history
samples/client/petstore/qt5cpp/PetStore/moc_*
samples/client/petstore/qt5cpp/PetStore/*.o
samples/client/petstore/objc/PetstoreClient.xcworkspace/xcuserdata
samples/client/petstore/qt5cpp/build-*
samples/client/petstore/qt5cpp/PetStore/PetStore
samples/client/petstore/qt5cpp/PetStore/Makefile
samples/client/petstore/java/hello.txt
samples/client/petstore/android-java/hello.txt
samples/client/petstore/objc/Build
samples/client/petstore/objc/Pods
samples/server/petstore/nodejs/node_modules
target
.idea
.lib
atlassian-ide-plugin.xml
.DS_Store
samples/client/petstore/php/SwaggerClient-php/composer.lock
samples/client/petstore/php/SwaggerClient-php/vendor/
samples/client/petstore/silex/SwaggerServer/composer.lock
samples/client/petstore/silex/SwaggerServer/venodr/

29
.gitignore vendored
View File

@@ -9,6 +9,7 @@ version.properties
lib/*
build/*
generated-files/*
generated-sources/*
generated-code/*
*.swp
*.swo
@@ -22,9 +23,35 @@ samples/server-generator/scalatra/output
samples/server-generator/node/output/node_modules
samples/server-generator/scalatra/target
samples/server-generator/scalatra/output/.history
samples/client/petstore/qt5cpp/PetStore/moc_*
samples/client/petstore/qt5cpp/PetStore/*.o
samples/client/petstore/objc/PetstoreClient.xcworkspace/xcuserdata
samples/client/petstore/qt5cpp/build-*
samples/client/petstore/qt5cpp/PetStore/PetStore
samples/client/petstore/qt5cpp/PetStore/Makefile
samples/client/petstore/java/hello.txt
samples/client/petstore/android-java/hello.txt
samples/client/petstore/objc/SwaggerClientTests/Build
samples/client/petstore/objc/SwaggerClientTests/Pods
samples/client/petstore/objc/SwaggerClientTests/SwaggerClient.xcworkspace
samples/client/petstore/objc/SwaggerClientTests/Podfile.lock
samples/server/petstore/nodejs/node_modules
target
.idea
.lib
atlassian-ide-plugin.xml
.DS_Store
packages/
.pub
.packages
samples/client/petstore/php/SwaggerClient-php/composer.lock
samples/client/petstore/php/SwaggerClient-php/vendor/
samples/client/petstore/silex/SwaggerServer/composer.lock
samples/client/petstore/silex/SwaggerServer/venodr/
samples/client/petstore/python/.projectile
samples/client/petstore/python/.venv/
*/.settings

View File

@@ -1,3 +1,5 @@
language: scala
scala:
- 2.10.2
sudo: false
language: java
script: mvn verify -Psamples
jdk:
- oraclejdk7

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM maven:3.3-jdk-7
WORKDIR /src
VOLUME /src
VOLUME /root/.m2/repository
ADD . /opt/swagger-codegen
RUN cd /opt/swagger-codegen && mvn package
ENTRYPOINT ["java", "-jar", "/opt/swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"]
CMD ["help"]

11
LICENSE Normal file
View File

@@ -0,0 +1,11 @@
Copyright 2015 SmartBear Software
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.

521
README.md
View File

@@ -1,230 +1,463 @@
# Swagger Code Generator
[![Build Status](https://travis-ci.org/wordnik/swagger-codegen.png)](https://travis-ci.org/wordnik/swagger-codegen)
[![Build Status](https://travis-ci.org/swagger-api/swagger-codegen.png)](https://travis-ci.org/swagger-api/swagger-codegen)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project)
## 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.
This is the swagger codegen project, which allows generation of client libraries automatically from a Swagger-compliant server.
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.
# Table of contents
- [Swagger Code Generator](#swagger-code-generator)
- [Overview](#overview)
- [Table of Contents](#table-of-contents)
- Installation
- [Build and run using docker](#build-and-run-using-docker)
- [Build a nodejs server stub](#build-a-nodejs-server-stub)
- [Compatibility](#compatibility)
- [Prerequisites](#prerequisites)
- [OS X Users](#os-x-users)
- [Building](#building)
- Generators
- [To generate a sample client library](#to-generate-a-sample-client-library)
- [Generating libraries from your server](#generating-libraries-from-your-server)
- [Modifying the client library format](#modifying-the-client-library-format)
- [Making your own codegen modules](#making-your-own-codegen-modules)
- [Where is Javascript???](#where-is-javascript)
- [Generating a client from local files](#generating-a-client-from-local-files)
- [Customizing the generator](#customizing-the-generator)
- [Validating your swagger spec](#validating-your-swagger-spec)
- [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation)
- [Generating static html api documentation](#generating-static-html-api-documentation)
- [To build a server stub](#to-build-a-server-stub)
- [node.js](#nodejs)
- [rails-grape](#rails-grape)
- [scala scalatra](#scala-scalatra)
- [java jax-rs](#java-jax-rs)
- [java spring-mvc](#java-spring-mvc)
- [To build the codegen library](#to-build-the-codegen-library)
- [License](#license)
## Build and run using docker
```
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
./run-in-docker.sh mvn package
```
## Build a nodejs server stub
```
./run-in-docker.sh generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l nodejs \
-o samples/server/petstore/nodejs
```
## Compatibility
The Swagger Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilies with the swagger specification:
Swagger Codegen Version | Release Date | Swagger Spec compatibility | Notes
-------------------------- | ------------ | -------------------------- | -----
2.1.5-SNAPSHOT | | 1.0, 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-codegen)
2.1.4 (**current stable**) | 2015-10-25 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.4](https://github.com/swagger-api/swagger-codegen/tree/v2.1.3)
2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.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.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!
* [Java 7](http://java.oracle.com)
* [Apache maven 3.0.3 or greater](http://maven.apache.org/)
#### OS X Users
Don't forget to install Java 7. You probably have 1.6 or 1.8.
* [Scala 2.9.1](http://www.scala-lang.org)
* [sbt (only download if you're building on Windows)](http://www.scala-sbt.org/)
You also need to add the scala binary to your PATH.
After cloning the project, you need to build it from source with this command:
Export JAVA_HOME in order to user proper Java version:
```
./sbt assembly
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
export PATH=${JAVA_HOME}/bin:$PATH
```
or for Windows...
#### Building
After cloning the project, you can build it from source with this command:
```
sbt assembly
mvn package
```
### To generate a sample client library
You can build a client against Wordnik's [petstore](http://petstore.swagger.wordnik.com) API as follows:
You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows:
```
./bin/scala-petstore.sh
./bin/java-petstore.sh
```
This will run the script in [samples/client/petstore/ScalaPetstoreCodegen.scala](https://github.com/wordnik/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) and create the client. You can then
compile and run the client, as well as unit tests against it:
This will run the generator with this command:
```
cd samples/client/petstore/scala
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l java \
-o samples/client/petstore/java
```
With a number of options. You can get the options with the `help generate` command:
```
NAME
swagger generate - Generate code with chosen lang
SYNOPSIS
swagger generate [(-a <authorization> | --auth <authorization>)]
[(-c <configuration file> | --config <configuration file>)]
[-D <system properties>]
(-i <spec file> | --input-spec <spec file>)
(-l <language> | --lang <language>)
[(-o <output directory> | --output <output directory>)]
[(-t <template directory> | --template-dir <template directory>)]
[(-v | --verbose)]
[(-s | --skip-overwrite)]
OPTIONS
-a <authorization>, --auth <authorization>
adds authorization headers when fetching the swagger definitions
remotely. Pass in a URL-encoded string of name:header with a comma
separating multiple values
-c <configuration file>, --config <configuration file>
Path to json configuration file. File content should be in a json
format {"optionKey":"optionValue", "optionKey1":"optionValue1"...}
Supported options can be different for each language. Run
config-help -l {lang} command for language specific config options.
-D <system properties>
sets specified system properties in the format of
name=value,name=value
-i <spec file>, --input-spec <spec file>
location of the swagger spec, as URL or file (required)
-l <language>, --lang <language>
client language to generate (maybe class name in classpath,
required)
-o <output directory>, --output <output directory>
where to write the generated files (current dir by default)
-t <template directory>, --template-dir <template directory>
folder containing the template files
-v, --verbose
verbose mode
-s , --skip-overwrite
specifies if the existing files should be overwritten during
the generation
```
You can then compile and run the client, as well as unit tests against it:
```
cd samples/client/petstore/java
mvn package
```
Other languages have petstore samples, too:
```
./bin/flash-petstore.sh
./bin/android-petstore.sh
./bin/java-petstore.sh
./bin/objc-petstore.sh
./bin/php-petstore.sh
./bin/python-petstore.sh
./bin/python3-petstore.sh
./bin/ruby-petstore.sh
```
### Generating libraries from your server
It's just as easy--you can either run the default generators:
```
./bin/runscala.sh com.wordnik.swagger.codegen.BasicScalaGenerator http://petstore.swagger.wordnik.com/api/api-docs special-key
```
Replace `Scala` with `Flash`, `Java`, `Objc`, `PHP`, `Python`, `Python3`, `Ruby`.
You will probably want to override some of the defaults--like packages, etc. For doing this, just create a scala
script with the overrides you want. Follow [ScalaPetstoreCodegen](https://github.com/wordnik/swagger-codegen/blob/master/samples/client/petstore/scala/ScalaPetstoreCodegen.scala) as an example:
For example, create `src/main/scala/MyCodegen.scala` with these contents:
```scala
import com.wordnik.swagger.codegen.BasicScalaGenerator
object MyCodegen extends BasicScalaGenerator {
def main(args: Array[String]) = generateClient(args)
// location of templates
override def templateDir = "scala"
// where to write generated code
override def destinationDir = "client/scala/src/main/scala"
// api invoker package
override def invokerPackage = "com.myapi.client"
// package for models
override def modelPackage = Some("com.myapi.client.model")
// package for api classes
override def apiPackage = Some("com.myapi.client.api")
// supporting classes
override def supportingFiles = List(
("apiInvoker.mustache", destinationDir + java.io.File.separator + packageName.replaceAll("\\.", java.io.File.separator), "ApiInvoker.scala"),
("pom.mustache", destinationDir, "pom.xml")
)
}
```
Now you can generate your client like this:
```
./bin/runscala.sh src/main/scala/MyCodegen.scala http://my.api.com/resources.json super-secret-key
```
w00t! Thanks to the scala interpretor, you didn't even need to recompile.
It's just as easy--just use the `-i` flag to point to either a server or file.
### Modifying the client library format
Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen
processes mustache templates with the [scalate](http://scalate.fusesource.org/) engine. You can modify our templates or
make your own.
Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen processes mustache templates with the [jmustache](https://github.com/samskivert/jmustache) engine. You can modify our templates or make your own.
You can look at `src/main/resources/${your-language}` for examples. To make your own templates, create your own files
and override the `templateDir` in your script to point to the right place. It actually is that easy.
You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your template folder. It actually is that easy.
### Making your own codegen modules
If you're starting a project with a new language and don't see what you need, swagger-codegen can help you create a project to generate your own libraries:
```
java -jar modules/swagger-codegen-distribution/target/swagger-codegen-cli.jar meta \
-o output/myLibrary -n myClientCodegen -p com.my.company.codegen
```
This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic.
### 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)
#### Generating a client from local files
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
-i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json
```
Or for example:
Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane.
### Selective generation
You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output:
The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated:
```
./bin/java-petstore-filemap.sh
# generate only models
java -Dmodels {opts}
# generate only apis
java -Dapis {opts}
# generate only supporting files
java -DsupportingFiles
# generate models and supporting files
java -Dmodels -DsupportingFiles
```
Which simple passes `-DfileMap=src/test/resources/petstore` as an argument. Great for creating libraries on your
ci server... or while coding on an airplane.
To control the specific files being generated, you can pass a CSV list of what you want:
```
# generate the User and Pet models only
-Dmodels=User,Pet
# generate the User model and the supportingFile `StringUtil.java`:
-Dmodels=User -DsupportingFiles=StringUtil.java
```
When using selective generation, _only_ the templates needed for the specific generation will be used.
### Customizing the generator
There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc:
```
$ ls -1 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/
AbstractTypeScriptClientCodegen.java
AkkaScalaClientCodegen.java
AndroidClientCodegen.java
AsyncScalaClientCodegen.java
CSharpClientCodegen.java
CsharpDotNet2ClientCodegen.java
DartClientCodegen.java
FlashClientCodegen.java
JavaClientCodegen.java
JavaInflectorServerCodegen.java
JaxRSServerCodegen.java
NodeJSServerCodegen.java
ObjcClientCodegen.java
PerlClientCodegen.java
PhpClientCodegen.java
PythonClientCodegen.java
Qt5CPPGenerator.java
RubyClientCodegen.java
ScalaClientCodegen.java
ScalatraServerCodegen.java
SilexServerCodegen.java
SinatraServerCodegen.java
SpringMVCServerCodegen.java
StaticDocCodegen.java
StaticHtmlGenerator.java
SwaggerGenerator.java
SwaggerYamlGenerator.java
SwiftCodegen.java
TizenClientCodegen.java
TypeScriptAngularClientCodegen.java
TypeScriptNodeClientCodegen.java
```
Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc. you can use a json config file to pass the values.
```
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l java \
-o samples/client/petstore/java \
-c path/to/config.json
```
Supported config options can be different per language. Running `config-help -l {lang}` will show available options.
```
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java
```
Output
```
CONFIG OPTIONS
modelPackage
package for generated models
apiPackage
package for generated api classes
sortParamsByRequiredFlag
Sort method arguments to place required parameters before optional parameters. Default: true
invokerPackage
root package for generated code
groupId
groupId in generated pom.xml
artifactId
artifactId in generated pom.xml
artifactVersion
artifact version in generated pom.xml
sourceFolder
source folder for generated code
localVariablePrefix
prefix for generated code members and local variables
serializableModel
boolean - toggle "implements Serializable" for generated models
library
library template (sub-template) to use:
<default> - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2
jersey2 - HTTP client: Jersey client 2.6
okhttp-gson - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1
retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
```
Your config file for java can look like
```
{
"groupId":"com.my.company",
"artifactId":"MyClent",
"artifactVersion":"1.2.0"
}
```
For all the unspecified options default values will be used.
Another way to override default options is to extend config class for specific language.
To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java:
```
package com.mycompany.swagger.codegen;
import io.swagger.codegen.languages.*;
public class MyObjcCodegen extends ObjcClientCodegen {
static {
PREFIX = "HELO";
}
}
```
and specify the `classname` when running the generator:
```
-l com.mycompany.swagger.codegen.MyObjcCodegen
```
Your subclass will now be loaded and overrides the `PREFIX` value in the superclass.
### Validating your swagger spec
You can use the validation tool to see that your server is creating a proper spec file. If you want to learn
more about the spec file and format, please see [swagger-core](https://github.com/wordnik/swagger-core/wiki). This
tool will read the server and generate a report of any violations of the spec. If there are violations, the
client codegen and ui may not work correctly.
To validate an api and write output to ./swagger-errors.html:
You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example:
http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json
### Generating dynamic html api documentation
To do so, just use the `-l dynamic-html` flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation:
```
./bin/validate.sh http://petstore.swagger.wordnik.com/api/api-docs "specia-key" ./swagger-errors.html
cd samples/dynamic-html/
npm install
node .
```
### 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.
Which launches a node.js server so the AJAX calls have a place to go.
### Generating static html api documentation
To do so, just use the `-l html` flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem:
```
./bin/static-docs.sh
cd samples/html/
open index.html
```
Will produce the output here:
```
https://github.com/wordnik/swagger-codegen/tree/master/samples/docs/swagger-static-docs
```
which is based on these templates:
```
https://github.com/wordnik/swagger-codegen/tree/master/src/main/resources/swagger-static
```
and looks like this
![Image](https://raw.github.com/wordnik/swagger-codegen/master/samples/docs/swagger-static-docs/static-docs.png)
### 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)
### node.js
* [ruby sinatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/sinatra)
* [scala scalatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/scalatra)
* [java jax-rs generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/java-jaxrs)
### Migrating from Swagger 1.1 to 1.2 format
If you've spent time hand-crafting your swagger spec files, you can use the [SpecConverter](https://github.com/wordnik/swagger-codegen/blob/master/src/main/scala/com/wordnik/swagger/codegen/SpecConverter.scala) to do the dirty work. For example:
```bash
$ ./bin/update-spec.sh http://developer.wordnik.com/v4/resources.json wordnik-developer
writing file wordnik-developer/api-docs
calling: http://developer.wordnik.com/v4/account.json
calling: http://developer.wordnik.com/v4/word.json
calling: http://developer.wordnik.com/v4/words.json
calling: http://developer.wordnik.com/v4/wordList.json
calling: http://developer.wordnik.com/v4/wordLists.json
writing file wordnik-developer/account
writing file wordnik-developer/word
writing file wordnik-developer/words
writing file wordnik-developer/wordList
writing file wordnik-developer/wordLists
```
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l nodejs \
-o samples/server/petstore/nodejs
```
Will read the 1.1 spec from wordnik developer and write it into the folder called `wordnik-developer`.
### rails-grape
*Not yet migrated to this branch*
### scala scalatra
```
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l scalatra \
-o samples/server/petstore/scalatra
```
### java jax-rs
```
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l jaxrs \
-o samples/server/petstore/jaxrs
```
### java spring-mvc
```
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l spring-mvc \
-o samples/server/petstore/spring-mvc
```
### To build the codegen library
This will create the swagger-codegen library from source.
```
./sbt assembly
mvn package
```
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!
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 specify a path to your scripts
License
-------
Copyright 2013 Wordnik, Inc.
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +0,0 @@
val version = scala.util.Properties.scalaPropOrElse("version.number", "unknown").toString match {
case "2.10.0" => "2.10"
case "2.10.2" => "2.10"
case "2.10.3" => "2.10"
case e: String => e
}
println(version)

31
bin/akka-scala-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/akka-scala -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l akka-scala -o samples/client/petstore/akka-scala"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -18,20 +18,29 @@ if [ ! -d "${APP_DIR}" ]; then
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/akka-scala-petstore.sh
./bin/android-java-petstore.sh
./bin/csharp-petstore.sh
./bin/flash-petstore.sh
./bin/dynamic-html.sh
./bin/html-petstore.sh
./bin/java-petstore.sh
./bin/java-petstore-jersey2.sh
./bin/java-petstore-okhttp-gson.sh
./bin/java-petstore-retrofit.sh
./bin/jaxrs-petstore-server.sh
./bin/nodejs-petstore-server.sh
./bin/objc-petstore.sh
./bin/perl-petstore.sh
./bin/php-petstore.sh
./bin/python-petstore.sh
./bin/python3-petstore.sh
./bin/qt5-petstore.sh
./bin/ruby-petstore.sh
./bin/scala-async-petstore.sh
./bin/scala-petstore.sh
./bin/scalatra-petstore-server.sh
./bin/silex-petstore-server.sh
./bin/spring-mvc-petstore-server.sh
./bin/swift-petstore.sh
./bin/tizen-petstore.sh
./bin/typescript-angular-petstore.sh
./bin/typescript-node-petstore.sh

24
bin/all-wordnik.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/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/android-java-wordnik-api.sh
./bin/java-wordnik-api.sh
./bin/objc-wordnik-api.sh
./bin/scala-wordnik-api.sh

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/android-java -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l android -o samples/client/petstore/android-java"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l android -o samples/client/wordnik/android-java"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

31
bin/csharp-dotnet2-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l CsharpDotNet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l csharp -o samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

31
bin/dart-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l dart -o samples/client/petstore/dart"
java $JAVA_OPTS -jar $executable $ags

31
bin/dynamic-html.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l dynamic-html -o samples/dynamic-html"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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"
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/flash -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l flash -o samples/client/petstore/flash"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

31
bin/html-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l html -o samples/html"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/JavaInflector -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l inflector -o samples/server/petstore/java-inflector"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,32 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DfileMap=src/test/resources/petstore-1.1/resources.json -DloggerPath=conf/log4j.properties"
ags="$@ samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

View File

@@ -0,0 +1,4 @@
{
"library": "jersey2",
"artifactId": "swagger-petstore-jersey2"
}

31
bin/java-petstore-jersey2.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l java -c bin/java-petstore-jersey2.json -o samples/client/petstore/java/jersey2"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -0,0 +1,4 @@
{
"library": "okhttp-gson",
"artifactId": "swagger-petstore-okhttp-gson"
}

View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -0,0 +1,4 @@
{
"library": "retrofit",
"artifactId": "swagger-petstore-retrofit"
}

31
bin/java-petstore-retrofit.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l java -c bin/java-petstore-retrofit.json -o samples/client/petstore/java/retrofit"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l java -o samples/client/petstore/java/default"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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"
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l java -o samples/client/wordnik/java"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

31
bin/jaxrs-petstore-server.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l jaxrs -o samples/server/petstore/jaxrs -Dswagger.codegen.jaxrs.impl.source=src/main/java"
java $JAVA_OPTS -jar $executable $ags

31
bin/nodejs-petstore-server.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l nodejs -o samples/server/petstore/nodejs"
java $JAVA_OPTS -Dservice -jar $executable $ags

View File

@@ -1,9 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
version="$(scala ./bin/Version.scala)"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -20,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ samples/client/petstore/objc/ObjcPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/objc -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l objc -o samples/client/petstore/objc"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
ags="$@ samples/client/wordnik-api/objc/ObjcWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l objc -o samples/client/wordnik/objc"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

31
bin/perl-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl -o samples/client/petstore/perl"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ samples/client/petstore/php/PHPPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/php -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l php -o samples/client/petstore/php"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,32 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files/resources.json"
ags="$@ samples/client/wordnik-api/php/PHPWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ samples/client/petstore/python/PythonPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/python -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l python -o samples/client/petstore/python"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,32 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files/resources.json"
ags="$@ samples/client/wordnik-api/python/PythonWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

View File

@@ -1,32 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ samples/client/petstore/python3/Python3PetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

View File

@@ -1,32 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files/resources.json"
ags="$@ samples/client/wordnik-api/python3/Python3WordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

31
bin/qt5-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/qt5cpp -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l qt5cpp -o samples/client/petstore/qt5cpp"
java $JAVA_OPTS -jar $executable $ags

5
bin/ruby-petstore.json Normal file
View File

@@ -0,0 +1,5 @@
{
"gemName": "petstore",
"moduleName": "Petstore",
"gemVersion": "1.0.0"
}

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ samples/client/petstore/ruby/RubyPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/ruby -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,32 +0,0 @@
#!/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="$@"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

31
bin/scala-async-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/asyncscala -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l async-scala -o samples/client/petstore/async-scala"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,31 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
ags="com.wordnik.swagger.codegen.ScalaAsyncClientGenerator $@"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ samples/client/petstore/scala/ScalaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/scala -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l scala -o samples/client/petstore/scala"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,7 +1,6 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
@@ -18,15 +17,15 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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"
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l scala -o samples/client/wordnik/scala"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi
java $JAVA_OPTS -jar $executable $ags

31
bin/scalatra-petstore-server.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/scalatra -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l scalatra -o samples/server/petstore/scalatra"
java $JAVA_OPTS -jar $executable $ags

31
bin/silex-petstore-server.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/silex -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l silex -o samples/server/petstore/silex"
java $JAVA_OPTS -jar $executable $ags

31
bin/sinatra-petstore-server.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/sinatra -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l sinatra -o samples/server/petstore/sinatra"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/JavaSpringMVC -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l spring-mvc -o samples/server/petstore/spring-mvc"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,32 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
ags="$@ SwaggerDocGenerator http://developer.wordnik.com/v4/resources.json"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

4
bin/swift-petstore.json Normal file
View File

@@ -0,0 +1,4 @@
{
"projectName": "PetstoreClient",
"responseAs": "PromiseKit"
}

31
bin/swift-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/swift -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l swift -c ./bin/swift-petstore.json -o samples/client/petstore/swift"
java $JAVA_OPTS -jar $executable $ags

31
bin/tizen-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -t modules/swagger-codegen/src/main/resources/tizen -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l tizen -o samples/client/petstore/tizen"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular -o samples/client/petstore/typescript-angular"
java $JAVA_OPTS -jar $executable $ags

31
bin/typescript-node-petstore.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/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
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# 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="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-node -o samples/client/petstore/typescript-node"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -1,31 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
ags="com.wordnik.swagger.codegen.SpecConverter $@"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

View File

@@ -1,31 +0,0 @@
#!/bin/sh
SCRIPT="$0"
SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala)
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
cd $APP_DIR
# if you've executed sbt assembly previously it will use that instead.
ags="com.wordnik.swagger.codegen.spec.Validator $@"
if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar ]; then
scala -cp target/scala-$SCALA_RUNNER_VERSION/swagger-codegen.jar $ags
else
echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly"
fi

View File

@@ -1,56 +0,0 @@
fs = require('fs')
yaml = require('js-yaml')
var args = process.argv.splice(2);
if(args.length == 0) {
process.exit(1);
}
var arg0 = args[0];
var outputdir = ".";
if(args.length > 1) {
outputdir = args[1];
}
var file = fs.lstatSync(arg0);
if(file.isFile()) {
convert(arg0, outputdir);
}
else if (file.isDirectory()) {
var files = fs.readdirSync(arg0);
files.map(function(item) {
var filename = arg0 + "/" + item;
var file = fs.lstatSync(filename);
if(file.isFile()) {
convert(filename, outputdir);
}
});
}
function convert(filename, outputdir) {
console.log("converting " + filename);
fs.readFile(filename, "utf8", function (err, data) {
if(err) {
console.log(err);
}
else {
try {
var js = yaml.load(data);
var prettyJs = JSON.stringify(js, undefined, 2);
var outputFilename = outputdir + "/" + filename.split("/").pop().replace(".yml", "") + ".json";
console.log("writing to " + outputFilename);
fs.writeFile(outputFilename, prettyJs, function(err) {
if(err) {
console.log(err);
}
});
}
catch (err) {
console.log(err);
}
}
});
}

133
build.sbt
View File

@@ -1,133 +0,0 @@
import xml.Group
import AssemblyKeys._
organization := "com.wordnik"
name := "swagger-codegen"
version := "2.0.13"
scalaVersion := "2.10.1"
crossVersion := CrossVersion.full
javacOptions ++= Seq("-target", "1.6", "-source", "1.6", "-Xlint:unchecked", "-Xlint:deprecation")
scalacOptions ++= Seq("-optimize", "-unchecked", "-deprecation", "-Xcheckinit", "-encoding", "utf8")
crossScalaVersions := Seq("2.9.0", "2.9.0-1", "2.9.1", "2.9.1-1", "2.9.2", "2.9.3", "2.10.0", "2.10.1", "2.10.2")
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-jackson" % "3.2.5",
"io.backchat.inflector" %% "scala-inflector" % "1.3.5",
"commons-io" % "commons-io" % "2.3",
"ch.qos.logback" % "logback-classic" % "1.0.13" % "provided",
"org.rogach" %% "scallop" % "0.8.1",
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "1.9.1" % "test"
)
libraryDependencies <+= scalaVersion {
case v if v.startsWith("2.9") =>
"org.fusesource.scalate" % "scalate-core_2.9" % "1.6.1"
case v if v.startsWith("2.10") => {
"org.fusesource.scalate" %% "scalate-core" % "1.6.1"
}
}
libraryDependencies ++= {
scalaVersion.toString match {
case v if v.startsWith("2.10") => Seq("org.scala-lang" % "scala-reflect" % v)
case _ => Seq()
}
}
packageOptions <+= (name, version, organization) map {
(title, version, vendor) =>
Package.ManifestAttributes(
"Created-By" -> "Simple Build Tool",
"Built-By" -> System.getProperty("user.name"),
"Build-Jdk" -> System.getProperty("java.version"),
"Specification-Title" -> title,
"Specification-Version" -> version,
"Specification-Vendor" -> vendor,
"Implementation-Title" -> title,
"Implementation-Version" -> version,
"Implementation-Vendor-Id" -> vendor,
"Implementation-Vendor" -> vendor
)
}
publishTo <<= (version) { version: String =>
if (version.trim.endsWith("SNAPSHOT"))
Some("Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
else
Some("Sonatype Nexus Releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
//publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))
artifact in (Compile, assembly) ~= { art =>
art.copy(`classifier` = Some("assembly"))
}
addArtifact(artifact in (Compile, assembly), assembly)
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { x => false }
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
homepage := Some(new URL("https://github.com/wordnik/swagger-codegen"))
parallelExecution in Test := false
startYear := Some(2009)
licenses := Seq(("Apache License 2.0", new URL("http://www.apache.org/licenses/LICENSE-2.0.html")))
pomExtra <<= (pomExtra, name, description) {(pom, name, desc) => pom ++ Group(
<scm>
<connection>scm:git:git@github.com:wordnik/swagger-codegen.git</connection>
<developerConnection>scm:git:git@github.com:wordnik/swagger-codegen.git</developerConnection>
<url>https://github.com/wordnik/swagger-codegen</url>
</scm>
<issueManagement>
<system>github</system>
<url>https://github.com/wordnik/swagger-codegen/issues</url>
</issueManagement>
<developers>
<developer>
<id>rpidikiti</id>
<name>Ramesh Pidikiti</name>
<email>ramesh@wordnik.com</email>
</developer>
<developer>
<id>ayush</id>
<name>Ayush Gupta</name>
<email>ayush@glugbot.com</email>
</developer>
<developer>
<id>fehguy</id>
<name>Tony Tam</name>
<email>fehguy@gmail.com</email>
</developer>
<developer>
<id>casualjim</id>
<name>Ivan Porto Carrero</name>
<url>http://flanders.co.nz/</url>
</developer>
<developer>
<id>radius314</id>
<name>Danny Gershman</name>
<email>danny.gershman@gmail.com</email>
</developer>
</developers>
)}
assemblySettings
jarName in assembly := "swagger-codegen.jar"

View File

@@ -1,124 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<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>

View File

@@ -1,29 +0,0 @@
<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>

View File

@@ -0,0 +1,103 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-project</artifactId>
<version>2.1.4</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swagger-codegen-cli</artifactId>
<packaging>jar</packaging>
<name>swagger-codegen (executable)</name>
<build>
<finalName>swagger-codegen-cli</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>logback.xml</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>io.swagger.codegen.SwaggerCodegen</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>process-resources</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>false</minimizeJar>
<createDependencyReducedPom>true</createDependencyReducedPom>
<dependencyReducedPomLocation>
${java.io.tmpdir}/dependency-reduced-pom.xml
</dependencyReducedPomLocation>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen</artifactId>
<version>${project.version}</version>
</dependency>
<!--https://github.com/airlift/airline-->
<dependency>
<groupId>io.airlift</groupId>
<artifactId>airline</artifactId>
<version>0.7</version>
</dependency>
<dependency>
<groupId>com.googlecode.lambdaj</groupId>
<artifactId>lambdaj</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>${jmockit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,37 @@
package io.swagger.codegen;
import io.airlift.airline.Cli;
import io.airlift.airline.Help;
import io.swagger.codegen.cmd.ConfigHelp;
import io.swagger.codegen.cmd.Generate;
import io.swagger.codegen.cmd.Langs;
import io.swagger.codegen.cmd.Meta;
/**
* User: lanwen
* Date: 24.03.15
* Time: 17:56
* <p>
* Command line interface for swagger codegen
* use `swagger-codegen-cli.jar help` for more info
*
* @since 2.1.3-M1
*/
public class SwaggerCodegen {
public static void main(String[] args) {
Cli.CliBuilder<Runnable> builder = Cli.<Runnable>builder("swagger")
.withDescription("Swagger code generator CLI. More info on swagger.io")
.withDefaultCommand(Langs.class)
.withCommands(
Generate.class,
Meta.class,
Langs.class,
Help.class,
ConfigHelp.class
);
builder.build().parse(args).run();
}
}

View File

@@ -0,0 +1,27 @@
package io.swagger.codegen.cmd;
import io.airlift.airline.Command;
import io.airlift.airline.Option;
import io.swagger.codegen.CliOption;
import io.swagger.codegen.CodegenConfig;
import io.swagger.codegen.CodegenConfigLoader;
@Command(name = "config-help", description = "Config help for chosen lang")
public class ConfigHelp implements Runnable {
@Option(name = {"-l", "--lang"}, title = "language", required = true,
description = "language to get config help for")
private String lang;
@Override
public void run() {
System.out.println();
CodegenConfig config = CodegenConfigLoader.forName(lang);
System.out.println("CONFIG OPTIONS");
for (CliOption langCliOption : config.cliOptions()) {
System.out.println("\t" + langCliOption.getOpt());
System.out.println("\t " + langCliOption.getDescription().replaceAll("\n", "\n\t "));
System.out.println();
}
}
}

View File

@@ -0,0 +1,249 @@
package io.swagger.codegen.cmd;
import io.airlift.airline.Command;
import io.airlift.airline.Option;
import io.swagger.codegen.ClientOptInput;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.DefaultGenerator;
import io.swagger.codegen.cmd.utils.OptionUtils;
import io.swagger.codegen.config.CodegenConfigurator;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
/**
* User: lanwen
* Date: 24.03.15
* Time: 20:22
*/
@Command(name = "generate", description = "Generate code with chosen lang")
public class Generate implements Runnable {
public static final Logger LOG = LoggerFactory.getLogger(Generate.class);
@Option(name = {"-v", "--verbose"}, description = "verbose mode")
private Boolean verbose;
@Option(name = {"-l", "--lang"}, title = "language", required = true,
description = "client language to generate (maybe class name in classpath, required)")
private String lang;
@Option(name = {"-o", "--output"}, title = "output directory",
description = "where to write the generated files (current dir by default)")
private String output = "";
@Option(name = {"-i", "--input-spec"}, title = "spec file", required = true,
description = "location of the swagger spec, as URL or file (required)")
private String spec;
@Option(name = {"-t", "--template-dir"}, title = "template directory",
description = "folder containing the template files")
private String templateDir;
@Option(name = {"-a", "--auth"}, title = "authorization",
description = "adds authorization headers when fetching the swagger definitions remotely. " +
"Pass in a URL-encoded string of name:header with a comma separating multiple values")
private String auth;
@Option(name = {"-D"}, title = "system properties", description = "sets specified system properties in " +
"the format of name=value,name=value")
private String systemProperties;
@Option(name = {"-c", "--config"}, title = "configuration file", description = "Path to json configuration file. " +
"File content should be in a json format {\"optionKey\":\"optionValue\", \"optionKey1\":\"optionValue1\"...} " +
"Supported options can be different for each language. Run config-help -l {lang} command for language specific config options.")
private String configFile;
@Option(name = {"-s", "--skip-overwrite"}, title = "skip overwrite", description = "specifies if the existing files should be " +
"overwritten during the generation.")
private Boolean skipOverwrite;
@Option(name = {"--api-package"}, title = "api package", description = CodegenConstants.API_PACKAGE_DESC)
private String apiPackage;
@Option(name = {"--model-package"}, title = "model package", description = CodegenConstants.MODEL_PACKAGE_DESC)
private String modelPackage;
@Option(name = {"--instantiation-types"}, title = "instantiation types", description = "sets instantiation type mappings in the format of type=instantiatedType,type=instantiatedType." +
"For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code.")
private String instantiationTypes;
@Option(name = {"--type-mappings"}, title = "type mappings", description = "sets mappings between swagger spec types and generated code types " +
"in the format of swaggerType=generatedType,swaggerType=generatedType. For example: array=List,map=Map,string=String")
private String typeMappings;
@Option(name = {"--additional-properties"}, title = "additional properties", description = "sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value")
private String additionalProperties;
@Option(name = {"--language-specific-primitives"}, title = "language specific primitives",
description = "specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double")
private String languageSpecificPrimitives;
@Option(name = {"--import-mappings"}, title = "import mappings",
description = "specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import")
private String importMappings;
@Option(name = {"--invoker-package"}, title = "invoker package", description = CodegenConstants.INVOKER_PACKAGE_DESC)
private String invokerPackage;
@Option(name = {"--group-id"}, title = "group id", description = CodegenConstants.GROUP_ID_DESC)
private String groupId;
@Option(name = {"--artifact-id"}, title = "artifact id", description = CodegenConstants.ARTIFACT_ID_DESC)
private String artifactId;
@Option(name = {"--artifact-version"}, title = "artifact version", description = CodegenConstants.ARTIFACT_VERSION_DESC)
private String artifactVersion;
@Option(name = {"--library"}, title = "library", description = CodegenConstants.LIBRARY_DESC)
private String library;
@Override
public void run() {
//attempt to read from config file
CodegenConfigurator configurator = CodegenConfigurator.fromFile(configFile);
//if a config file wasn't specified or we were unable to read it
if(configurator == null) {
//createa a fresh configurator
configurator = new CodegenConfigurator();
}
//now override with any specified parameters
if (verbose != null) {
configurator.setVerbose(verbose);
}
if(skipOverwrite != null) {
configurator.setSkipOverwrite(skipOverwrite);
}
if(isNotEmpty(spec)) {
configurator.setInputSpec(spec);
}
if(isNotEmpty(lang)) {
configurator.setLang(lang);
}
if(isNotEmpty(output)) {
configurator.setOutputDir(output);
}
if(isNotEmpty(auth)) {
configurator.setAuth(auth);
}
if(isNotEmpty(templateDir)) {
configurator.setTemplateDir(templateDir);
}
if(isNotEmpty(apiPackage)) {
configurator.setApiPackage(apiPackage);
}
if(isNotEmpty(modelPackage)) {
configurator.setModelPackage(modelPackage);
}
if(isNotEmpty(invokerPackage)) {
configurator.setInvokerPackage(invokerPackage);
}
if(isNotEmpty(groupId)) {
configurator.setGroupId(groupId);
}
if(isNotEmpty(artifactId)) {
configurator.setArtifactId(artifactId);
}
if(isNotEmpty(artifactVersion)) {
configurator.setArtifactVersion(artifactVersion);
}
if(isNotEmpty(library)) {
configurator.setLibrary(library);
}
setSystemProperties(configurator);
setInstantiationTypes(configurator);
setImportMappings(configurator);
setTypeMappings(configurator);
setAdditionalProperties(configurator);
setLanguageSpecificPrimitives(configurator);
final ClientOptInput clientOptInput = configurator.toClientOptInput();
new DefaultGenerator().opts(clientOptInput).generate();
}
private void setSystemProperties(CodegenConfigurator configurator) {
final Map<String, String> map = createMapFromKeyValuePairs(systemProperties);
for (Map.Entry<String, String> entry : map.entrySet()) {
configurator.addSystemProperty(entry.getKey(), entry.getValue());
}
}
private void setInstantiationTypes(CodegenConfigurator configurator) {
final Map<String, String> map = createMapFromKeyValuePairs(instantiationTypes);
for (Map.Entry<String, String> entry : map.entrySet()) {
configurator.addInstantiationType(entry.getKey(), entry.getValue());
}
}
private void setImportMappings(CodegenConfigurator configurator) {
final Map<String, String> map = createMapFromKeyValuePairs(importMappings);
for (Map.Entry<String, String> entry : map.entrySet()) {
configurator.addImportMapping(entry.getKey(), entry.getValue());
}
}
private void setTypeMappings(CodegenConfigurator configurator) {
final Map<String, String> map = createMapFromKeyValuePairs(typeMappings);
for (Map.Entry<String, String> entry : map.entrySet()) {
configurator.addTypeMapping(entry.getKey(), entry.getValue());
}
}
private void setAdditionalProperties(CodegenConfigurator configurator) {
final Map<String, String> map = createMapFromKeyValuePairs(additionalProperties);
for (Map.Entry<String, String> entry : map.entrySet()) {
configurator.addAdditionalProperty(entry.getKey(), entry.getValue());
}
}
private void setLanguageSpecificPrimitives(CodegenConfigurator configurator) {
final Set<String> set = createSetFromCsvList(languageSpecificPrimitives);
for (String item : set) {
configurator.addLanguageSpecificPrimitive(item);
}
}
private Set<String> createSetFromCsvList(String csvProperty) {
final List<String> values = OptionUtils.splitCommaSeparatedList(csvProperty);
return new HashSet<String>(values);
}
private Map createMapFromKeyValuePairs(String commaSeparatedKVPairs) {
final List<Pair<String, String>> pairs = OptionUtils.parseCommaSeparatedTuples(commaSeparatedKVPairs);
Map result = new HashMap();
for (Pair<String, String> pair : pairs) {
result.put(pair.getLeft(), pair.getRight());
}
return result;
}
}

View File

@@ -0,0 +1,23 @@
package io.swagger.codegen.cmd;
import ch.lambdaj.collection.LambdaIterable;
import io.airlift.airline.Command;
import io.swagger.codegen.CodegenConfig;
import static ch.lambdaj.Lambda.on;
import static ch.lambdaj.collection.LambdaCollections.with;
import static java.util.ServiceLoader.load;
/**
* User: lanwen
* Date: 24.03.15
* Time: 20:25
*/
@Command(name = "langs", description = "Shows available langs")
public class Langs implements Runnable {
@Override
public void run() {
LambdaIterable<String> langs = with(load(CodegenConfig.class)).extract(on(CodegenConfig.class).getName());
System.out.printf("Available languages: %s%n", langs);
}
}

View File

@@ -0,0 +1,147 @@
package io.swagger.codegen.cmd;
import ch.lambdaj.function.convert.Converter;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.samskivert.mustache.Mustache;
import io.airlift.airline.Command;
import io.airlift.airline.Option;
import io.swagger.codegen.DefaultGenerator;
import io.swagger.codegen.SupportingFile;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.util.List;
import java.util.Map;
import static ch.lambdaj.collection.LambdaCollections.with;
import static com.google.common.base.Joiner.on;
/**
* User: lanwen
* Date: 24.03.15
* Time: 20:22
*/
@Command(name = "meta", description = "MetaGenerator. Generator for creating a new template set " +
"and configuration for Codegen. The output will be based on the language you " +
"specify, and includes default templates to include.")
public class Meta implements Runnable {
private static final Logger LOG = LoggerFactory.getLogger(Meta.class);
private static final String TEMPLATE_DIR_CLASSPATH = "codegen";
private static final String MUSTACHE_EXTENSION = ".mustache";
@Option(name = {"-o", "--output"}, title = "output directory",
description = "where to write the generated files (current dir by default)")
private String outputFolder = "";
@Option(name = {"-n", "--name"}, title = "name",
description = "the human-readable name of the generator")
private String name = "default";
@Option(name = {"-p", "--package"}, title = "package",
description = "the package to put the main class into (defaults to io.swagger.codegen)")
private String targetPackage = "io.swagger.codegen";
@Override
public void run() {
final File targetDir = new File(outputFolder);
LOG.info("writing to folder [{}]", targetDir.getAbsolutePath());
String mainClass = StringUtils.capitalize(name) + "Generator";
List<SupportingFile> supportingFiles = ImmutableList.of(
new SupportingFile("pom.mustache", "", "pom.xml"),
new SupportingFile("generatorClass.mustache",
on(File.separator).join("src/main/java", asPath(targetPackage)), mainClass.concat(".java")),
new SupportingFile("README.mustache", "", "README.md"),
new SupportingFile("api.template", "src/main/resources" + File.separator + name, "api.mustache"),
new SupportingFile("model.template", "src/main/resources" + File.separator + name, "model.mustache"),
new SupportingFile("services.mustache",
"src/main/resources/META-INF/services", "io.swagger.codegen.CodegenConfig")
);
Map<String, Object> data = new ImmutableMap.Builder<String, Object>()
.put("generatorPackage", targetPackage)
.put("generatorClass", mainClass)
.put("name", name)
.put("fullyQualifiedGeneratorClass", targetPackage + "." + mainClass).build();
with(supportingFiles).convert(processFiles(targetDir, data));
}
/**
* Converter method to process supporting files: execute with mustache,
* or simply copy to destination directory
*
* @param targetDir - destination directory
* @param data - map with additional params needed to process templates
* @return converter object to pass to lambdaj
*/
private Converter<SupportingFile, File> processFiles(final File targetDir, final Map<String, Object> data) {
return new Converter<SupportingFile, File>() {
private DefaultGenerator generator = new DefaultGenerator();
@Override
public File convert(SupportingFile support) {
try {
File destinationFolder = new File(new File(targetDir.getAbsolutePath()), support.folder);
File outputFile = new File(destinationFolder, support.destinationFilename);
String template = generator
.readTemplate(new File(TEMPLATE_DIR_CLASSPATH, support.templateFile).getPath());
String formatted = template;
if (support.templateFile.endsWith(MUSTACHE_EXTENSION)) {
LOG.info("writing file to {}", outputFile.getAbsolutePath());
formatted = Mustache.compiler().withLoader(loader(generator))
.defaultValue("")
.compile(template)
.execute(data);
} else {
LOG.info("copying file to {}", outputFile.getAbsolutePath());
}
FileUtils.writeStringToFile(outputFile, formatted);
return outputFile;
} catch (IOException e) {
throw new RuntimeException("Can't generate project", e);
}
}
};
}
/**
* Creates mustache loader for template using classpath loader
*
* @param generator - class with reader getter
* @return loader for template
*/
private Mustache.TemplateLoader loader(final DefaultGenerator generator) {
return new Mustache.TemplateLoader() {
public Reader getTemplate(String name) {
return generator.getTemplateReader(TEMPLATE_DIR_CLASSPATH
+ File.separator + name.concat(MUSTACHE_EXTENSION));
}
};
}
/**
* Converts package name to path on file system
*
* @param packageName - package name to convert
* @return relative path
*/
private String asPath(String packageName) {
return packageName.replace(".", File.separator);
}
}

View File

@@ -0,0 +1,43 @@
package io.swagger.codegen.cmd.utils;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import java.util.List;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
public class OptionUtils {
public static List<Pair<String, String>> parseCommaSeparatedTuples(String input) {
List<Pair<String, String>> results = new ArrayList<Pair<String, String>>();
final List<String> tuples = splitCommaSeparatedList(input);
for (String tuple : tuples) {
int ix = tuple.indexOf('=');
if (ix > 0 && ix < tuple.length() - 1) {
final Pair<String, String> pair = Pair.of(tuple.substring(0, ix), tuple.substring(ix + 1));
results.add(pair);
}
}
return results;
}
public static List<String> splitCommaSeparatedList(String input) {
List<String> results = new ArrayList<String>();
if(input != null && !input.isEmpty()) {
for (String value : input.split(",")) {
if(isNotEmpty(value))
results.add(value);
}
}
return results;
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>
<logger name="io.swagger" level="debug"/>
<root level="error">
<appender-ref ref="STDOUT"/>
</root>
</configuration>

View File

@@ -0,0 +1,357 @@
package io.swagger.codegen.cmd;
import io.swagger.codegen.ClientOptInput;
import io.swagger.codegen.DefaultGenerator;
import io.swagger.codegen.SwaggerCodegen;
import io.swagger.codegen.config.CodegenConfigurator;
import mockit.Expectations;
import mockit.FullVerifications;
import mockit.Injectable;
import mockit.Mocked;
import mockit.Verifications;
import org.apache.commons.lang3.ArrayUtils;
import org.testng.annotations.Test;
public class GenerateTest {
@Mocked
CodegenConfigurator configurator;
@Injectable
ClientOptInput clientOptInput;
@Mocked
DefaultGenerator generator;
@Test
public void testVerbose() throws Exception {
setupAndRunGenericTest("-v");
new FullVerifications() {{
configurator.setVerbose(true);
times = 1;
}};
setupAndRunGenericTest("--verbose");
new FullVerifications() {{
configurator.setVerbose(true);
times = 1;
}};
}
@Test
public void testRequiredArgs_ShortArgs() throws Exception {
setupAndRunTest("-i", "swagger.yaml", "-l", "java", "-o", "src/main/java", false, null);
new FullVerifications() {{
}};
}
@Test
public void testRequiredArgs_LongArgs() throws Exception {
setupAndRunTest("--input-spec", "swagger.yaml", "--lang", "java", "--output", "src/main/java", false, null);
new FullVerifications() {{
}};
}
@Test
public void testTemplateDir() throws Exception {
final String templateDir = "src/main/resources/customTemplates";
setupAndRunGenericTest("--template-dir", templateDir);
new FullVerifications() {{
configurator.setTemplateDir(templateDir);
times = 1;
}};
setupAndRunGenericTest("-t", templateDir);
new FullVerifications() {{
configurator.setTemplateDir(templateDir);
times = 1;
}};
}
@Test
public void testAuth() throws Exception {
final String auth = "hello:world";
setupAndRunGenericTest("--auth", auth);
new FullVerifications() {{
configurator.setAuth(auth);
times = 1;
}};
setupAndRunGenericTest("-a", auth);
new FullVerifications() {{
configurator.setAuth(auth);
times = 1;
}};
setupAndRunGenericTest();
new FullVerifications() {{
configurator.setAuth(anyString);
times = 0;
}};
}
@Test
public void testSystemProperties() throws Exception {
setupAndRunGenericTest("-D", "hello=world,foo=bar");
new FullVerifications() {{
configurator.addSystemProperty("hello", "world");
times = 1;
configurator.addSystemProperty("foo", "bar");
times = 1;
}};
setupAndRunGenericTest("-D", "hello=world,key=,foo=bar");
new FullVerifications() {{
configurator.addSystemProperty("hello", "world");
times = 1;
configurator.addSystemProperty("foo", "bar");
times = 1;
configurator.addSystemProperty("key", anyString);
times = 0;
}};
}
@Test
public void testConfig() throws Exception {
setupAndRunTest("-i", "swagger.yaml", "-l", "java", "-o", "src/main/java", true, "config.json", "-c", "config.json");
new FullVerifications(){{}};
setupAndRunTest("-i", "swagger.yaml", "-l", "java", "-o", "src/main/java", true, "config.json", "--config", "config.json");
new FullVerifications(){{}};
}
@Test
public void testSkipOverwrite() throws Exception {
setupAndRunGenericTest("-s");
new FullVerifications(){{
configurator.setSkipOverwrite(true); times=1;
}};
setupAndRunGenericTest("--skip-overwrite");
new FullVerifications(){{
configurator.setSkipOverwrite(true); times=1;
}};
}
@Test
public void testApiPackage() throws Exception {
final String value = "io.foo.bar.api";
setupAndRunGenericTest("--api-package", value);
new FullVerifications(){{
configurator.setApiPackage(value); times=1;
}};
}
@Test
public void testModelPackage() throws Exception {
final String value = "io.foo.bar.api";
setupAndRunGenericTest("--model-package", value);
new FullVerifications(){{
configurator.setModelPackage(value); times=1;
}};
}
@Test
public void testInstantiationTypes() throws Exception {
setupAndRunGenericTest("--instantiation-types", "hello=world,key=,foo=bar");
new FullVerifications() {{
configurator.addInstantiationType("hello", "world");
times = 1;
configurator.addInstantiationType("foo", "bar");
times = 1;
configurator.addInstantiationType("key", anyString);
times = 0;
}};
}
@Test
public void testTypeMappings() throws Exception {
setupAndRunGenericTest("--type-mappings", "hello=world,key=,foo=bar");
new FullVerifications() {{
configurator.addTypeMapping("hello", "world");
times = 1;
configurator.addTypeMapping("foo", "bar");
times = 1;
configurator.addTypeMapping("key", anyString);
times = 0;
}};
}
@Test
public void testAdditionalProperties() throws Exception {
setupAndRunGenericTest("--additional-properties", "hello=world,key=,foo=bar");
new FullVerifications() {{
configurator.addAdditionalProperty("hello", "world");
times = 1;
configurator.addAdditionalProperty("foo", "bar");
times = 1;
configurator.addAdditionalProperty("key", anyString);
times = 0;
}};
}
@Test
public void testLanguageSpecificPrimitives() throws Exception {
setupAndRunGenericTest("--language-specific-primitives", "foo,bar,,hello,world");
new FullVerifications() {{
configurator.addLanguageSpecificPrimitive("foo");
times = 1;
configurator.addLanguageSpecificPrimitive("bar");
times = 1;
configurator.addLanguageSpecificPrimitive("hello");
times = 1;
configurator.addLanguageSpecificPrimitive("world");
times = 1;
}};
}
@Test
public void testImportMappings() throws Exception {
setupAndRunGenericTest("--import-mappings", "hello=world,key=,foo=bar");
new FullVerifications() {{
configurator.addImportMapping("hello", "world");
times = 1;
configurator.addImportMapping("foo", "bar");
times = 1;
configurator.addImportMapping("key", anyString);
times = 0;
}};
}
@Test
public void testInvokerPackage() throws Exception {
final String value = "io.foo.bar.api";
setupAndRunGenericTest("--invoker-package", value);
new FullVerifications(){{
configurator.setInvokerPackage(value); times=1;
}};
}
@Test
public void testGroupId() throws Exception {
final String value = "io.foo.bar.api";
setupAndRunGenericTest("--group-id", value);
new FullVerifications(){{
configurator.setGroupId(value); times=1;
}};
}
@Test
public void testArtifactId() throws Exception {
final String value = "awesome-api";
setupAndRunGenericTest("--artifact-id", value);
new FullVerifications(){{
configurator.setArtifactId(value); times=1;
}};
}
@Test
public void testArtifactVersion() throws Exception {
final String value = "1.2.3";
setupAndRunGenericTest("--artifact-version", value);
new FullVerifications(){{
configurator.setArtifactVersion(value); times=1;
}};
}
@Test
public void testLibrary() throws Exception {
final String value = "library1";
setupAndRunGenericTest("--library", value);
new FullVerifications(){{
configurator.setLibrary(value); times=1;
}};
}
private void setupAndRunTest(String specFlag, final String spec, String langFlag, final String lang,
String outputDirFlag, final String outputDir, boolean configuratorFromFile,
final String configFile, String... additionalParameters) {
final String[] commonArgs = {"generate", langFlag, lang, outputDirFlag, outputDir, specFlag, spec};
String[] argsToUse = ArrayUtils.addAll(commonArgs, additionalParameters);
if (configuratorFromFile) {
new Expectations(){{
CodegenConfigurator.fromFile(configFile);
times = 1;
result = configurator;
}};
} else {
new Expectations() {{
CodegenConfigurator.fromFile(anyString);
result = null;
new CodegenConfigurator();
times = 1;
result = configurator;
}};
}
new Expectations() {{
configurator.toClientOptInput();
times = 1;
result = clientOptInput;
new DefaultGenerator();
times = 1;
result = generator;
generator.opts(clientOptInput);
times = 1;
result = generator;
generator.generate();
times = 1;
}};
SwaggerCodegen.main(argsToUse);
new Verifications() {{
configurator.setLang(lang);
times = 1;
configurator.setInputSpec(spec);
times = 1;
configurator.setOutputDir(outputDir);
}};
}
private void setupAndRunGenericTest(String... additionalParameters) {
setupAndRunTest("-i", "swagger.yaml", "-l", "java", "-o", "src/main/java", false, null, additionalParameters);
}
}

View File

@@ -0,0 +1,52 @@
package io.swagger.codegen.cmd.utils;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
public class OptionUtilsTest {
@Test
public void splitCommaSeparatedList() throws Exception {
doCommaSeparatedListTest("a,b,c", Arrays.asList("a", "b", "c"));
doCommaSeparatedListTest("a,,c", Arrays.asList("a", "c"));
doCommaSeparatedListTest("", new ArrayList<String>());
doCommaSeparatedListTest(null, new ArrayList<String>());
}
@Test
public void testParseCommaSeparatedTuples() throws Exception {
doTupleListTest("a=1,b=2,c=3", Arrays.asList(Pair.of("a", "1"), Pair.of("b", "2"), Pair.of("c", "3")));
doTupleListTest("a=1,,c=3", Arrays.asList(Pair.of("a", "1"), Pair.of("c", "3")));
doTupleListTest("a=1,xyz,c=3", Arrays.asList(Pair.of("a", "1"), Pair.of("c", "3")));
doTupleListTest("a=1,=,c=3", Arrays.asList(Pair.of("a", "1"), Pair.of("c", "3")));
doTupleListTest("", new ArrayList<Pair<String, String>>());
doTupleListTest(null, new ArrayList<Pair<String, String>>());
}
private void doTupleListTest(String input, List<Pair<String, String>> expectedResults) {
final List<Pair<String, String>> result = OptionUtils.parseCommaSeparatedTuples(input);
assertNotNull(result);
assertEquals(result.size(), expectedResults.size());
for (int i = 0; i < expectedResults.size(); i++) {
final Pair<String, String> actualPair = result.get(i);
final Pair<String, String> expected = expectedResults.get(i);
assertEquals(actualPair, expected);
}
}
private void doCommaSeparatedListTest(String csvStr, List<String> expectedResults) {
final List<String> result = OptionUtils.splitCommaSeparatedList(csvStr);
assertNotNull(result);
assertEquals(result.size(), expectedResults.size());
for (int i = 0; i < expectedResults.size(); i++) {
assertEquals(result.get(i), expectedResults.get(i));
}
}
}

View File

@@ -0,0 +1,55 @@
swagger-codegen-maven-plugin
============================
A Maven plugin to support the [swagger](http://swagger.io) code generation project
Usage
============================
Add to your `build->plugins` section (default phase is `generate-sources` phase)
```xml
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>src/main/resources/api.yaml</inputSpec>
<language>java</language>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
```
Followed by:
```
mvn clean compile
```
### General Configuration parameters
- `inputSpec` - swagger spec file path
- `language` - target generation language
- `output` - target output path (default is `${project.build.directory}/generated-sources/swagger`)
- `templateDirectory` - directory with mustache templates
- `addCompileSourceRoot` - add the output directory to the project as a source root (`true` by default)
- `modelPackage` - the package to use for generated model objects/classes
- `apiPackage` - the package to use for generated api objects/classes
- `invokerPackage` - the package to use for the generated invoker objects
- `configOptions` - a map of language-specific parameters (see below)
### Java-specific parameters (under configOptions)
- `sourceFolder` - the folder to use for generated sources under the output folder
- `groupId` - groupId in generated pom.xml
- `artifactId` - artifactId in generated pom.xml
- `artifactVersion` - artifact version in generated pom.xml

View File

@@ -0,0 +1,87 @@
<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>io.swagger</groupId>
<artifactId>swagger-codegen-project</artifactId>
<version>2.1.4</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<name>swagger-codegen (maven-plugin)</name>
<packaging>maven-plugin</packaging>
<description>maven plugin to build modules from swagger codegen</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.4</version>
<configuration>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<phase>process-classes</phase>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>help-goal</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@@ -0,0 +1,16 @@
package io.swagger.codegen.plugin;
/**
* User: lanwen
* Date: 24.03.15
* Time: 14:47
*/
public final class AdditionalParams {
public static final String TEMPLATE_DIR_PARAM = "templateDir";
public static final String MODEL_PACKAGE_PARAM = "modelPackage";
public static final String API_PACKAGE_PARAM = "apiPackage";
public static final String INVOKER_PACKAGE_PARAM = "invokerPackage";
private AdditionalParams() {
}
}

View File

@@ -0,0 +1,195 @@
package io.swagger.codegen.plugin;
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* 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 io.swagger.codegen.CliOption;
import io.swagger.codegen.ClientOptInput;
import io.swagger.codegen.ClientOpts;
import io.swagger.codegen.CodegenConfig;
import io.swagger.codegen.CodegenConfigLoader;
import io.swagger.codegen.DefaultGenerator;
import io.swagger.models.Swagger;
import io.swagger.parser.SwaggerParser;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import config.Config;
import config.ConfigParser;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.ServiceLoader;
import static io.swagger.codegen.plugin.AdditionalParams.API_PACKAGE_PARAM;
import static io.swagger.codegen.plugin.AdditionalParams.INVOKER_PACKAGE_PARAM;
import static io.swagger.codegen.plugin.AdditionalParams.MODEL_PACKAGE_PARAM;
import static io.swagger.codegen.plugin.AdditionalParams.TEMPLATE_DIR_PARAM;
/**
* Goal which generates client/server code from a swagger json/yaml definition.
*/
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
public class CodeGenMojo extends AbstractMojo {
/**
* Location of the output directory.
*/
@Parameter(name = "output",
property = "swagger.codegen.maven.plugin.output",
defaultValue = "${project.build.directory}/generated-sources/swagger")
private File output;
/**
* Location of the swagger spec, as URL or file.
*/
@Parameter(name = "inputSpec", required = true)
private String inputSpec;
/**
* Folder containing the template files.
*/
@Parameter(name = "templateDirectory")
private File templateDirectory;
/**
* The package to use for generated model objects/classes
*/
@Parameter(name = "modelPackage")
private String modelPackage;
/**
* The package to use for generated api objects/classes
*/
@Parameter(name = "apiPackage")
private String apiPackage;
/**
* The package to use for the generated invoker objects
*/
@Parameter(name = "invokerPackage")
private String invokerPackage;
/**
* Client language to generate.
*/
@Parameter(name = "language", required = true)
private String language;
/**
* Path to separate json configuration file.
*/
@Parameter(name = "configurationFile", required = false)
private String configurationFile;
/**
* A map of language-specific parameters as passed with the -c option to the command line
*/
@Parameter(name = "configOptions")
private Map configOptions;
/**
* Add the output directory to the project as a source root, so that the
* generated java types are compiled and included in the project artifact.
*/
@Parameter(defaultValue = "true")
private boolean addCompileSourceRoot = true;
@Parameter
protected Map<String, String> environmentVariables = new HashMap<String, String>();
/**
* The project being built.
*/
@Parameter(readonly = true, required = true, defaultValue = "${project}")
private MavenProject project;
@Override
public void execute() throws MojoExecutionException {
Swagger swagger = new SwaggerParser().read(inputSpec);
CodegenConfig config = CodegenConfigLoader.forName(language);
config.setOutputDir(output.getAbsolutePath());
if (environmentVariables != null) {
for(String key : environmentVariables.keySet()) {
String value = environmentVariables.get(key);
if(value == null) {
// don't put null values
value = "";
}
System.setProperty(key, value);
}
}
if (null != templateDirectory) {
config.additionalProperties().put(TEMPLATE_DIR_PARAM, templateDirectory.getAbsolutePath());
}
if (null != modelPackage) {
config.additionalProperties().put(MODEL_PACKAGE_PARAM, modelPackage);
}
if (null != apiPackage) {
config.additionalProperties().put(API_PACKAGE_PARAM, apiPackage);
}
if (null != invokerPackage) {
config.additionalProperties().put(INVOKER_PACKAGE_PARAM, invokerPackage);
}
if (configOptions != null) {
for (CliOption langCliOption : config.cliOptions()) {
if (configOptions.containsKey(langCliOption.getOpt())) {
config.additionalProperties().put(langCliOption.getOpt(),
configOptions.get(langCliOption.getOpt()));
}
}
}
if (null != configurationFile) {
Config genConfig = ConfigParser.read(configurationFile);
if (null != genConfig) {
for (CliOption langCliOption : config.cliOptions()) {
if (genConfig.hasOption(langCliOption.getOpt())) {
config.additionalProperties().put(langCliOption.getOpt(), genConfig.getOption(langCliOption.getOpt()));
}
}
} else {
throw new RuntimeException("Unable to read configuration file");
}
}
ClientOptInput input = new ClientOptInput().opts(new ClientOpts()).swagger(swagger);
input.setConfig(config);
try {
new DefaultGenerator().opts(input).generate();
} catch (Exception e) {
// Maven logs exceptions thrown by plugins only if invoked with -e
// I find it annoying to jump through hoops to get basic diagnostic information,
// so let's log it in any case:
getLog().error(e);
throw new MojoExecutionException("Code generation failed. See above for the full exception.");
}
if (addCompileSourceRoot) {
project.addCompileSourceRoot(output.toString());
}
}
}

View File

@@ -0,0 +1,271 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-project</artifactId>
<version>2.1.4</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swagger-codegen</artifactId>
<packaging>jar</packaging>
<name>swagger-codegen (core library)</name>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<defaultGoal>install</defaultGoal>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>logback.xml</exclude>
</excludes>
</resource>
</resources>
<extensions>
<extension>
<groupId>org.jvnet.wagon-svn</groupId>
<artifactId>wagon-svn</artifactId>
<version>1.8</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>1.0-alpha-6</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav</artifactId>
<version>1.0-beta-1</version>
</extension>
</extensions>
<directory>target</directory>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>io.swagger.codegen.Codegen</mainClass>
</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>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifestEntries>
<mode>development</mode>
<url>${project.url}</url>
<implementation-version>${project.version}</implementation-version>
<package>io.swagger</package>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release-profile</id>
<properties>
<skipTests>true</skipTests>
</properties>
</profile>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<reporting>
<outputDirectory>target/site</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<aggregate>true</aggregate>
<debug>true</debug>
<links>
<link>http://java.sun.com/javaee/5/docs/api</link>
<link>http://java.sun.com/j2se/1.5.0/docs/api</link>
</links>
<excludePackageNames/>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.6</version>
<reportSets>
<reportSet>
<reports>
<report>project-team</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-parser</artifactId>
<version>${swagger-parser-version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-compat-spec-parser</artifactId>
<version>${swagger-parser-version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>swagger-core</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<dependency>
<groupId>com.samskivert</groupId>
<artifactId>jmustache</artifactId>
<version>${jmustache-version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io-version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-tools-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-ext</artifactId>
<version>${slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang-version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>${commons-cli-version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>${reflections-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>${jmockit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>

View File

@@ -0,0 +1,34 @@
package config;
import com.google.common.collect.ImmutableMap;
import java.util.HashMap;
import java.util.Map;
public class Config {
private Map<String, String> options;
public Config() {
this.options = new HashMap<String, String>();
}
public Config(Map<String, String> properties) {
this.options = properties;
}
public Map<String, String> getOptions() {
return ImmutableMap.copyOf(options);
}
public boolean hasOption(String opt) {
return options.containsKey(opt);
}
public String getOption(String opt) {
return options.get(opt);
}
public void setOption(String opt, String value) {
options.put(opt, value);
}
}

View File

@@ -0,0 +1,40 @@
package config;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.File;
import java.util.Iterator;
import java.util.Map;
public class ConfigParser {
public static Config read(String location) {
System.out.println("reading config from " + location);
ObjectMapper mapper = new ObjectMapper();
Config config = new Config();
try {
JsonNode rootNode = mapper.readTree(new File(location));
Iterator<Map.Entry<String, JsonNode>> optionNodes = rootNode.fields();
while (optionNodes.hasNext()) {
Map.Entry<String, JsonNode> optionNode = (Map.Entry<String, JsonNode>) optionNodes.next();
if (optionNode.getValue().isValueNode()) {
config.setOption(optionNode.getKey(), optionNode.getValue().asText());
} else {
System.out.println("omitting non-value node " + optionNode.getKey());
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
return null;
}
return config;
}
}

View File

@@ -0,0 +1,90 @@
package io.swagger.codegen;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.util.regex.Pattern;
public abstract class AbstractGenerator {
public File writeToFile(String filename, String contents) throws IOException {
System.out.println("writing file " + filename);
File output = new File(filename);
if (output.getParent() != null && !new File(output.getParent()).exists()) {
File parent = new File(output.getParent());
parent.mkdirs();
}
Writer out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(output), "UTF-8"));
out.write(contents);
out.close();
return output;
}
public String readTemplate(String name) {
try {
Reader reader = getTemplateReader(name);
if (reader == null) {
throw new RuntimeException("no file found");
}
java.util.Scanner s = new java.util.Scanner(reader).useDelimiter("\\A");
return s.hasNext() ? s.next() : "";
} catch (Exception e) {
e.printStackTrace();
}
throw new RuntimeException("can't load template " + name);
}
public Reader getTemplateReader(String name) {
try {
InputStream is = this.getClass().getClassLoader().getResourceAsStream(getCPResourcePath(name));
if (is == null) {
is = new FileInputStream(new File(name));
}
if (is == null) {
throw new RuntimeException("no file found");
}
return new InputStreamReader(is);
} catch (Exception e) {
e.printStackTrace();
}
throw new RuntimeException("can't load template " + name);
}
/**
* Get the template file path with template dir prepended, and use the
* library template if exists.
*/
public String getFullTemplateFile(CodegenConfig config, String templateFile) {
String library = config.getLibrary();
if (library != null && !"".equals(library)) {
String libTemplateFile = config.templateDir() + File.separator +
"libraries" + File.separator + library + File.separator +
templateFile;
if (templateExists(libTemplateFile)) {
return libTemplateFile;
}
}
return config.templateDir() + File.separator + templateFile;
}
public boolean templateExists(String name) {
return this.getClass().getClassLoader().getResource(getCPResourcePath(name)) != null;
}
public String getCPResourcePath(String name) {
if (!"/".equals(File.separator)) {
return name.replaceAll(Pattern.quote(File.separator), "/");
}
return name;
}
}

View File

@@ -0,0 +1,23 @@
package io.swagger.codegen;
public class CliOption {
private final String opt;
private String description;
public CliOption(String opt, String description) {
this.opt = opt;
this.description = description;
}
public String getOpt() {
return opt;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@@ -0,0 +1,81 @@
package io.swagger.codegen;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.codegen.auth.AuthParser;
import io.swagger.models.Swagger;
import io.swagger.models.auth.AuthorizationValue;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
public class ClientOptInput {
private CodegenConfig config;
private ClientOpts opts;
private Swagger swagger;
private List<AuthorizationValue> auths;
public ClientOptInput swagger(Swagger swagger) {
this.setSwagger(swagger);
return this;
}
public ClientOptInput opts(ClientOpts opts) {
this.setOpts(opts);
return this;
}
public ClientOptInput config(CodegenConfig codegenConfig) {
this.setConfig(codegenConfig);
return this;
}
@Deprecated
public ClientOptInput auth(String urlEncodedAuthString) {
this.setAuth(urlEncodedAuthString);
return this;
}
@Deprecated
public String getAuth() {
return AuthParser.reconstruct(auths);
}
@Deprecated
public void setAuth(String urlEncodedAuthString) {
this.auths = AuthParser.parse(urlEncodedAuthString);
}
@Deprecated
public List<AuthorizationValue> getAuthorizationValues() {
return auths;
}
public CodegenConfig getConfig() {
return config;
}
public void setConfig(CodegenConfig config) {
this.config = config;
}
public ClientOpts getOpts() {
return opts;
}
public void setOpts(ClientOpts opts) {
this.opts = opts;
}
@ApiModelProperty(dataType = "Object")
public Swagger getSwagger() {
return swagger;
}
public void setSwagger(Swagger swagger) {
this.swagger = swagger;
}
}

View File

@@ -0,0 +1,57 @@
package io.swagger.codegen;
import io.swagger.codegen.auth.AuthMethod;
import java.util.HashMap;
import java.util.Map;
public class ClientOpts {
protected String uri;
protected String target;
protected AuthMethod auth;
protected Map<String, String> properties = new HashMap<String, String>();
protected String outputDirectory;
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
public Map<String, String> getProperties() {
return properties;
}
public void setProperties(Map<String, String> properties) {
this.properties = properties;
}
public String getOutputDirectory() {
return outputDirectory;
}
public void setOutputDirectory(String outputDirectory) {
this.outputDirectory = outputDirectory;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("ClientOpts: {\n");
sb.append(" uri: ").append(uri).append(",");
sb.append(" auth: ").append(auth).append(",");
sb.append(properties);
sb.append("}");
return sb.toString();
}
}

View File

@@ -0,0 +1,164 @@
package io.swagger.codegen;
import config.Config;
import config.ConfigParser;
import io.swagger.models.Swagger;
import io.swagger.parser.SwaggerParser;
import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.ServiceLoader;
/**
* @deprecated use instead {@link io.swagger.codegen.DefaultGenerator}
* or cli interface from https://github.com/swagger-api/swagger-codegen/pull/547
*/
@Deprecated
public class Codegen extends DefaultGenerator {
static Map<String, CodegenConfig> configs = new HashMap<String, CodegenConfig>();
static String configString;
static String debugInfoOptions = "\nThe following additional debug options are available for all codegen targets:" +
"\n -DdebugSwagger prints the swagger specification as interpreted by the codegen" +
"\n -DdebugModels prints models passed to the template engine" +
"\n -DdebugOperations prints operations passed to the template engine" +
"\n -DdebugSupportingFiles prints additional data passed to the template engine";
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
Options options = new Options();
options.addOption("h", "help", false, "shows this message");
options.addOption("l", "lang", true, "client language to generate.\nAvailable languages include:\n\t[" + configString + "]");
options.addOption("o", "output", true, "where to write the generated files");
options.addOption("i", "input-spec", true, "location of the swagger spec, as URL or file");
options.addOption("t", "template-dir", true, "folder containing the template files");
options.addOption("d", "debug-info", false, "prints additional info for debugging");
options.addOption("a", "auth", true, "adds authorization headers when fetching the swagger definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values");
options.addOption("c", "config", true, "location of the configuration file");
ClientOptInput clientOptInput = new ClientOptInput();
ClientOpts clientOpts = new ClientOpts();
Swagger swagger = null;
CommandLine cmd = null;
try {
CommandLineParser parser = new BasicParser();
CodegenConfig config = null;
cmd = parser.parse(options, args);
if (cmd.hasOption("d")) {
usage(options);
System.out.println(debugInfoOptions);
return;
}
if (cmd.hasOption("a")) {
clientOptInput.setAuth(cmd.getOptionValue("a"));
}
if (cmd.hasOption("l")) {
clientOptInput.setConfig(getConfig(cmd.getOptionValue("l")));
} else {
usage(options);
return;
}
if (cmd.hasOption("o")) {
clientOptInput.getConfig().setOutputDir(cmd.getOptionValue("o"));
}
if (cmd.hasOption("h")) {
if (cmd.hasOption("l")) {
config = getConfig(String.valueOf(cmd.getOptionValue("l")));
if (config != null) {
options.addOption("h", "help", true, config.getHelp());
usage(options);
return;
}
}
usage(options);
return;
}
if (cmd.hasOption("i")) {
swagger = new SwaggerParser().read(cmd.getOptionValue("i"), clientOptInput.getAuthorizationValues(), true);
}
if (cmd.hasOption("c")) {
String configFile = cmd.getOptionValue("c");
Config genConfig = ConfigParser.read(configFile);
config = clientOptInput.getConfig();
if (null != genConfig && null != config) {
for (CliOption langCliOption : config.cliOptions()) {
if (genConfig.hasOption(langCliOption.getOpt())) {
config.additionalProperties().put(langCliOption.getOpt(), genConfig.getOption(langCliOption.getOpt()));
}
}
}
}
if (cmd.hasOption("t")) {
clientOpts.getProperties().put(CodegenConstants.TEMPLATE_DIR, String.valueOf(cmd.getOptionValue("t")));
}
} catch (Exception e) {
usage(options);
return;
}
try {
clientOptInput
.opts(clientOpts)
.swagger(swagger);
new Codegen().opts(clientOptInput).generate();
} catch (Exception e) {
e.printStackTrace();
}
}
public static List<CodegenConfig> getExtensions() {
ServiceLoader<CodegenConfig> loader = ServiceLoader.load(CodegenConfig.class);
List<CodegenConfig> output = new ArrayList<CodegenConfig>();
Iterator<CodegenConfig> itr = loader.iterator();
while (itr.hasNext()) {
output.add(itr.next());
}
return output;
}
static void usage(Options options) {
HelpFormatter formatter = new HelpFormatter();
formatter.printHelp("Codegen", options);
}
public static CodegenConfig getConfig(String name) {
if (configs.containsKey(name)) {
return configs.get(name);
} else {
// see if it's a class
try {
System.out.println("loading class " + name);
Class customClass = Class.forName(name);
System.out.println("loaded");
return (CodegenConfig) customClass.newInstance();
} catch (Exception e) {
throw new RuntimeException("can't load class " + name);
}
}
}
static {
List<CodegenConfig> extensions = getExtensions();
StringBuilder sb = new StringBuilder();
for (CodegenConfig config : extensions) {
if (sb.toString().length() != 0) {
sb.append(", ");
}
sb.append(config.getName());
configs.put(config.getName(), config);
configString = sb.toString();
}
}
}

View File

@@ -0,0 +1,126 @@
package io.swagger.codegen;
import io.swagger.models.Model;
import io.swagger.models.Operation;
import io.swagger.models.Swagger;
import io.swagger.models.auth.SecuritySchemeDefinition;
import io.swagger.models.properties.Property;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface CodegenConfig {
CodegenType getTag();
String getName();
String getHelp();
Map<String, Object> additionalProperties();
String apiPackage();
String apiFileFolder();
String fileSuffix();
String outputFolder();
String templateDir();
String modelFileFolder();
String modelPackage();
String toApiName(String name);
String toApiVarName(String name);
String toModelName(String name);
String toParamName(String name);
String escapeText(String text);
String escapeReservedWord(String name);
String getTypeDeclaration(Property p);
String getTypeDeclaration(String name);
void processOpts();
List<CliOption> cliOptions();
String generateExamplePath(String path, Operation operation);
Set<String> reservedWords();
List<SupportingFile> supportingFiles();
String getOutputDir();
void setOutputDir(String dir);
CodegenModel fromModel(String name, Model model);
CodegenModel fromModel(String name, Model model, Map<String, Model> allDefinitions);
CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, Map<String, Model> definitions, Swagger swagger);
CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, Map<String, Model> definitions);
List<CodegenSecurity> fromSecurity(Map<String, SecuritySchemeDefinition> schemes);
Set<String> defaultIncludes();
Map<String, String> typeMapping();
Map<String, String> instantiationTypes();
Map<String, String> importMapping();
Map<String, String> apiTemplateFiles();
Map<String, String> modelTemplateFiles();
Set<String> languageSpecificPrimitives();
void preprocessSwagger(Swagger swagger);
void processSwagger(Swagger swagger);
String toApiFilename(String name);
String toModelFilename(String name);
String toModelImport(String name);
String toApiImport(String name);
void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map<String, List<CodegenOperation>> operations);
Map<String, Object> postProcessModels(Map<String, Object> objs);
Map<String, Object> postProcessOperations(Map<String, Object> objs);
Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs);
String apiFilename(String templateName, String tag);
boolean shouldOverwrite(String filename);
boolean isSkipOverwrite();
void setSkipOverwrite(boolean skipOverwrite);
Map<String, String> supportedLibraries();
void setLibrary(String library);
/**
* Library template (sub-template).
*/
String getLibrary();
}

View File

@@ -0,0 +1,34 @@
package io.swagger.codegen;
import java.util.ServiceLoader;
import static java.util.ServiceLoader.load;
public class CodegenConfigLoader {
/**
* Tries to load config class with SPI first, then with class name directly from classpath
*
* @param name name of config, or full qualified class name in classpath
* @return config class
*/
public static CodegenConfig forName(String name) {
ServiceLoader<CodegenConfig> loader = load(CodegenConfig.class);
StringBuilder availableConfigs = new StringBuilder();
for (CodegenConfig config : loader) {
if (config.getName().equals(name)) {
return config;
}
availableConfigs.append(config.getName()).append("\n");
}
// else try to load directly
try {
return (CodegenConfig) Class.forName(name).newInstance();
} catch (Exception e) {
throw new RuntimeException("Can't load config class with name ".concat(name) + " Available: " + availableConfigs.toString(), e);
}
}
}

View File

@@ -0,0 +1,43 @@
package io.swagger.codegen;
/**
* A class for storing constants that are used throughout the project.
*/
public class CodegenConstants {
public static final String API_PACKAGE = "apiPackage";
public static final String API_PACKAGE_DESC = "package for generated api classes";
public static final String MODEL_PACKAGE = "modelPackage";
public static final String MODEL_PACKAGE_DESC = "package for generated models";
public static final String TEMPLATE_DIR = "templateDir";
public static final String INVOKER_PACKAGE = "invokerPackage";
public static final String INVOKER_PACKAGE_DESC = "root package for generated code";
public static final String GROUP_ID = "groupId";
public static final String GROUP_ID_DESC = "groupId in generated pom.xml";
public static final String ARTIFACT_ID = "artifactId";
public static final String ARTIFACT_ID_DESC = "artifactId in generated pom.xml";
public static final String ARTIFACT_VERSION = "artifactVersion";
public static final String ARTIFACT_VERSION_DESC = "artifact version in generated pom.xml";
public static final String SOURCE_FOLDER = "sourceFolder";
public static final String SOURCE_FOLDER_DESC = "source folder for generated code";
public static final String LOCAL_VARIABLE_PREFIX = "localVariablePrefix";
public static final String LOCAL_VARIABLE_PREFIX_DESC = "prefix for generated code members and local variables";
public static final String SERIALIZABLE_MODEL = "serializableModel";
public static final String SERIALIZABLE_MODEL_DESC = "boolean - toggle \"implements Serializable\" for generated models";
public static final String LIBRARY = "library";
public static final String LIBRARY_DESC = "library template (sub-template)";
public static final String SORT_PARAMS_BY_REQUIRED_FLAG = "sortParamsByRequiredFlag";
public static final String SORT_PARAMS_BY_REQUIRED_FLAG_DESC = "Sort method arguments to place required parameters before optional parameters. Default: true";
}

View File

@@ -0,0 +1,19 @@
package io.swagger.codegen;
import io.swagger.models.ExternalDocs;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class CodegenModel {
public String parent;
public String name, classname, description, classVarName, modelJson;
public String unescapedDescription;
public String defaultValue;
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();
public Set<String> imports = new HashSet<String>();
public Boolean hasVars, emptyVars, hasMoreModels, hasEnums;
public ExternalDocs externalDocs;
}

View File

@@ -0,0 +1,39 @@
package io.swagger.codegen;
import java.util.HashMap;
import java.util.Map;
public final class CodegenModelFactory {
private static final Map<CodegenModelType, Class<?>> typeMapping = new HashMap<CodegenModelType, Class<?>>();
/**
* Configure a different implementation class.
*
* @param type the type that shall be replaced
* @param implementation the implementation class must extend the default class and must provide a public no-arg constructor
*/
public static void setTypeMapping(CodegenModelType type, Class<?> implementation) {
if (!type.getDefaultImplementation().isAssignableFrom(implementation)) {
throw new IllegalArgumentException(implementation.getSimpleName() + " doesn't extend " + type.getDefaultImplementation().getSimpleName());
}
try {
implementation.newInstance();
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
typeMapping.put(type, implementation);
}
@SuppressWarnings("unchecked")
public static <T> T newInstance(CodegenModelType type) {
Class<?> classType = typeMapping.get(type);
try {
return (T) (classType != null ? classType : type.getDefaultImplementation()).newInstance();
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}

View File

@@ -0,0 +1,21 @@
package io.swagger.codegen;
public enum CodegenModelType {
MODEL(CodegenModel.class),
OPERATION(CodegenOperation.class),
PARAMETER(CodegenParameter.class),
PROPERTY(CodegenProperty.class),
RESPONSE(CodegenResponse.class),
SECURITY(CodegenSecurity.class);
private final Class<?> defaultImplementation;
private CodegenModelType(Class<?> defaultImplementation) {
this.defaultImplementation = defaultImplementation;
}
public Class<?> getDefaultImplementation() {
return defaultImplementation;
}
}

View File

@@ -0,0 +1,89 @@
package io.swagger.codegen;
import io.swagger.models.ExternalDocs;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class CodegenOperation {
public final List<CodegenProperty> responseHeaders = new ArrayList<CodegenProperty>();
public Boolean hasAuthMethods, hasConsumes, hasProduces, hasParams, returnTypeIsPrimitive,
returnSimpleType, subresourceOperation, isMapContainer, isListContainer,
hasMore = Boolean.TRUE, isMultipart, isResponseBinary = Boolean.FALSE;
public String path, operationId, returnType, httpMethod, returnBaseType,
returnContainer, summary, notes, baseName, defaultResponse;
public List<Map<String, String>> consumes, produces;
public CodegenParameter bodyParam;
public List<CodegenParameter> allParams = new ArrayList<CodegenParameter>();
public List<CodegenParameter> bodyParams = new ArrayList<CodegenParameter>();
public List<CodegenParameter> pathParams = new ArrayList<CodegenParameter>();
public List<CodegenParameter> queryParams = new ArrayList<CodegenParameter>();
public List<CodegenParameter> headerParams = new ArrayList<CodegenParameter>();
public List<CodegenParameter> formParams = new ArrayList<CodegenParameter>();
public List<CodegenSecurity> authMethods;
public List<String> tags;
public List<CodegenResponse> responses = new ArrayList<CodegenResponse>();
public Set<String> imports = new HashSet<String>();
public List<Map<String, String>> examples;
public ExternalDocs externalDocs;
public Map<String, Object> vendorExtensions;
public String nickname; // legacy support
/**
* Check if there's at least one parameter
*
* @return true if parameter exists, false otherwise
*/
private boolean nonempty(List<CodegenParameter> params) {
return params != null && params.size() > 0;
}
/**
* Check if there's at least one body parameter
*
* @return true if body parameter exists, false otherwise
*/
public boolean getHasBodyParam() {
return nonempty(bodyParams);
}
/**
* Check if there's at least one query parameter
*
* @return true if query parameter exists, false otherwise
*/
public boolean getHasQueryParams() {
return nonempty(queryParams);
}
/**
* Check if there's at least one header parameter
*
* @return true if header parameter exists, false otherwise
*/
public boolean getHasHeaderParams() {
return nonempty(headerParams);
}
/**
* Check if there's at least one path parameter
*
* @return true if path parameter exists, false otherwise
*/
public boolean getHasPathParams() {
return nonempty(pathParams);
}
/**
* Check if there's at least one form parameter
*
* @return true if any form parameter exists, false otherwise
*/
public boolean getHasFormParams() {
return nonempty(formParams);
}
}

View File

@@ -0,0 +1,60 @@
package io.swagger.codegen;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
public class CodegenParameter {
public Boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
isCookieParam, isBodyParam, isFile, notFile, hasMore, isContainer,
secondaryParam, isBinary, isCollectionFormatMulti;
public String baseName, paramName, dataType, collectionFormat, description, baseType, defaultValue;
public String jsonSchema;
public boolean isEnum;
public List<String> _enum;
public Map<String, Object> allowableValues;
public Map<String, Object> vendorExtensions;
/**
* Determines whether this parameter is mandatory. If the parameter is in "path",
* this property is required and its value MUST be true. Otherwise, the property
* MAY be included and its default value is false.
*/
public Boolean required;
public CodegenParameter copy() {
CodegenParameter output = new CodegenParameter();
output.isFile = this.isFile;
output.notFile = this.notFile;
output.hasMore = this.hasMore;
output.isContainer = this.isContainer;
output.secondaryParam = this.secondaryParam;
output.baseName = this.baseName;
output.paramName = this.paramName;
output.dataType = this.dataType;
output.collectionFormat = this.collectionFormat;
output.isCollectionFormatMulti = this.isCollectionFormatMulti;
output.description = this.description;
output.baseType = this.baseType;
output.isFormParam = this.isFormParam;
output.isQueryParam = this.isQueryParam;
output.isPathParam = this.isPathParam;
output.isHeaderParam = this.isHeaderParam;
output.isCookieParam = this.isCookieParam;
output.isBodyParam = this.isBodyParam;
output.required = this.required;
output.jsonSchema = this.jsonSchema;
output.defaultValue = this.defaultValue;
output.isEnum = this.isEnum;
if (this._enum != null) {
output._enum = new ArrayList<String>(this._enum);
}
if (this.allowableValues != null) {
output.allowableValues = new HashMap<String, Object>(this.allowableValues);
}
output.vendorExtensions = this.vendorExtensions;
return output;
}
}

View File

@@ -0,0 +1,143 @@
package io.swagger.codegen;
import java.util.List;
import java.util.Map;
public class CodegenProperty {
public String baseName, complexType, getter, setter, description, datatype, datatypeWithEnum,
name, min, max, defaultValue, baseType, containerType;
public String unescapedDescription;
/**
* maxLength validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.1
*/
public Integer maxLength;
/**
* minLength validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.2
*/
public Integer minLength;
/**
* pattern validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.3
*/
public String pattern;
/**
* A free-form property to include an example of an instance for this schema.
*/
public String example;
public String jsonSchema;
public Double minimum;
public Double maximum;
public Boolean exclusiveMinimum;
public Boolean exclusiveMaximum;
public Boolean hasMore = null, required = null, secondaryParam = null;
public Boolean isPrimitiveType, isContainer, isNotContainer;
public boolean isEnum;
public Boolean isReadOnly = false;
public List<String> _enum;
public Map<String, Object> allowableValues;
public CodegenProperty items;
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CodegenProperty other = (CodegenProperty) obj;
if ((this.baseName == null) ? (other.baseName != null) : !this.baseName.equals(other.baseName)) {
return false;
}
if ((this.complexType == null) ? (other.complexType != null) : !this.complexType.equals(other.complexType)) {
return false;
}
if ((this.getter == null) ? (other.getter != null) : !this.getter.equals(other.getter)) {
return false;
}
if ((this.setter == null) ? (other.setter != null) : !this.setter.equals(other.setter)) {
return false;
}
if ((this.description == null) ? (other.description != null) : !this.description.equals(other.description)) {
return false;
}
if ((this.datatype == null) ? (other.datatype != null) : !this.datatype.equals(other.datatype)) {
return false;
}
if ((this.datatypeWithEnum == null) ? (other.datatypeWithEnum != null) : !this.datatypeWithEnum.equals(other.datatypeWithEnum)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
if ((this.min == null) ? (other.min != null) : !this.min.equals(other.min)) {
return false;
}
if ((this.max == null) ? (other.max != null) : !this.max.equals(other.max)) {
return false;
}
if ((this.defaultValue == null) ? (other.defaultValue != null) : !this.defaultValue.equals(other.defaultValue)) {
return false;
}
if ((this.baseType == null) ? (other.baseType != null) : !this.baseType.equals(other.baseType)) {
return false;
}
if ((this.containerType == null) ? (other.containerType != null) : !this.containerType.equals(other.containerType)) {
return false;
}
if (this.maxLength != other.maxLength && (this.maxLength == null || !this.maxLength.equals(other.maxLength))) {
return false;
}
if (this.minLength != other.minLength && (this.minLength == null || !this.minLength.equals(other.minLength))) {
return false;
}
if ((this.pattern == null) ? (other.pattern != null) : !this.pattern.equals(other.pattern)) {
return false;
}
if ((this.example == null) ? (other.example != null) : !this.example.equals(other.example)) {
return false;
}
if ((this.jsonSchema == null) ? (other.jsonSchema != null) : !this.jsonSchema.equals(other.jsonSchema)) {
return false;
}
if (this.minimum != other.minimum && (this.minimum == null || !this.minimum.equals(other.minimum))) {
return false;
}
if (this.maximum != other.maximum && (this.maximum == null || !this.maximum.equals(other.maximum))) {
return false;
}
if (this.exclusiveMinimum != other.exclusiveMinimum && (this.exclusiveMinimum == null || !this.exclusiveMinimum.equals(other.exclusiveMinimum))) {
return false;
}
if (this.exclusiveMaximum != other.exclusiveMaximum && (this.exclusiveMaximum == null || !this.exclusiveMaximum.equals(other.exclusiveMaximum))) {
return false;
}
if (this.required != other.required && (this.required == null || !this.required.equals(other.required))) {
return false;
}
if (this.secondaryParam != other.secondaryParam && (this.secondaryParam == null || !this.secondaryParam.equals(other.secondaryParam))) {
return false;
}
if (this.isPrimitiveType != other.isPrimitiveType && (this.isPrimitiveType == null || !this.isPrimitiveType.equals(other.isPrimitiveType))) {
return false;
}
if (this.isContainer != other.isContainer && (this.isContainer == null || !this.isContainer.equals(other.isContainer))) {
return false;
}
if (this.isNotContainer != other.isNotContainer && (this.isNotContainer == null || !this.isNotContainer.equals(other.isNotContainer))) {
return false;
}
if (this.isEnum != other.isEnum) {
return false;
}
if (this._enum != other._enum && (this._enum == null || !this._enum.equals(other._enum))) {
return false;
}
if (this.allowableValues != other.allowableValues && (this.allowableValues == null || !this.allowableValues.equals(other.allowableValues))) {
return false;
}
return true;
}
}

View File

@@ -0,0 +1,25 @@
package io.swagger.codegen;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class CodegenResponse {
public final List<CodegenProperty> headers = new ArrayList<CodegenProperty>();
public String code, message;
public Boolean hasMore;
public List<Map<String, Object>> examples;
public String dataType, baseType, containerType;
public Boolean isDefault;
public Boolean simpleType;
public Boolean primitiveType;
public Boolean isMapContainer;
public Boolean isListContainer;
public Boolean isBinary = Boolean.FALSE;
public Object schema;
public String jsonSchema;
public boolean isWildcard() {
return "0".equals(code) || "default".equals(code);
}
}

View File

@@ -0,0 +1,16 @@
package io.swagger.codegen;
import java.util.List;
import java.util.Map;
public class CodegenSecurity {
public String name;
public String type;
public Boolean hasMore, isBasic, isOAuth, isApiKey;
// ApiKey specific
public String keyParamName;
public Boolean isKeyInQuery, isKeyInHeader;
// Oauth specific
public String flow, authorizationUrl, tokenUrl;
public List<Map<String, Object>> scopes;
}

View File

@@ -0,0 +1,36 @@
package io.swagger.codegen;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.HashMap;
import java.util.Map;
public enum CodegenType {
CLIENT, SERVER, DOCUMENTATION, OTHER;
private static Map<String, CodegenType> names = new HashMap<String, CodegenType>();
@JsonCreator
public static CodegenType forValue(String value) {
return names.get(value.toLowerCase());
}
@JsonValue
public String toValue() {
for (Map.Entry<String, CodegenType> entry : names.entrySet()) {
if (entry.getValue() == this) {
return entry.getKey();
}
}
return null; // or fail
}
static {
names.put("client", CLIENT);
names.put("server", SERVER);
names.put("documentation", DOCUMENTATION);
names.put("other", OTHER);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,731 @@
package io.swagger.codegen;
import static org.apache.commons.lang3.StringUtils.capitalize;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Template;
import io.swagger.models.ComposedModel;
import io.swagger.models.Contact;
import io.swagger.models.Info;
import io.swagger.models.License;
import io.swagger.models.Model;
import io.swagger.models.Operation;
import io.swagger.models.Path;
import io.swagger.models.SecurityRequirement;
import io.swagger.models.Swagger;
import io.swagger.models.auth.OAuth2Definition;
import io.swagger.models.auth.SecuritySchemeDefinition;
import io.swagger.models.parameters.Parameter;
import io.swagger.util.Json;
import org.apache.commons.io.IOUtils;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.util.*;
public class DefaultGenerator extends AbstractGenerator implements Generator {
Logger LOGGER = LoggerFactory.getLogger(DefaultGenerator.class);
protected CodegenConfig config;
protected ClientOptInput opts = null;
protected Swagger swagger = null;
@Override
public Generator opts(ClientOptInput opts) {
this.opts = opts;
this.swagger = opts.getSwagger();
this.config = opts.getConfig();
this.config.additionalProperties().putAll(opts.getOpts().getProperties());
return this;
}
@Override
public List<File> generate() {
Boolean generateApis = null;
Boolean generateModels = null;
Boolean generateSupportingFiles = null;
Set<String> modelsToGenerate = null;
Set<String> apisToGenerate = null;
Set<String> supportingFilesToGenerate = null;
// allows generating only models by specifying a CSV of models to generate, or empty for all
if(System.getProperty("models") != null) {
String modelNames = System.getProperty("models");
generateModels = true;
if(!modelNames.isEmpty()) {
modelsToGenerate = new HashSet<String>(Arrays.asList(modelNames.split(",")));
}
}
if(System.getProperty("apis") != null) {
String apiNames = System.getProperty("apis");
generateApis = true;
if(!apiNames.isEmpty()) {
apisToGenerate = new HashSet<String>(Arrays.asList(apiNames.split(",")));
}
}
if(System.getProperty("supportingFiles") != null) {
String supportingFiles = System.getProperty("supportingFiles");
generateSupportingFiles = true;
if(!supportingFiles.isEmpty()) {
supportingFilesToGenerate = new HashSet<String>(Arrays.asList(supportingFiles.split(",")));
}
}
if(generateApis == null && generateModels == null && generateSupportingFiles == null) {
// no specifics are set, generate everything
generateApis = true; generateModels = true; generateSupportingFiles = true;
}
else {
if(generateApis == null) {
generateApis = false;
}
if(generateModels == null) {
generateModels = false;
}
if(generateSupportingFiles == null) {
generateSupportingFiles = false;
}
}
if (swagger == null || config == null) {
throw new RuntimeException("missing swagger input or config!");
}
if (System.getProperty("debugSwagger") != null) {
Json.prettyPrint(swagger);
}
List<File> files = new ArrayList<File>();
config.processOpts();
config.preprocessSwagger(swagger);
config.additionalProperties().put("generatedDate", DateTime.now().toString());
config.additionalProperties().put("generatorClass", config.getClass().toString());
if (swagger.getInfo() != null) {
Info info = swagger.getInfo();
if (info.getTitle() != null) {
config.additionalProperties().put("appName", info.getTitle());
}
if (info.getVersion() != null) {
config.additionalProperties().put("appVersion", info.getVersion());
}
if (info.getDescription() != null) {
config.additionalProperties().put("appDescription",
config.escapeText(info.getDescription()));
}
if (info.getContact() != null) {
Contact contact = info.getContact();
config.additionalProperties().put("infoUrl", contact.getUrl());
if (contact.getEmail() != null) {
config.additionalProperties().put("infoEmail", contact.getEmail());
}
}
if (info.getLicense() != null) {
License license = info.getLicense();
if (license.getName() != null) {
config.additionalProperties().put("licenseInfo", license.getName());
}
if (license.getUrl() != null) {
config.additionalProperties().put("licenseUrl", license.getUrl());
}
}
if (info.getVersion() != null) {
config.additionalProperties().put("version", info.getVersion());
}
}
StringBuilder hostBuilder = new StringBuilder();
String scheme;
if (swagger.getSchemes() != null && swagger.getSchemes().size() > 0) {
scheme = swagger.getSchemes().get(0).toValue();
} else {
scheme = "https";
}
hostBuilder.append(scheme);
hostBuilder.append("://");
if (swagger.getHost() != null) {
hostBuilder.append(swagger.getHost());
} else {
hostBuilder.append("localhost");
}
if (swagger.getBasePath() != null) {
hostBuilder.append(swagger.getBasePath());
}
String contextPath = swagger.getBasePath() == null ? "" : swagger.getBasePath();
String basePath = hostBuilder.toString();
// resolve inline models
InlineModelResolver inlineModelResolver = new InlineModelResolver();
inlineModelResolver.flatten(swagger);
List<Object> allOperations = new ArrayList<Object>();
List<Object> allModels = new ArrayList<Object>();
// models
Map<String, Model> definitions = swagger.getDefinitions();
if (definitions != null) {
List<String> sortedModelKeys = sortModelsByInheritance(definitions);
if(generateModels) {
if(modelsToGenerate != null && modelsToGenerate.size() > 0) {
List<String> updatedKeys = new ArrayList<String>();
for(String m : sortedModelKeys) {
if(modelsToGenerate.contains(m)) {
updatedKeys.add(m);
}
}
sortedModelKeys = updatedKeys;
}
for (String name : sortedModelKeys) {
try {
//don't generate models that have an import mapping
if(config.importMapping().containsKey(name)) {
continue;
}
Model model = definitions.get(name);
Map<String, Model> modelMap = new HashMap<String, Model>();
modelMap.put(name, model);
Map<String, Object> models = processModels(config, modelMap, definitions);
models.putAll(config.additionalProperties());
allModels.add(((List<Object>) models.get("models")).get(0));
for (String templateName : config.modelTemplateFiles().keySet()) {
String suffix = config.modelTemplateFiles().get(templateName);
String filename = config.modelFileFolder() + File.separator + config.toModelFilename(name) + suffix;
if (!config.shouldOverwrite(filename)) {
continue;
}
String templateFile = getFullTemplateFile(config, templateName);
String template = readTemplate(templateFile);
Template tmpl = Mustache.compiler()
.withLoader(new Mustache.TemplateLoader() {
@Override
public Reader getTemplate(String name) {
return getTemplateReader(config.templateDir() + File.separator + name + ".mustache");
}
})
.defaultValue("")
.compile(template);
writeToFile(filename, tmpl.execute(models));
files.add(new File(filename));
}
} catch (Exception e) {
throw new RuntimeException("Could not generate model '" + name + "'", e);
}
}
}
}
if (System.getProperty("debugModels") != null) {
System.out.println("############ Model info ############");
Json.prettyPrint(allModels);
}
// apis
Map<String, List<CodegenOperation>> paths = processPaths(swagger.getPaths());
if(generateApis) {
if(apisToGenerate != null && apisToGenerate.size() > 0) {
Map<String, List<CodegenOperation>> updatedPaths = new TreeMap<String, List<CodegenOperation>>();
for(String m : paths.keySet()) {
if(apisToGenerate.contains(m)) {
updatedPaths.put(m, paths.get(m));
}
}
paths = updatedPaths;
}
for (String tag : paths.keySet()) {
try {
List<CodegenOperation> ops = paths.get(tag);
Map<String, Object> operation = processOperations(config, tag, ops);
operation.put("basePath", basePath);
operation.put("contextPath", contextPath);
operation.put("baseName", tag);
operation.put("modelPackage", config.modelPackage());
operation.putAll(config.additionalProperties());
operation.put("classname", config.toApiName(tag));
operation.put("classVarName", config.toApiVarName(tag));
operation.put("importPath", config.toApiImport(tag));
processMimeTypes(swagger.getConsumes(), operation, "consumes");
processMimeTypes(swagger.getProduces(), operation, "produces");
allOperations.add(new HashMap<String, Object>(operation));
for (int i = 0; i < allOperations.size(); i++) {
Map<String, Object> oo = (Map<String, Object>) allOperations.get(i);
if (i < (allOperations.size() - 1)) {
oo.put("hasMore", "true");
}
}
for (String templateName : config.apiTemplateFiles().keySet()) {
String filename = config.apiFilename(templateName, tag);
if (!config.shouldOverwrite(filename) && new File(filename).exists()) {
continue;
}
String templateFile = getFullTemplateFile(config, templateName);
String template = readTemplate(templateFile);
Template tmpl = Mustache.compiler()
.withLoader(new Mustache.TemplateLoader() {
@Override
public Reader getTemplate(String name) {
return getTemplateReader(config.templateDir() + File.separator + name + ".mustache");
}
})
.defaultValue("")
.compile(template);
writeToFile(filename, tmpl.execute(operation));
files.add(new File(filename));
}
} catch (Exception e) {
throw new RuntimeException("Could not generate api file for '" + tag + "'", e);
}
}
}
if (System.getProperty("debugOperations") != null) {
System.out.println("############ Operation info ############");
Json.prettyPrint(allOperations);
}
// supporting files
Map<String, Object> bundle = new HashMap<String, Object>();
bundle.putAll(config.additionalProperties());
bundle.put("apiPackage", config.apiPackage());
Map<String, Object> apis = new HashMap<String, Object>();
apis.put("apis", allOperations);
if (swagger.getHost() != null) {
bundle.put("host", swagger.getHost());
}
bundle.put("basePath", basePath);
bundle.put("scheme", scheme);
bundle.put("contextPath", contextPath);
bundle.put("apiInfo", apis);
bundle.put("models", allModels);
bundle.put("apiFolder", config.apiPackage().replace('.', File.separatorChar));
bundle.put("modelPackage", config.modelPackage());
List<CodegenSecurity> authMethods = config.fromSecurity(swagger.getSecurityDefinitions());
if (authMethods != null && !authMethods.isEmpty()) {
bundle.put("authMethods", authMethods);
bundle.put("hasAuthMethods", true);
}
if (swagger.getExternalDocs() != null) {
bundle.put("externalDocs", swagger.getExternalDocs());
}
for (int i = 0; i < allModels.size() - 1; i++) {
HashMap<String, CodegenModel> cm = (HashMap<String, CodegenModel>) allModels.get(i);
CodegenModel m = cm.get("model");
m.hasMoreModels = true;
}
config.postProcessSupportingFileData(bundle);
if (System.getProperty("debugSupportingFiles") != null) {
System.out.println("############ Supporting file info ############");
Json.prettyPrint(bundle);
}
if(generateSupportingFiles) {
for (SupportingFile support : config.supportingFiles()) {
try {
String outputFolder = config.outputFolder();
if (isNotEmpty(support.folder)) {
outputFolder += File.separator + support.folder;
}
File of = new File(outputFolder);
if (!of.isDirectory()) {
of.mkdirs();
}
String outputFilename = outputFolder + File.separator + support.destinationFilename;
if (!config.shouldOverwrite(outputFilename)) {
continue;
}
String templateFile = getFullTemplateFile(config, support.templateFile);
boolean shouldGenerate = true;
if(supportingFilesToGenerate != null && supportingFilesToGenerate.size() > 0) {
if(supportingFilesToGenerate.contains(support.destinationFilename)) {
shouldGenerate = true;
}
else {
shouldGenerate = false;
}
}
if(shouldGenerate) {
if (templateFile.endsWith("mustache")) {
String template = readTemplate(templateFile);
Template tmpl = Mustache.compiler()
.withLoader(new Mustache.TemplateLoader() {
@Override
public Reader getTemplate(String name) {
return getTemplateReader(config.templateDir() + File.separator + name + ".mustache");
}
})
.defaultValue("")
.compile(template);
writeToFile(outputFilename, tmpl.execute(bundle));
files.add(new File(outputFilename));
} else {
InputStream in = null;
try {
in = new FileInputStream(templateFile);
} catch (Exception e) {
// continue
}
if (in == null) {
in = this.getClass().getClassLoader().getResourceAsStream(getCPResourcePath(templateFile));
}
File outputFile = new File(outputFilename);
OutputStream out = new FileOutputStream(outputFile, false);
if (in != null && out != null) {
System.out.println("writing file " + outputFile);
IOUtils.copy(in, out);
} else {
if (in == null) {
System.out.println("can't open " + templateFile + " for input");
}
if (out == null) {
System.out.println("can't open " + outputFile + " for output");
}
}
files.add(outputFile);
}
}
} catch (Exception e) {
throw new RuntimeException("Could not generate supporting file '" + support + "'", e);
}
}
}
config.processSwagger(swagger);
return files;
}
private void processMimeTypes(List<String> mimeTypeList, Map<String, Object> operation, String source) {
if (mimeTypeList != null && mimeTypeList.size() > 0) {
List<Map<String, String>> c = new ArrayList<Map<String, String>>();
int count = 0;
for (String key : mimeTypeList) {
Map<String, String> mediaType = new HashMap<String, String>();
mediaType.put("mediaType", key);
count += 1;
if (count < mimeTypeList.size()) {
mediaType.put("hasMore", "true");
} else {
mediaType.put("hasMore", null);
}
c.add(mediaType);
}
operation.put(source, c);
String flagFieldName = "has" + source.substring(0, 1).toUpperCase() + source.substring(1);
operation.put(flagFieldName, true);
}
}
private List<String> sortModelsByInheritance(final Map<String, Model> definitions) {
List<String> sortedModelKeys = new ArrayList<String>(definitions.keySet());
Comparator<String> cmp = new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
Model model1 = definitions.get(o1);
Model model2 = definitions.get(o2);
int model1InheritanceDepth = getInheritanceDepth(model1);
int model2InheritanceDepth = getInheritanceDepth(model2);
if (model1InheritanceDepth == model2InheritanceDepth) {
return 0;
} else if (model1InheritanceDepth > model2InheritanceDepth) {
return 1;
} else {
return -1;
}
}
private int getInheritanceDepth(Model model) {
int inheritanceDepth = 0;
Model parent = getParent(model);
while (parent != null) {
inheritanceDepth++;
parent = getParent(parent);
}
return inheritanceDepth;
}
private Model getParent(Model model) {
if (model instanceof ComposedModel) {
return definitions.get(((ComposedModel) model).getParent().getReference());
}
return null;
}
};
Collections.sort(sortedModelKeys, cmp);
return sortedModelKeys;
}
public Map<String, List<CodegenOperation>> processPaths(Map<String, Path> paths) {
Map<String, List<CodegenOperation>> ops = new HashMap<String, List<CodegenOperation>>();
for (String resourcePath : paths.keySet()) {
Path path = paths.get(resourcePath);
processOperation(resourcePath, "get", path.getGet(), ops, path);
processOperation(resourcePath, "head", path.getHead(), ops, path);
processOperation(resourcePath, "put", path.getPut(), ops, path);
processOperation(resourcePath, "post", path.getPost(), ops, path);
processOperation(resourcePath, "delete", path.getDelete(), ops, path);
processOperation(resourcePath, "patch", path.getPatch(), ops, path);
processOperation(resourcePath, "options", path.getOptions(), ops, path);
}
return ops;
}
public SecuritySchemeDefinition fromSecurity(String name) {
Map<String, SecuritySchemeDefinition> map = swagger.getSecurityDefinitions();
if (map == null) {
return null;
}
return map.get(name);
}
public void processOperation(String resourcePath, String httpMethod, Operation operation, Map<String, List<CodegenOperation>> operations, Path path) {
if (operation != null) {
if (System.getProperty("debugOperations") != null) {
LOGGER.debug("processOperation: resourcePath= " + resourcePath + "\t;" + httpMethod + " " + operation + "\n");
}
List<String> tags = operation.getTags();
if (tags == null) {
tags = new ArrayList<String>();
tags.add("default");
}
/*
build up a set of parameter "ids" defined at the operation level
per the swagger 2.0 spec "A unique parameter is defined by a combination of a name and location"
i'm assuming "location" == "in"
*/
Set<String> operationParameters = new HashSet<String>();
if (operation.getParameters() != null) {
for (Parameter parameter : operation.getParameters()) {
operationParameters.add(generateParameterId(parameter));
}
}
//need to propagate path level down to the operation
if(path.getParameters() != null) {
for (Parameter parameter : path.getParameters()) {
//skip propagation if a parameter with the same name is already defined at the operation level
if (!operationParameters.contains(generateParameterId(parameter))) {
operation.addParameter(parameter);
}
}
}
for (String tag : tags) {
CodegenOperation co = null;
try {
co = config.fromOperation(resourcePath, httpMethod, operation, swagger.getDefinitions(), swagger);
co.tags = new ArrayList<String>();
co.tags.add(sanitizeTag(tag));
config.addOperationToGroup(sanitizeTag(tag), resourcePath, operation, co, operations);
List<Map<String, List<String>>> securities = operation.getSecurity();
if (securities == null && swagger.getSecurity() != null) {
securities = new ArrayList<Map<String, List<String>>>();
for (SecurityRequirement sr : swagger.getSecurity()) {
securities.add(sr.getRequirements());
}
}
if (securities == null || securities.isEmpty()) {
continue;
}
Map<String, SecuritySchemeDefinition> authMethods = new HashMap<String, SecuritySchemeDefinition>();
// NOTE: Use only the first security requirement for now.
// See the "security" field of "Swagger Object":
// https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#swagger-object
// "there is a logical OR between the security requirements"
if (securities.size() > 1) {
LOGGER.warn("More than 1 security requirements are found, using only the first one");
}
Map<String, List<String>> security = securities.get(0);
for (String securityName : security.keySet()) {
SecuritySchemeDefinition securityDefinition = fromSecurity(securityName);
if (securityDefinition != null) {
if(securityDefinition instanceof OAuth2Definition) {
OAuth2Definition oauth2Definition = (OAuth2Definition) securityDefinition;
OAuth2Definition oauth2Operation = new OAuth2Definition();
oauth2Operation.setType(oauth2Definition.getType());
oauth2Operation.setAuthorizationUrl(oauth2Definition.getAuthorizationUrl());
oauth2Operation.setFlow(oauth2Definition.getFlow());
oauth2Operation.setTokenUrl(oauth2Definition.getTokenUrl());
oauth2Operation.setScopes(new HashMap<String, String>());
for (String scope : security.get(securityName)) {
if (oauth2Definition.getScopes().containsKey(scope)) {
oauth2Operation.addScope(scope, oauth2Definition.getScopes().get(scope));
}
}
authMethods.put(securityName, oauth2Operation);
} else {
authMethods.put(securityName, securityDefinition);
}
}
}
if (!authMethods.isEmpty()) {
co.authMethods = config.fromSecurity(authMethods);
co.hasAuthMethods = true;
}
}
catch (Exception ex) {
String msg = "Could not process operation:\n" //
+ " Tag: " + tag + "\n"//
+ " Operation: " + operation.getOperationId() + "\n" //
+ " Resource: " + httpMethod + " " + resourcePath + "\n"//
+ " Definitions: " + swagger.getDefinitions() + "\n" //
+ " Exception: " + ex.getMessage();
throw new RuntimeException(msg, ex);
}
}
}
}
private String generateParameterId(Parameter parameter) {
return parameter.getName() + ":" + parameter.getIn();
}
protected String sanitizeTag(String tag) {
// remove spaces and make strong case
String[] parts = tag.split(" ");
StringBuilder buf = new StringBuilder();
for (String part : parts) {
if (isNotEmpty(part)) {
buf.append(capitalize(part));
}
}
return buf.toString().replaceAll("[^a-zA-Z ]", "");
}
public Map<String, Object> processOperations(CodegenConfig config, String tag, List<CodegenOperation> ops) {
Map<String, Object> operations = new HashMap<String, Object>();
Map<String, Object> objs = new HashMap<String, Object>();
objs.put("classname", config.toApiName(tag));
objs.put("pathPrefix", config.toApiVarName(tag));
// check for operationId uniqueness
Set<String> opIds = new HashSet<String>();
int counter = 0;
for (CodegenOperation op : ops) {
String opId = op.nickname;
if (opIds.contains(opId)) {
counter++;
op.nickname += "_" + counter;
}
opIds.add(opId);
}
objs.put("operation", ops);
operations.put("operations", objs);
operations.put("package", config.apiPackage());
Set<String> allImports = new LinkedHashSet<String>();
for (CodegenOperation op : ops) {
allImports.addAll(op.imports);
}
List<Map<String, String>> imports = new ArrayList<Map<String, String>>();
for (String nextImport : allImports) {
Map<String, String> im = new LinkedHashMap<String, String>();
String mapping = config.importMapping().get(nextImport);
if (mapping == null) {
mapping = config.toModelImport(nextImport);
}
if (mapping != null) {
im.put("import", mapping);
imports.add(im);
}
}
operations.put("imports", imports);
// add a flag to indicate whether there's any {{import}}
if (imports.size() > 0) {
operations.put("hasImport", true);
}
config.postProcessOperations(operations);
if (objs.size() > 0) {
List<CodegenOperation> os = (List<CodegenOperation>) objs.get("operation");
if (os != null && os.size() > 0) {
CodegenOperation op = os.get(os.size() - 1);
op.hasMore = null;
}
}
return operations;
}
public Map<String, Object> processModels(CodegenConfig config, Map<String, Model> definitions, Map<String, Model> allDefinitions) {
Map<String, Object> objs = new HashMap<String, Object>();
objs.put("package", config.modelPackage());
List<Object> models = new ArrayList<Object>();
Set<String> allImports = new LinkedHashSet<String>();
for (String key : definitions.keySet()) {
Model mm = definitions.get(key);
CodegenModel cm = config.fromModel(key, mm, allDefinitions);
Map<String, Object> mo = new HashMap<String, Object>();
mo.put("model", cm);
mo.put("importPath", config.toModelImport(key));
models.add(mo);
allImports.addAll(cm.imports);
}
objs.put("models", models);
List<Map<String, String>> imports = new ArrayList<Map<String, String>>();
for (String nextImport : allImports) {
Map<String, String> im = new LinkedHashMap<String, String>();
String mapping = config.importMapping().get(nextImport);
if (mapping == null) {
mapping = config.toModelImport(nextImport);
}
if (mapping != null && !config.defaultIncludes().contains(mapping)) {
im.put("import", mapping);
imports.add(im);
}
// add instantiation types
mapping = config.instantiationTypes().get(nextImport);
if (mapping != null && !config.defaultIncludes().contains(mapping)) {
im.put("import", mapping);
imports.add(im);
}
}
objs.put("imports", imports);
config.postProcessModels(objs);
return objs;
}
}

View File

@@ -0,0 +1,10 @@
package io.swagger.codegen;
import java.io.File;
import java.util.List;
public interface Generator {
Generator opts(ClientOptInput opts);
List<File> generate();
}

Some files were not shown because too many files have changed in this diff Show More