Commit Graph

4912 Commits

Author SHA1 Message Date
Jérémie Bresson
d5d8c356b7
Rename default packages for jaxrs generators (#209) 2018-04-24 06:26:42 +02:00
Jérémie Bresson
6983dcffa2
Update all jaxrs examples (#144) 2018-04-23 12:17:14 +02:00
William Cheng
f353f60b89
Update Perl client samples (OAS2, OAS3) with various fixes (#204)
* update perl client with various fixes

* update perl petstore with oas3, tests passed
2018-04-23 17:49:48 +08:00
William Cheng
b908b734dd
Update Groovy default value, fix import error when doing "gradle test" (#203)
* update groovy default value, fix import error when doing gradle test

* remove empty lines
2018-04-23 17:31:14 +08:00
Jon Schoning
db02cc2ac9 [haskell-http-client] resolve oas 2.0 regressions (#198)
* [haskell-http-client] fix codegen issues

* ensure datatypeWithEnum is set on codegenParameter when is enum

* [haskell-http-client] fix isAlias + arrayModelType missing "datatype"

* [haskell-http-client] param.isListContainer is sometimes false for list types

* [haskell-http-client] gen MimeNoContent instances automatically

* [haskell-http-client] fix example-app and integration tests

* [haskell-http-client] update docs
2018-04-23 16:10:50 +08:00
William Cheng
2833319b81
Update Groovy petstore client via OAS2 (#133)
* restore groovy client from codegen 2x

* update groovy client with oas2

* reformat groovy templates to remove empty lines
2018-04-23 14:12:37 +08:00
Jérémie Bresson
7ecd5f3566
Rename "swagger" to "openapi" (#191)
* Rename ".swagger-codegen-ignore" to ".openapi-generator-ignore"
* Rename setGenerateSwaggerMetadata(Boolean) to setGenerateMetadata(Boolean)
* Rename Metadata Folder to .openapi-generator
2018-04-22 21:28:17 +02:00
William Cheng
a7da9039a4
Update Scala petstore with OAS2, OAS3 (#162)
* update pestore with oas2

* update scala petstore oas3 (no diff)
2018-04-22 22:00:49 +08:00
Jérémie Bresson
b109bf7ddc
Update "jaxrs-cxf-client" sample OAS2, OAS3 (#172) 2018-04-22 10:41:16 +02:00
William Cheng
6959ef9939
Update Clojure Petstore with OpenAPI spec v3 (#181)
* update clojure test

* update with clojure oas3
2018-04-22 16:32:51 +08:00
William Cheng
35f0cc221d
update erlang client with oas3 (#182) 2018-04-22 10:25:30 +08:00
William Cheng
f79f23865b
update clojure petstore with OAS2 (#117) 2018-04-21 23:06:07 +08:00
Akihito Nakano
5e05638360 Fix content type (#179)
* Update php client with OAS3

* Fix content type

the endpoint consumes 'application/x-www-form-urlencoded'

* Regenerate php client from OAS3

* Update the test case according to the fix on spec
2018-04-21 22:26:35 +08:00
Jérémie Bresson
2e50780e1d
Remove "swagger-" prefix from artifactId (#170)
* Remove "swagger-" prefix in the samples artifactId
* Rename some artifactIds to make them unique
2018-04-21 12:31:21 +02:00
Akihito Nakano
1f0bed2a0c Update php client with OAS2 (#149)
* Update php client with petstore OpenAPI v2 spec

bin/php-petstore.sh

* Change order of arguments according to the changes that auto-generated codes

* Fix 'FakeHttpClient not found' error

It has occured when run the test case separately like below.
"vendor/bin/phpunit tests/RequestTest.php"

* Update assertion according to a change on spec

* Update assertion
2018-04-21 18:13:45 +08:00
William Cheng
0736939c2a
Remove x-codegen-hasMore extensions (#169)
* remove x-codegen-hasMoreRequired from ruby template

* remove x-codegen-hasMore from html2 templates

* remove commented code
2018-04-21 12:49:27 +08:00
Tomasz Prus
d74d2ba031 fix: python clients (#136)
* fix: python client

* fix: regenerate petstore samples for python-asyncio/tornado

* fix: python-asyncio tests

* fix: python-tornado tests

* chore: update python samples

* fix: enable tests for python-tornado

* fix: discriminator property

* fix: file type

* python: regenerate samples

* fix: define file as generic type
2018-04-21 11:54:40 +08:00
William Cheng
fdeca629bb
Update JS petstore with OAS2, fix example values (#168)
* restore js petstore from codegen 2x

* update js petstore with oas2, fix example values

* remove comment code in js generator
2018-04-21 11:49:02 +08:00
William Cheng
93bf3d91ea
Update C++ Pistache samples with oas2, oas3 (#166)
* restore pistache from codegen 2.x

* update pistache samples with oas2

* update pistache with oas3 petstore (no diff)

* restore datatype for array of model

* update pisache server scripts

* Revert "restore datatype for array of model"

This reverts commit 3b949a3873f3fca78311065173eda26e786dedec.

* fix array of models in method signature
2018-04-21 00:40:45 +08:00
Jérémie Bresson
d21e4227a6 Update finch Petstore OAS2 (#126)
* Update finch sample

* Udpate 'finch' samples

* update finch with oas3 petstore (no diff)
2018-04-20 21:52:22 +08:00
William Cheng
8a4f905892
Update C++ Restbed server samples with OAS2, OAS3 (#165)
* restore restbed samples from codegen2x

* update restbed samples with oas2

* update restbed sample with oas3 (no diff)
2018-04-20 19:07:42 +08:00
William Cheng
fa346ce004
Update Javascript closure angular Petstore samples with OAS2, OAS3 (#164)
* update js closure angular with oas2

* update js closure angular with oas3 (no diff)
2018-04-20 19:01:05 +08:00
William Cheng
3e0f959215
Update Scalaz petstore with OAS2, OAS3 (#163)
* update scalaz petstore with oas2

* update scalaz oas3 petstore (no diff)
2018-04-20 19:00:52 +08:00
William Cheng
e4b1613d1e
Update akka-scala petstore with OAS3 (#161)
* update akka-scala with oas3 petstore

* update akka-scala petstore oas3, fix import model
2018-04-20 16:58:27 +08:00
Jérémie Bresson
f3736d66b7 Fix "meta" command (#157)
* Fix "meta" generator

* Add script in bin/ to test the use case

* Add result in samples/

* Update read-me

* Implement 'escapeQuotationMark'
2018-04-20 15:25:51 +08:00
William Cheng
03490e9230 fix java binary mapping (#158) 2018-04-20 08:20:13 +02:00
William Cheng
28a1255c0e
Update Go server petstore sample with OAS3 (#154)
* restore go server from codegen 2x

* update go server petstore with oas3
2018-04-20 12:05:27 +08:00
William Cheng
686ff6a502
Go server petstore update (OAS2, OAS3) (#146)
* restore go server petstore from codegen 2x

* update go server petstore (oas2) - no diff

* update go server samples (oas3)

* add go petstore server script
2018-04-19 21:57:22 +08:00
William Cheng
86f67c6665
Update Erlang client petstore (OAS2) (#147)
* update erlang client, add method to customize array model parameter name

* remvoe debug log
2018-04-19 21:22:24 +08:00
William Cheng
c20352caab
Update Android Petstore (httpclient, volley) with OAS2, OAS3 (#145)
* restore android samples from codegen 2x

* update android volley with oas2

* update android volley oas3

* update android http client petstore (oas2)

* update android httpclient petstore (oas3)
2018-04-19 16:13:35 +08:00
William Cheng
80d10e2cba
Update C# dotnet2 client with OAS2, OAS3 petstore (#143)
* update csharp2 from codegen 2x

* update csharp dotnet 2 client (oas2)

* update csharp dotnet2 with pestore oas3
2018-04-19 15:05:47 +08:00
William Cheng
9fdcb3681b
Update ObjC petstore and test cases (#139)
* restore objc samples from codegen 2x

* update objc petstore test

* update objc with oas3 petstore
2018-04-19 12:08:00 +08:00
William Cheng
74ddbf7a16
update scalatra with oas2 spec (#131) 2018-04-19 09:16:52 +08:00
William Cheng
0feef2b57e
Update akka-scala petstore with OAS2, fix description in responder header (#129)
* update akka-scala sample by codegen 2x

* fix description in response headers, update akka scala generator
2018-04-19 09:16:28 +08:00
William Cheng
7c734445b2
fix file parameter in header file (cpprest) (#130) 2018-04-18 22:29:53 +08:00
William Cheng
52af29f46d
Update CPPREST client with OAS2 (#128)
* restore cpprest from codegen 2x

* fix cpprest by modifying the template

* better naming for array of models

* updtae cpprest samples with oas2
2018-04-18 18:13:35 +08:00
William Cheng
05f5c5798b
Update html, dynamic-html petstore, fix example value for form parameters (#122)
* update dynamic-html samples with oas2

* update dynamic-html oas3 (no change)

* update html petstore (oas2)

* update html petstore with oas3

* fix example value for form parameters

* fix javadoc string
2018-04-18 17:42:38 +08:00
William Cheng
08038ddc30
update haskell servant samples with oas3, oas2 (#116) 2018-04-18 01:48:49 +08:00
William Cheng
a30e25e50d
Update ObjC petstore with oas2, fix default value for parameter (#115)
* update objc petstore with oas2, fix default value for parameter

* update objc petstore with oas3 spec

* update objc core data oas2

* update objc petstore with oas3
2018-04-18 01:47:32 +08:00
William Cheng
ddf10b98dc
Update NodeJS server petstore samples with OAS2, OAS3 (#113)
* update nodejs server oas2

* update nodejs server petstore with oas3

* update nodejs google cloud with oas2 petstore

* update nodejs server google function with oas3
2018-04-17 22:58:13 +08:00
William Cheng
dc0cbd23b6
update tizen samples with oas3 petstore (#114) 2018-04-17 22:53:09 +08:00
William Cheng
4845eaa81d
Update bash Petstore OAS2 (#112)
* update bash petstore oas2, fix default parameter, map file to binary

* update bash petstore with oas3 script
2018-04-17 22:39:26 +08:00
William Cheng
0fc84687ff
update rails petstore (oas3) (#111) 2018-04-17 21:03:00 +08:00
Jeremie Bresson
53597764c3 Add OpenAPI spec 3.0 support (beta)
Co-authored-by: Akihito Nakano <sora.akatsuki@gmail.com>
Co-authored-by: Jeremie Bresson <dev@jmini.fr>
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
Co-authored-by: Martin Delille <martin@phonations.com>
Co-authored-by: Tomasz Prus <tomasz.prus@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2018-04-17 09:19:10 +02:00
wing328
4cfbc118e8 renaming for openapi-generator 2018-03-13 14:41:23 +08:00
Jérémie Bresson
25a6a9d444 html: fix typo in class name (#7818)
* html: fix typo in class name

* Update "html" samples
2018-03-13 00:08:48 +08:00
William Cheng
e7f4fb3c45
Fix nodejs-server path issue in windows platform (#7808)
* fix nodejs-server path issue in windows platform

* only replace character in apiPackage
2018-03-12 23:21:07 +08:00
Martin Delille
1bb1e44d18 [qt5cpp] Remove qt5 pro.user file (#7813) 2018-03-12 23:17:39 +08:00
Martin Delille
9bd94b4dbb [qt] Fix warning message (#7815)
* [qt] fix warning message

* remove unused model.mustache file
2018-03-12 23:00:45 +08:00
etherealjoy
1947220159 Qt5cpp plug memleaks part2 (#7792)
* Small fixes to prevent crash when empty json body is provided.

* Fix some more memory Leaks in the model-body
- Members not deleted in cleanup() method, for maps/arrays of primitive types.
- Avoid undefined behavior when updating class members with data from missing json fields
2018-03-09 00:19:45 +08:00
Simon Sprünker
f00a1ef52c [JAVA] Fix #7734: Correct consumes/produces attributes for Spring Controllers (#7760)
* fix #7734: Correct consumes/produces attributes for Spring Controllers

* fix #7734: Update petstore
2018-03-08 22:56:43 +08:00
Charles Capps
4eeb974cb6 [Java][google-api-client] Fix bug with empty POST request not sending content-type (#7787)
* Add overloaded method to take an InputStream for the request body, and fix a bug with collections

* Use fully qualified name for InputStream to avoid potential conflicts

* Add support for Input Stream choosing content type, and fix a bug

* Ensure GET requests send an empty request body!
2018-03-08 22:51:49 +08:00
Dennis Frommknecht
53eeb0c049 fix connection leak on retrofit OAuth token renewal (#7750) 2018-03-08 22:00:22 +08:00
Akihito Nakano
0adbf7e51f [PHP] Improve: update sample tests automatically (#7717)
* Improve: update sample tests automatically

* security test

* Update sample

- bin/php-petstore.sh
- bin/security/php-petstore.sh

The security test has not been updated for a while.
2018-03-08 21:56:48 +08:00
Akihito Nakano
32cf2f16f5 [PHP] Non required enum property (#7723)
* Add required enum property

* Update samples

* Add test case which reproduce the problem

refs https://github.com/swagger-api/swagger-codegen/pull/7686#issuecomment-368200011
> 2. Non-required enum property is listed as invalid when omitted

* If the property is not empty, perform validation

* Update samples

* Use is_null() according to setter implementation

refs 377247f125/modules/swagger-codegen/src/main/resources/php/model_generic.mustache (L347)

* Update samples
2018-03-08 21:54:34 +08:00
etherealjoy
12f3661d6f Qt5cpp plug memleaks (#7695)
* Small fixes to prevent crash when empty json body is provided.

* WIP: plug mem-leaks

* fixup: add the QJsonObject instance in toJsonArray instead of pointer

* fixup: simplify toJsonMap

Actually the original solution is incomplete, because "innerType" maps to a single C++ type. Have a look at Qt's builtin QJsonObject::fromVariantMap.

* Updates to antis81:patch-1 after tests.

* update to remove string allocation

* Updates due to address of members being passed

* Update PetStore Examples

* Small updates for Header includes
2018-03-07 20:54:40 +08:00
wing328
724a8fb05d update java petstore samples (jersey1) 2018-03-05 19:34:34 +08:00
Paul Vogel
3bcf0ff764 [PHP] Add path & file separator (/) to return the correct path when deserializing a file (#7671)
* Add path & file separator (/) to return the correct path

Add the separator between the tempFolderPath and the sanitized filename so that the path to the file is correct.

(Fixes #7670)

* Remove separator from generated file

* Add separator

Add the separator between the tempFolderPath and the sanitized filename so that the path to the file is correct.

(Fixes #7670)

* Update sample code

Via ./bin/php-petstore.sh
2018-03-05 10:32:47 +08:00
Andy Kipp
8e0a0ebd62 Fix python / tornado body handling (#7738)
* Handle empty body

* Update petstore
2018-02-28 16:08:17 +08:00
Alberto Sartori
56a0268e39 [elm] missing '->' in Main elm template (#7728) 2018-02-26 23:11:21 +08:00
Adam Conway
ff1178ad7e [Java][Spring] fix optional query params missing in generated swagger (#7607)
* Added genericModelSubstitutes if using Optional

As per https://github.com/springfox/springfox/issues/1848  Doesn't seem to fix the problem, but is what springfox recommends so might be aprt of it.

* Added config package to scans

If you have defined apiPackage and basepackage (e.g. as com.example.api) but not defined configPackage then config is still in io.swagger.config and is not included in the component scan.  This means the config is not used when generating the swagger definition from the code.  Fixed by including configPackage also in the scan.

* Ran spring-all-pestore.sh update script

* Converted tabs to spaces

* Ran spring-all-pestore.sh update script
2018-02-23 00:02:38 +08:00
wing328
e5001a0c8d java update petstore clients 2018-02-22 21:51:14 +08:00
Adrien CABARBAYE
d4543a99e3 [Java][retrofit2] Fix for Issue #7446 (#7659)
* [Java][retrofit2]  Fix for issue #7446:  file upload sets filename as baseName instead of a dynamic filename. The solution is to use  okhttp3.MultipartBody.Part instead of RequestBody in formParams template.

* Changes corresponding to review comments

* Petstore Samples

* Fixed tests
2018-02-22 21:45:19 +08:00
wing328
b4827beba4 update python petstore samples 2018-02-22 20:59:45 +08:00
wing328
a59c325cb7 update dart, ruby petstore samples 2018-02-22 17:53:51 +08:00
Akihito Nakano
91bd7ac3b9 [PHP] Run unit tests on 'tests' directory (#7675)
* Run unit tests on 'tests' directory

* Fix: move argument to <argument>
2018-02-22 17:31:47 +08:00
Akihito Nakano
be14e02875 [PHP] Cleanup test (#7673)
* Regenerate PetApiTest, OrderTest

The same test code as deleted is in the 'tests' directory.

* Move test code 'test' -> 'tests', and Regenerate test/Model/PetTest.php

* Regenerate 'test' directory

rm -rf samples/client/petstore/php/SwaggerClient-php/test && bin/php-petstore.sh
2018-02-22 17:31:18 +08:00
Akihito Nakano
14e1e19803 [PHP] Improve validation on empty arrays (#7686)
* Api should throw exception if an empty array is passed

* Update samples

- bin/php-petstore.sh
- bin/security/php-petstore.sh
2018-02-22 17:15:00 +08:00
shigeru.nakajima
dcad9ae807 [Rails5] make version of the generated Rails stub server to strict Rails 5.0 (#7700) 2018-02-22 15:57:14 +08:00
Ken Gilmer
39fa375e3a [kotlin] Fix NPE for POST/PUT/PATCH with empty request models. (#7629)
* [kotlin] Fix NPE for POST/PUT/PATCH with empty request models.

* [kotlin] Pass content type in empty response as discussed in PR review.
2018-02-18 23:51:02 +08:00
edwd
9fb2c29a46 7644 objc deprecated afnetworking datataskwithrequest (#7645)
* Replacing calls to dataTaskWithRequest:completionHandler:

In objc ApiClient-body.mustache, replacing calls to AFNetworking's deprecated `dataTaskWithRequest:completionHandler:` with calls to `dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:`.

* Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change: ./bin/objc-petstore.sh and ./bin/security/objc-petstore.sh
2018-02-18 22:58:57 +08:00
Benoit Vermont
c599906f1a Kotlin: Correct data_class.mustache to use proper property for inner enum data type (#7597)
* Correct data_class.mustache to use proper property

The name of the property is "datatype" lowercase, as can be seen in https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java#L10

Using "dataType" does not work, and the type of the inner enum is null.

* Change in petstore
2018-02-18 22:44:35 +08:00
Karol
cddcda0fe0 Java Jersey2: Make generated client code thread safe (#7605)
* fix issue-7453; make jersey 2 generated code thread safe by following the withHttpInfo pattern used by many other generated clients

* fix issue-7453; make jersey 2 generated code thread safe by following the withHttpInfo pattern used by many other generated clients
2018-02-18 22:35:08 +08:00
William Cheng
aa6b217bb9
[Ruby] Add auto-generated rubocop config file (#7637)
* add rubocop to ruby api client

* add new files

* fix ruby generator test case
2018-02-12 14:08:02 +08:00
wing328
8ba9db67f5 remove oudated php, node server samples 2018-02-11 17:28:38 +08:00
William Cheng
854b5012be
fix NPE when host is undefined (#7633) 2018-02-10 17:11:11 +08:00
Victor Orlovsky
62a930223f [JAVA][Rest-assured] reqSpec() method has been added into api.mustache for requests custom… (#7556)
* reqSpec() method has been added into api.mustache for requests customisation (group operations)

* add - reqSpec() has been added to samples
2018-02-08 14:51:23 +08:00
Alexander Ovchinnikov
ee561fcd63 Add withXml option for Go language (#7566)
* Added support for application/xml content-type for GO language
Issue #7463

* Added test scripts for Go lang "withXml" feature

* Added samples for Go land "withXml" feature.

* "withXml" feature for Go language is only available for client.
2018-02-08 14:47:47 +08:00
Jim Schubert
8668175879 [aspnetcore] Fix string enum generation (#7581)
* [aspnetcore] Fix enum strings generation regression

* [aspnetcore] Regenerate sample
2018-02-08 14:43:47 +08:00
Xiaoxiao
b184fb1d9c [Swift3] escape URL parameters (#7529)
* Escape URL parameters for Swift4 and update its Petstore sample

* Update the code style

* Update code style

* Update code style

* Remove break statements in switch for AlamofireImplementations
2018-02-08 00:19:04 +08:00
William Cheng
52f606b8dc
Fix Swift3 test cases and add pom.xml, travis config for iOS test (#7608)
* add pom.xml for testing objc, swift

* add travis config for testing swift, objc

* test swift, objc clients

* use ruby 2.4.2

* remove stack

* update swift3 petstore

* test with xcode9

* remove testing inline additional properties for swift3

* restore travis, pom
2018-02-07 23:13:48 +08:00
Jim Schubert
0e34bcf4e4 [csharp] ctor params should always be camelCase (#7519)
* [csharp] ctor params should always be camelCase

After PR #6305, var names defaulted to PascalCase results in constructor
arguments also being PacalCase. Model properties and constructor
arguments have no reason to be the same case, and in fact may cause
issues (`name = name` will result in a compilation error).

This commit forces all constructor params in models to lowerCase.

This is a necessary change, for instance, if client SDK consumers assign
using named args:

var a = new Model(first = "", second = "")

The PacalCase default and update to constructor arg casing will break
existing consumers of the client.

See #7070 for more details and discussion.

* [csharp] Regenerate samples

* [csharp] Remove client models generated from a different spec.

* [csharp] Escape reserved words on camelcase/lowercase lambdas

* [csharp] Regenerate samples
2018-02-06 22:54:26 +08:00
Stephane Carrez
9ba74f4840 [Ada] Fix GNAT project and server skeleton to avoid sending a response when an error is returned (#7574)
* Fix the GNAT project for the client and server to avoid using unecessary projects on
the client side

* Define a minimal configuration for user and application definition

* Fix the server skeleton to emit the response only when the status code is 200

* Fix the Ada petstore GNAT project
2018-02-05 17:47:20 +08:00
William Cheng
dbe78e23e8
[Lua] Improve auto-generated test files (#7568)
* move lua spec folder, remove extra endline

* remove extra line

* remove duplicated import
2018-02-04 22:06:43 +08:00
William Cheng
6c79052ac4
Add auto-generated Lua spec files for APIs, models (#7562)
* add auto-generated lua spec files for api, models

* use partial header in test files
2018-02-03 00:12:01 +08:00
shwetas1205
dfbef43743 Fixed unicode error and supported allow_nonstandard_methods in tornado based python client (#7560)
* fixing "decoding Unicode is not supported" error for py2 when data is unicode

* allowing nonstandard methods for tornado python client.

* Making sure to return unicode when needed
2018-02-02 23:00:04 +08:00
William Cheng
38a2c1dde9
[Lua] Fix Rockpec (#7554)
* fix lua rockspec

* use dot in the rockspec namespace
2018-02-02 14:03:58 +08:00
wing328
5a2c3a6571 Merge branch 'fix/issue-6553-completable' of https://github.com/wingsofovnia/swagger-codegen into wingsofovnia-fix/issue-6553-completable 2018-02-02 12:19:44 +08:00
William Cheng
fec0363f7d
[Java] Add back byte array enhancement (#7546)
* add back byte array enhanceement

* add okio dependency to java rest assured api client
2018-02-01 21:49:22 +08:00
wing328
d01a60cb14 update ts petstore files 2018-02-01 19:20:35 +08:00
wing328
3adbd86760 remove corrupted ts files 2018-02-01 19:18:14 +08:00
Tomasz Prus
f6e0e297eb [python-asyncio] tests and fixes (#7235)
* fix: creating ssl context and passing args/files/forms

* feat: python-async add tests

* chore: rebuild petstore sample for python, tornado and asyncio

* feat: add python asyncio to travis

* feat: print coverage (python-asyncio)
2018-02-01 17:26:38 +08:00
Erik Timmers
157e6b7fab [angular] Add option to generate tagged unions (#7245)
Using the option `taggedUnions` will create a union type for each parent
type instead of extending interfaces. The union types are tagged by using
the discriminator values.

And also:
* Add support for aliases;
* Add support for read-only properties.
2018-02-01 17:20:50 +08:00
William Cheng
36f69a034d
remove trailing spaces in qt5 c++ templates (#7525) 2018-02-01 13:35:09 +08:00
Jon Schoning
2d0bafb6b2 [haskell-http-client] default InlineMimeTypes=true (#7534)
- default CLI option InlineMimeTypes to True, since it produces cleaner code

- update bounds on dependancies
2018-02-01 12:26:13 +08:00
William Cheng
6b9d38d40a
remove trailing spaces in ada template (#7527) 2018-01-30 14:39:13 +08:00
William Cheng
eb35870d11
remove trailing spaces in r templates (#7526) 2018-01-30 11:02:13 +08:00
wing328
5d92717dc9 update jaxrs to listent at port 10080 2018-01-30 00:23:08 +08:00
wing328
36b042d605 update ts aurelia petstore samples 2018-01-29 16:42:16 +08:00
Konstantin Simon Maria Möllers
7faaa091cd Fix generated module imports in Aurelia APIs (#7465) (#7520) 2018-01-29 15:46:51 +08:00
wing328
7c20316755 update artifict id for jaxrs datelib j8 2018-01-29 13:51:21 +08:00
wing328
cf21ac0327 update spring petstore samples 2018-01-29 01:38:13 +08:00
wing328
87cdddcf17 add CI test for JAXRS datelibrary java8 2018-01-29 00:35:09 +08:00
wing328
6bc84eeee1 add rest-assured to circleci jdk8 test 2018-01-28 22:33:24 +08:00
Victor Orlovsky
6debf749ae [NEW API CLIENT] Rest-assured (#7492)
* Rest-assured http client has been added

ApiClient has been added

@Deprecated has been added for operation

{{{returnType}}} has been fixed

build.gradle.mustache, build.sbt.mustache, api_doc_mustache has been added

Samples has been added for rest-assured

Useless supporting files has been removed for rest-assured

Sample has been added for rest-assured

* Tests has been added

* Doc and tests has been fixed, JSON.mustache moved to common
2018-01-28 22:29:23 +08:00
William Cheng
c69925b53a
[Kotlin] Fix issues with threetenbp (#7516)
* fix kotlin threetenbp client

* fix typo in kotlin sample path
2018-01-28 21:40:22 +08:00
wing328
a811a48c3f minor fix to kotlin client genrator due to merge conflict 2018-01-28 17:18:15 +08:00
jarlesat
88c5112f2e Adds support for returning response in jaxrs-spec interfaces (#7442)
* Issue 7440 Added support for returning response in jaxrs-spec interfaces.

* Issue-7386 Updates samples for jaxrs-spec interfaces introduced in issue 7386.
2018-01-28 15:19:30 +08:00
Jon Schoning
9fba9c3255 [haskell-http-client] add config options: cabalPackage, cabalVersion, baseModule, requestType, configType (#7515)
- add new config options:

    cabalPackage
      Set the cabal package name, which consists of one or more alphanumeric words separated by hyphens

    cabalVersion
      Set the cabal version number, consisting of a sequence of one or more integers separated by dots

    baseModule
      Set the base module namespace

    requestType
      Set the name of the type used to generate requests

    configType
      Set the name of the type used for configuration
2018-01-28 14:59:04 +08:00
Stephane Carrez
4bd8fc6e8a Fix 7511: [Ada] Client call is not correct with multiple parameters and application/x-www-urlencoded (#7512)
* Fix calling the 'Call' procedure to submit the request for the Ada client when a request
has form parameters

* Rebuild the files by running bin/ada-petstore.sh
2018-01-28 14:54:36 +08:00
micheleISEP
3035bc629b [Ada] Hotfix/ada model sort (#7491)
* Ada generator generates "=>" (correct syntax) instead of "->". Fixes #7450

* Updated the Ada petstore samples

* Committing "VERSION" file and the rest of the petstore samples

* Redone the algorithm to sort the models by their dependencies, to create correct *-model.ads files.

To fix #7485

* changed tabs into spaces
2018-01-28 14:48:51 +08:00
Jean-François Côté
d1933b5fca Fix a problem in the generation of typescript-jquery when we have enum in a query param (#7506) 2018-01-28 14:48:33 +08:00
Jim Schubert
7cad47dd39 [kotlin-server] --library=ktor (barebones implementation) (#7412)
* [tools] Make sed in new.sh more cross-platform

The -r option passed to sed is a GNU sed option for extended regex
evaluation. The -E option evaluates the same option, and is part of the
POSIX standard, meaning this option is available in GNU sed as well as
Apple's BSD variant.

This commit removes the need for users to install gnu-sed on Mac.

* [ktor] Initial ktor (kotlin-server)

This adds a very barebones implementation for a ktor server generator.

This supports metrics and typed locations. All endpoins are stubbed to
return HTTP/1.1 501 Not Implemented.

* [ktor] Initial sample

* [ktor] Adding options for select feature installs

Options available:

* featureAutoHead
* featureConditionalHeaders
* featureHSTS
* featureCORS
* featureCompression

* [ktor] Start of auth functionality

* [ktor] API key auth placeholder

* Add basic support for oauth2 configurations

ktor doesn't seem to explicitly accept oauth flow properties in its
configuration object. This may be a blocker for 'implicit' flow
definitions.

* Added example response objects

* [ktor] Route for apis with bodies, some cleanup

ktor locations are only supported for routes with path/query parameters.
Routes with body or file parameters must be declared with traditional
route api.

This commit also includes lambdas for simplifying processing in
library-based server generator code. As an example, ktor requires
lowercase http methods while spring (a potential future generator)
would require an uppercase such as HttpMethod.GET. It doesn't make sense
to modify these in the operations post-process method because that
format wouldn't be universally desirable.

The lambdas included in the KotlinServerCodegen:
* lowercase: converts all text to lowercase
* uppercase: converts all text to UPPERCASE
* titlecase: converts words (with configurable delim) to Title Case
* indented|indented_8|indented_12|indented_16: these helpers apply the
  same desired indent to all lines of an included fragment's text.

* Fix some javadoc issues in lambda classes

* Update kotlin-server-petstore.bat

Change `kotlin` to `kotlin-server`

* Fix javadoc error messages in CI
2018-01-27 17:43:46 +08:00
William Cheng
a2410b210c
Add auto-generated rockspec file to Lua API client (#7475)
* add luarocks spec

* remove trailing spaces

* remove rockspec filename option

* update lua rockspec

* update rockspec based on feedback

* remove configuration which is not needed

* remove api_client, which is no longer needed
2018-01-27 17:09:45 +08:00
wing328
15b3dfbb80 update java petstore samples 2018-01-26 10:02:24 +08:00
Benjamin Roedell
47111b3241 Issue 4824 fix gson deserialize format byte (#7473)
* Build sample prior to code changes so differences are easier to decipher

* Add byte array type adapter for okhttp-gson (java8 only)

* Unit revealed that Gson (or GsonFire) defaults to escape = (equal sign) out of base64 string.  Add disableHtmlEscaping() to gsonbuilder.

* Update specs and samples to include format=byte and include junit test of byte array serialization and deserialization.

* Implement recommendations by @cbornet including: Use okio.ByteString for base64 conversions instead of java 8 lib since the okhttp-gson client already includes okio. Remove setting to disableHtmlEscaping. Rename LocalByteArrayAdapter to ByteArrayAdapter.

* Update spec and sample for java okhttp-gson library client

* Undo addition of profilePhoto property.  A format byte property is already available under the format_test definition.

* Put previously deleted tests back. Modified testFindPetsByTags() to verify exception since the server now returns a 500 for this request.

* Update test to pass when run against docker containerized server swaggerapi/petstore (heads up, this test fails if calling out to the internet published version of http://petstore.swagger.io)
2018-01-26 09:52:49 +08:00
William Cheng
2d898511a8
Add Play server samples to CircleCI (#7501)
* add play server samples to circle ci

* add pom.xml for java play framework
2018-01-26 09:48:51 +08:00
Jens Radtke
76907cacde fix: declare property headerSelector (#7495)
The property was created dynamically, it's a more clean approach to
declare it as a member of the class.
2018-01-26 00:49:35 +08:00
William Cheng
2394fac677
update swagger annoatation version to 1.5.17 (#7500) 2018-01-25 23:29:20 +08:00
William Cheng
df10c725ab
Add lua test script, minor fix to Lua API files (#7490)
* add lua test script, minor fix to api files

* fix model import, avoid null header issue

* add space before equal sign
2018-01-25 22:01:04 +08:00
Jean-François Côté
e33b350c89 Fix an issue in Play Framework generator where a CSV is empty and transfered to the controllerImp with an empty item. (#7496) 2018-01-25 21:53:20 +08:00
etondoze
d1a296412e Upgraded swagger-parser and swagger-core versions (#7497) 2018-01-25 21:35:11 +08:00
ehyche
a3d0f1d4bd Swift4: make generated models structs instead of classes (#7345)
* Split up model template into partials

* Change models from class to struct.

This fixes issue https://github.com/swagger-api/swagger-codegen/issues/6941.

In this change, we make our Swift4 generated model objects struct instead of class. However, in order to do this, we needed to handle the following edge cases:

* Inheritance and polymorphism (allOf)
  * With classes, we use inheritance. So therefore, the parent properties are ONLY on the parent generated class, and the model object which derives from the parent class picks up those properties through inheritance.
  * However, structs do not support inheritance. So we simply duplicate the parent allOf properties in the child struct.
* We have to handle the case where the property name on the struct may be different than the property name in the JSON. By default, the Codable protocol assumes that the JSON property name is the same as the struct property name. If they need to be different, then we generate a CodingKeys string enum, which contains the mapping between struct property name and JSON property name.
* additionalProperties. We cannot use the default Codable implementation for the additionalProperties, since it will look for an actual dictionary called "additionalProperties" in the JSON. Therefore, for model objects which have additionalProperties, we must generate our own implementation for the Decodable and Encodable protocols.

I have run ./bin/swift4-all.sh and ./bin/swift4-test.sh to re-generate all of the sources, and I have verified that the generated code in samples/clients/test/swift4/default builds and the unit tests pass.

* Update VERSION in .swagger-codegen

* Update generated code for swift4-test schema
2018-01-25 21:33:11 +08:00
Jeffrey Slort
2b84118c9f removed isomorphic-fetch typing dependency (#6894)
* removed isomorphic-fetch typing dependency
removed postinstall command

* space

* regenerated samples

* updated security samples

* fixed missing url module

* added prepublish hook

* regenerated samples

* added npm build to build
2018-01-25 21:20:58 +08:00
wing328
0b4b25afff update all c# pestore samples 2018-01-25 21:17:57 +08:00
Esteban Marin
20305139b5 [Feature][TypeScript] request param enum as literal unions (#7433)
* #7365: use enums string / number literals for request parameter if it is an enum

* #7365: use enums string / number literals for request parameter if it is an enum

* #7365: use enums string / number literals for request parameter if it is an enum

* #7365: improve docs

* #7365: move code to AbstractTypeScriptClientCodegen, remove redundant code in TypeScriptAngularClientCodegen, change type Object to Number in numericEnumValuesToEnumTypeUnion()

* #7365: move code to AbstractTypeScriptClientCodegen, remove redundant code in TypeScriptAngularClientCodegen, change type Object to Number in numericEnumValuesToEnumTypeUnion()

* #7365: allow parameter data type customizations

* #7365: re-enable disabled unit test assertions

* #7365: remove enum handling from type declaration generation

* #7365: generate all typescript samples

* #7365: re-enable disabled unit test assertion
2018-01-25 18:36:14 +08:00
Jörn Ahrens
a5e26a44ff [Dart] - Rework Dart client generator to be flutter-compatible (#7418)
* copy mustache templates from dart generator

* Start with generator by copying the DartClientCodegen for now

* at least we know this is not for a browser..

* First working version for a simple swagger configuration

* remove browserClient parameter, since it doesn't make sense for flutter

* Take care of complex types to support object hierarchies

* add null safety

* add small test for options

* add flutter-petstore scripts

* generate flutter petstore output

* Add new flutter test project

* move generated client to make it usable

* use generated swagger petstore plugin

* add support for lists of objects

* add DateTime support

* fix listFromJson implementation

* fix NPEs in DateTime operations + place order in sample

* Small readme changes

* bugfixes

* Use flutter-compatible implementation as default dart implementation

* fix generated samples

* Make lists serializable, now all dart test cases are working again

* better list implementation

* use StringBuffer

* removed FlutterClientCodegen

* fix browser client

* fix dependencies

* swagger-browser-client for browserClient testcases

* fix scripts

* removed flutter scripts

* add map support and simplify code via using .toJson contract

* remove unneeded devDependencies

* Regenerated samples

* fix call to mapFromJson, it is not a constructor

* remove pointless string serialization

* regenerated dart samples
2018-01-25 18:18:53 +08:00
Articus
60e3339aa6 [Feature][PHP] Update for ze-ph generator (#7472)
* update for ze-ph generator stub to support Zend Expressive 2.1 and Path Handler 0.3

* ze-ph: for each operation generator creates special DTO model from its query parameters

* ze-ph: generation of extra TODO's for complex container type and update for samples
2018-01-24 12:36:24 +08:00
wing328
5a3a33b3c8 update java vertx server samples 2018-01-24 12:32:45 +08:00
William Cheng
61e58d6496
Add R namespace file (#7467)
* add r namespace file

* rename NAMESPACE mustache file
2018-01-22 22:32:22 +08:00
William Cheng
cf4df630b7
Add Spring Petstore samples (async, java8-localdatetime) to CircleCI (#7468)
* add ci for spring mvc: async, localdatetime

* update artifactId for new spring samples
2018-01-22 21:35:51 +08:00
micheleISEP
43f0e86923 Ada code generator corrected: "=>" instead of "->". Fixes #7450 (#7456)
* Ada generator generates "=>" (correct syntax) instead of "->". Fixes #7450

* Updated the Ada petstore samples

* Committing "VERSION" file and the rest of the petstore samples
2018-01-22 17:40:34 +08:00
wing328
6651f6bfa1 Merge remote-tracking branch 'origin/2.4.0' 2018-01-22 14:16:55 +08:00
Jim Schubert
8724719960 [csharp] Support arrays of arrays for properties and models (#7400)
* [csharp] Support composition on toJson

Previous implementation assumed specification only supports polymorphic
associations (via discrimator), although the code didn't seem to be
setup correctly for that in the first place. That is, the parent object
must define the discriminator (see
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#models-with-polymorphism-support),
so NOT HAS parent AND HAS discriminator doesn't make sense.

From a C# perspective, base classes should have the method marked
virtual and derived classes should override the method. This supports
both composition and polymorphic definitions.

* [csharp] this.Configuration in api template

Unprefixed Configuration property access leads to ambiguous references
when spec defines a Configuration model.

* [csharp] Models/properties support nested arrays

Previous implementation didn't support multiple levels of array with
array items as OpenAPI spec supports. This means an object defined as
type: array with items = type: array|items=double (which is common in
GIS) would not be possible.

This implementation assumes generics in the nested type definitions, so
the above would generate List<List<double?>> for model parent types as
well as property type declarations.

* [csharp] Regenerate integration test sample

* [csharp] Set "Client" case sensitive as reserved

* [csharp] Regenerate security sample

* [csharp] Regenerate samples
2018-01-22 14:14:17 +08:00
Jim Schubert
1c4e6b7d46 [csharp] Fix ToJson to work with composition and polymorphism (#7399)
* [csharp] Support composition on toJson

Previous implementation assumed specification only supports polymorphic
associations (via discrimator), although the code didn't seem to be
setup correctly for that in the first place. That is, the parent object
must define the discriminator (see
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#models-with-polymorphism-support),
so NOT HAS parent AND HAS discriminator doesn't make sense.

From a C# perspective, base classes should have the method marked
virtual and derived classes should override the method. This supports
both composition and polymorphic definitions.

* [csharp] Regenerate integration test files

* [csharp] Regenerate samples

* [csharp] Regenerate security sample
2018-01-22 14:13:50 +08:00
Jim Schubert
ed7af73f6b [csharp] Reference this.Configuration in client api template (#7394)
* [csharp] this.Configuration in api template

Unprefixed Configuration property access leads to ambiguous references
when spec defines a Configuration model.

* [csharp] Regenerate samples
2018-01-22 14:04:19 +08:00
jarlesat
99fc272465 [JAX-RS][Spec] Removes throws Exception. (#7437)
* Issue-7435 Removes throws Exception.

* Issue-7435 Updates jaxrs-samples.
2018-01-22 13:48:59 +08:00
Stephane Carrez
7d2b49085f Fix 7457: [Ada] wrong order for generated structures in *-models.ads (#7462)
* Fix the comparison between two model types to compare them recursively
and make sure we sort the model types according to their dependencies

* Run bin/ada-petstore.sh to update the generated Ada client samples
2018-01-22 13:27:39 +08:00
Stephane Carrez
2b2b85eec7 Fix 7459: [Ada] wrong JSON in POST operations (#7460)
* Fix Ada client generated code to avoid having a spurious body name for parameters passed in the body

* Run bin/ada-petstore.sh to update the generated Ada client samples
2018-01-22 13:21:09 +08:00
Tristan Sloughter
c73118524c [erlang-client] Erlang request utils (#7257)
* [erlang-client] fix body param from being included path and base path to remove host

* [erlang-client] move request logic out of api functions to utils module

* [erlang-client] add support for passing http client configuration to requests

* [erlang-client] update auth handling

* [erlang-client] remove underscore2, replacing with original underscore + replaceAll
2018-01-22 13:18:35 +08:00
magnolia
6db63c7a1f deleted unnecessary notes (#7454)
https://github.com/swagger-api/swagger-codegen/issues/7398
2018-01-20 14:31:43 +08:00
ccozzolino
59ff4c198b [Java][library: vertx] Add default value and required parameter support to vertx server temp… (#7410)
* Add default value and required parameter support to vertx server templates. Fix for #7409.

* Added missing serviceId declaration to workaround #allParams section clearing the vendorExtensions map
2018-01-20 14:31:06 +08:00
Esteban Marin
ef832e7157 [Feature][Angular] improve docs angular import (#7363)
* #7354: improve docs about importing multiple ApiModules, prevent https://github.com/angular/angular/issues/20575#issuecomment-356261374

* #7354: prevent https://github.com/angular/angular/issues/20575#issuecomment-356261374 add error message about importing the HttpModule / HttpClientModule

* #7354: generate sample files

* #7354: generate README.md also for non-npm packages
2018-01-20 14:24:33 +08:00
Kane Lai
a61d23265d Fixed incorrect renaming of header and query param to camel cases for Kotlin Client template (#7420)
* - Fixed incorrect renaming of header and query param to camel cases

* Generated petstore code base on modified Kotlin template
2018-01-19 17:30:04 +08:00
magnolia
7853308c8e Rebuild Scalatra sample (#7431)
When creating the following PR, sample was generated without reflecting the last change.

https://github.com/swagger-api/swagger-codegen/pull/7393

With this commit, it will be synchronized
2018-01-19 16:20:41 +08:00
magnolia
1ee85de94e Added Intelli J ignore (#7423)
.idea
*.iml
2018-01-19 16:20:12 +08:00
etherealjoy
ea4b948428 [qt5cpp] Add nullptr guard to prevent crash when empty model is being serialized (#7434)
* Small fixes to prevent crash when empty json body is provided.

* Updated PetStore example for Qt5
2018-01-19 15:36:45 +08:00
William Cheng
30c1448d78
Fix build.gradle for Java RESTEasy client (#7448)
* update release 2.3.1

* add jeff9finger to java tech committee

* fix build.gradle for java resteasy
2018-01-19 13:21:39 +08:00
magnolia
7b8e409cf9 Added gitignore generation function (#7402)
Copy gitignore template from client
2018-01-15 21:00:26 +08:00
William Cheng
389344726e
Split CircleCI test into JDK7, JDK8 specified tests (#7405)
* split out circleci pom for jdk7, jdk8

* update circle config to use jdk7 pom
2018-01-15 16:46:33 +08:00
Jinkui Shi
612cfb7af4 [Akka-scala] Clean unused dependencies such swagger-core #7329 (#7329) 2018-01-15 14:14:10 +08:00
Euan Kemp
027df610b1 [Rust] Handle error response statuses (#6865)
* [Rust] Consider error statuscodes to be errors

* [Rust] Introduce 'ApiError' type for 4xx/5xx resp

This updates the previous commit which added an 'ErrorStatus' variant to
an 'ApiError' variant.

It does not specialize the error to the specific possible error
responses yet, rather returning a 'serde_json::Value' for any case.

This will lose any error messages which cannot be parsed as json and
instead return a json-parse error.

A future change should update the generated signatures such that the
returned future's error type is specialized to the specific errors that
may be returned by that api (and possibly a catchall json::Value still).

* [Rust] Regenerate petstore samples

* [Rust] Add error example to petstore sample
2018-01-15 11:38:11 +08:00
wing328
15e7255154 Merge branch 'issue-7044' of https://github.com/joeboyscout04/swagger-codegen into joeboyscout04-issue-7044 2018-01-14 23:41:46 +08:00
wing328
44211c8811 Merge branch '2.4.0' of https://github.com/swagger-api/swagger-codegen into 2.4.0 2018-01-14 23:19:28 +08:00
Carl E Leiby
25a127240a Generated retrofit2 petstore files 2018-01-14 23:18:28 +08:00
Reijhanniel Jearl Campos
3bd2da9a8b [Java] #3204 - Fix build warnings (#7364)
* [Java] #3024 - Add build-helper-maven-plugin version to retrofit client template

* [Java] #3024 - Add build-helper-maven-plugin version to feign client template

* [Java] #3024 - Add build-helper-maven-plugin version to jersey client template

* [Java] #3024 - Add build-helper-maven-plugin version to resteasy client template
2018-01-14 21:13:56 +08:00
wing328
44853c31b6 update rust default user agent to promote swagger codegen 2018-01-14 18:25:04 +08:00
Tristan Bourvon
66be7a7910 [Rust] Add user agent handling for rust template (master) (#7375)
* Add user agent handling for rust template

* Run ./bin/rust-petstore.sh
2018-01-14 18:18:58 +08:00
magnolia
d5c355a596 [Scalatra] Updated the version of Scalatra to the latest (2.6.2) (#7393)
* Updated the version of Scalatra to the latest (2.6.2)

 - Updated Scalatra 2.6.2 (latest)
 - Updated Scala 2.12.4
 - Updated sbt 1.1.0
 - Reduced dependent artifacts to a minimum
 - Cleaned up build.sbt
 - Changed the package name from client to server
 - Set log output (logback)
 - Updated web.xml for servlet 3.1

* rename package 'com.wordnik' -> 'io.swagger'

* Added rolling file appender to logback.xml
2018-01-14 18:11:37 +08:00
Euan Kemp
3029b7b0fb [Rust] Format example with rustfmt (#7339)
This was handled via 'cargo fmt' on the current nightly rust. I also
moved a few lines around and deleted an old comment.
2018-01-14 18:03:12 +08:00
etherealjoy
0bf430a803 Qt5cpp Add support for nested containers (#7340)
* Disable creation of empty json fields and fields for primitives which were not set, but using default values
modelnamePrefix will be the one passed from command line or SWG if none

* Updates after review
Also common http files are splitted
Update Petstore examples

* Small Fixes for cleaning up arrays of arrays/maps

* Changes
- Api Body pass by Reference, avoid seg fault due to deletion of auto constructed object passed as parameter.
- Support Maps and Arrays upto a depth of 2
- Refactor Helpers to handle Maps and simplify code

* Remove size check due to possible incorrect type

* Update PetStore Examples for Qt5 C++ and small fixes for QDate/QDateTime

* Updates after review. Fixes typo and remove usage of auto keyword.

* Restored usage of auto keyword.
2018-01-14 17:47:54 +08:00
Akihito Nakano
809e1f4c93 [PHP] Cleanup tests (#7333)
* Regenerate test/UserApiTest.php

The same implementation as testLoginUser() is in tests/UserApiTest.php

* Delete test/Client/ObjectSerializerTest.php

The same implementation is in tests/ObjectSerializerTest.php

* Update Petstore sample

- bin/php-petstore.sh
- bin/security/php-petstore.sh
2018-01-14 17:47:08 +08:00
Ben Mordue
429b96ae7e [JAVA] equals and hashCode for models with byte[] and binary strings (#7341)
* equals and hashCode methods for POJOs with byte array vars

* Also fix equals and hashCode for binary vars

* Ran script to update samples
2018-01-14 17:39:32 +08:00
wing328
fb73b8c4de update r petstore samples 2018-01-14 17:18:40 +08:00
wing328
97298bdb03 Merge branch '2.4.0' of https://github.com/swagger-api/swagger-codegen into 2.4.0 2018-01-14 17:14:43 +08:00
sneumann
9e06f7063f Fix assignment of new object instance to variable (#7379)
* #7359 Fix - use reflection to instantiate non-generated class (#7360)

* add tests for java vertx petstore

* add swagger example to README.md (#7368)

* Fix assignment of new object instance to variable

Fixes `Error in foobar$fromJSONString(s) : object 'CategoryObject' not found`
Discussion in https://github.com/swagger-api/swagger-codegen/issues/6520#issuecomment-357132746 ,
thanks @wing328 for encouraging.
2018-01-14 17:14:35 +08:00
Euan Kemp
0f6696089f [Go] Use consistent indentation in readme (#7336)
* [Go] Use consistent indentation in readme

* [Go] Regenerate petstore sample
2018-01-14 17:05:18 +08:00
antihax
72abb20f2e [Go] Fix operation files clobbering model files. [2.4.0] (#7337)
* Prevent operation files clobbering model files.

* Update Tests
2018-01-14 17:00:17 +08:00
Illia Ovchynnikov
642c0566de Use Rx2 Completalbe for Void Retrofit2 responses 2018-01-13 14:15:44 +01:00
wing328
73c338be58 Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-13 15:54:41 +08:00
William Cheng
8aef689d1b
[Java] allow setting boolean getter (is, has, get) in templates (#7344)
* allow setting java boolean getter (is, has, get) in templates

* update msf4j boolean getter

* update jaxrs-spec boolean handler

* update jaxrs boolean getter

* update reasteasy, spring, cxf boolean getter

* update inflector boolean getter

* update java play boolean getter

* update java boolean getter

* update spring samples
2018-01-13 15:19:02 +08:00
SergeyLyakhov
4241b11d97 [Java][jersey2] Fix logging for jersey2 + java6 (#6715). (#7348)
* [Java][jersey2] Fix logging for jersey2 + java6 (#6715).

* Fix formatting according to comments.
2018-01-12 21:16:23 +08:00
Jim Schubert
75c0180c71 [scala] Escape reserved words, support Array[Byte] (#7378)
* [scala] Escape reserved words, support Array[Byte]

Previously, Array[Byte] was compiling to ArrayByte. This provides a type
mapping to output the correct type.

This also escapes reserved words with grave accents, as is most common
in Scala. Escaping with an underscore prefix breaks serialization (in
Jackson, for example) unless templates are modified manually. Escaping
using grave accent should unblock most serializers from requiring
template modifications.

* [scala] Regenerate integration test outputs

* [scala] Regenerate samples

* [scala] Remove unused imports in related codegen files
2018-01-12 21:14:30 +08:00
wing328
50b599719d add tests for java vertx petstore 2018-01-11 16:36:23 +08:00
ccozzolino
247fbd4435 #7359 Fix - use reflection to instantiate non-generated class (#7360) 2018-01-11 16:31:37 +08:00
wing328
3930b5b0a1 Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-11 13:40:35 +08:00
Jim Schubert
65bda3e7b6 [scala] updates for client default values, required attributes (#7286)
* [scala] Fix default values in scala client

This uses consistent logic for optional types with default values in the
scala client. Also, uses Option(default) instead of Some(default) to
guard against people defining defaultValue = null. Option(null) becomes
None while Some(null) defines a null value explicitly and will break
maplike operations.

* [scala] Regenerate client sample

* [scala] Add missing json4s import, which will be added by another PR but allows current samples to generate

* [scala] Include integration tests for required attributes support

* [scala] Support string types with formats

This adds support for better support of type=string and
format={date,date-time,binary,byte}. Previously, binary and byte were
inconsistently defined as strings rather than byte arrays, while
date/date-time were parsing default values into formats that did not
match OpenAPI/Swagger 2.0 specifications for full-date and date-time.

We may want to consider pulling in json4s-ext to support wider date
formats and moving to date=LocalDate and date-time=ZonedDateTime.

This will have breaking changes for consumers expecting binary/byte to
be strings rather than byte arrays.

* [scala] Unique parameter names in integration test, to avoid seemingly conflicting names

* [scala] Regenerate client sample

* Sort file listings in AssertFile.java

Per File#list() javadocs:

There is no guarantee that the name strings in the resulting array
will appear in any specific order; they are not, in particular,
guaranteed to appear in alphabetical order.

I'm unable to repro directory listing failures on OS X High Sierra or
Ubuntu 16.04 under Parallels, so it's not clear to me if listing order
is indeterminate per-platform or the behavior is just not defined and
up to the platform's installed runtime. Sorting the array of strings
prior to comparison should resolve this issue on every platform/runtime.

* [scala] exclude api tests for integration test gen script

Script should match options in the integration test class

* [scala] Temporarily disable client integration tests

CI doesn't seem to pick up template changes in integration tests.
Disabling scala client integration tests, pending investigation of the
issue.

* [scala] Remove redundant json4s import

* [scala] Regenerate integration test

* [scala] Regenerate sample
2018-01-10 13:24:57 +08:00
Jean-François Côté
ebf4efe3ea Fix issue #6867 : The apiPackage option was ignored (#7316)
* Fix issue #6867 : The apiPackage option is ignored in the template for Java Play Framework.

* use openjdk7 in travis to ensure it works with jdk7
2018-01-10 13:15:49 +08:00
Joseph Elliott
673be4e88f exclude commons package from org.apache.oltu.oauth2 to provide a more long-term fix. 2018-01-08 14:41:57 +01:00
Joseph Elliott
c642d8a89b Roll back oltu_version to 1.0.0 to fix #7044 2018-01-08 14:25:32 +01:00
wing328
16e3226c8a Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-08 18:01:20 +08:00
Mehdi Jouan
c7f12d6c2d [Spring][Java] fix support of long values for @Max and @Min annotations (#7227)
* add support of long values for @Max and @Min annotations

* run shell scripts for java and spring

* fix import issue after running shell script
2018-01-08 00:22:06 +08:00
William Cheng
f7779c545e
refactor abstract scala codegen (#7334) 2018-01-08 00:20:38 +08:00
Sunrin SHIMURA
f5adbec1ff [Rust-Server] Use string literal based mime initialization (#7212)
* Use string literal based mime initialization to avoid invalid token error

* canonicalize mimetypes before checking
2018-01-08 00:00:12 +08:00
ccozzolino
d9745962be [Java:vertx] Initialize router in init method and re-use router member to create S… (#7234)
* Initialize router in init method and re-use router member to create SwaggerRouter

* Added generated samples for 7320 fix

* Fixed alignment to 4 spaces for 7320 fix
2018-01-07 23:37:37 +08:00
Jean-François Côté
193432ef52 Added optional extra JQueryAjaxSettings at the class and function level (#7238) 2018-01-07 23:21:43 +08:00
wing328
007974e3de Merge remote-tracking branch 'origin/master' into 2.4.0 2018-01-07 23:13:24 +08:00
craffael
9a284776d8 [Java] Fix serialization of the discriminator field when using GSON (#7075)
* set discriminator on object construction...

* regenerate all java samples

* run bin/java-msf4j-petstore-server.sh

* remove extra newline
2018-01-07 23:10:32 +08:00
Greg Marzouka
14e7158164 [Scala] Fix missing json4s import (#7271)
* [Scala] Fix missing json4s import

Closes #7270

* Update petstore sample
2018-01-07 22:50:30 +08:00
Stephane Carrez
362625bfa9 [Ada] Add Ada support for server code generator #6680 (#7256)
* Add Ada client petstore samples
- Add script to generate Ada client support with swagger-codegen
- Add files to build the Ada sample
- Add main program to use the generated client samples API
  and connect to the server to perform some operations

* Add some description for the samples

* Update the documentation to explain how to build, how to use the generated Ada client code

* Add server support for path parameters
- Update postProcessOperations to scan each path parameter and emit a x-path-index
  vendor attribute to tell the index of the path parameter

* Add and fix Ada server code package declaration
- fix declaration of operations
- generate a generic package that must be instantiated with the target server implementation
  and which provides the skeleton (deserialization and serialization of data)

* Implement the Ada server side operations
- extract body, query parameters, path parameters
- serialize the result
- register operations to the server according to the path/routes

* Update the code generation to generate server Ada implementation code

* Improvement of Ada server support: generate the swagger.json template file

* Define toModelName operation to the creation of a model identifier

* Add support for server permission generation
- collect the security scopes in postProcessAuthMethod() method and make sure
  these scopes have unique identifiers.  Some scopes correspond to URLs
  but others correspond to pseudo identifiers.

* Use the #lambdaAdaComment filter to indent correctly a multi-line description

* Fix model generation to support arrays

* Update the generated GNAT project file

* Refactoring and improvement of server code generation
- Change the server generated code to pass a Context_Type object
  to allow the server implementation to get/set headers in the request/response
  and control what is put in some responses
- Generate the security permissions based on the scopes that have been collected

* Server code generation improvement
- Fix generation of GNAT project
- Generate the intermediate Ada packages if necessary
- Generate the server main

* Ada server main template

* Ada server code improvement
- Add support to generate server permission verification
- Fix the GNAT project definition
- Templates for Ada intermediate packages

* Skeleton for the server side implementation

* Generate an empty Ada server implementation

* Templates for the Ada server implementation

* Add a README.md file and a GNAT config.gpr file

* New templates to document the generated Ada server

* Add server configuration file for the Ada server

* Fix the log message in the Ada server to report the correct URI to connect to

* Generate the Ada server configuration file

* Improvement of Ada code model to support nullable types

* Update the Ada server templates

* Refactor the Ada code generator
- separate the Ada client and Ada server code generators
- register the Ada server code generator under the name 'ada-server'
  keep 'ada' for the client Ada code generator
- moved the common Ada code operation supports to the AbstractAdaCodegen

* Improvement and cleanup of Ada client and server code
- new template for the client main program
- fix the GNAT project template for client or server programs
- remove unused options to better use the --model-package option

* Fix the GNAT project file name to use a lower case name
Fix the default GNAT config
Fix the headers of intermediate Ada package files

* Regenerate the model and client Ada files

* Update the Ada client sample to take into account the Nullable types

* Regenerate some files with Ada Swagger Codegen

* Ignore generation of petstore.gpr
2018-01-07 18:44:20 +08:00
etherealjoy
c7ff303779 [qt5cpp] Disable creation of empty json fields and handle prefix in model generation (#7206)
* Disable creation of empty json fields and fields for primitives which were not set, but using default values
modelnamePrefix will be the one passed from command line or SWG if none

* Updates after review
Also common http files are splitted
Update Petstore examples
2018-01-07 17:50:44 +08:00
wing328
0469975632 minor enhancement to scala gatling 2018-01-07 17:38:55 +08:00
ryandavis84
6d2d4298df Gatling generator2 issue #6927 (#6934)
* Initial commit, Generates everything necessary to run a performnace test against a swagger api.  Just have to fill out the CSV feeder files with your data.

* adding samples and gatling-petstore.sh file

* Extending the AbstractScalaCodeGen

* Checking in the CodegenConfig file as it is needed to generate

* removing escaped reserved words

* Changed model to be able to make all variables utilize an underscore while json fields are still just the variable name

* Changing underscore to var as interpolation can not start with a _ in scala

* Fixing path params

* allow you to pass in a system property to define which config to use as a workload profile, use rate and instance multipliers to scale up and down your test, added ramp down after the test is completed, added global assertions.

* Addressing PR feedback

* missed semi-colon

* Bringing everything up to date with the renames that were suggested
2018-01-07 17:18:36 +08:00
Jon Schoning
bca2b9fb5b [haskell-http-client] handle */* mimetype correctly & split api modules & allowNonUniqueOperationIds (#7254)
* [haskell-http-client] handle */* mimetype correctly

* [haskell-http-client] generate separate api modules, for each child api

* [haskell-http-client] add cliOption "allowNonUniqueOperationIds"

When cli option "allowNonUniqueOperationIds" is true,
allows *different* API modules to contain the same operationId,
and then each API must be imported qualified.
2018-01-07 11:59:55 +08:00
Oleksandr Slynko
919f867eba [go] Fix go client formatting (#7283)
* Fix some go client formatting issues

* Fix go client go imports

* Run `goimports -w .` on examples directory

* Sort imports in api

* Add new line between each property

Before secret feature was used to add new line using two property
declaration in the same line. There should be no new line before
first property. The easiest way is to use `-first` special
property
https://github.com/samskivert/jmustache#-first-and--last

New line are required so `goimports` won't reformat  whitespaces between
property name and type.

* Change whitespaces to tabs

* Fix whitespaces in api_client

There is a new line between each service to prevent `goimports` from
adding whitespaces between types and names

* Fix more whitespaces

There was a need to set special delimeter for formatting in the commit.
Go slices use curly braces and `jmustache` got confused when found
triple curly braces.

* Fix whitespaces in configuration.mustache

* Fix whitespaces for api response

* Support for optional description

Do not add whitespace if description is missing

* Add new lines between enum values to prevent formatting

* Generate go code from current code

- imports are not sorted :(
- there are extra whitespaces for different languages. I don't know why

* Run generate for security tests
2018-01-07 11:53:55 +08:00
Akihito Nakano
4e5ec4c71c [PHP] Cleanup StoreApiTest (#7248)
* Move test codes in "test" to "tests".

* Simplify class name specification

* Regenerate test/Api/StoreApiTest.php

testGetInventory already exists in tests/StoreApiTest.php
2018-01-07 11:46:31 +08:00
Dennis Kieselhorst
ee5709177a [Java] update CXF to latest release (3.2.1) (#7284)
* update CXF to latest release (3.2.1)

* update CXF to latest release (3.2.1) - samples update
2018-01-07 11:43:34 +08:00
Akihito Nakano
50d217894c [PHP] Cleanup EnumTest (#7282)
* Move test codes in "test" to "tests"

- EnumClassTest
- EnumTestTest

* Regenerate test/Model/Enum(Class|Test)Test.php
2018-01-07 11:42:44 +08:00
Bernat Ràfales
9b5bba0193 Correct minor typo in Ruby gemspec files (#7263)
[Ruby] Correct minor typo in Ruby gemspec files
2018-01-07 11:41:14 +08:00
Ben Wells
7479fc5361 Generate swagger yaml for go client (#7281) 2018-01-07 11:37:40 +08:00
Akihito Nakano
fa9fc4b45b Delete ApiClient (#7305) 2018-01-07 11:34:17 +08:00
Akihito Nakano
fa3e72e6e3 [PHP] Cleanup AnimalFarmTest (#7279)
* Move test codes in "test" to "tests"

* Regenerate test/Model/AnimalFarmTest.php
2018-01-07 11:21:53 +08:00
Jinkui Shi
30bd6f680d [akka-scala] License info add in template header #7321 (#7322)
* [akka-scala] License info add in template header #7321

* generate petstore by akka-scala teplate
2018-01-07 11:00:57 +08:00
Jean-François Côté
3465f2918e Fix a regression bug that was introduce in a recent commit. Removed the tabs that were causing error in Play Framework (#7241) 2018-01-07 10:48:49 +08:00
Jean-François Côté
0a9c6f56c8 Fix issue #7262 with the parameter name in the path. The problem was that camelCase naming was forced only in this part of the code when everywhere else it is configurable. (#7313) 2018-01-07 10:33:46 +08:00
manuc66
a050907d1f fix net35 with JsonSubTypes (#7043)
* upgrade JsonSubTypes to 1.2.0

* update samples

* add SwaggerClientNet35

* re-generate

* fix the linux build script
2017-12-22 00:31:44 +08:00
William Cheng
587dc20e06
[Javascript] Set ES5 as default (#7239)
* default js client to es5

* update js option wording
2017-12-22 00:08:30 +08:00
Ramzi Maalej
9dde8525ec [Akka-Scala] This is a fix to a bug introduced by this PR #7172 (#7228)
* Add missing import

* Update petstore app
2017-12-21 10:56:36 +08:00
Erik Timmers
d6539ba3c8 Add Elm language - BETA (#6947)
This is the initial Codegen for Elm 0.18.
Please try it out and provide feedback.

Not yet supported:

* path variables;
* additionalProperties;
* authentication;
* recursive types.
2017-12-20 22:26:46 +08:00
Jon Schoning
538f28e568 bump stack resolver to lts-10.0 (#7221) 2017-12-20 21:55:23 +08:00
Ben Wells
83fb107749 Create abstract go codegen base class (#7197)
Remove tabs
2017-12-19 23:41:02 +08:00
William Cheng
350a97095b
[Go] rename local variable "file" to "localVarFile" (#7214)
* comment out pkmst test for the time being

* rename file to localVarFile
2017-12-19 23:12:12 +08:00
William Cheng
bd19111ff0
[Java][PKMST] Move resource folder (#7213)
* comment out pkmst test for the time being

* move pkmst resource folder
2017-12-19 22:16:16 +08:00
William Cheng
37cd8b52d0
[Java][PKMST] rename pkmst to java-pkmst, update scripts/batch files (#7209)
* rename pkmst to java-pkmst, update scripts/batch files

* update pkmst batch file
2017-12-19 17:25:48 +08:00
Asad Saeeduddin
a3ca8d55e2 [TypeScript-Fetch] Support for non-JSON body params (#6994)
* Commit leftover snapshot changes

* Add logic to deal with non-JSON body params

If the spec specifies a list of consumes MIME types, default to the
first MIME type in the list instead of "application/json" (the user may
still override this by passing "Content-Type" in options.headers).

Additionally, only perform explicit JSON serialization if the data type
of the body parameter is not "string", or if it is string, only when the
content type is "application/json".

* Update snapshots
2017-12-19 17:20:16 +08:00
sanshuman
cb59591eff pkmst- Prokarma microservice toolkit for java (#7023)
* Added pkmst-microservice toolkit

* formatted

* replaces tab with blank spaces

* adding documentation folder

* adding documentation folder

* Update readme.mustache

Added feature set offered by pkmst

* updated readme

* Update io.swagger.codegen.CodegenConfig

Arranged pkmstServerCodeGen and SymfonyServerCodegen in aphabatical order

* Update readme.mustache

* renamed according to convention and added typeinfoannotation

* removed tabs

* updated codegen which extends abstractjavacodegen

* Added the script files and rectified the errors

* folder name changed and commons -lang3 version upgraded

* updated readme.mustache

* updated logging filter

* Added petstore to samples and updated the pom for the same

* Added java-pkmst sample to pom.xml.circleci

* updated readme.mustache
2017-12-19 16:12:44 +08:00
Sunrin SHIMURA
7d96f61e5d [Rust-Server] use status codes as the variants of the response enums instead of descriptions (#7125)
* use status codes in the variants of the responses instead of message

* samples

* add missing {{code}}

* use human friendly idents if possible

* generate samples

* salvage an oversight
2017-12-19 14:40:35 +08:00
antihax
dc69138de5 Go: Return error body with >= 300 errors (#7192)
* Report better errors

* update tests
2017-12-18 23:03:47 +08:00
Ben Wells
6349e79a59 Fix typo in Petstore yaml (#7195) 2017-12-18 12:30:57 +08:00
Ben Wells
d25341d58d Output models for go-server #3851 (#7188)
* Output swagger models.

Fix route verbs and formatting

* Remove backup files

* Make postProcessOperations consistent with go client
2017-12-17 21:55:20 +08:00
Christophe Bornet
79326399ef Fix starting springboot server from IDE (#7184) 2017-12-16 11:19:31 +08:00
elion
20ace869b7 Issue 7151 2.3.0 (#7181)
* Removed redundant version declaration. Upgraded Spring boot dependency version.

* Update samples
2017-12-15 21:04:00 +08:00
wing328
f1c52dc97e Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-12-15 00:31:41 +08:00
Ben Wells
2e348b27f7 [Go-server] Fix formatting of go-server generated code (#7162)
* Add missing go-server petstore batch script

* Make go-server confirm to gofmt
2017-12-15 00:04:48 +08:00
wing328
1d44bb8141 update spring petstore samples 2017-12-15 00:02:43 +08:00
Jean-François Côté
e70bdf17f2 [Typescript All] Prevent usage of reserved keyword for model fields (#7112)
* Prevent usage of reserved keyword for model fields

* Changes from code review to follow JS convention of using toParamName and toVarName

* Another small change from code review. Removing from postProcess because it is already called from somewhere else.
2017-12-14 12:47:02 +08:00
Max K
a96bc3a409 Added support for controller action parameter validation into the ValidateModelStateAttribute (#7156) 2017-12-14 12:26:57 +08:00
Max K
5306372b98 Added Contact NAME to Startup.cs (#7168)
* Ran bin/aspnetcore-petstore-server.sh

* Added contact information to startup.cs

* updated to support NAME as well

* updated samples

* updated NAME default
2017-12-14 01:31:11 +08:00
Max K
5e4d363675 [AspnetCore Server] Added Original swagger (#7170)
* Updated Codegenerator as well as added new swagger-original mustache template

* updated Startup.cs template to provide guidance for original Swagger file

* Updated Sample
2017-12-14 00:57:16 +08:00
William Cheng
c774e98464
update swagger parser, core version the latest (#7163) 2017-12-13 18:08:26 +08:00
Max K
c496ec7269 Added support for VERSION, APPNAME and CONTACT from Swagger file into Startup.cs (#7103)
* Added support for VERSION and APPNAME from Swagger file into Startup.cs for Swashbuckle SwaggerGen

* Ran bin/aspnetcore-petstore-server.sh

* Added contact information

* Added contact information to startup.cs
2017-12-13 12:03:33 +08:00
Max K
1541d96b18 Updated SwaggerResponse Attributes so they use the actual dataType instead of the common returnType (#7096)
* Moved SwaggerResponse Attributes to use the respective dataType instead of the common returnType.

* Updated examples
2017-12-13 11:59:45 +08:00
Benjamin Gill
4dbb44b061 End use of deprecated openssl method (#7154) 2017-12-13 11:31:11 +08:00
Bartek Kryza
8b61b1d466 #7047 - Added Bash syntax check to tests (#7155) 2017-12-13 11:14:07 +08:00
Max K
9ca63955c2 Added support for Operation EXAMPLE value in ASP.NET Core Generator. (#7091)
* Added support for Operation EXAMPLE value in ASP.NET Core Generator.

* Updated PetStore samples
2017-12-13 00:13:13 +08:00
Aleksandr Nekrasov
643ef64f04 resteasy support javax injection instead of static delegate factory (#5272)
* resteasy support javax injection instead of static delegate factory

* fixed resteasy joda example
2017-12-12 00:35:51 +08:00
Max K
d881cb39bf Added Base Path support as well as PathParameterValidation (#7120)
* Ran bin/aspnetcore-petstore-server.sh

* Added BasePath filter and Validation filter

* Updated filters and added Attribute generators

* Removed newline

* Updated samples
2017-12-12 00:04:20 +08:00
Ville Skyttä
794bb07cf7 Spelling fixes (#7142) 2017-12-10 10:48:30 +08:00
Dimitar Ivanov
b4f707450a Erlang server: handle broken JSON (#7129) 2017-12-09 17:57:48 +08:00
wing328
e7b97383d1 update php petstore samples 2017-12-09 17:32:45 +08:00
Krzysztof Karol
d43e9c8be2 Fix wrong params indentation (#7136) 2017-12-09 17:22:24 +08:00
Akihito Nakano
cfa5a55a28 [PHP] Improve StoreApiTest (#7141)
* Move the test code to the appropriate test case

* currently, InvalidArgumentException will be thrown

* Remove unnecessary tests at this time

* Unify into single quotes
2017-12-09 17:01:25 +08:00
Benjamin Gill
1a831f73f3 [rust-server] Plaintext support; encode params (#7082)
* MMORCH-428: Export the Authorization struct

This is needed so that code can check that the version of Authorization
in the auto-generated code is the same as the version it is using. If
the versions are not exactly the same then the lookup into the TypeMap
will not work.

* Add Rust as a supported language for client and server.

Clarify that there are two Rust client implementations, and one Rust server implementation.

* Percent-encode path and query parameters in client URLs
Fixes #122

Also don't include a question mark at the end of the path when there are no query paramters.
Fixes #121

* Rust2 client: add --host and --port parameters to example client.

Allows the example command-line client to override the default host and port.

* Extract default host and port from Swagger file.

* Derive 'Eq' and 'Ord' on enums

* Rust2: improve server code structure.

    server.rs (main.rs) - main entry point for binary; starts the web server and points it at the server code within the library.
    server_lib/mod.rs (lib.rs) - root of library; creates the server.
    server_lib/server.rs (server.rs) - actual server code

The old server_lib/mod.rs is now server_lib/server.rs; server_lib/mod.rs is new.

This structure is easy to map onto a server implementation; unfortunately we can't get it exactly right here because of the limitations of cargo's examples/ folder.

* Rust2: Explain fully how to use the example code in your project.

* Added plaintext support

* Linting

* MGJ Markups
2017-12-08 18:42:14 +08:00
Oliver Hoffmann
20f48b04fc Make efficient use of entrySet iterator. (#7105) 2017-12-08 00:35:11 +08:00
wing328
365f3a923b update php petstore samples 2017-12-08 00:32:53 +08:00
Benjamin Gill
a57fb0c7db [rust-server] add license and description to Cargo.toml (#7080)
* Move errant file to 'rust-server'

Rust2 was the old name

* Add license and description to Cargo.toml

For rust-server, getting them from the swagger

* Valid Java doesn't have uninitialised variables...

* Default license to "Unlicense"

* Set license to "Unlicense" for generated crates
2017-12-08 00:28:29 +08:00
Jinkui Shi
01b6330202 [Scala] [ISSUE-7085] Scala template code format refactor (#7086)
* [Scala] [ISSUE-7085] Scala template code format refactor

* upgrade scala version to 2.11.12 and upgrade dependency version
2017-12-08 00:20:19 +08:00
Akihito Nakano
1ff3b00ac5 [PHP] Add generator version (#7124)
* Add generator version

* Update samples

- bin/php-petstore.sh
- bin/security/php-petstore.sh
2017-12-08 00:02:52 +08:00
wing328
fb69703fe0 update ruby petstore samples 2017-12-07 23:55:51 +08:00
topce
b0f61f394c fix issue 7048 (#7108) 2017-12-07 23:50:26 +08:00
Max K
e75523a684 [AspNetCore SERVER] Added support for ASP.NET Core 2.0 (#7114)
* Updated to .NET Core 2.0

* Fixed issue with IConfiguration vs. IConfigurationRoot

* Ran bin/aspnetcore-petstore-server.sh

* Updated to .NET Core 2.0

* Fixed issue with IConfiguration vs. IConfigurationRoot

* Ran bin/aspnetcore-petstore-server.sh
2017-12-06 11:02:13 +08:00
Jean-François Côté
40f1de8a58 [Typescript jQuery] Add README.md (#7113)
* Add README.md to the typescript jquery client generator

* Fix from code reviews about the addition of README.md. Made the fix in fetch too since it was a copy paste
2017-12-06 10:34:29 +08:00
Max K
645d71ed3b Operation now returns StatusCode Stubs as well (#7098)
* Operation now returns StatusCode Stubs as well

* Updated mustache file to use comments

return StatusCode(..) is now commented out.

* Change default(..) to not escape the type

default(dataType) --> default(&dataType)

* Return IActionResult no matter what..

* Updated formatting

* Ran bin/aspnetcore-petstore-server.sh
2017-12-05 22:14:00 +08:00
William Cheng
ffa0151445
fix msf4j return type annotation (#7110) 2017-12-05 17:23:04 +08:00
Sridhar-1987
a4fbbb5999 Pass optional as null (#7066)
* Pass optional as null

* Addressing review comments

* Addressing review comments-2

* Addressing review comments-3
2017-12-04 22:18:32 +08:00
Ramzi Maalej
61e706ba6f [Akka-Scala] Add build.sbt to Akka-scala (#7076)
* Add build.sbt to Akka-scala

* Add readme.md and build.sbt to petstore sample
2017-12-01 12:03:10 +08:00
ehyche
76d3cb5002 Swift4: Fix issue 6746 - problem with arrays of primitives (#7072)
* Update samples using latest codegen and templates

* Fix issue 6746 - problem with array models where array element type is a primitive
2017-12-01 10:30:24 +08:00
antihax
831e8d7c87 [Go] Add context to all requests for tracing, logging, cancellations, etc. (#6997)
* Add context to all requests for tracing, logging, cancellations, etc.

* Fix compile error with when call has no parameters.
2017-11-30 00:30:35 +08:00
ehyche
d2a2292d20 Update samples using latest codegen and templates (#7071) 2017-11-29 14:49:45 +08:00
wing328
80cc90c7c1 update spring petstore samples 2017-11-29 11:19:46 +08:00
wing328
9a95f2f36b update swift petstore samples 2017-11-28 23:44:49 +08:00
Tomasz Prus
efe16fda8c [python/tornado] ssl improvements (#7061) 2017-11-28 10:06:29 +08:00
wing328
55410a3d4a update spring petstore sample 2017-11-27 22:12:46 +08:00
Ben Mordue
02bcc55e23 Do not apply content-type header if no request body (#6648)
* Do not apply content-type header if no request body

* Set content-type header if there are form params

* Add tests

* Run update script

* Regenerated sample clients
2017-11-27 18:33:28 +08:00
Maxim Zinchenko
a8642dbdfc [Java][Spring][Server] Issue #4680 (#6890)
* Issue #4680 correct values for enum with escaped double quotes

* Issue #4680 regenerate samples

* Issue #4680 remove new lines

* Issue #4680 fixed scripts

* Issue #4680 update samples under CentOS
2017-11-27 18:30:39 +08:00
wing328
088eef5927 update petstore samples 2017-11-27 17:16:44 +08:00
Greg Marzouka
75c2d5ed4c [Scala] Default Option parameters to None (#6538)
* Add sensible defaults for not required params in scala

* Also default to None for async methods
2017-11-27 17:06:28 +08:00
craffael
fc5ec6271a [NancyFx] Fix for issue #7024, date field mapped to ZonedDateTime (#7025)
* add support for async routes/endpoints

you can now set --optional-properties async=true to generate
a nancyfx server stub that uses asynchronous programming.

(cherry picked from commit 126869cb0b967e8063417e11993cf6326ce8ffd4)

* add nancyfx-petstore-server-async.sh to generate sample of async nancyfx.

* Rename async => asyncServer

* update bin/nancyfx-petstore-server-async.sh

* rename async => asyncServer in api.mustache + small bugfix

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh

* remove additional new line in api.mustache + add space after if

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh

* Map `date` fields to LocalDate c# type + add a JsonConverter for LocalDate.
2017-11-27 16:46:09 +08:00
Erik Janssen
1b90a05754 [Scala][Finch] Adding security definitions to Finch (#6891)
* #6818: support for security definitions and some refactoring

* adding support for Either

* adding dates with TimeZone (date-time) and Local (date)

* cleanup

* generating code
2017-11-27 16:38:12 +08:00
naelrashdeen
5d59dd10ec [PHP][Symfony] Further enhancements (#7001)
* Further enchancements for PHP-Symfony. Fixes issues described in #6999

* Ran shell script to update petstore sample
2017-11-27 16:25:50 +08:00
Gingonic
a565a94a06 Removed wrong import of StrictJsonDeserializationVisitor (#6948)
* Removed wrong import

* Run samples
2017-11-27 16:16:42 +08:00
Tristan Sloughter
3d3a30a533 [Erlang] erlang client: properly handle optional parameters (#7042)
* erlang client: properly handle optional parameters

* [Erlang Client] handle multiple path params in the same path
2017-11-27 16:11:14 +08:00
topce
8a0de971e4 Remove rxjs operators (#6989)
* do not import rxjs-operators if using HttpClinet

* generate code

* do not import operators if they are not needed
2017-11-24 13:24:46 +08:00
Keni Steward
8eb33f9d1b [Typescript][Angular]Issue #6902 Return Client Response for Angular 4.3 and above with Observe string (#6955)
* Updated swagger-ui wget url to https

* Issue #6902 Add Observe/ReportProgress pass through variables to the response for each api call for angular 4.3 and above

* Issue #6902 Fixed problem where extra comma as generated and should
not have been.

* Issue #6902 Fixed compiltion issue for Angular 4.3
2017-11-24 01:50:07 +08:00
William Cheng
a4531b695e
use python client toOperationId logic (#7035) 2017-11-23 17:41:50 +08:00
Oliver Hoffmann
10107ac7ec Upgrade to resteasy-jackson2-provider (#7017)
* Upgrade to resteasy-jackson2-provider

* Upgrade to resteasy-jackson2-provider
2017-11-23 17:35:49 +08:00
Lukasz Konopski
0f92baeb04 Inheritance support java client okhttp gson (#6636)
* #6636 inheritance support for java client okhttp with gson parser

* #6636 generate samples
2017-11-22 21:28:13 +08:00
Guillermo Pastor
65bb761952 Fix: Resolve problem with UUID class not found if there is almost one parameter with format as uuid (#6617)
* feat: java.util.UUID if parameter is UUID

* solve git problem
2017-11-22 16:54:11 +08:00
François Rosé
acefe3f385 [CppRest] Add Object and fix modelbase includes (#6905)
* Objects are represented by `ModelBase.h`, not `Object.h` which does not exist.

* Use correct relative imports for files in the `model` and `api` folders.

* [CppRest] Update cpprest petstore client sample.

* Implement `Object` class to support arbitrary types.

* [CppRest] Update cpprest petstore client sample.

* [CppRest] Add newly generated files to petstore client sample.

* [CppRest] Add `Object` to CMakeLists.
2017-11-22 12:19:13 +08:00
François Rosé
d9cea0f97e [CppRest] Support optional parameters (#6959)
* Use boost::optional for parameters that are not required.

* Update sample petstore client.
2017-11-22 12:13:05 +08:00
William Cheng
803f337d24
[Scala][Lagom] rename generator from scala-lagom to scala-lagom-server (#7014)
* rename scala-lagom to scala-lagom-server

* add back pom.xml and shell script

* update scala-lagom-server path in circleci pom.xml

* make shell script executable

* rename batch file
2017-11-21 23:24:02 +08:00
William Cheng
573b5518be
[Scala][Lagom] minor enhancements (#7011)
* rename lagom scala, minor enhancements

* add scala lagom to circle ci

* test sala lagom with jdk8 only
2017-11-21 17:34:09 +08:00
gmkumar2005
32abb72769 [LagomScala] Add Scala API generator for lagomframework #6900 (#6901)
* Initial Commit

* Removed unneeded class, Updated names as per naming conventions, Removed licensing info from  generated code

* Moved samples from client folder to server

* Fixed naming issue with scripts in the bin

* improved code format for api

* fixed compile issue and improved formatting

* fixed compile issue and improved formatting
2017-11-21 15:40:04 +08:00
Kenny Jones
63fce58931 [Java][Spring] Resolve serialization warning from RFC3339DateFormat (#6960)
Adds `serialVersionUID` to RFC3339DateFormat.java to avoid Java warning.
2017-11-21 12:14:02 +08:00
Daiki Matsudate
a5e4abe5ec [Swift4]Update templates for swift 4 (#6921)
* update versions of dependencies on swift4 and swift3

* change syntax for swift4

* run petstore script

* change enum case from UpperCamel to lowerCamel

* remove unneeded break statements

* avoid wrapping conditionals in parentheses

* avoid force casting

* run pod update on petstore/swift4/rxswift

* update project for swift 4

* run swift4-petstore-all.sh

* fix compile error

* avoid use iso8601 date strategy for encoder / decoder

* resolve file references
2017-11-21 11:33:52 +08:00
manuc66
b06ccec11e [csharp] Update JsonSubTypes to 1.1.3 and use nuget dependency (#6969)
* the result I want to obtain

* add csharp-petstore-net-40.bat for windows

* just ran bin\windows\csharp-petstore-all.bat

* Removed those directories:
- samples\client\petstore\csharp
- samples\client\petstore\csharp-dotnet2

then ran :
bin\windows\csharp-petstore-all.bat

* - update JsonSubTypes to 1.1.3 by using nuget dependency (the package is compatible with net40)
- allign all version of Newtonsoft.Json to 10.0.3

* the result of bin\windows\csharp-petstore-all.bat

* ran bin\security\windows\csharp-petstore.bat
2017-11-21 11:26:58 +08:00
topce
04ee374328 [TypeScript][Angular] fix problem with strict compilation (#6978)
* fix probelme with strict compilation

* commit generated files
2017-11-21 01:21:45 +08:00
wing328
404b526dbe update resttempalte java petstore samples 2017-11-21 00:48:39 +08:00
William Cheng
ec0da35b6c
regenerate package.json, tsconfig.json for ts node (#6987) 2017-11-18 21:05:19 +08:00
wing328
da1702db03 update petstore sample 2017-11-17 23:39:12 +08:00
William Cheng
15bbb52b22
check for dot in path and throw exception if found (#6986) 2017-11-17 20:18:06 +08:00
Tomasz Prus
73cb68ee7b [python] fix tests, tornado ssl fix (#6968)
* fix: non-zero exit code if tests fail

* tests: use local petserver to run tests

* fix: non-zero exit code if tests fail

* tests: use local petserver to run tests

* fix: creating ssl context in old version of Python

* chore: remove unused target from Makefile

* doc: changes from upstream

* fix: tornado client raises NotImplementedError in older version of Python
2017-11-17 17:33:39 +08:00
wing328
d04d280d1b update java petstore samples 2017-11-16 17:09:59 +08:00
Shuma Yoshioka
85b0d0ff78 [TypeScript][Node] Resolve errors for strict compile (#6933)
* [TypeScript][Node] Resolve TS7017 error

* Run `bin/typescript-node-petstore-all.sh`

* Run `bin/security/typescript-node.sh`

* Add `strict` option to ts-node config

* Run `bin/typescript-node-petstore-all.sh`

* Fix `strict` option syntax in typescript-node/tsconfig.mustache

* Sync tsconfig.json

* Sync package.json

* Delete typings.json

* Sync tsconfig.json

* Resolve TS2345 error

* Resolve TS2322 in integration-test (Delete non-effective codes)

* Add @types/rewire to test

* Resolve TS7017 errors

* Run `bin/typescript-node-petstore-all.sh`

* Run `bin/security/typescript-node.sh`
2017-11-16 17:00:48 +08:00
Jim Schubert
2c9f98ce38 [csharp] clean boolean additional properties 6784 (#6899)
* [csharp] Convert "false" properties to booleans

It appears as though "false" strings in additionalProperties are no
longer treated as false booleans. This may be an issue elsewhere, but a
simple fix is to always explicitly set the boolean value in a generator
class back to the additionalProperties map to convert boolean Strings to
boolean Objects.

* [nancyfx] Clean up async default option handling

* [nancyfx] Include asyncServer=false in sample script

* [csharp] Regenerate samples

* [csharp] Resolve .net 4 generation issues

Some functionality is missing from .NET 4.0, such as IReadonlyDictionary
and Type.GetTypeInfo().

This commit resolves compilation of generated .NET 4.0 code, requiring
no conditional versioning of Newtonsoft.Json.

* [csharp] Regenerate .net 4.0 sample

* [csharp] Resolve .NET 4.0 sample compile

Sample build.sh wasn't accounting for targeting different FCL correctly.
That is, when passing "net40" to the -sdk option, it would use the
default -sdk:4 and -langversion:6. These don't necessarily match with
what is installed on a machine with only .NET 4.0 (which is our targeted
use case here).

To resolve, we need to define another version-specific value for passing
to the mcs -sdk option (see man mcs for details).

This option currently isn't overridable in the client codegen class.
Also, langversion is set specifically to the version of C# available to
the targeted SDK version. If there is need, we may extend this to
something like:

langversion=${MCS_LANG_VERSION:-6}

To allow users to run as:

   env MCS_LANG_VERSION=5 sh build.sh

I haven't done this because I doubt there's much of a use case via this
script. I'm assuming most consumers will build via IDE or MSBuild.

* [csharp] Revert bin/csharp-petstore.sh to 3.5

* [csharp] Regenerate .NET 3.5 sample

* [csharp] Resolve nuget issue with existing files

* [csharp] Update -all.sh, regenerate samples
2017-11-15 22:36:37 +08:00
Atanas Bozhkov
970de01bdf [Swift4] Add throw to reserved words (#6952)
* * Added `throw` to Swift4 Reserved words.

* * Regenerating Swift4 Petstore project
2017-11-15 21:45:30 +08:00
William Cheng
744c7d904a
remove spaces, empty lines from qt5cpp client (#6956) 2017-11-14 23:28:06 +08:00
Charles Capps
47f1865e69 [Java][google-api-client] Fix minor bugs in google api client (#6951)
* Fix minor bugs in google-api-client templates

* Update samples
2017-11-14 12:02:59 +08:00
Dawid van Graan
5af788cb9f [Swift4] Allow for custom dateformatter to be used (#6672)
* Add a custom dateformat to be set

* Samples updated

* Update CodableHelper.swift

Change to correct format: decoder.dataDecodingStrategy = .base64

* Update CodableHelper.mustache

Add `decoder.dataDecodingStrategy = .base64` back

* Update CodableHelper.swift

Fix `decoder.dataDecodingStrategy = .base64`

* Update CodableHelper.swift

Fix `decoder.dataDecodingStrategy = .base64`
2017-11-13 22:15:43 +08:00
Akihito Nakano
9ca9887de4 [PHP] Improve docs and README (#6935)
* Fix wrong client class, add details about client

* Improve example for Configuration

* camelcase

* Improve README like api doc

* Update samples
2017-11-13 13:56:45 +08:00
Gabriele Bonetti
62444a7aaf Binary mode for file deserialization in python (#6936)
* use wb mode in file deserialization

* add auto generated files from security/python-petstore.sh
2017-11-13 12:50:10 +08:00
wing328
90a0b7a7e2 add python tornado test to travis 2017-11-13 12:05:18 +08:00
Tomasz Prus
4e967e696c [Python/tornado] add integration tests and fix bugs (#6925)
* tests: add integration test for python-tornado

* [python-tornado-client] tests: increase timeout for test_upload_file

* [python-tornado-client] fix: tornado client passes tests
2017-11-13 12:03:55 +08:00
Alexandre Demode
63d28cf75b Fix PHP passes response body to ApiException (#6923) 2017-11-13 11:30:46 +08:00
Shuma Yoshioka
053061ec9f [TypeScript][Node] Resolve TS2532 error (#6932)
* [TypeScript][Node] Resolve TS2532 error

* Run `bin/typescript-node-petstore-all.sh`

* Run `bin/security/typescript-node.sh`
2017-11-13 11:23:56 +08:00
wing328
444a05ce21 minor formatting change 2017-11-12 22:21:54 +08:00
Tristan Sloughter
b9651e5775 WIP: initial commit for Erlang client generator (#6502)
* WIP: initial commit for Erlang client generator

* add models types and function type specs

* fix type specs when models are the type and support QS lists

* make method lowercase in postprocessoperations

* add model encode function

* add erlang client sample

* add windows client sample script

* proper return type spec and handle return error messages
2017-11-12 22:02:05 +08:00
Greg Marzouka
f921f4f4da [Scala] Default case class Option types to None for non-required fields (#6790)
* [Scala] Default case class Option types to None

* Update Petstore sample
2017-11-10 15:57:40 +08:00
Gustavo Paz
b404dafa02 Issue 6694 2.3.0 (#6845)
* The get method template is modified to return the value of the enum instead of the enum itself.

* Update of the Petstore CXF server sample

* Update of the Petstore CXF client sample

* Update of the Petstore CXF server annotated base path sample

* Update of the Petstore CXF server non spring application sample
2017-11-10 15:32:05 +08:00
Andrew Norman
372a08763d adding "Read Timeout" getters and setters for the Jersey and OkHttp (#6853)
* adding "Read Timeout" getters and setters for the Jersey and OkHttp
based ApiClients

adding "Write Timeout" getters and setters for the OkHttp based
ApiClient

adding tests for the OkHttpClient covering the new getters and setters

* generated files from the bin scripts
2017-11-10 12:12:40 +08:00
afrolovsky
9a44512d03 @JsonProperty annotation for jaxrs-spec server model classes (#6911) (#6916) 2017-11-09 21:46:26 +08:00
François Rosé
485b186129 [CppRest] Unique header guards (#6904)
* [CppRest] Generate unique header guards based on the package names.

* [CppRest] Update cpprest petstore client sample.
2017-11-09 17:59:45 +08:00
François Rosé
7a83081f18 [CppRest] Remove U macro (#6903)
* [CppRest] Replace U macro with conversion function for default string values.

* [CppRest] Replace U macro with conversion function in templates.

* [CppRest] Update cpprest petstore client sample.
2017-11-09 17:58:21 +08:00
wing328
8b251555ac update php symfony petstore, remove spaces in empty line 2017-11-09 16:36:25 +08:00
Keni Steward
39a9c5587f [Typescript][Node] Fixes inccorect enum generation for enumsMap when Array<Enum> is defined fixes part of Issue #5681 (#6862) 2017-11-07 01:19:58 +08:00
Jeffrey Slort
cf813f5c8e Feature/replace isomorphic fetch with portable fetch (#6739)
* Replaced isomorphic fetch with portable fetch

* Ran scripts in bin

* reference custom.d.ts in api.ts

* ran scripts and added custom.d.ts files to git

* Ran scripts in bin after merge

* regenerated security tests
2017-11-05 15:37:54 +08:00
wing328
2bce479c1c
minor code format enhancement to ts angualr (#6888) 2017-11-05 12:05:45 +08:00
Jon Schoning
cd1c2b13e3 [haskell-http-client] refactor & promote accept mimetype to request; simplify templates (#6866)
* add AuthMethodException

* rename cli prop

* simplify templates
2017-11-05 01:41:53 +08:00
Meindert Deen
a5586044cd Implemented fix for #6006. Mime-type support (#6751)
* Implemented fix for #6006. Mime-type support for accepts and
content-type.

* Review comments of @macjohnny incorporated

* merge with latest and retest

* merge with latest and retest. Now correctly generated with new Maven build
2017-11-05 00:26:42 +08:00
Kenny Jones
b6699f6068 [python] Convert unicode to six.u (#6881)
`unicode` does not exist in py3, therefore since six is already imported
switch to using `six.u` so that `unicode` is used on py2 and `str` is used
on py3.
2017-11-04 23:24:51 +08:00
Jim Schubert
7b269eaf4a Kotlin sanitize model names 6864 (#6874)
* [kotlin] better sanitize model names

* [kotlin] Regenerate samples
2017-11-04 23:23:08 +08:00
stkrwork
659e64206a - Updated cpp generators to name boolean getter functions with an is at the beginning (ex. isActive) (#6880) 2017-11-04 22:04:38 +08:00
wing328
cf5eba87bd update circleci to cover java google-api client, update Java petstore
samples
2017-11-03 18:49:32 +08:00
Charles Capps
c2eb53ab1d [Java] Templates to support google-api-client library (#6838)
* Add support for the google-api-client

* When there's no return type, just return (no parsing the response)

* Update the deserialization to use a Jackson typeref.

* Delete the auth mustache files as we don't need them

* Stop generating unneeded auth files; get SBT/gradle working with the generated module

* Add builder-style methods to the google-api-client ApiClient for getting API instances

* Update the README to reflect the new client library option

* Generated overloaded methods to send query params as a Map<String, Object>

* Add files for Sample codes

* Add type in angle brackets to support Java 6

* Required query params must be added to the Map of params. Update sample code.

* Use explicit types instead of diamonds to support Java6 in one more place.

* Clean up javadoc warnings in generated code / remove pointless return statements

* Clean up extra newlines in generated code
2017-11-03 18:46:07 +08:00
Jean-François Côté
16373b9f70 Fix the fake endpoint example. Now all cases are handled by the java play framework! (#6850) 2017-11-02 17:54:34 +08:00
wing328
86b266b02f
[TS][Anuglar] Update Travis CI to cover TS Angular 4.3 petstore client (#6844)
* add CI to TS Angular 4.3

* comment out ts cache direcotries
2017-11-02 17:32:32 +08:00
Akihito Nakano
e8635632a4 [PHP] Fix #6770: Debug flag is not passed (#6808)
* Add testcase which reproduces issue #6770

* Pass debug option if needed

* Update samples

* bin/php-petstore.sh
* bin/security/php-petstore.sh

* Api throws exception when failed to open debug file

* Pass debug option if needed (Async)

* Extract instance method

* Update samples

* bin/php-petstore.sh
* bin/security/php-petstore.sh
2017-11-02 17:14:00 +08:00
Kenny Jones
74f70a1924 [python-client] Modify python templates to resolve linting errors (#6839)
The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.

pyclient            7714 vs. 120
pyclient3           7717 vs. 120
pyclient3-asyncio   7584 vs. 120
pyclient-tornado    7633 vs. 120
pyclient3-tornado   7633 vs. 120

For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/2eb69a7e8db75e9fd53789f01570d9f2

Enforces linting for python clients by running flake8 for the generated
python client.
2017-11-02 00:47:14 +08:00
craffael
8fec429158 [NancyFx] Support Async (#6755)
* add support for async routes/endpoints

you can now set --optional-properties async=true to generate
a nancyfx server stub that uses asynchronous programming.

(cherry picked from commit 126869cb0b967e8063417e11993cf6326ce8ffd4)

* add nancyfx-petstore-server-async.sh to generate sample of async nancyfx.

* Rename async => asyncServer

* update bin/nancyfx-petstore-server-async.sh

* rename async => asyncServer in api.mustache + small bugfix

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh

* remove additional new line in api.mustache + add space after if

* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh
2017-11-01 22:50:49 +08:00
Euan Kemp
c97b63d2bb [Rust] Implement 'object' type conversion (#6846)
* [Rust] Use serde Value for objects

This hopefully fixes the previous TODO; it at least fixes compilation
errors for the specific swagger model I'm working with.

* [Rust] Update Cargo.toml to specify versions

Letting the version float freely is scary, to say the least.

This gives it a better chance at being future-proof.

When the crate author had a recommended selector I picked that,
otherwise I went semver compatible.

* [Rust] Regenerate the example
2017-11-01 22:00:56 +08:00
Renaud Amar
9272b3e768 [Ruby] Fix "build_from_hash" function for Ruby enums (#6812)
* Modify build_from_hash to compare value against enum's value rather than const name

* Updated Petstore sample
2017-11-01 21:47:22 +08:00
ehyche
95ef1bf62e Swift3: properly percent-escape path parameters (#6705)
* Add addiitional files from upstream

* Remove mis-added files

* Swift3: Properly percent-escape path parameters

This change fixes the following issue:

https://github.com/swagger-api/swagger-codegen/issues/6400

The problem was that path parameters were not properly percent-escaped before being placed into the URL path. This leads to creation of an invalid URL, which then fails.

So therefore, in the API template where path parameters are handled, we propertly percent escape them, using the characters which are allowed in URL paths.

In addition to this template change, then this PR includes the following changes:

1. Resulting changes in all generated code due to the above template change.
2. I added the objcCompatible run to the swift3-petstore-all.sh so that I could re-generated all of the generated code with a single script.
3. I added a unit test in UserAPITests.swift which verifies that paths are properly escaped.
4. In order to make the unit test work, then I needed access to RequestBuilder<T>.URLString to verify that the path was properly escaped. However, RequestBuilder<T>.URLString had "internal" access control so it was inaccessible from the unit test. So therefore, I made four contants in RequestBuilder<T> to be public. This should not harm anything, since they are constants ("let's") and cannot be changed from the outside of the class after initialization.
5. There were also some stray changes which look like they were caused by having not run bin/swift3-petstore-all.sh in a while.
2017-10-30 15:40:00 +08:00
niku
bc302f7151 [Elixir Client]Improve elixir client typings (#6821)
* [Elixir Client] Update the sample

It just executes
% bin/elixir-petstore.sh
without any code changes.
It have been affected by updating the sample swagger specification of 07b408a44a

* [Elixir Client] Fix typings in RequestBuilder

Fix following dialyzer warnings in the sample:

```
lib/swagger_petstore/api/another_fake.ex:30: Function test_special_tags/2 has no local return
lib/swagger_petstore/api/another_fake.ex:30: Function test_special_tags/3 has no local return
lib/swagger_petstore/api/another_fake.ex:32: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'patch') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:29: Function fake_outer_boolean_serialize/1 has no local return
lib/swagger_petstore/api/fake.ex:29: Function fake_outer_boolean_serialize/2 has no local return
lib/swagger_petstore/api/fake.ex:34: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:57: Function fake_outer_composite_serialize/1 has no local return
lib/swagger_petstore/api/fake.ex:57: Function fake_outer_composite_serialize/2 has no local return
lib/swagger_petstore/api/fake.ex:62: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:85: Function fake_outer_number_serialize/1 has no local return
lib/swagger_petstore/api/fake.ex:85: Function fake_outer_number_serialize/2 has no local return
lib/swagger_petstore/api/fake.ex:90: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:113: Function fake_outer_string_serialize/1 has no local return
lib/swagger_petstore/api/fake.ex:113: Function fake_outer_string_serialize/2 has no local return
lib/swagger_petstore/api/fake.ex:118: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:142: Function test_client_model/2 has no local return
lib/swagger_petstore/api/fake.ex:142: Function test_client_model/3 has no local return
lib/swagger_petstore/api/fake.ex:144: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'patch') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:181: Function test_endpoint_parameters/5 has no local return
lib/swagger_petstore/api/fake.ex:181: Function test_endpoint_parameters/6 has no local return
lib/swagger_petstore/api/fake.ex:195: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:230: Function test_enum_parameters/1 has no local return
lib/swagger_petstore/api/fake.ex:230: Function test_enum_parameters/2 has no local return
lib/swagger_petstore/api/fake.ex:242: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:266: Function test_inline_additional_properties/2 has no local return
lib/swagger_petstore/api/fake.ex:266: Function test_inline_additional_properties/3 has no local return
lib/swagger_petstore/api/fake.ex:268: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:293: Function test_json_form_data/3 has no local return
lib/swagger_petstore/api/fake.ex:293: Function test_json_form_data/4 has no local return
lib/swagger_petstore/api/fake.ex:295: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake_classname_tags123.ex:29: Function test_classname/2 has no local return
lib/swagger_petstore/api/fake_classname_tags123.ex:29: Function test_classname/3 has no local return
lib/swagger_petstore/api/fake_classname_tags123.ex:31: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'patch') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:30: Function add_pet/2 has no local return
lib/swagger_petstore/api/pet.ex:30: Function add_pet/3 has no local return
lib/swagger_petstore/api/pet.ex:32: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:57: Function delete_pet/2 has no local return
lib/swagger_petstore/api/pet.ex:57: Function delete_pet/3 has no local return
lib/swagger_petstore/api/pet.ex:62: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'delete') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:86: Function find_pets_by_status/2 has no local return
lib/swagger_petstore/api/pet.ex:86: Function find_pets_by_status/3 has no local return
lib/swagger_petstore/api/pet.ex:88: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:112: Function find_pets_by_tags/2 has no local return
lib/swagger_petstore/api/pet.ex:112: Function find_pets_by_tags/3 has no local return
lib/swagger_petstore/api/pet.ex:114: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:138: Function get_pet_by_id/2 has no local return
lib/swagger_petstore/api/pet.ex:138: Function get_pet_by_id/3 has no local return
lib/swagger_petstore/api/pet.ex:140: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:163: Function update_pet/2 has no local return
lib/swagger_petstore/api/pet.ex:163: Function update_pet/3 has no local return
lib/swagger_petstore/api/pet.ex:165: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'put') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:191: Function update_pet_with_form/2 has no local return
lib/swagger_petstore/api/pet.ex:191: Function update_pet_with_form/3 has no local return
lib/swagger_petstore/api/pet.ex:197: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:223: Function upload_file/2 has no local return
lib/swagger_petstore/api/pet.ex:223: Function upload_file/3 has no local return
lib/swagger_petstore/api/pet.ex:229: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/store.ex:30: Function delete_order/2 has no local return
lib/swagger_petstore/api/store.ex:30: Function delete_order/3 has no local return
lib/swagger_petstore/api/store.ex:32: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'delete') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/store.ex:54: Function get_inventory/1 has no local return
lib/swagger_petstore/api/store.ex:54: Function get_inventory/2 has no local return
lib/swagger_petstore/api/store.ex:56: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/store.ex:79: Function get_order_by_id/2 has no local return
lib/swagger_petstore/api/store.ex:79: Function get_order_by_id/3 has no local return
lib/swagger_petstore/api/store.ex:81: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/store.ex:104: Function place_order/2 has no local return
lib/swagger_petstore/api/store.ex:104: Function place_order/3 has no local return
lib/swagger_petstore/api/store.ex:106: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:30: Function create_user/2 has no local return
lib/swagger_petstore/api/user.ex:30: Function create_user/3 has no local return
lib/swagger_petstore/api/user.ex:32: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:56: Function create_users_with_array_input/2 has no local return
lib/swagger_petstore/api/user.ex:56: Function create_users_with_array_input/3 has no local return
lib/swagger_petstore/api/user.ex:58: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:82: Function create_users_with_list_input/2 has no local return
lib/swagger_petstore/api/user.ex:82: Function create_users_with_list_input/3 has no local return
lib/swagger_petstore/api/user.ex:84: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:108: Function delete_user/2 has no local return
lib/swagger_petstore/api/user.ex:108: Function delete_user/3 has no local return
lib/swagger_petstore/api/user.ex:110: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'delete') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:133: Function get_user_by_name/2 has no local return
lib/swagger_petstore/api/user.ex:133: Function get_user_by_name/3 has no local return
lib/swagger_petstore/api/user.ex:135: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:159: Function login_user/3 has no local return
lib/swagger_petstore/api/user.ex:159: Function login_user/4 has no local return
lib/swagger_petstore/api/user.ex:161: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:185: Function logout_user/1 has no local return
lib/swagger_petstore/api/user.ex:185: Function logout_user/2 has no local return
lib/swagger_petstore/api/user.ex:187: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:211: Function update_user/3 has no local return
lib/swagger_petstore/api/user.ex:211: Function update_user/4 has no local return
lib/swagger_petstore/api/user.ex:213: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'put') breaks the contract (map(),'Elixir.String':t()) -> map()
```
2017-10-29 00:46:07 +08:00
Jon Schoning
4fc52c5524 [haskell-http-client] add support for enums (#6803)
* support enums for models and operation parameters

* add generateEnums cli option (default: true)

* bump stack resolver: lts-9.10
2017-10-29 00:45:13 +08:00
Jean-François Côté
18ba90f5ac [JavaPlayFramework] Add parameters for beanValidation in the application.conf + fix bugs (#6794)
* Add configuration to split input and output bean validations. When useBeanValidation is used, the variable are created in the application.conf file and can be tweaked by environment. For example, dev and stage can have true to both but only have input in prod.

* Refactor of mustache tags for more clarity

* sample generation with refactor

* Fix a couple of bugs with the fake-endpoint yaml but there is still 2 cases where it doesn't work.
2017-10-27 22:48:27 +08:00
wing328
cab4fc0fed add support for csharp net40 (#6792) 2017-10-27 22:47:02 +08:00
Christophe Bornet
fe2ed67f20 Remove Accept request header from api signature (#6704)
* Remove Accept request header from api signature

* Inject HttpServletRequest to get request header and clean templates

* Use constructor injection for HttpServletRequest

* Implement example in default controller responses
2017-10-27 22:45:30 +08:00
Kenny Jones
28d14e34c4 [python-flask] Apply template tweaks to improve lint results (#6826)
The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.

flaskConnexion          1843 vs. 20
flaskConnexion-python2  1841 vs. 19

For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/edc9d71ef7fd2bf23714ecbb693d52b3
2017-10-27 22:18:14 +08:00
Kenny Jones
54b670b7e0 [python-flask] Create main function and entrypoint (#6814)
Enable the creation of the entrypoint so that the server can be started
using a named command instead of needing to always use `python -m` to
run the server.
2017-10-26 20:38:30 +08:00
Stephan E
f78d958ec0 Fix ruby model generation with objects and additionalProperties (#6816)
* Fix model generation with objects and additionalProperties

* Generate Ruby Petstore

* Generate Ruby Security Petstore
2017-10-26 19:59:38 +08:00
Keni Steward
4f3c86aa14 Adding forRoot instead of forConfig and forcing only 1 instantiation of the ApiModule (#6775)
* Added forRoot and constructure duplicate check

* added imports

* updated providers display format

* updated examples

* Moved providers so users don't hav eto use forRoot if they don't want.

* Updated the readme
2017-10-26 17:57:30 +08:00
Jérémie Fraudeau
681b1c20ea [Scala][Finch] Fix interpretation of queryParams and headers (#6809)
* [Scala][Finch] Fix interpretation of queryParams and headers

* [Scala][Finch] Updates the sample for Finch generated server
2017-10-26 16:44:06 +08:00
wing328
6814530d69 fix enum in path parameter (spring) (#6810) 2017-10-25 22:30:36 +08:00
Asad Saeeduddin
49974c51bd Change return type from any -> Response (#6774)
* Leftover updates to sample file

* Change return type any -> Response

* Update samples
2017-10-25 12:34:37 +08:00
Halil İbrahim Şener
f42a4a51dd [javascript] Use babel-preset-env instead of es2015 and upgrade babel-cli and babel-core (#6799) 2017-10-25 11:12:41 +08:00
Brian Kim
044bfdac39 Fix #6166 by adding @Deprecated annotations in Java jersey2, okhttp-gson, resteasy libraries (#6801) 2017-10-25 11:10:03 +08:00
Dimitar Ivanov
ab338f8cb9 Erlang-server: fix dialyzer; fix min and max checks (#6752) 2017-10-25 10:57:53 +08:00
Esteban Marin
f4ac6feae2 Bugfix/6727 import http client module (#6757)
* [angular-typescript] imports HttpClientModule

HttpModule has no effect, since the new `HttpClient` is now used. fixes #6727

* #6727: import http client module or http module, depending on setting

* #6727: import http client module or http module, depending on setting

* #6727: generate samples
2017-10-25 10:53:20 +08:00
Esteban Marin
66cbab1947 Bugfix/6649 angular http client empty body (#6754)
* fix empty body issue

* #6649: add line break

* #6649: improve indentation

* #6649: improve indentation

* #6649: generate code

* #6649: generate samples

* #6649: fix method docs
2017-10-24 22:51:58 +08:00
wing328
698149573d fix r body parameter null issue (#6786) 2017-10-24 10:45:25 +08:00