wing328
acb34e3db0
better JS enum class support
2016-05-03 11:21:17 +08:00
wing328
d35e30d578
better enum support for JS
2016-05-03 11:21:17 +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
83567861e0
update JS readme to use gitUserId instead
2016-04-30 20:15:45 +08: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
wing328
04e56a165e
update js doc
2016-03-19 11:11:18 +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
90bd843be6
JavaScript: add auto-generated documentation in Markdown
2016-03-16 19:42:27 +08:00
wing328
a529d9dfe0
push new git_push and .gitinore file
2016-03-12 18:01:53 +08:00
wing328
637bdd2f50
add git_push and gitignore to most client generators
2016-03-12 17:35:25 +08:00
xhh
dfe57bfd6b
JS client: remove "undefined" from model dependency arguments
...
Closes #2279
2016-03-07 15:57:13 +08:00
xhh
8d964cff52
Handle arbitrary object in JS client
...
Closes #2165
Other changes:
* Update JS client of the Petstore sample
* Add test cases for getPetByIdInObject and getInventoryInObject
2016-03-04 18:40:03 +08: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
xhh
432fb84a06
Handle reserved operationId/model name in JS client
2016-02-26 19:56:52 +08:00
xhh
baf5d2895e
JS client: support optional parameters with object syntax
...
Closes #2027
2016-02-24 20:55:46 +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
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
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
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
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
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
xhh
d52ebdf684
JavaScript client: Add authentications support
...
Closes #1952
2016-02-06 16:26:15 +08:00
xhh
47f25efb25
JavaScript client: support collectionFormat for parameters
...
Closes #1953
2016-02-04 16:30:41 +08:00
xhh
2eb125681e
JavaScript client: handle response deserialization
...
to support array of models and Date property in model
Closes #1951
2016-02-04 12:36:44 +08:00
xhh
c7fa44cd0c
Fix ApiClient.isFileParam in browserify runtime
...
Closes #2028
2016-02-04 08:43:13 +08:00
xhh
5463015725
JavaScript client: use brackets to access mobel properties
...
to support nonstandard characters in property names, e.g. "user-status".
2016-02-03 16:01:33 +08:00
xhh
794589d6b8
JavaScript: add default headers and some tests
2016-01-22 18:46:29 +08:00
xhh
16e367bdc8
JavaScript: fix constructFromObject for Array fields
...
Closes #1721
2016-01-22 11:23:45 +08:00
xhh
3b5462c1e9
Use String for "binary" as a workaronud
2016-01-20 10:34:36 +08:00
xhh
9c580a2447
Set accept header for JavaScript client
2016-01-20 10:29:09 +08:00
xhh
40d83e7f52
Some cleanup
2016-01-19 22:52:05 +08:00
xhh
14630c7632
Make JavaScript client work in both Node.js and browser
...
* Replace jQuery with SuperAgent which works in both Node.js and browser
* Use UMD pattern (returnExports.js) to make the module exporting compatible
with all major systems: AMD, Node.js (CommonJS) and browser
* Implement support of header and form parameters. Closes #1736
* Move HTTP requesting code to `ApiClient` and allow customizing options
in it, e.g. "basePath"
* Update unit tests accordingly and add some tests for `ApiClient`
2016-01-19 22:21:36 +08:00
xhh
1777124e62
Javascript: remove call to apiClietn.parameterToString
2015-12-17 21:37:04 +08:00
xhh
1b0294dac0
Javascript: fix the constructFromObject issue
...
Closes #1721
Also fixed indentations in models
2015-12-17 21:29:58 +08:00
xhh
a58f755a6a
Escape path parameters with encodeURIComponent
...
and tweak the test command
2015-12-17 21:19:28 +08:00
xhh
f07b75f419
Include Javascript client into integration test
...
and return the promise-like result of $.ajax for API
2015-12-17 20:41:09 +08:00