Commit Graph

31 Commits

Author SHA1 Message Date
Ferris Tseng
c30c586f94 update petstore sample 2016-06-17 15:46:36 -04:00
wing328
8085e11063 add license header to JS cient, update sample 2016-06-15 01:18:04 +08:00
xhh
020a9fcdc0 Fix enum model docs for JS and Java clients 2016-05-06 18:41:15 +08:00
xhh
5acef6d634 Update petstore sample for JS-promise client 2016-05-06 18:02:32 +08:00
wing328
ab7b73ca21 update js samples 2016-05-01 12:09:23 +08:00
wing328
2d5cc50bd1 Merge branch 'master' of https://github.com/demonfiddler/swagger-codegen into demonfiddler-master
Conflicts:
	samples/client/petstore/javascript-promise/README.md
	samples/client/petstore/javascript-promise/docs/PetApi.md
	samples/client/petstore/javascript-promise/docs/StoreApi.md
	samples/client/petstore/javascript-promise/src/api/PetApi.js
	samples/client/petstore/javascript-promise/src/index.js
	samples/client/petstore/javascript/README.md
	samples/client/petstore/javascript/docs/PetApi.md
	samples/client/petstore/javascript/docs/StoreApi.md
	samples/client/petstore/javascript/src/api/PetApi.js
	samples/client/petstore/javascript/src/index.js
2016-05-01 12:05:49 +08:00
wing328
8d9a09efb1 update JS test case 2016-04-30 21:36:25 +08:00
wing328
7f09a86a1e update wording related to git 2016-04-30 20:23:35 +08:00
Kevin Glinski
2beeabb33a fixing typeos 2016-04-14 08:22:56 -04:00
wing328
0e1f1606cd update js code gen to handle different type, format 2016-04-11 22:20:30 +08:00
demonfiddler
77638bc21d Merge https://github.com/swagger-api/swagger-codegen 2016-03-31 14:38:15 +01:00
wing328
f23031fc96 add new files for JS 2016-03-30 21:54:38 +08:00
wing328
20f1e97df3 fix typo in readme 2016-03-30 20:58:18 +08:00
demonfiddler
14ceb4bf84 Fix, tests for Issue#2240 "Support invokerPackage configuration option" 2016-03-25 16:36:06 +00:00
wing328
eb5c689fac update js sample 2016-03-24 19:54:25 +08:00
demonfiddler
3082702429 [JavaScript] Recommission integration tests for Issue#2258. 2016-03-18 18:49:17 +00:00
xhh
4100a8537b Display parameter's default value for operations
Done for Java clients (default, jersey2, okhttp-gson), Ruby client and
JavaScript client.
2016-03-17 16:22:36 +08:00
xhh
dfe57bfd6b JS client: remove "undefined" from model dependency arguments
Closes #2279
2016-03-07 15:57:13 +08:00
delenius
067d0a9318 Remove toJson method from JS client
Also regenerates the petstore samples.
2016-03-01 07:41:31 -08:00
xhh
72b9e2dd81 Update petstore javascript-promise sample and tests 2016-02-25 10:43:45 +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
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
delenius
59931ef0f7 Correct exporting of enum classes
Fixes #2102.
2016-02-15 07:46:14 -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
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
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
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