Commit Graph

1743 Commits

Author SHA1 Message Date
xhh
9b4b0111ad Merge branch 'master' into ruby-object-tests 2016-03-04 12:45:42 +08:00
wing328
c51f4c629e to fix #2306 2016-03-04 12:08:57 +08:00
wing328
a92a9f2a03 Merge pull request #1990 from expectedbehavior/php-raw-string
[PHP] Use String instead of Byte Array
2016-03-04 10:57:59 +08:00
wing328
1e4fb0ec96 Merge pull request #2301 from wing328/update_test_file
Update wording for test files
2016-03-04 10:23:13 +08:00
Elijah Miller
74536af3b9 Map binary to string in PHP since ByteArray is no longer in use. 2016-03-03 11:01:13 -05:00
Elijah Miller
6698c532e6 Keep PHP binary responses as strings for easier manipulation. 2016-03-03 11:01:13 -05:00
xhh
8e4f9fdc7c Add test cases for empty "object" type to Ruby Petstore
And fix the deserialization of empty "object" property
2016-03-03 20:36:15 +08:00
wing328
7e63226ed4 update wording for test file, minor tweats to petstore test 2016-03-03 20:19:37 +08:00
wing328
d2bb505147 Merge pull request #1752 from justusth/master
Csharp Enums
2016-03-03 18:00:36 +08:00
Tommy Alander
27fc4ba4e8 remove unused line 2016-03-03 10:33:51 +01:00
wing328
1f2026576f Merge pull request #2297 from xhh/object-without-properties
Do not generate models for "object" type with no properties
2016-03-03 17:10:34 +08:00
Tommy Alander
2d6dac16b7 add cli option to specify if to emit default values in datamember 2016-03-03 08:32:23 +01:00
xhh
f9cc29fb74 Update petstore to use an inline model for testing
and add test cases to Java clients for "object" type with no properties.
2016-03-03 12:48:44 +08:00
Tommy Alander
cb6a71ae89 Merge remote-tracking branch 'main/master' 2016-03-02 19:48:58 +01:00
Tommy Alander
23a7af4716 regen test code for petstore csharp and fix test errors 2016-03-02 19:47:45 +01:00
xhh
7bea6da587 Do not generate models for "object" type with no properties
Also updated the petstore sample to include operations to cover the case
in model property and response, and updated Java clients to sync with
it.

Closes #2237
2016-03-02 21:12:27 +08:00
wing328
057e1d4c4b proper indention for swift generator 2016-03-02 15:46:24 +08:00
Tommy Alander
cd0c99655c Merge remote-tracking branch 'main/master' 2016-03-02 08:41:01 +01:00
Thomas Gilbert
dea699f1ef Update petstore swift client 2016-03-02 08:14:37 +01:00
delenius
067d0a9318 Remove toJson method from JS client
Also regenerates the petstore samples.
2016-03-01 07:41:31 -08:00
Rastislav Kostrab
734681ad59 Javascript samples updated 2016-03-01 14:39:16 +01:00
Tommy Alander
cbbc2cf5ae Merge remote-tracking branch 'main/master' 2016-03-01 09:05:13 +01:00
xhh
8e937bd0a8 Merge branch 'master' into java-local-var 2016-03-01 12:06:44 +08:00
xhh
665ffa355b Android: add localVar prefix for "response" and "builder" 2016-03-01 12:04:46 +08:00
xhh
cc08be6eda Fix concurrent_unit_version in android-volley build.gradle
Closes #2228
2016-03-01 10:50:41 +08:00
xhh
a42f972dfe Clojure client: update Petstore sample, fix tests 2016-02-29 19:06:12 +08:00
xhh
75c2cc9029 Android client: better local variable naming
and fix the importing of Long and Byte
2016-02-29 18:27:23 +08:00
wing328
3106cadaf7 Merge pull request #2273 from xhh/java-local-var
[Java] better local variable naming for Java clients
2016-02-29 18:20:52 +08:00
wing328
d665903b3f Merge pull request #2149 from dhontecillas/master
support latest Retrofit 2 v2.0.0-beta4
2016-02-29 18:05:14 +08:00
Tommy Alander
a2be66d492 Merge remote-tracking branch 'main/master' 2016-02-29 08:24:31 +01:00
xhh
9b229de79f Java clients: better local variable naming 2016-02-29 13:23:56 +08:00
wing328
74d91f4ea1 add prefix, suffix to ts model 2016-02-29 12:11:54 +08:00
wing328
9f3c34dbfa Merge pull request #2267 from wing328/objc_model_prefix
[ObjC] add prefix and suffix support to ObjC models
2016-02-28 18:49:50 +08:00
wing328
f3a1f829d0 Merge pull request #2266 from wing328/php_better_local_var
[Ruby][Python][PHP] better local variable naming for ruby, python and php
2016-02-28 18:23:11 +08:00
wing328
742e3f5070 remove 'method' from python api 2016-02-28 16:51:50 +08:00
wing328
dfa977627a better reserved word for objc 2016-02-28 15:52:51 +08:00
wing328
f68e93c662 better local variable naming for ruby, python and php 2016-02-28 11:48:14 +08:00
wing328
335a881091 Merge pull request #2264 from wing328/csharp_enhancement_variable
[C#] better local variable naming for C# API client
2016-02-28 11:44:40 +08:00
wing328
8a68a64609 Merge pull request #2261 from wing328/php_model_name_improve
[PHP][Python][Perl] add prefix/suffix support to model name
2016-02-28 11:28:26 +08:00
wing328
b077ff18a2 better local variable naming for C# 2016-02-28 02:15:29 +08:00
wing328
72843adae2 Merge pull request #2244 from hideya/feature/2120
Fix #2120, #2157 - Update Swift API method generation for ease of use
2016-02-28 01:09:28 +08:00
wing328
5db16325d4 update perl model to support prefix and suffix 2016-02-27 21:47:07 +08:00
hideya kawahara
9ee154c13a Make {{projectName}}API namespace for API classes optional 2016-02-27 19:38:12 +09:00
wing328
28769ac671 add prefix and suffic support to php and python models 2016-02-27 18:30:56 +08:00
David Hontecillas
0fe8f7e375 fix build.gradle template for retrofit2 2016-02-26 13:34:57 +01:00
xhh
432fb84a06 Handle reserved operationId/model name in JS client 2016-02-26 19:56:52 +08:00
xhh
35079fedef Merge branch 'master' into java-reserved-operation-id
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java
2016-02-26 11:34:47 +08:00
hideya kawahara
ac3ab477d3 Update Swift API method generation for ease of use 2016-02-26 09:21:30 +09:00
David Hontecillas
6788c89816 fix templates for retrofit2rx and build.gradle 2016-02-25 17:00:56 +01:00
wing328
41c0034794 Merge pull request #2243 from wing328/python_better_reserved_word
[Pytthon] better reserved word handling for objc
2016-02-25 22:46:08 +08:00
wing328
2d4ccbfd79 add test case to python, better resered word handling for objc 2016-02-25 20:09:58 +08:00
David Hontecillas
4ba806f656 update tests for retrofit beta4 2016-02-25 11:34:48 +01:00
wing328
005584cf2a Merge pull request #2240 from wing328/csharp_better_reserved_word
[C#] add better reserved keyword handling for c#
2016-02-25 17:04:44 +08:00
xhh
6b6f0df985 Handle reserved operationId/modelName in Java/Android clients 2016-02-25 16:28:11 +08:00
wing328
700a157b40 Merge pull request #2236 from hideya/fix/2156
Fix 2156 - Use fixed date/time in operation.examples to avoid unnecessary diffs
2016-02-25 16:02:14 +08:00
wing328
329223f364 add better reserved keyword handling for c# 2016-02-25 15:35:05 +08:00
wing328
a351724365 Merge pull request #2239 from wing328/php_reserved_words
[PHP] better reserved words handling for method and model names
2016-02-25 15:06:14 +08:00
wing328
b20c90a346 Merge pull request #2238 from xhh/ruby-empty-reserved-operation-id
[Ruby] Handle empty/reserved operation id
2016-02-25 14:51:58 +08:00
wing328
6962947611 better handling of model (reserved keyword) 2016-02-25 14:16:40 +08:00
wing328
4e034d3dc5 better reserved word handling for php 2016-02-25 13:16:54 +08:00
xhh
52c9d67025 Update petstore spec and fix tests 2016-02-25 12:20:17 +08:00
wing328
b5ba52111d Merge pull request #2229 from xhh/js-optional-params
[JavaScript] Support optional parameters with object syntax
2016-02-25 11:53:56 +08:00
xhh
84c6b869f8 Ruby client: handle empty/reserved operation id
by using a normalized one instead of throwing errors
2016-02-25 11:48:30 +08:00
xhh
72b9e2dd81 Update petstore javascript-promise sample and tests 2016-02-25 10:43:45 +08:00
wing328
484ed848ac Merge pull request #2230 from wing328/perl_reserved_word
[Perl] better handling of reserved keyword in Perl
2016-02-25 10:26:53 +08:00
hideya kawahara
a13bba5dc5 Use fixed date/time in operation.examples to avoid unnecessary diffs 2016-02-25 11:20:30 +09:00
wing328
b561acb966 Merge pull request #2220 from xhh/java-exception-javadoc
[Java] Add ApiException to javadoc
2016-02-24 22:40:35 +08:00
wing328
2ed02ee187 better handling of reserved keyword in perl 2016-02-24 21:57:29 +08:00
xhh
baf5d2895e JS client: support optional parameters with object syntax
Closes #2027
2016-02-24 20:55:46 +08:00
xhh
37c77d63c2 Java client: add ApiException to javadoc
and some indentation fixes
2016-02-23 20:09:46 +08:00
wing328
eed91d335d remove exception comment on model constructor to avoid compile warning 2016-02-23 19:32:49 +08:00
wing328
82d7c2d780 add test case, update c# model constructor to remove readonly property 2016-02-23 19:16:26 +08:00
wing328
0520e68e29 Merge pull request #2206 from xhh/java-readonly
[Java] Do not generate setter method for readonly properties
2016-02-23 16:20:32 +08:00
Tony Tam
d99de3199c fixes #2214 2016-02-22 16:35:02 -08:00
xhh
909d1b537b Support readonly properties for Java retrofit clients 2016-02-22 19:00:57 +08:00
xhh
b8beca7f24 Java: do not generate setter for readonly properties 2016-02-22 15:50:43 +08:00
xhh
8c36ed8409 Merge branch 'master' into java-imports
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
2016-02-22 09:24:58 +08:00
wing328
91da8fef52 fix typo 2016-02-21 23:33:53 +08:00
wing328
b3b4670055 add exception comment, minor enhancement to param description 2016-02-21 23:31:19 +08:00
wing328
d42f23f829 update test case, minor fix to required property in c# 2016-02-21 23:09:56 +08:00
wing328
890b7d17e3 add readonly property support to C# 2016-02-21 22:36:04 +08:00
wing328
95ec991c52 add exception comment 2016-02-21 18:54:13 +08:00
wing328
74c512453e add .travis.yml 2016-02-20 21:54:00 +08:00
wing328
f27d2534a6 update php readme 2016-02-19 23:37:35 +08:00
wing328
a14015c1c7 Merge pull request #2174 from xhh/java-object-mapper-getter
[Java] Add getter/setter methods for objectMapper and httpClient in ApiClient
2016-02-19 18:31:01 +08:00
xhh
7296da7bc3 Fix tests by upgrading libraries 2016-02-19 17:48:59 +08:00
xhh
a892511b1f Add missing libs to Java jersey2 client 2016-02-19 13:24:16 +08:00
wing328
84b4af7bfb Merge pull request #2169 from xhh/ruby-nested-model-ref
[Ruby] Fix class name reference of nested model
2016-02-19 11:29:58 +08:00
wing328
13324f3ee7 Merge pull request #2178 from delenius/promise-tests
Update tests for javascript-promise-petstore
2016-02-19 11:25:32 +08:00
delenius
079addb6db More fine-grained fix
Instead of just ignoring default values in the generated
model constructors, we modify the generator code in Java.
The template checks for null before outputting a default value.
2016-02-18 11:12:01 -08:00
delenius
98fcaa2f15 Update tests for javascript-promise-petstore
This simply copies the new tests from javascript-petstore
into javascript-promise-petstore.
2016-02-18 08:35:07 -08:00
xhh
71a133dafe Merge remote-tracking branch 'origin/master' into ruby-nested-model-ref
Conflicts:
	samples/client/petstore/ruby/lib/petstore/api/pet_api.rb
	samples/client/petstore/ruby/lib/petstore/api/store_api.rb
	samples/client/petstore/ruby/lib/petstore/configuration.rb
2016-02-18 21:13:37 +08:00
xhh
de463cf170 Merge branch 'master' into java-object-mapper-getter
Conflicts:
	samples/client/petstore/java/default/src/main/java/io/swagger/client/ApiClient.java
2016-02-18 20:57:22 +08:00
wing328
eec806b54e Merge pull request #2158 from xhh/java-improvements
[Java] Remove unused jackson imports from Java models
2016-02-18 20:49:21 +08:00
xhh
b9a6a9b6ce Java: add getter/setter for ApiClient#objectMapper
and ApiClient#httpClient as well.

Closes #2134
2016-02-18 20:17:42 +08:00
wing328
615b2727ec Merge pull request #2171 from wing328/php_test_memory_limit
[PHP] update php test case with higher memory limit
2016-02-18 20:03:50 +08:00
wing328
eecce8d2d0 Merge pull request #2170 from wing328/feature_all_models_postprocess
Add postProcessAllModels to default generator
2016-02-18 16:53:43 +08:00
wing328
fd9a62adbe update php test case with higher memory limit 2016-02-18 16:40:13 +08:00
wing328
0b125984da add postProcessAllModels 2016-02-18 16:15:15 +08:00
xhh
a21493f2db Ruby: fix class name reference of nested model
and model name in underscore format, e.g. "my_response".

Closes #2140
2016-02-18 15:29:31 +08:00
delenius
692c865c76 Handle empty response.body from superagent
Superagent does not always produce a `body`. See
http://visionmedia.github.io/superagent/ for details. When it
doesn't, we should deserialize the raw `response.text` rather
than returning `null`. Currently, the JS client always returns
`null` when the return type is String! This commit fixes
that.
2016-02-17 22:39:53 -08:00
wing328
61215f31fb Merge pull request #2167 from xhh/javascript-fixes
[JavaScript] Some bug fixes
2016-02-18 13:17:04 +08:00
wing328
c1b4f8df06 Merge pull request #2132 from jimschubert/csharp_35_client
[csharp] Initial settings for v3.5 client compatibility
2016-02-18 12:02:00 +08:00
xhh
bb70073ca3 JavaScript: fix call to buildCollectisnParam
Closes #2166
2016-02-18 10:31:21 +08:00
xhh
33d7d7b4b1 JavaScript: update Petstore sample and fix tests 2016-02-18 10:20:01 +08:00
Jim Schubert
1d57e70e76 [csharp] Set RestSharp to 105.1.0 due to bug in newer versions 2016-02-17 13:31:50 -05:00
xhh
cac8df949d Fix tests 2016-02-17 19:46:40 +08:00
xhh
b2ed17e63e Remove unused jackson imports from Java models
by fixing the logic of enum Boolean checking.

Other changes:

* Remove the `true &&` prefix from the `equals` method in models.
* Apply some changes of Java-default to Java-okhttp-gson, i.e. adding
  `this` and parent model handling.
* Some improvements on spaces and blank lines.
2016-02-17 18:03:27 +08:00
wing328
c4d799a4a7 Merge pull request #2155 from wing328/multi_auth_setting
Add support for multi-authentication setting
2016-02-17 15:24:05 +08:00
wing328
a47cdddbeb Merge pull request #2056 from xhh/javascript-auth
[JavaScript] Add authentications support to JavaScript client
2016-02-16 22:08:50 +08:00
wing328
a87ce3181b Merge pull request #2125 from hideya/fix/objc-method-naming
[ObjC] Fix #2121, generated method names don't follow coding convention
2016-02-16 17:55:50 +08:00
wing328
a4825d8142 add multi auth setting (based on #1961) 2016-02-16 17:17:42 +08:00
xhh
7beb7373c2 Merge branch 'master' into javascript-auth
Conflicts:
	modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache
	modules/swagger-codegen/src/main/resources/Javascript/api.mustache
2016-02-16 17:08:58 +08:00
hideya kawahara
753499e204 generated ObjC method names to follow Apple's coding convention 2016-02-16 10:55:36 +09:00
delenius
59931ef0f7 Correct exporting of enum classes
Fixes #2102.
2016-02-15 07:46:14 -08:00
wing328
516a9413a2 update pom.mustache and sample 2016-02-15 18:24:57 +08:00
wing328
816ae0bb3f update pom for okhttp-gson java to test gradle 2016-02-15 18:17:35 +08:00
xhh
908ab83d9b Java okhttp-gson: fix dependencies 2016-02-15 16:48:58 +08:00
wing328
a159998293 Merge pull request #2115 from delenius/enums
Use objects for enums, not constructor functions
2016-02-15 10:29:34 +08:00
wing328
5b0d8b1f13 Merge pull request #2114 from delenius/static-factories
Use static model factory methods
2016-02-15 10:13:09 +08:00
wing328
326ff340dc Merge pull request #2128 from who/master
Adding PATCH header override the default Java client
2016-02-15 10:03:57 +08:00
Jim Schubert
0f6038f3b1 [csharp] Initial settings for v3.5 client compatibility
Pass -DtargetFramework=v3.5 to generate .NET 3.5 client
2016-02-13 10:55:54 -05:00
wing328
23a90b7dcc remove objc, add pom.xml to test C# petstore client 2016-02-13 17:43:38 +08:00
wing328
2fcbc38b67 fix objc binary mapping, add objc,swift to CI tests 2016-02-13 16:29:35 +08:00
Andrew B
a303a09749 Adding PATCH header override the default Java client 2016-02-12 18:52:49 -08:00
delenius
fa2333717a Use static model factory methods
The `constructFromObject` factory methods should be class methods
(or "static" methods), not instance methods.

With this commit, ApiClient no longer calls the model constructors
directly. Instead, it calls the new static factory method to get the
new instance. If there is no data on the top level, null is returned.

It is still possible for users to call the model constructors
directly, of course.
2016-02-12 07:54:04 -08:00
delenius
86154f87c3 Use objects for enums, not constructor functions
Fixes #2101.
2016-02-12 07:53:51 -08:00
wing328
81593bc4f6 add delay script, update CI test to run ruby test first 2016-02-12 18:46:19 +08:00
wing328
6dfc86f1d2 Merge pull request #2087 from delenius/optional-params
Fix handling of missing optional params
2016-02-11 19:16:39 +08:00
wing328
7cb2898f47 update perl pom with new test folder 2016-02-11 09:30:41 +08:00
delenius
c7766457bd Don't set missing optional params in models
Fixes #2103.

In the constructFromObject methods, we were always setting all the
parameters, including optional ones that were missing in the `data`
object. Because of the `convertToType` calls, this had the effect
of producing the *strings* `"undefined"` or `"null"` as property
values on the constructed object! This obviously leads to difficult
bugs.

This commit makes sure that we first check that the data field
exists in the data object. Note that both `null` and `undefined`
values will be skipped.
2016-02-10 17:18:31 -08:00
wing328
3d9a331666 automaticallay generate test cases for Perl 2016-02-11 08:24:51 +08:00
wing328
f53abf7d8e Merge pull request #2083 from wing328/csharp_minor_fix
[C#] minor fix to documentation comment in Configuration class
2016-02-10 22:33:43 +08:00
wing328
e7b18a04d9 Merge pull request #2062 from jimschubert/csharp_common
[csharp][aspnet5] AbstractCSharpCodegen base
2016-02-10 21:33:30 +08:00
Tatsuki Sugiura
0ea7ae1c16 ruby: Add test for boolean convertion. 2016-02-10 19:18:03 +09:00
Joseph Zuromski
694d735edc [Swift] fix issue 1994: make sure we don't crash if rawValue returns nil when trying to create an enumeration - instead return nil which allows the instance variable to be nil in this case (it will still try to unwrap the optional though if you declare the enumeration as a required property)
note: there aren't really any tests I can add to validate this since the service is always returning valid enumerations. but I did update the sample code.
2016-02-09 12:59:14 -08:00
Jim Schubert
37d07e1012 [csharp][aspnet5] AbstractCSharpCodegen base
This moves a bit of logic into a base type to prevent lots of
duplicates.

I've only converted csharp and aspnet5 generators, not csharp 2.0.

This base class should provide enough flexibility to support other C#
based client and server generators.
2016-02-09 12:37:59 -05:00
wing328
a36966d961 Merge pull request #1991 from jaz-ah/issue-1989
[Swift] fix issue 1989: generate AnyObject type from json object type instead…
2016-02-10 00:42:39 +08:00
Joseph Zuromski
cf7fc1a61b make SwaggerClient a shared scheme 2016-02-09 08:30:27 -08:00
wing328
fed231c46d fix documentation comment in Configuration class (C#), make
compile-mono permission executable
2016-02-09 22:13:47 +08:00
delenius
aab96ec772 Remove unused callback param when using promises 2016-02-08 23:39:05 -08:00
delenius
7301618671 Add petstore tests for usePromises version 2016-02-08 20:02:38 -08:00
Joseph Zuromski
d84953d504 add in more tests 2016-02-08 15:22:32 -08:00
Joseph Zuromski
2465f398da add a couple more user tests 2016-02-08 14:43:08 -08:00
Joseph Zuromski
fff0951771 add in some real tests 2016-02-08 14:23:22 -08:00
Joseph Zuromski
288acdb2d4 one more gitignore to keep git clean after build 2016-02-08 13:04:18 -08:00
Joseph Zuromski
7c4983df16 fixup gitignore/schemes 2016-02-08 12:59:35 -08:00
Joseph Zuromski
4a0c7966a1 add in pods 2016-02-08 12:56:49 -08:00
Joseph Zuromski
bc0658e81c add in initial swift client tests 2016-02-08 12:51:14 -08:00
delenius
153faebc6d Modify JS PetStore tests for prototypes change
This is just the result of running ./bin/javascript-petstore.sh
after the fix for #2044.
2016-02-08 12:39:30 -08:00