Commit Graph

4953 Commits

Author SHA1 Message Date
Cliffano Subagio
ea30a4a7f8 [Ruby] Chunked file download (#5718)
* [Ruby] Modify file download to be written in chunks in order to handle large files. #5704

* [Ruby] Update Ruby Petstore with file download improvement. #5704
2017-05-29 14:56:48 +08:00
wing328
ef35b80bd8 Fixed missing isWildcard method used in templates 2017-05-29 11:45:28 +08:00
René Winkelmeyer
3d97d83f7a Apex update for NamedCredentials and Salesforce DX (#5717)
* Added mustache file for namedCredentials

* Removed Basic and OAuth from Apex API in favor of NamedCredentials

* Moved old README to README for ant deployment

* Added SFDX OSS descriptor

* Removed remoteSite mustache

* Changed package.xml from RemoteSite to NamedCredential

* Update ApexClientCodegen to support SFDX and namedCredentials

* Created initial README for Salesforce DX

* Ran Petstore test for Apex commit

* Fixed error in README mustache
2017-05-29 11:16:06 +08:00
Michael Langford
b1ccaf69ac Updates http-client dependency to correctly handles certificates (#5707)
* Updates http-client dependency to one that correctly handles certificates

This is important as amazon AWS gateway and several other types of certificates will not work correctly due to the old java library used by the 2.0.0 version of http-client.

* Runs the petstore updates switch for clojure

* Runs the petstore updates switch for clojure
2017-05-27 00:27:11 +08:00
wing328
4d705081c8 [PHP] Fix broken links in the auto-generated documentation (#5715)
* remove trailing space in cpprest, update samples

* remove unused pom.xml in go pestore

* fix broken links in php api doc by fixing baseType

* fix csharp api doc

* fix php examples

* fix examples for abstract php generator
2017-05-26 21:47:49 +08:00
Takuro Wada
a2240ac619 [htmlDocs2] inconsistent python method name between html2 and python generator (#5711) 2017-05-26 17:24:06 +08:00
Svarog
84df23f025 Made httpMethod in curl example actually upper case in html2 to support firefox (#5558) (#5705) 2017-05-26 17:19:09 +08:00
rompic
ef53f08b09 fixed #5692 and regenerated samples (#5698) 2017-05-24 23:26:33 +08:00
wing328
b024288df2 JS ES6 enhancements 2017-05-24 16:50:32 +08:00
Dinuka De Silva
ca139ffc05 Gh-4044: Enabling ES6 in javascript client (#5593)
* gh-4044: Added useES6 as an option for javascript templates

* gh-4044: Enabled ES6 in `javascript/api.mustache`

* gh-4044: Enabled ES6 in `javascript/ApiClient.mustache`

* gh-4044: Enabled ES6 in `javascript/enumClass.mustache`

* gh-4044: Added useES6 cli option to `javascript` clients and updated the test cases

* gh-4044: Enabled ES6 in `javascript/index.mustache`

* gh-4044: Enabled ES6 in `javascript` model templates
* `javascript/model.mustache`
* `javascript/partial_model_generic.mustache`
* `javascript/partial_model_enum_class.mustache`
* `javascript/partial_model_inner_enum.mustache`

* gh-4044: Separated `javascript-es6` templates to another folder

* gh-4044: Updated `javascript-es6/index.mustache`

* gh-4044: Enabled ES6 in `javascript-es6/api_doc.mustache`

* gh-4044: Added required dependencies for ES6

* gh-4044: Updated Supportig files for ES6 and non ES6

* gh-4044: Added test scripts to verify `javascript` useEs6 option

* gh-4044: Commented `javascript-es6` scripts due to the permission issues.
2017-05-24 16:35:54 +08:00
mtakaki
165c116661 Moving import-mappings out of configOptions and converting it into a list, rather than being a comma-separated string. (#5384)
* Moving import-mappings out of configOptions and converting it into a list, rather than being a comma-separated string. #5383

* Making the change to importMappings backwards compatible
2017-05-23 21:46:27 +08:00
kirpit
e12b22d5ce Implement generating interfaces option for api resources, closes #5453. (#5519)
* Implement generating interfaces option for api resources, closes swagger-api/swagger-codegen#5453.

This commit introduces another _system property_ for typescript-angular2, called `withInterfaces` that is default to `false`. You can activate this flag by:

```
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l typescript-angular2 -o samples/server/petstore/springboot/typescript-angular2 \
-D withInterfaces=true
```

If set to `true`, generated api resource classes will be implemented with their interfaces in separate files.

This change should not break and change the behaviour even though `withInterfaces` flag set to `true`. You are also welcome to create your own custom resource class by implementing those generated interfaces as they support defining new attributes with `[others: string]: any;` signature.

* Fix unit test for typescript/angular2 client options for "withInterfaces"

* Use double quote to follow coding standard

* Respect interface naming convention for typescript/angular2

 Create respectful interface names that ends with `Interface` suffix, instead of prefixing with `I` according to typescript naming convention. This is also consistent with their file names that also ends with `Interface.ts`.

 Also fixes the merge conflicts.

* Have better explanation for the `withInterfaces` system config
2017-05-23 21:40:21 +08:00
wing328
82740de5a0 Merge branch 'master' of https://github.com/christof-vollrath-bild-de/swagger-codegen into christof-vollrath-bild-de-master 2017-05-23 17:57:54 +08:00
René Winkelmeyer
9f1c3e3e50 Updated default Apex API version to v39 (Spring '17 release) (#5678) 2017-05-21 16:04:37 +08:00
wing328
8314f4e78a Add removeOperationIdPrefix option (#5674)
* add removeOperationIdPrefix option

* remove removeOperationIdPrefix from cli option for generators
2017-05-21 01:28:06 +08:00
wing328
7edf744426 [Apex] add petstore samples, shell scripts, batch files (#5672)
* add apex petstore samples, shell scripts, batch files

* add wording "beta" to Apex help
2017-05-20 01:02:08 +08:00
wing328
a0482a4038 Add support for Apex API client (#5669)
* Salesforce Apex support

* typo in function name

* comments for clarification

* DoubleProperty and FloatProperty are both DecimalProperty

* test models with default and provided example property values

* adding some more default example values
2017-05-19 23:18:52 +08:00
Jean-François Côté
ef2028e53f [Java Play Framework] Warnings removal and default value fix (#5660)
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.

* Fix suggestions in the PR discussion + add .bat and .sh file as requested.

* Updated Readme.md file

* Remove unused mustache file + fix baseName vs paramName in all the mustache files.

* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.

* Fix the problem with the Http.MultipartFormData.FilePart

* Removal of warning (final) and fix of a missing default value for boolean query parameters
2017-05-19 22:32:19 +08:00
Takuro Wada
ad0838f0a0 [ts-ng2] add check whether header parameter is undefined or not (#5668) 2017-05-19 18:23:17 +08:00
Jean-François Côté
4479382ced [Java Play Framework] Fix conversions (#5604)
* First commit of the Java Play Framework server generator. It is highly based on Spring so there might me a couple of things that don't make sense (like options or parameters) for the Play Framework.

* Fix suggestions in the PR discussion + add .bat and .sh file as requested.

* Updated Readme.md file

* Remove unused mustache file + fix baseName vs paramName in all the mustache files.

* Fix the compilation error when we have a body which is a list or map. Doesn't fix the problem with the annotation itself.

* Fix the problem with the Http.MultipartFormData.FilePart

* Fix the conversion of boolean type

* Add samples for the fix with the boolean

* Fix bugs introduced by polci related to the bean validation.

* Refactor to use the "beanValidationCore". Asked by @wing328
2017-05-18 16:19:48 +08:00
David Biesack
632a2e3949 Fix #5653 so body parameter schema link matches model anchor (#5655)
* Sync with upstream/master

* Fix for issue #5653

Override the toModelName(String name) [from DefaultCodegen] in StaticHtmlGenerator to return `name` unmodified
so that the anchors for models and the href for body parameters match case (do not convert model names to TitleCase.

* Revert "Fix for issue #5653"

This reverts commit 5472aa10a3101ea5dd417bc509c5d9c5351a3d66.

* Fix for issue #5653

Override the toModelName(String name) [from DefaultCodegen] in StaticHtmlGenerator to return `name` unmodified
so that the anchors for models and the href for body parameters match case (do not convert model names to TitleCase.
2017-05-18 15:16:42 +08:00
Harald Walker
4417bb6b32 #5649 Fix FileAlreadyExistsException when downloading file using jersey2 (#5654)
* #5649 Fix download file copy

* Include generated pet store samples and fix indentation

* Regenerate petstore sample to fix indentation
2017-05-18 15:12:53 +08:00
Cas Perl
a6b7f60ac7 Python improved (#5512)
* ignore .vscode

* fixed test case for models requiring mandatory attributes. added deserialize test for enum class

* construct model with mandatory attributes. improve class reflection (e.g. deserialize). disable generated empty model unit test for further FIXME

* rebuilt samples

* FIXME comment

* FIXME comment

* fix deserialization enum test
2017-05-17 21:18:51 +08:00
Benjamin Douglas
be3cfda3ce Disable Jackson FAIL_ON_INVALID_SUBTYPE in feign (#5597)
* Disable Jackson FAIL_ON_INVALID_SUBTYPE in feign

With this change, Jackson does not fail even if it doesn't recognize a
discriminator type name. This is helpful when upgrading a microservice with
a new subtype while keeping compatibility with its old clients. The instance
is returned as null instead of throwing an exception deep in the feign
framework, allowing clients to gracefully degrade.

* Disable FAIL_ON_INVALID_SUBTYPE for all Jackson-based projects
2017-05-16 21:20:05 +08:00
Kyle Cacciatore
046b730446 Upgraded connexion to 1.1.9 - required change to encoder as connexion is isolating implementation specific code (#5645) 2017-05-16 21:07:21 +08:00
wing328
0a67696de8 Merge branch 'empty_classes' of https://github.com/bbdouglas/swagger-codegen into bbdouglas-empty_classes 2017-05-16 17:51:42 +08:00
Brendan Burns
c5d1c5d73b Extract out a new helper method from java ApiClients (#5648) 2017-05-16 13:59:06 +08:00
wing328
63facc0b0b add null/nil as reserved keyword (#5647) 2017-05-16 00:02:27 +08:00
mtakaki
9c46ab2599 Fixing import-mappings and using it when generating API stub. #2502 (#5373) 2017-05-14 22:26:02 +08:00
René Pfeuffer
54febc38e6 #5615 [Java] recognize 'null' as a reserved keyword (#5617) 2017-05-14 11:59:13 +08:00
Takuro Wada
a7d5684679 [Python] add an option to Config in order to specify safe chars for path parameter (#5628) 2017-05-14 11:54:26 +08:00
Takuro Wada
11baad6e4b [TypeScript-jquery] set default return type as any (#5630)
* [TypeScript-jquery] fix bug of empty returnType appearing if returnType is not provided

* chore: add security sample for typescript-jquery
2017-05-14 11:36:09 +08:00
sdoeringNew
98d53bc8d2 #5619 added getValue() method in generated Enum classes in Java (#5620) 2017-05-13 00:03:44 +08:00
Brendan Burns
e7a1f5fb17 [Java] Add custom SSL KeyManagers for okhttp-gson Java clients (#5629)
* Add the ability to set SSL KeyManagers for okhttp-gson Java clients

* Update generated code.

* Update security model files.
2017-05-12 23:49:00 +08:00
wing328
68864a2eea [JavaScript] Minor fix to JS doc and add swagger-codegen version to the file header (#5623)
* fix JS doc using instance instead of default

* update JS header with codegen version

* roll back change in swagger codegen version in pom.xml
2017-05-12 16:49:20 +08:00
Jim Schubert
eaa2dc6d21 [csharp] Fix project glob pattern (#5605)
This fixes the glob pattern to remove hard-coded namespaces, and exclude
the obj folder. This removes a newly introduced issue that breaks
apiPackage and modelPackage support and fixes a problem with Xamarin
pulling in obj/**.cs when globbing **/*.cs.
2017-05-11 01:01:45 +08:00
wing328
9b68f02f83 [Java][Spring] Undo "Add examples defined in the spec to Spring MVC server generator " (#5599)
* remove unused pom.xml in go pestore

* remove example support in JavaSprin (undo changes)
2017-05-10 17:31:43 +08:00
kenisteward
ec7b80abab #4962 Empty Response body handling in typescript-angular2 - added returning an empty object on response.json() failure (#5585) 2017-05-10 15:46:33 +08:00
Voydz
5a257a0558 [csharp] fixes for netstandard (json serializing and project files) (#5590) 2017-05-10 15:24:43 +08:00
wing328
fd3cae6c4b rename .swagger folder to .swagger-codegen 2017-05-09 17:07:45 +08:00
Jim Schubert
f25a7575d3 [generator] Adds a .swagger/VERSION file for all generators (#5556) 2017-05-09 16:59:48 +08:00
sabras75
824842290d Fix#5510 (#5582)
* Add overloads on signals.
The overload adds the NetworkError and the error string to the signal. Both signal will be emitted. Clients are supposed to subscribe to  only one of the overloads.

* refactor generated code alignement

* Do not use method overload for signals. Instead, have another naming convention for signal that carries Error information.
 Why ? Because signal overloading and QT5 connector with method referencing do not mix well (see http://stackoverflow.com/questions/16794695/connecting-overloaded-signals-and-slots-in-qt-5). It would need to specify exactly which overload to take. That is cumbersome to write AND is a breaking change for the consumer of the generated code.

* update qt5 sample files
2017-05-09 16:34:17 +08:00
Eric Bélanger
fa2e575762 [JavaSpring] add support for cascading bean validation (#5393) 2017-05-09 00:38:59 +08:00
Vincent Coetzee
409638676e Added code to templates to ensure correct generation of code for Swift3 (#5390)
* Added code to templates to ensure generation of code for Swift3 that builds on both Apple platforms and Linux. Fixed a bug in the Model decoders that prevented code from building for Linux

* Ran the script to generate the PetStore API
2017-05-08 18:26:30 +08:00
Takuro Wada
a81cff0ed0 [typescript-angular2] change OpaqueToken to InjectionToken<string> (Issue #5565) (#5569)
* change OpaqueToken to InjectionToken<string> and add useOpaqueToken option for typescript-angular2 (#5565)

* run security shell
2017-05-08 18:08:54 +08:00
Marcus Low Junxiang
adb213bc00 Modifying resty dependency to use stable release instead of HEAD (#5579)
* Modifying resty dependency to use stable release instead of HEAD

* adding dependency to pre-integration test
2017-05-08 09:55:13 +08:00
Luca Favatella
ea16da813c [Erlang] Plant CI for server (#5559)
* [Erlang] Address apparent reproducibily issue of sample

Spotted running `bin/erlang-petstore-server.sh` on d08d55d41 .

Apart from newlines, this is the opposite change of ec6248cbc .

* [Erlang] Perform basic testing of sample server on CI

* [Erlang] Install recent Erlang/OTP version

... in order to satisfy `jesse` compilation.

The error I faced is:
```
$ curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  766k  100  766k    0     0  1041k      0 --:--:-- --:--:-- --:--:-- 1041k
rebar 3.3.6 on Erlang/OTP R16B03 Erts 5.10.4
...
===> Verifying dependencies...
===> Fetching jesse ({git,"https://github.com/for-GET/jesse.git",
                                 {tag,"1.4.0"}})
===> Fetching jsx ({git,"https://github.com/talentdeficit/jsx.git",
                               {branch,"v2.8.0"}})
===> Skipping jsx (from {git,"git://github.com/talentdeficit/jsx.git",
                                    {tag,"2.8.0"}}) as an app of the same name has already been fetched
===> Compiling jsx
===> Compiling jesse
===> Compiling _build/default/lib/jesse/src/jesse_tests_util.erl failed
_build/default/lib/jesse/src/jesse_tests_util.erl:28: can't find include lib "common_test/include/ct.hrl"
_build/default/lib/jesse/src/jesse_tests_util.erl:55: undefined macro 'config/2'

_build/default/lib/jesse/src/jesse_tests_util.erl:24: function do_test/2 undefined

_build/default/lib/jesse/src/jesse_tests_util.erl:72: function test_schema/3 is unused
_build/default/lib/jesse/src/jesse_tests_util.erl:102: function get_path/2 is unused
_build/default/lib/jesse/src/jesse_tests_util.erl:105: function load_schema/1 is unused

[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:804)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751)
	at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (Erlang Test) on project ErlangServerTests: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
```

* [Erlang] Bump `jsx` dependency to latest stable version

* [Erlang] Disable sample server from CI until compilation works
2017-05-06 11:23:30 +08:00
mguan-trulia
918343b684 issue #3365 adding accept encoding for PHP (#5525) 2017-05-06 10:40:08 +08:00
Alexander
9212c21567 [PHP] Add default value to method signature if present in Swagger spec (#5571)
* Add default value to method signature if present in Swagger spec

* Update pet store PHP code
2017-05-06 10:39:14 +08:00
wing328
167cbe9726 remove trailing comma in ts angular template (#5563) 2017-05-05 17:05:45 +08:00