-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TypeScript] String enums allow incorrect widening #5146
Comments
typescript 2.4 will support string enums: microsoft/TypeScript#15486 |
* represent swagger enums as union of literal types enabling their easy use in angular templates, structural subtyping among enums (in particular, different instances of the same enum are now mutually assignable), improving type safety by preventing incorrect widening, and permitting numeric enum values (albeit without descriptive names) Fixes #6206, #5146, #3500 * update samples * restore blank lines at end of file * fix typo
* represent swagger enums as union of literal types enabling their easy use in angular templates, structural subtyping among enums (in particular, different instances of the same enum are now mutually assignable), improving type safety by preventing incorrect widening, and permitting numeric enum values (albeit without descriptive names) Fixes swagger-api#6206, swagger-api#5146, swagger-api#3500 * update samples * restore blank lines at end of file * fix typo
commit ff9c72320834c572ffde470b60b1d1845b36bb72 Author: alex-fisher <[email protected]> Date: Tue Oct 17 10:37:22 2017 -0500 ContentType selection fix for csharp. (#6633) * ContentType selection fix for csharp. Updated to reflect java implementation. Previously any request body of type string was having the content type overridden to 'application/json'. This prevented custom json ContentTypes * updated the petshop codegen for C# * Fixed content type selection test for csharp * Replaced tabs with 4 spaces * Removed trailing space / string comparison commit be3e33f4729d05398bbe76eb431ed146fe314b4d Author: François Rosé <[email protected]> Date: Tue Oct 17 17:14:34 2017 +0200 [C++] Sanitize operation ids. (#6664) * [C++] Sanitize operation ids. * [C++] Handle reserved words in `toOperationId`. * [C++] Re-order reserved words alphabetically. * [C++] Add missing reserved words. commit 27850d9596a5d8ec74f5927a2ce082deb08c9c35 Merge: d093a3449 abe1be1a1 Author: wing328 <[email protected]> Date: Tue Oct 17 22:53:34 2017 +0800 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen commit d093a344996f68567bc8ae121bcd4fc3e428326f Author: wing328 <[email protected]> Date: Tue Oct 17 22:53:04 2017 +0800 add jaxrs-spec-interface to circle ci commit abe1be1a14fff193c7322c0b4f23aadc60435a4e Author: Giacomo <[email protected]> Date: Tue Oct 17 16:51:37 2017 +0200 JAXRS-SPEC: fix container return type (#6659) * JAXRS-SPEC: fix container return type * Run ./bin/jaxrs-spec-petstore-server.sh ./bin/jaxrs-spec-petstore-server-interface.sh commit 5143fb58a4c854c9c3da3dd47a4d89f2473a13ca Author: wing328 <[email protected]> Date: Tue Oct 17 22:31:06 2017 +0800 revise go header, minor formatting fix (#6695) commit 62627f20bcc9b8feedc98fb6a4901ed114e7fa5b Author: niku <[email protected]> Date: Tue Oct 17 22:59:25 2017 +0900 [Elixir Client]Improve elixir client typings (#6665) * [Elixir Client] Improve primitive typings * [Elixir Client] Add type to models Fix following dialyzer warnings in the sample: ``` :0: Unknown type 'Elixir.SwaggerPetstore.Model.ApiResponse':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Client':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Order':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterBoolean':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterComposite':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterNumber':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterString':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Pet':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.User':t/0 ``` commit 07b408a44a4b2373b34619d5dd5c6d955d57fff0 Author: Akihito Nakano <[email protected]> Date: Tue Oct 17 22:22:49 2017 +0900 [PHP] Fix #5338: InvalidArgumentException (#6685) * Add endpoint definition which reproduces #5338 bug * Update samples * Add test case which reproduces #5338 bug * Fix "InvalidArgumentException: Invalid resource type: object" * Update samples - ./bin/php-petstore.sh - ./bin/security/php-petstore.sh commit 381acd28ea42bf6e26e158bb3c8f82961ddfcc9c Author: Hidetake Iwata <[email protected]> Date: Tue Oct 17 16:45:48 2017 +0900 Add http://www.nttdata.com (#6713) commit 5c14f907d699d6f8c8230f8a34048ec12cfd7095 Author: wing328 <[email protected]> Date: Mon Oct 16 22:33:12 2017 +0800 add beta to scalaz generator commit 62794c1d60602da591f120825efcfd2ea7dce7ca Author: wing328 <[email protected]> Date: Mon Oct 16 22:23:26 2017 +0800 add scalaz to cirleci commit 15450754ecd7df9209c3f1f16ca13e10d5315b41 Author: wing328 <[email protected]> Date: Mon Oct 16 22:15:07 2017 +0800 add tbrown1979 as template creator for scalaz commit 488aa989bf1f8f3436b89c5f5d8bd04e933a3331 Author: Taylor Brown <[email protected]> Date: Mon Oct 16 09:07:57 2017 -0500 Adding a new Scala client codegen (#6572) * Adding a Scalaz codegen client * Fixing imports and removing commented code * Adding the bash file and updating the Pet store samples for Scalaz. * Finalizing Scalaz generation so that it works for the Petstore.yaml * Removing some unnecessary files and comments * Removing some files that were accidentally generated for the wrong Scala commit 1050aa9a06014261bfe24497ec85a530a0b34f50 Author: P.Y. Laligand <[email protected]> Date: Mon Oct 16 06:28:21 2017 -0700 Added support for enums in Dart. (#6516) * Added support for enums in Dart. * Pick non-private names for enum values. The _ prefix denotes a private member in Dart, so avoid generating enum values starting with this character. * Properly encode enum values into query paramters. * Various cleanups. * Add support for x-enum-values extension. Use class instead of enum for better ergonomy. Better generated enum names. * Fixed test. * Support enum descriptions. commit 8b70f24371e5296fc95a60c3c89e1e53eccbb179 Author: Jean-François Côté <[email protected]> Date: Mon Oct 16 09:23:05 2017 -0400 There was no validation when a required field was null, creating crash and null pointer exception further down the line in the business code. Now, it throws a InvalidArgumentException. (#6673) commit 619c391be9682214b44f7707d52fdf279ca5ae45 Author: wing328 <[email protected]> Date: Mon Oct 16 11:48:13 2017 +0800 update python flask petstore samples commit 12a85bb09d9e8a68bb6c39929d11ec8972b18321 Author: Logan Patino <[email protected]> Date: Sun Oct 15 23:34:31 2017 -0400 Add enum support for flask (#6684) commit 8bcceb4a1036baa84434fa1284835e5adf769510 Author: Yukio Ejiri <[email protected]> Date: Mon Oct 16 12:05:41 2017 +0900 [kotlin] Fix causing NoClassDefFoundError at runtime on Android device (#6661) * Fix causing NoClassDefFoundError at runtime on Android device. * Add samples modified by bin/kotlin-client-petstore.sh commit 3067da2877b627af87ffec8201c58426ae598843 Author: Javier Velilla <[email protected]> Date: Mon Oct 16 00:02:19 2017 -0300 Swagger eiffel:fix (#6674) * Updated api client, Required parameters {{#required}} .. {{/required}}, are mapped to Eiffel Void Safety Rules, optional parameters are translated to detachable TYPE. Validation Rules are mapped to preconditions, at the moment maximun and minimun validation has been added. Improved API_CLIENT.parameter_to_tuple feature to accept a LIST [ANY] instead of LIST [STRING_32]. Improved model template to generate the model output. * Updated API_CLIENT.parameter_to_string feature, missing STRING representation. * Updating sample using the latest modifications. commit 3f7f6b85994a05db153b6f6b64cdb06e2dc2795f Author: Elias Ovchynnikov <[email protected]> Date: Mon Oct 16 04:18:32 2017 +0200 Add operationId as nickname to @ApiOperation (#6688) * Add operationId as nickname to @ApiOperation * Refresh samples after adding nicknames to @ApiOperation commit 1f97caf960e19b847588d2ef2c0ed2010c6c25c5 Author: Gustavo Paz <[email protected]> Date: Sun Oct 15 21:17:40 2017 -0500 Included Open Systems International in the list of companies using Swagger Codegen (#6692) commit 027fb2fe4787b3cc1798b22f575a75fb2cd87479 Author: stkrwork <[email protected]> Date: Sun Oct 15 17:38:46 2017 +0200 - Removed unnecessary line in in Restbed Codegen Constructor (#6675) - Updated samples commit 96444d374f1f29d634cec8a005af74b07798a6ef Author: wing328 <[email protected]> Date: Fri Oct 13 18:27:13 2017 +0800 update go petstore samples commit eb453791b61742a9430562c01ab7b810b6710d30 Author: Vincent Batts <[email protected]> Date: Fri Oct 13 05:02:20 2017 -0400 golang: trailing whitespace fails gofmt (#6669) Signed-off-by: Vincent Batts <[email protected]> commit b22fb30891a8c6a576ead24358dbcd77af2f75c8 Author: wing328 <[email protected]> Date: Fri Oct 13 00:35:04 2017 +0800 add jaz-ah to swift, android tech committee commit e9f49abfee90b94ce40a868c12a2a0b803b8f203 Author: wing328 <[email protected]> Date: Thu Oct 12 19:31:36 2017 +0800 add back petstore test (#6663) commit 278bcfe96b83ad98065c444c775580aaf8dd3242 Author: wing328 <[email protected]> Date: Thu Oct 12 18:27:56 2017 +0800 add Edubits to swift tech comm commit 5ffdee4479a762b4dee45c2a2e8d7c38a03acf52 Author: naelrashdeen <[email protected]> Date: Thu Oct 12 11:40:11 2017 +0200 [PHP][Symfony] Generate valid PHP code (#6578) Fixes #5985 We were experiencing syntax issues when generating the Petstore example. See some of the examples below: StoreApiInterface.php namespace Swagger\Server\Api; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Swagger\Server\Model\Order; **use maparray<string,int>;** use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; UserApiInterface.php public function createUsersWithArrayInput(**User[]** $body); public function createUsersWithListInput(User[] $body); As far as I know, it is not possible to use array of objects in this way. PetApiInterface.php namespace Swagger\Server\Api; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Swagger\Server\Model\Pet; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Swagger\Server\Model\ApiResponse; **use string[];** use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; public function findPetsByStatus(string[] $status); public function findPetsByTags(string[] $tags); commit b716b378c4d9579d25cc31a53d3815ddb8ed94f7 Author: ehyche <[email protected]> Date: Thu Oct 12 05:35:59 2017 -0400 Swift4: Add additional initializer for initializing model object with properties. (#6642) * Add addiitional files from upstream * Remove mis-added files * Add additional swift4 initializer for initializing model object with properties. This change fixes this issue: https://github.com/swagger-api/swagger-codegen/issues/6641 It adds an additional initializer which allows model objects to be initialized using the properties. For exxample, if we had this model: "ErrorInfo": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "details": { "type": "array", "items": { "type": "string" } } }, "description": "Example Error object" }, This we generate an initializer for this model object like this: public init(code: Int?, message: String?, details: [String]?) { self.code = code self.message = message self.details = details } * Add hasVars checks around initializers and re-run all scripts to re-generate commit 590754f4f4dd9a5cf37dee220967dac77fb77f65 Author: Yukio Ejiri <[email protected]> Date: Thu Oct 12 18:31:09 2017 +0900 [kotlin] Fix syntax errors on localVariableHeader in api.mustache (#6660) commit 3bd24c3e5ccae74364235cfc62c11c5ac1c27ce2 Author: Javier Velilla <[email protected]> Date: Thu Oct 12 06:28:00 2017 -0300 Updated api client, Required parameters {{#required}} .. {{/required}}, are mapped to Eiffel (#6653) Void Safety Rules, optional parameters are translated to detachable TYPE. Validation Rules are mapped to preconditions, at the moment maximun and minimun validation has been added. Improved API_CLIENT.parameter_to_tuple feature to accept a LIST [ANY] instead of LIST [STRING_32]. Improved model template to generate the model output. commit 02a053e2b618ea9653b2c4cfef266bb7e8fe2fa8 Author: Jumpei Takiyasu <[email protected]> Date: Thu Oct 12 18:26:57 2017 +0900 Update README.md (#6656) Add my slide to README.md commit 30a176126aa3600b6252f80b84040a1ab351c125 Author: wing328 <[email protected]> Date: Wed Oct 11 21:16:53 2017 +0800 revise wordings for powershell generator commit b5a01b51c6fd64a55c8751e3844dc5800345b823 Author: wing328 <[email protected]> Date: Wed Oct 11 20:58:27 2017 +0800 comment out swift test due to build image changes commit db67840ded582e3cfb199c72a1a4502873b1bb9c Author: Jon Schoning <[email protected]> Date: Tue Oct 10 10:01:48 2017 -0500 [haskell-http-client] bug fixes; path & newtype generation issues (#6638) * fix path generation/param-substitution issues * fix newtype de-duplication issues * refactoring only * correct version in comments * prevent duplicate MimeTypes * sort parameter newtypes commit dc88ed99aed818a2c2f4bc13e00a4125ef63931e Author: Esteban Marin <[email protected]> Date: Tue Oct 10 16:55:50 2017 +0200 [angular-typescript] fix using form data (#6574) * #6457: fix sending form params * #6457: fix sending form params using files * #6457: fix sending form params with files for angular 4.3 * #6457: generate samples * #6457: [typescript-angular] fix form data submission in IE/Edge * re-apply [typescript-angular] add customized encoder to use '+' char in query parameter #6306 (#6334) * adapt for HttpClient: [typescript-angular] add customized encoder to use '+' char in query parameter #6306 (#6334) * generate samples * #6457: fix url parameter encoder imports for angular <4.3 * #6457: generate samples commit 02d25f5a14e801b6d7961939778c3275e2d44df9 Author: ehyche <[email protected]> Date: Tue Oct 10 10:53:17 2017 -0400 Swift4: Fix inline enum issue (#6640) * Add addiitional files from upstream * Remove mis-added files * Fix compilation issue with Swift4 inline enums. This change fixes this issue: https://github.com/swagger-api/swagger-codegen/issues/6607 The problem was that I was using "datatype" instead of "datatypeWithEnum" in the model.mustache file. When you have a the following model property: "myInlineStringEnum": { "type": "string", "enum": [ "inlineStringEnumValue1", "inlineStringEnumValue2", "inlineStringEnumValue3" ] } Then we were generating: public enum MyInlineStringEnum: String, Codable { case inlinestringenumvalue1 = "inlineStringEnumValue1" case inlinestringenumvalue2 = "inlineStringEnumValue2" case inlinestringenumvalue3 = "inlineStringEnumValue3" } However, when we decode this, we were using type of the enum ("datatype") rather than the enum type itself ("datatypeWithEnum"). So we were generating: myInlineStringEnum = try container.decodeIfPresent(String.self, forKey: "myInlineStringEnum") rather than: myInlineStringEnum = try container.decodeIfPresent(MyInlineStringEnum.self, forKey: "myInlineStringEnum") commit 1bdb1047383879d845a9c27890c9476ffb2fcdfd Author: Graham Johnson <[email protected]> Date: Tue Oct 10 08:45:47 2017 -0600 Add Serializable import to JaxRS-spec models if serializableModel is set (#6651) commit 676af621223de2ca77d2e526e291453b5150b631 Author: Jihun Lee <[email protected]> Date: Tue Oct 10 23:41:18 2017 +0900 Updated feign library dependency to io.github.openfeign (#6652) Changed groupId from “com.netflix.feign” to “io.github.openfeign” from gradle and sbt mustache templates. commit 39ae041975ad0d2b7b51db4b4bc906cc1ba38624 Merge: 3b134319f d054a43b6 Author: wing328 <[email protected]> Date: Mon Oct 9 23:33:32 2017 +0800 Merge branch 'update_java_server_samples' commit d054a43b658e3fee098c43e38eb432fe94fa5be1 Author: wing328 <[email protected]> Date: Mon Oct 9 23:00:44 2017 +0800 update java server samples commit 3b134319fa428a938eba535d7da0120ad5ce5a6b Author: wing328 <[email protected]> Date: Mon Oct 9 18:13:57 2017 +0800 add java version to pom in resteasy eap java8 commit e6d4362012477d8a13a883e297a066fd36a0bf45 Author: Jean-François Côté <[email protected]> Date: Mon Oct 9 10:51:32 2017 -0400 Fix for regression in issue: https://github.com/swagger-api/swagger-codegen/issues/6472 (#6480) commit e90a40bfced4cba7c7d425aab6928a34a56d4198 Author: wing328 <[email protected]> Date: Mon Oct 9 10:18:46 2017 +0800 use japanese name of taxpon commit 07c71e342e9dd7543340779b4c14380e8f4c8f06 Author: wing328 <[email protected]> Date: Mon Oct 9 09:39:05 2017 +0800 add link to ada's article commit 164f5bbb72a19cb730830030fb8f110cd5538e80 Author: wing328 <[email protected]> Date: Mon Oct 9 09:28:31 2017 +0800 fix underscore to handle spaces (#6637) commit 81e0357561381fe9d274e757e01259d56bd2c467 Author: wing328 <[email protected]> Date: Sun Oct 8 18:38:23 2017 +0800 fix NPE reported in #6519 (#6635) commit 41b7950dcd8bb51967fb3f14148b2fe62f204efd Author: Sasa Vilic <[email protected]> Date: Sun Oct 8 12:29:48 2017 +0200 Fix class path for DeferredResult (#6452) commit 73b38dd19e1b87d74bf846f30b4e8502d65fe451 Author: Lukasz Konopski <[email protected]> Date: Sun Oct 8 12:25:38 2017 +0200 #3904 Inheritance support java client retrofit gson (#4729) * merge with master * remove zoo specific artifact names * fix duplicate doublequote * #3904 add samples for retrofit2 * #3904 clean json field retrieval * #3904 allow non-abstract parent class commit 1dc3fb4f37248b20078294f9745aa8cbe65d4691 Author: wing328 <[email protected]> Date: Sun Oct 8 17:16:48 2017 +0800 remove unused JS files commit 1f9f8c5a3e157daf62c891ff9f27db7f76897e2a Author: Halil İbrahim Şener <[email protected]> Date: Sun Oct 8 12:15:21 2017 +0300 [JavaScript] Fix licenseNames (#6605) * [JavaScript] Fix licenseName in package.mustache * Fix invalid SPDX license expression in resources/2_0 * Update JavaScript samples commit 8a7940f199a03b7fabfa7ee6f54f34dee6134b47 Author: jarlesat <[email protected]> Date: Sun Oct 8 09:28:12 2017 +0200 Issue 5431 Support jaxrs client api interfaces (#6412) * Adds the ability to create code for an interface-based jaxrs client. * Adds shell script and sample files for jaxrs-spec-interface * rebase into adds shell * Fixes bug in creation of Produces/Consumes in method annotation. Allows for instance "application/json; charset=utf-8" * Fixes generated pom.xml * Generate pom.xml by default * Prettier output from api.mustache * Fixes bug in mediatype, allowing charset-specification in swagger.yaml. * Merges generation of interface-based jaxrs client/api into jaxrs-spec. * Moves jaxrs-spec server interface to match location of jaxrs-spec server * Makes Generated-annotation in genereated classes slightly prettier. commit cdc83ffd161149a6eddd3f52aa636b88f81876fa Author: Stephane Carrez <[email protected]> Date: Sun Oct 8 06:16:23 2017 +0200 [Ada] Adding Ada client samples (#6634) * 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 commit 7a7dd6d4cde4cbb86bf44928428479705cd6a120 Author: wing328 <[email protected]> Date: Sun Oct 8 12:08:45 2017 +0800 add ada style guide commit eab9c72a42b65ed2b2bef2bdddf9c6bc9761f8dc Author: Adrian Moos <[email protected]> Date: Sat Oct 7 15:42:46 2017 +0200 represent swagger enums as union of literal types (#6233) * represent swagger enums as union of literal types enabling their easy use in angular templates, structural subtyping among enums (in particular, different instances of the same enum are now mutually assignable), improving type safety by preventing incorrect widening, and permitting numeric enum values (albeit without descriptive names) Fixes #6206, #5146, #3500 * update samples * restore blank lines at end of file * fix typo commit cc756b5563e77f9cd78d38b513a5f75d91b89886 Author: Greg Marzouka <[email protected]> Date: Sat Oct 7 06:24:08 2017 -0400 [Scala] Properly handle csv collectionFormat (#6540) * Add support for lists of path parameters (eg instances), and default params for optional case classes * Update Petstore sample * Revert defaulting of case class fields to None * Update Petstore sample commit 5b32e886f474f4cb80bc70911fdb3776d3ef5cc4 Author: Jon Schoning <[email protected]> Date: Sat Oct 7 04:12:48 2017 -0500 [haskell-http-client] add support for auth methods (#6622) * add support for auth methods * use newtypes for required params * fix duplicate operationId issues * prevent aliasing of vendorextension references in fromOperation * add --fast to stack ci build commit 0db4b323848e6008b83f62d232ceb9279bf0ed51 Author: Andrea Rossi <[email protected]> Date: Sat Oct 7 07:44:35 2017 +0200 [objc] Let the developer specify the timezone to be used for date serialisation (#6628) * [objc] Update deployment target to 8.0 Updates the test project deployment target to 8.0, as that's the lowest supported by the latest XCode. * [objc] Update petstore tests based on current master Makes sure the tests are based on the latest version of master. * [objc] Allow specifying the serialization timezone Now it's possible to specify the timezone used for serializing dates commit 567ae3fd12428b122e5bc2c3d522105a00ca8145 Author: Gareth T <[email protected]> Date: Sat Oct 7 00:05:48 2017 -0400 [GO CLIENT] Fix issue with generating code for API key (#6630) * [GO CLIENT] Fix Go security query parameter generation by using correct string literal and using the Add method. * Add generated files. commit 42313af7a1b6921fc49eab1e324cedb6a1f9da21 Author: Akihito Nakano <[email protected]> Date: Fri Oct 6 16:56:13 2017 +0900 [PHP] Fix: Type object not handled properly in setParameterExampleValue (#6619) * Add test which reproduce the warning #5338 https://github.com/swagger-api/swagger-codegen/issues/5338#issuecomment-292502895 `[main] WARN io.swagger.codegen.languages.PhpClientCodegen - Type object not handled properly in setParameterExampleValue` * Fix Type object not handled properly in setParameterExampleValue * Update samples - /bin/php-petstore.sh - /bin/security/php-petstore.sh commit 2f98ade6939305db942f593d89d5450300fbd8b8 Author: wing328 <[email protected]> Date: Fri Oct 6 11:03:15 2017 +0800 fix inconsistent java naming (#6624) commit 86803c0c2404a6a8c8ea9aef97e271c3ab02ebc8 Author: niku <[email protected]> Date: Fri Oct 6 10:16:27 2017 +0900 [Elixir] Improve Elixir Client about primitive type spec (#6623) Fix following dialyzer warnings in the sample: ``` :0: Unknown type 'Elixir.Float':t/0 :0: Unknown type 'Elixir.Integer':t/0 ``` commit 2644adb7a3b25ba68794b4862107733eb4f92b99 Author: Gareth T <[email protected]> Date: Thu Oct 5 21:10:31 2017 -0400 Note precisely which clients and servers can be used with Haskell. (#6625) commit 2e5289c4d74eafd48e3a324ccdd9e39323b5fb06 Author: wing328 <[email protected]> Date: Thu Oct 5 23:07:53 2017 +0800 add link to MS machine learning server commit 61b910fb82bb6397980dc9563798330e6ad1ace6 Author: Brian <[email protected]> Date: Wed Oct 4 10:07:06 2017 -0700 [R] Added ApiClient and fixed other issues (#6571) * Added namespace mustache to be generated * Fixed syntax issues with package generation * Added Response and Element mustache templates * Added ApiClient * Fix: Only required parameters needed for api operations * Added documentation generated code * Regenerated petstore samples * Fixed url paths for operations * Fixed based on comments in issues #6520 * Regenerated petstore samples commit e49e7a056b1a4aa07f98e3cbb56ac1880b239a7f Author: Cédric Grard <[email protected]> Date: Wed Oct 4 16:46:06 2017 +0200 Typo error fix (#6620) commit 90010da61db4c05d6fca6fdbda3bcd3474ae26b3 Author: Stephane Carrez <[email protected]> Date: Wed Oct 4 05:51:04 2017 +0200 [Ada] Adding Ada support for client code generator (#6602) * Ada language support (generic generator) Implement the AbstractAdaCodegen class with the Ada keywords and global behavior for Ada language * Ada language support (main generator) Implement the AdaCodegen class for the Ada client and server code generator Initial implementation based on a mix from CppRestClientCodegen, NodeJSServerCodegen * Ada language support: register the AdaCodegen generator class * Ada language license template * Ada language model templates (spec and body) * Ada language client spec and body templates * Ada language server spec and body templates * Fix escaping Ada keywords for parameter name * Generate GNAT project and update type mappings - Use 'p_' as escape prefix for parameter names because identifiers are not allowed to start with '_' - Add GNAT project file generation - Update the type mappings to use the Swagger package types * Fix generation of operations with no parameters * Fix instantiation of Ada.Containers.Vectors package in generated model files * New template for the GNAT project file generation * Fix datatype generation for Ada language - Override the getTypeDeclaration function to specify the datatype - Fix definition of language predefined types * Add a Serialize procedure declaration for the Ada model generation * Add a Serialize procedure for the Ada template model generation * Fix operation name and parameter name for Ada - Declare and implement toAdaIdentifier function to verify and turn some identifier to Ada identifier following Ada style - Override toOperationId and use toAdaIdentifier for generation of operation name - Update toParamName to use toAdaIdentifier * Media type support for Ada code generator - Implement postProcessMediaTypes function to add a 'adaMediaType' member to each media type and map it to some Ada enumeration - Post process the 'produces' and 'consumes' media type of an operation * Use x-has-notes extension to avoid emitting notes when they are empty * First generation for Ada client operation body * Add a x-has-uniq-produces and x-has-uniq-consumes to media types to indicate that the list contains only one item, this is necessary for Ada generator for generation of arrays with one item only * Add a postProcessParameter for Ada code generator to emit a x-is-model-type attribute * Update Ada client body template for the serialization of data * Fix postProcessParameter in Ada code generator to take into account file parameters * Update the Ada client body to support form parameters * Fix type name used for mapped types in the Ada generator * Declare a Deserialize procedure for the Ada generated model * Override the fromOperation for Ada client code generator - Emit a x-codegen-response extension with the response description type - Emit a x-id-model-type extension for each type property * Update the Ada client package spec template to declare the result type * Add support to extract response and return result in Ada client code * Fix Ada postProcessModels to handle container properties and emit a correct x-is-model-type attribute * Add support for Deserialize procedure in the Ada model generator * Fix indentation of generated Ada client body package * Add projectName option to configure the GNAT project name * Update the GNAT project name for the Ada code generator * Cleanup implementation and remove unused code * Cleanup implementation and remove unused code * Fix javadoc errors * Use 'ada' for the language name to follow swagger-codegen convention Add (beta) to the help description Fix a NPE that occurs with incomplete yaml descriptions commit f7bd2c519e6bde8d640d6a9cd25918e53fa60d7b Author: wing328 <[email protected]> Date: Wed Oct 4 11:49:40 2017 +0800 add new language "ada" commit bf74e33c52cdb125bcd30e7742d116352f8f9ded Author: wing328 <[email protected]> Date: Wed Oct 4 00:03:35 2017 +0800 rename CsharpDotNet2 to csharp-dotnet2 (#6611) commit 5175281f32409ada8298740213f87b85f28f4c56 Author: wing328 <[email protected]> Date: Tue Oct 3 23:46:56 2017 +0800 rename silex-PHP to php-silex (#6612) commit f62b81fdd0a3a2edfa572a33609223ba2c2fb131 Author: wing328 <[email protected]> Date: Tue Oct 3 20:34:19 2017 +0800 add link to ntt presentation commit 74e31699da6a6818abcfc1917516c88dcc492654 Author: Pierre Deman <[email protected]> Date: Tue Oct 3 10:58:27 2017 +0200 CsharpDotNet2Client - Use clientPackage in additionalProperties (#6581) * CsharpDotNet2Client - Use clientPackage in additionalProperties if provided * Give execution rights for csharp-dotnet2-petstore.sh * Fix generation of C#.net2 apiPackage, modelPackage, clientPackage * Fix modelPackage property missing when generating models * Initialize clientPackage in constructor commit 1896e9664862b32137f0d57e01e2e5e052c814ff Author: craffael <[email protected]> Date: Tue Oct 3 09:14:28 2017 +0200 [nancyfx] fix interface prefix (#6595) * Retrofit2: Return ResponseBody if response if file. Until now -------------------- If a swagger endpoint returned a file (e.g. an image), then the Retrofit2 template has choosen the return type java.io.File. However, retrofit cannot deal with this and throws a com.google.gson.stream.MalformedJsonException. New: ------------------- If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint will return a okhttp3.ResponseBody which can be used to retrieve the file. * fix Interface Prefix commit 28a5b74dbf313529a2fc697d46e9ed870cfd6a30 Author: wing328 <[email protected]> Date: Mon Oct 2 23:52:01 2017 +0800 add partial header to haskell http client (#6606) commit 900aad6da485a286cb4bff0e89d7c8912742756a Author: wing328 <[email protected]> Date: Mon Oct 2 21:14:09 2017 +0800 add links to blog posts in techium.jp commit bb919346bfc473ef75a285b66da88ab63d4f10a8 Author: wing328 <[email protected]> Date: Mon Oct 2 13:15:49 2017 +0800 cache elixir deps commit b5200ba12c0b0e35616752864d7be757b85b5f74 Author: wing328 <[email protected]> Date: Mon Oct 2 13:06:45 2017 +0800 cache stack in shippable ci commit 44bf1d69cb3ddc483aa533ef01fe790c51bc617d Author: Trond Bolsø <[email protected]> Date: Mon Oct 2 05:24:08 2017 +0200 Fix for self-referential imports in typescript-angular client (#6450) commit 1f4013e7f17396b3de096fe9fd98d2984a1484f7 Author: craffael <[email protected]> Date: Mon Oct 2 05:10:09 2017 +0200 [NancyFx] provide option to override package context (#6593) * Retrofit2: Return ResponseBody if response if file. Until now -------------------- If a swagger endpoint returned a file (e.g. an image), then the Retrofit2 template has choosen the return type java.io.File. However, retrofit cannot deal with this and throws a com.google.gson.stream.MalformedJsonException. New: ------------------- If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint will return a okhttp3.ResponseBody which can be used to retrieve the file. * Add the option packageContext for nancyFx which allows a better adjustment of the namespace. * run nancyfx-petstore-server.bat commit 6e7ad13e1b327b45ce9cdafdfb6c1b46fe8b8b32 Author: Benjamin Douglas <[email protected]> Date: Sun Oct 1 19:54:41 2017 -0700 Pre-calculate type aliases before processing models (#6559) A type alias in this context is where a model is simply another name for a primitive type, such as `MyString` in the following model definitions: MyList: type: array items: $ref: '#/definitions/MyString' MyString: type: string It is valid to use a type alias as a property in another object or array model, even if the object/array is defined before the alias is, as in the example above. However, the current alias logic only looks "back" in list of previously defined models, meaning that `MyList` would not know that `MyString` is an alias. This change fixes the incorrect behavior by pre-calculating the list of aliases before any models are processed. It also changes the test endpoint to verify the correct behavior even when an object is defined before an alias it uses. commit 8bd7d3912b641f6acb278fbc68eb82b2886496bc Author: Jon Schoning <[email protected]> Date: Sun Oct 1 05:18:46 2017 -0500 [haskell-http-client] fixes for fake-endpoints (#6597) * fix compile errors / sanitization for petstore-with-fake-endpoints-models-for-testing.yaml * correct mimetype logic * add makefile commit c32281cd026987fb72edeca1cb1d18032e29fa6e Author: wing328 <[email protected]> Date: Sun Oct 1 14:24:04 2017 +0800 add haskell to shippable ci (#6600) commit 82b6e81897ac6ab86f5476bbabdf6c68fbcf0ca1 Author: wing328 <[email protected]> Date: Sat Sep 30 17:28:07 2017 +0800 use String() to convert num, update TS angular samples commit f3e19e0fdc1ae6416c37bb637521323d88939a9f Author: wing328 <[email protected]> Date: Sat Sep 30 15:05:03 2017 +0800 fix comma in method without parameters commit da37f40202ac964d8ab4a4f70343da90694ff4ed Author: Adrian Moos <[email protected]> Date: Sat Sep 30 11:19:39 2017 +0200 Add optional support for HttpClient (#6295) * fix compilation error in eclipse by updating package declarations in moved files (eclipse validates that package and folder names match) * permit specifying the full angular version simplifying the templates by moving trivial case splits to the model * remove dead code this method is never called ... * support HttpClient in addition to Http, clean up generated code Fixes #6080 * added new sample, and regenerated existing samples * updated samples this time with the freshly build generator ... * improve formatting * updated samples * fix compilation error in generated code the overload for blobs does not have a type parameter * added the first test for the utils package * fix extra trainling commas in function argument lists * regenerated samples commit e3c61cd1e42c17e8b90b209296a72b1f51f1847c Author: wing328 <[email protected]> Date: Sat Sep 30 14:24:38 2017 +0800 add cbornet to python tech committee commit 634dc07719aab76e916108b7d83a0b070101d848 Author: wing328 <[email protected]> Date: Fri Sep 29 22:02:41 2017 +0800 update tech comm, fix broken link to 2.0.17 commit 063e885c2fd4c9c76bbc3f9014901d273a132fb8 Author: Jinkui Shi <[email protected]> Date: Fri Sep 29 17:24:34 2017 +0800 [Scala] format the Scala code style templete (#6532) * The templete of scala code style refactor * more reformat * more reformat * generate petstore client commit 924a8e5efeb5d48acd389f144ce294a7f6469f74 Author: Vlad Frolov <[email protected]> Date: Fri Sep 29 10:46:16 2017 +0300 [CPPREST] Fixed multipart files upload implementation (#6518) commit 8e854dc7441bce5ac8171684d0763729b07a832f Author: wing328 <[email protected]> Date: Fri Sep 29 11:39:15 2017 +0800 add kenjones-cisco to bash tech comm commit 39908ebb832d3f18e5b0d2b6e24bcc80c3f6dc27 Author: wing328 <[email protected]> Date: Fri Sep 29 09:47:03 2017 +0800 add jvelilla to eiffel tech committee commit 25812fc526a296dc9cf0df17b86439a445800daa Author: Akito Nozaki <[email protected]> Date: Thu Sep 28 09:16:32 2017 -0700 Swift3: non dictionary body type (#6531) * Adding support for non dictionary body types. * Adding test for rest of the swift3 types * Cleaning up implementation of makeRequest and adding better error handling. * Adding ClientError for error produced before request is sent. * Changing how encoding of body data is handled. * Cleaning up code that was modified. commit 16045a1cffd573731462c7b005d0285fa715bc54 Merge: 32b5f8d87 87a9caa33 Author: wing328 <[email protected]> Date: Thu Sep 28 14:25:25 2017 +0800 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen commit 87a9caa33f51be0fb214e0a0999c6b574468af0b Author: Kenny Jones <[email protected]> Date: Thu Sep 28 02:14:47 2017 -0400 Bugfix: Path replacement regex not working (#6580) A previous change to make the regex a variable to allow proper linting resulted in the regexp not having access to the value associated with the variable and the path variable not being replaced. Moves the regexp variable inside the for loop to allow the value to be used and the path variable to be replaced with the provided value. commit 32b5f8d87d108772cd7cd491f9b65bc0228a0de5 Merge: 4c31983bd d04b7642f Author: wing328 <[email protected]> Date: Thu Sep 28 14:02:55 2017 +0800 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen commit 4c31983bd3c82823db02ec20620fff434b73b1dc Author: wing328 <[email protected]> Date: Thu Sep 28 14:01:37 2017 +0800 fix JS help text commit d04b7642f6b9311b827ff1bd52a217accca877f6 Author: Kenny Jones <[email protected]> Date: Thu Sep 28 01:17:48 2017 -0400 Feature: Adds doc generation (#6570) Reference #2359 commit 2c7dcbe3e5a99101f184670ef34a8893884d2c5e Author: wing328 <[email protected]> Date: Wed Sep 27 22:37:42 2017 +0800 fix elixir model naming commit bd5b5860289682d60b621c1e3a10dd081b3f7275 Author: yissachar <[email protected]> Date: Wed Sep 27 21:49:05 2017 -0400 Use valid JS RegEx (#6584) commit 4b9ee1f1940dba349d49dfb499b813f4cbb5858c Author: Jeff Ching <[email protected]> Date: Wed Sep 27 18:32:17 2017 -0700 [Elixir] Improve Elixir client (#6550) * Fix dependencies and generate model classes * Better elixir client generation. Responses are parsed and serialized by Poison into the model structs. Use shared helper functions to generate the request. Extract client connection configuration from api calls. Elixir client can sanitize the operationId Correctly output the model variables. Fix typos Fix path replacement when there are multiple replacements Cannot separate globally shared parameters from operations Error handling for the tesla response update templates Can generate clients that compile Can make requests - parse optional params, build query Add oauth to connection. Fix connection directory Add basic auth helper for creating a connection Fix map types. Fix guard clauses for creaing connections Add licenceInfo template. Parse config for moduleName via standard invokerPackage option Can provide and inject a license header into all source files fix location of connection.ex Move shared code into reusable modules Elixir filenames should be underscored Fix visibility of helper functions Parse the packageName from config options Handle date and datetime fields with DateTime.from_iso8601 Fix indentation Update documentation, add typespecs Generate a standard elixir .gitignore typespec is calculated recursively in java Use the JSON middleware and using Poison.Decoder.decode on already parsed structs move decoded struct into java Fix handling of non-json responses Switch basic auth to use the provided Tesla.Middleware.BasicAuth Update README template to include the appDescription Update sample elixir client remove junk client models that don't belong with petstore Only implement Poison.Decoder protocol if needed Update samples with skipped Poison.Deocder impl * Handle multipart file uploads Handle building form params in the body Files are handled as strings for input * Requests with no defined return type will return the Tesla.Env response * Run the bin/elixir-petstore.sh commit 3ac2b803f972d3919f1b8d04e0b32ef20613b15d Author: wing328 <[email protected]> Date: Wed Sep 27 20:53:27 2017 +0800 [Elixir] Add Elixir Petstore sample to Shippable CI (#6575) * add elixir petstore to shippable ci * use oracle sdk commit 28a3206d163e3c87399f63f659190b64dd99dd7b Author: wing328 <[email protected]> Date: Wed Sep 27 11:52:44 2017 +0800 update swift link, add kotlin, powershell commit 2917829eb0b3ed57b13f2d6334c5c6b72c8a5183 Author: wing328 <[email protected]> Date: Wed Sep 27 10:44:16 2017 +0800 add links to https://shinesolutions.com/ commit 2a284fa1aa3e5bdf3f1fac68d4a3a8890731579e Author: wing328 <[email protected]> Date: Wed Sep 27 10:41:38 2017 +0800 add SAP blog post by Radu Simen commit e3ba06cabb94f7da530655750608b49b06094eab Author: Jakob Schelbert <[email protected]> Date: Tue Sep 26 18:06:53 2017 +0200 Fix some bugs for the R client (#6535) * * Fix bugs in api.mustache, model.mustache, mostly bracket errors or small typos * Added section about installation in README.mustace TODO: fix tests in testthat TODO: fix bug in description.mustace regarding package name * Updates to sample for R client caused by running ./bin/r-petstore.sh (or .\bin\windows\r-petstore.bat) * Add R specific files to .gitignore * [R] add additional files generated by the petstore sample. (see #6520) commit 5e9d977a03756b0445f026dec0a4f1b6095ff8b1 Author: Kenny Jones <[email protected]> Date: Tue Sep 26 09:53:05 2017 -0400 Bugfix: Resolve lint errors for generated client (#6563) Updates the bash client template to allow the generated client code to be free of lint errors. Resolves: #6562 commit 451218bfb0d27843fa17bb21b3e6d153dd999501 Merge: c53ebf6c4 d2b91073e Author: wing328 <[email protected]> Date: Tue Sep 26 17:16:31 2017 +0800 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen commit c53ebf6c458da1e249ed46b36c3a4ade66a853f2 Author: wing328 <[email protected]> Date: Tue Sep 26 17:10:08 2017 +0800 add "npm run build" to ts angular commit d2b91073e1fc499fea67141ff4c17740d25f8e83 Author: Mehdy Bohlool <[email protected]> Date: Mon Sep 25 23:16:48 2017 -0700 [python] Add default Configuration (#6554) * Add default configuration * Fix assert_hostname bug in rest.py * Update petstore sample commit e2916fdc1366f759138a8c4620703beff0a9daa7 Author: lukoyanov <[email protected]> Date: Tue Sep 26 09:14:04 2017 +0300 [Java] Play! framework + retrofit2 client exception converter, bug fixes (#6543) * added exception converter * underscore removal fix * samples updated * added test * test whitespace commit 0a9e3782c536145f8908b766215f817a574c6548 Author: Greg Marzouka <[email protected]> Date: Tue Sep 26 00:22:01 2017 -0400 [Scala] Add support for PATCH via X-HTTP-Method-Override (#6539) * Added support for http PATCH to the scala client using X-HTTP-Method-Override header * Update Petstore sample commit d325c6ee7703466d89fd0b8ba99a55d05288c6de Author: wing328 <[email protected]> Date: Tue Sep 26 11:14:54 2017 +0800 revise wording for PR template commit c09c7d2fac31dc65886532e7e2c766bcb4cc6fe0 Author: wing328 <[email protected]> Date: Tue Sep 26 11:11:24 2017 +0800 add new item to copy technical committee in PR commit d75e4ae4dea1bb4d6f7a4188e415325e2dd047ea Author: wing328 <[email protected]> Date: Mon Sep 25 17:22:41 2017 +0800 add link to netflix blog commit 96137e5677765816fed1164d80798835ab4d898f Author: wing328 <[email protected]> Date: Mon Sep 25 16:28:30 2017 +0800 add encodeURIComponent to encode path parameters (#6551) commit 419ee1cc79f372d6ac8a66c888179c2e44178e1d Author: wing328 <[email protected]> Date: Mon Sep 25 15:23:27 2017 +0800 Add class prefix to tag with numbers (#6561) * add class prefix to tag with numbers, update java to default tag name * update codegen test commit 672cc29f734ca0f1c916491782558f91ee633381 Author: wing328 <[email protected]> Date: Mon Sep 25 12:49:58 2017 +0800 [Bash] Add test setting for Bash client (#6558) * add pom.xml and travis.yml for bash * create travis.yml.bak, test .travis.yml.bash * restore travis.yml commit 4b0314498bbf993927c2f3224f68dd790ce44a32 Author: Kenny Jones <[email protected]> Date: Sun Sep 24 11:07:12 2017 -0400 Bugfix: Handle all different types of security (#6528) The only special handling was for security definition type `apiKey` in `query`. All the other security configurations should result in the same generated code. Moves the handling of the special query parameters outside of the `parameters without specific cardinality` section. To cover the scenario where `elif` was being used, simply leverage the builtin `continue` statement to stop processing the specific query parameter and continue to the next available query parameter, if any. Manually test with multiple different combinations. Resolves: #6526 commit e85353ddae420da6d8aeb20e946b6c59d9d102df Merge: 2d44d7f29 53d34caa4 Author: wing328 <[email protected]> Date: Sun Sep 24 22:03:40 2017 +0800 Merge branch 'scala_ci' commit 53d34caa4ff7f466ff560379cc3dcab4b113f263 Author: wing328 <[email protected]> Date: Sun Sep 24 21:32:28 2017 +0800 add scala test, rearrange test order commit 2d44d7f291fd9b63950d8a27dd52dc7fe06d425d Author: wing328 <[email protected]> Date: Sun Sep 24 21:18:49 2017 +0800 use parameter name as description if not defined (#6557) commit c50110354027ea785b9836919007ee21862f9168 Author: wing328 <[email protected]> Date: Sun Sep 24 17:48:11 2017 +0800 add ackintosh to php tech committee commit f5bc5ecc04d55ce48e64ff47eca25ca9c4ee1fee Author: wing328 <[email protected]> Date: Sun Sep 24 16:43:42 2017 +0800 [Scala] Decommission "async-scala" generator (#6552) * remove async-scala generator * remove async-scala related scripts commit b31a80448a6cf2e0bcd913507412722bc69ec838 Author: Akihito Nakano <[email protected]> Date: Sun Sep 24 16:40:06 2017 +0900 [PHP] Improve Api template (#6507) * Improve spacing in doc comment * Improve grouping of parameter tags * Improve line length * Fix undefined variable $_tempBody * Improve indent commit ac99fe6b2d13dc516f7d3796ee5c8b5e576b9b79 Author: Alex <[email protected]> Date: Sun Sep 24 07:47:40 2017 +0100 fix #6353 (#6514) commit 639f88918a1500a799c360fc4c7ff7ceb3aff25c Author: wing328 <[email protected]> Date: Sun Sep 24 12:49:43 2017 +0800 [Java][RESTEasy] fix resteasy dependency issue in pom.xml (#6556) * fix resteasy dependency issue * add java resteasy petstore to circleci test commit 8f8515486fa073b835b9cc56ed262e92356c18df Author: Akihito Nakano <[email protected]> Date: Sat Sep 23 22:36:05 2017 +0900 [PHP] Improve Model template (#6460) * Update samples ./bin/php-petstore.sh * Remove unnecessary implements entry ModelInterface, ArrayAccess are already implemented in parent * Remove field `container` which is already defined in parent * Change snake case to lower camel case - invalid_properties - allowed_values * Improve doc commenct style * Improve description length * Improve length * Doc comment short description must start with a capital letter * Add a line between @param and @return * Delete an additinal blank line at end of doc comment * Udpate petstore-security-test commit 4a89d236192631ee29b1ba871805335910e19b8b Author: Esteban Marin <[email protected]> Date: Sat Sep 23 11:23:45 2017 +0200 [typescript-angular] apply encodeURIComponent to path-parameter (#6525) * #6524: [typescript-angular] apply encodeURIComponent to path-parameter * #6524: [typescript-angular2] update samples * #6524: [typescript-angularjs] update samples commit 209158aa9d3f6a4f5be6d94f41d472eea1992a42 Author: wing328 <[email protected]> Date: Sat Sep 23 17:07:21 2017 +0800 update ts jquery petstore samples commit 1baa5fca45e43436e55c1dc29d81666a15bcc6a1 Author: Jean-François Côté <[email protected]> Date: Sat Sep 23 04:57:48 2017 -0400 [Typescript-jQuery] Fix for issue #6505 (#6541) * Fix that prevented the default version to generate the model files * Add generated samples commit 16678b810698ab05e02c45df7992586903957bba Author: wing328 <[email protected]> Date: Sat Sep 23 15:55:14 2017 +0800 update ts angular v2, v4 petstore samples commit 07df0759d325786bebdfb2a55544bda683b9dfc2 Author: stoetti <[email protected]> Date: Sat Sep 23 09:48:05 2017 +0200 [TypeScript][Angular] Better support for "Accept", "Content-Type" (#6454) * add consumes and produces as corresponding headers if present * add check for empty array fix copy/paste error * fix styling * add isJsonMime filter produces- and consumes-Arrays for json-mime items commit b1e7a4f7242bae5cac1c450b8093a41a45f06fd7 Author: wing328 <[email protected]> Date: Sat Sep 23 15:45:17 2017 +0800 update cpprest petstore samples commit 8698444fb259b876077ca605fc075f7e6b694683 Author: WendellDuncan <[email protected]> Date: Sat Sep 23 01:32:29 2017 -0600 Propsed fix for the ApiClient runtime crash (#6523) commit c5c639b62b13efa8377024c6fa25ddc3901ebe38 Author: Brad Crumb <[email protected]> Date: Sat Sep 23 09:31:20 2017 +0200 Zend Expressive fix and upgrade to version 2 (#6461) * upgraded zend-expressive from version 1 to 2 * Changed error handler for compatibility with Zend Expressive 2 * generated newest sample files for Petstore ze-ph * removed ErrorMiddleware because it is never been used anymore. Regenerated samples * removed ErrorMiddleware Template from Codegen * remove ErrorMiddleware from petstore sample * Fixed some code styles * regenerated ze-ph samples with corrected code styles * added new line at the end of the file commit ccc980e619800b8a6524dcf20cfe5d97e3627486 Author: Hidetake Iwata <[email protected]> Date: Sat Sep 23 16:24:37 2017 +0900 Add link to Gradle Swagger Generator Plugin (#6481) commit c74c31bcfcbbf9b365b79eb030eec77bb66a1025 Author: CK <[email protected]> Date: Sat Sep 23 09:05:05 2017 +0200 produce correct enum for jaxrs resteasy eap (#6489) commit ffd8c4adb69d800c4e9181a698d7ee1fb01483cc Author: wing328 <[email protected]> Date: Fri Sep 22 14:25:43 2017 +0800 update elasticsearch to elastic commit 6267869b3fc3e36ceac9295cfea11fcae236dcc4 Author: Cliffano Subagio <[email protected]> Date: Fri Sep 22 14:37:31 2017 +1000 Add Jenkins World 2017 talk. (#6542) commit bcfd14551a38a8732fed1619531f04fef433cab8 Author: Jean-François Côté <[email protected]> Date: Thu Sep 21 12:54:10 2017 -0400 Fixing conversion when it's an item of a collection + add missing isUuid in objects (#6473) commit e626afaf1a87d0396204f0996e120e74d2f70d4d Author: wing328 <[email protected]> Date: Thu Sep 21 21:05:17 2017 +0800 add https://www.elastic.co/ to list of co using sw commit ae6d34d480627f9d39c5048080a138cedc1898f1 Author: wing328 <[email protected]> Date: Thu Sep 21 15:30:01 2017 +0800 various readme update commit d08149b7cc899098a31ad7241af4a0278646393d Author: wing328 <[email protected]> Date: Thu Sep 21 11:07:43 2017 +0800 Fix abcsum with abcsun commit 7f6bccb4ed1dd23a1aa0a694c24cff262b8f00ee Author: lukoyanov <[email protected]> Date: Wed Sep 20 07:32:52 2017 +0300 [Java] Added Play! WS filters support for retrofit2 client (#6499) * added play! ws filters support * samples updated commit 594b390e1149c3d4a9a0fc3b1d41975c48dc1f7c Author: Akihito Nakano <[email protected]> Date: Tue Sep 19 19:07:37 2017 +0900 [PHP] Fix #6474: Bug with 'format: date' when using --model-name-prefix (#6510) * Add test case which repeats the issue #6474 * Add "date" to type mapping * Update samples ./bin/php-petstore.sh ./bin/security/php-petstore.sh commit e27d4577c1c86f083635f100856929eb63093856 Author: wing328 <[email protected]> Date: Tue Sep 19 10:20:47 2017 +0800 update perl petstore sample commit 65d788396b7e92ae26766e29e10d01c79d44aee0 Author: Larry Bordowitz <[email protected]> Date: Mon Sep 18 19:11:38 2017 -0700 [6313] Add imports to perl objects. (#6500) commit 146b10777413d022f642900082cf84314d3edebe Author: ehyche <[email protected]> Date: Mon Sep 18 21:46:27 2017 -0400 Eliminate all Java compilation warnings for swift4 codegen module (#6467) commit 5443c0a94c67e84fe98aa642a16b9a56c4c1624a Author: stkrwork <[email protected]> Date: Tue Sep 19 03:31:53 2017 +0200 [QT5][CPP] Fixing issue with maps in models (#6479) * [QT5][CPP] Fixing issue with maps in models - Adjusted init function to init map correctly - Adjusted cleanup function to cleanup maps correctly * Fixed formatting for samples commit f3c41e866cd65296ddc9fa8a2de575de62d25fc2 Author: Mehdy Bohlool <[email protected]> Date: Mon Sep 18 10:25:33 2017 -0700 [Python] Add configuration.{connection_pool_maxsize, assert_hostname} (#6508) * Backport kubernetes client features: - assert_hostname - connection_pool_maxsize - cleanups * Update petstore sample commit d928617b69db76ba5ba7736e2394b7baa3fe9db3 Author: Jon Schoning <[email protected]> Date: Mon Sep 18 12:24:38 2017 -0500 [haskell-http-client] use katip logger, default strict (#6478) * change strictFields cli option default to True; * use katip logging; add cli-option for monad-logger * fix date parsing * remove package.yaml commit 5f566255ace78ade49db0dace7f50e93682d1d03 Author: Barry Andrews <[email protected]> Date: Mon Sep 18 13:14:47 2017 -0400 Add support for reserved-words-mappings to cpprest (#6501) * Also handles automatic escaping for reserved words, i.e. by default, no need to provide a mapping. Fix #6498 commit b807f6ff968085b78ffb5ded1dd9a174c9abc68c Author: ehyche <[email protected]> Date: Mon Sep 18 13:04:50 2017 -0400 Support object schemas with only additionalProperties. (#6492) Previously, we had implemented the Codable protocol by simply claiming conformance, and making sure that each of our internal classes also implemented the Codable protocol. So our model classes looked like: class MyModel: Codable { var propInt: Int var propString: String } class MyOtherModel: Codable { var propModel: MyModel } Previously, our additionalProperties implementation would have meant an object schema with an additionalProperties of Int type would have looked like: class MyModelWithAdditionalProperties: Codable { var additionalProperties: [String: Int] } But the default implementation of Codable would have serialized MyModelWithAdditionalProperties like this: { "additionalProperties": { "myInt1": 1, "myInt2": 2, "myInt3": 3 } } The default implementation would put the additionalProperties in its own dictionary (which would be incorrect), as opposed to the desired serialization of: { "myInt1": 1, "myInt2": 2, "myInt3": 3 } So therefore, the only way to support this was to do our own implementation of the Codable protocol. The Codable protocol is actually two protocols: Encodable and Decodable. So therefore, this change generates implementations of Encodable and Decodable for each generated model class. So the new generated classes look like: class MyModel: Codable { var propInt: Int var propString: String // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: String.self) try container.encode(propInt, forKey: "propInt") try container.encode(propString, forKey: "propString") } // Decodable protocol methods public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) propInt = try container.decode(Int.self, forKey: "propInt") propString = try container.decode(String.self, forKey: "propString") } } class MyOtherModel: Codable { var propModel: MyModel // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: String.self) try container.encode(propModel, forKey: "propModel") } // Decodable protocol methods public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) propModel = try container.decode(MyModel.self, forKey: "propModel") } } commit 8067612e06172942c5d661f0988bb866492d1cab Author: ehyche <[email protected]> Date: Mon Sep 11 23:37:39 2017 -0700 Handle when response is a file URL. (#6469) This is the equivalent change in the swift4 module which was made in the swift3 module in this PR: https://github.com/swagger-api/swagger-codegen/pull/6274 This updates AlamofireImplementations.mustache to handle when the response is an URL. It also makes changes in the generated sample code for: * default configuration (no promisekit or rxswift) * promisekit * rxswift Also, in order to build, the generated code needed to be updated with the change in CodableHelper which changes dataDecodingStrategy to ".base64" from its previous definition in earlier Xcode 9 betas. * commit d639b38d0ddcaeb17cc8bdaf446ebfb9c4597876 Author: wing328 <[email protected]> Date: Tue Sep 12 14:17:29 2017 +0800 fix link to fehguy twitter account commit 591149bcb7553d9163d1b60813062e8c7f9e3dd8 Author: wing328 <[email protected]> Date: Tue Sep 12 11:41:14 2017 +0800 Better logic to handle tags with special characters (#6466) * better logic to handle tag with special characters * update test cases * comment out swift test cases * restore the swift tests commit 9e0911b3765f59719e7b4838986631af6a251842 Author: wing328 <[email protected]> Date: Mon Sep 11 17:39:12 2017 +0800 [ObjC] fix NPE when getting swagger type (#6465) * fix npe in swagger type (objc) * remove trailing spaces commit a6d6432e6da01e12167775d4d1c5945d88cc9a54 Author: Lance Hannestad <[email protected]> Date: Sun Sep 10 19:23:38 2017 -0700 [Python][Flask] Upgraded connxion to 1.1.15 (now supports multi collection format arrays) (#6463) * [Python][Flask] Upgraded connxion to 1.1.15 (now supports multi collection format arrays) * Was modified by ./bin/python-petstore.sh commit f6787539c0169cccf1e50be90b3cbb201d8f42b2 Author: wing328 <[email protected]> Date: Mon Sep 11 10:09:16 2017 +0800 add more blog posts commit 753ba935f1af4656c3e5dcbf1c4cbf97e4256bad Author: wing328 <[email protected]> Date: Mon Sep 11 03:15:12 2017 +0800 add https://pycon.jp/2017/ja/ presentation commit 665545a2b42410c7e476b14f1dbe3e2a1bdab694 Author: wing328 <[email protected]> Date: Mon Sep 11 03:08:00 2017 +0800 add more links to presentations, blog posts, etc commit 5b004de20da5394b5a1478304a13d2db5c5970aa Author: wing328 <[email protected]> Date: Mon Sep 11 02:44:59 2017 +0800 add R to the list of supported languages commit afb75d64d02c17c461f00f878826a8babe68c79a Author: wing328 <[email protected]> Date: Sun Sep 10 02:16:08 2017 +0800 fix NPE in get swagger type (#6462) commit 29bd1d92f27cdac8d2b6b959f3a070db555c35af Author: wing328 <[email protected]> Date: Sun Sep 10 00:31:57 2017 +0800 add square blog post by roykachouh, retrofit post commit 94f5250e71850ffc9428d02def94a3e2d2a4ad63 Author: wing328 <[email protected]> Date: Sun Sep 10 00:12:58 2017 +0800 add presentation by Jesse Collis commit e733bfa67d9daffbed7f8f373221cd1c0c4a61e6 Author: wing328 <[email protected]> Date: Sat Sep 9 21:19:21 2017 +0800 update c# petstore samples commit bbb901549fe744abef05821b73c7051b7f6960ae Author: IvanovJohn <[email protected]> Date: Sat Sep 9 17:19:57 2017 +0700 [C#] Enabled inheritance to prevent property duplication (#6335) * Issue#3829. [CSharp] Enabled inheritance to prevent property duplication when using allOf and discriminator * tabs removed * Petstore sample updated commit a2cb35b1e9ab2a3e4129127820ec6f72434649b1 Merge: 35cf42996 4fb612c2e Author: wing328 <[email protected]> Date: Sat Sep 9 17:18:16 2017 +0800 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen commit 35cf42996a363befa0b06ea8c1f2eb0906d195c3 Author: wing328 <[email protected]> Date: Sat Sep 9 17:16:04 2017 +0800 add note to deprecate swift generator commit 4fb612c2e8bb8860568f6da59b61bd0c8bb5d923 Author: Jon Schoning <[email protected]> Date: Sat Sep 9 04:11:46 2017 -0500 [haskell-http-client] update documentation; refactoring; add 'strictFields' cli option (#6458) * update readme; remove unused DeriveAnyClass extension * refactor request/param utility functions * add strictFields cli option * add CONTRIBUTING.md commit dcca1156913c9b5fc81337b16c6b88e90e7c2c4b Author: Carlton Whitehead <[email protected]> Date: Thu Sep 7 20:47:56 2017 -0400 Genesys acquired Interactive Intelligence (#6453) See http://www.genesys.com/about/newsroom/news/genesys-completes-acquisition-of-interactive-intelligence commit 5c547d5f4d4ef3140a651e8ec67aba118301c279 Author: wing328 <[email protected]> Date: Fri Sep 8 08:41:01 2017 +0800 add jfastnacht to php tech comm commit 4310ea326c182e03ff66fdae5bed09e05132c0c5 Author: Jon Schoning <[email protected]> Date: Thu Sep 7 10:17:49 2017 -0500 [haskell-http-client] update readme; improve lens generation; fix dateFormat (#6448) * point readme links to canonical locations * use lenses for non-required model fields, instead of traversals * fix .gitignore generation * fix dateFormat cli option bug commit 3cd3b907f6e09ed0697bcc8f3c574f9224dd33d4 Author: ecolleu <[email protected]> Date: Thu Sep 7 12:12:09 2017 +0200 [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (#6436) * [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (Issue #6432) The constructor of StringEntity can throw UnsupportedEncodingException, which is not catch nor thrown by createRequest method. Therefore the build of android client fails with: ApiInvoker.java:448: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown This commit adds a try ... catch on UnsupportedEncodingException in invokeAPI methods and declare this exception to be thrown in createRequest * [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (Issue #6432) The constructor of StringEntity can throw UnsupportedEncodingException, which is not catch nor thrown by createRequest method. Therefore the build of android client fails with: ApiInvoker.java:448: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown This commit adds a try ... catch on UnsupportedEncodingException in invokeAPI methods and declare this exception to be thrown in createRequest * [ANDROID][Volley] Handle UnsupportedEncodingException (Issue #6432) Throw more precise ApiException commit 0cf82d7ae36a244266241a9055f87bc4b9ea7106 Author: Jean-François Côté <[email protected]> Date: Thu Sep 7 01:14:22 2017 -0400 [All generators] Supports of hyphen-case to camelCase (#6399) * Supports of hyph…
* [Java] fix bug to only remove "CustomInstantDeserializer" for Play v2.5 (swagger-api#6444) * fix bug to only remove CustomInstantDeserializer for play25 * revise logic * fix logic for CustomInstantDeserializer.java * [Swift3/Swift4] update all cocoapods for swift3/swift4 (swagger-api#6441) * [Swift] update all cocoapods for swift3/swift4 * fix subspec specification * [Java] Handle Long in enum correctly (swagger-api#6342) Resolves swagger-api#6338 * [All generators] Supports of hyphen-case to camelCase (swagger-api#6399) * Supports of hyphen-case to camelCase * Add unit tests for the new section in the camelize function. * [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (swagger-api#6436) * [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (Issue swagger-api#6432) The constructor of StringEntity can throw UnsupportedEncodingException, which is not catch nor thrown by createRequest method. Therefore the build of android client fails with: ApiInvoker.java:448: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown This commit adds a try ... catch on UnsupportedEncodingException in invokeAPI methods and declare this exception to be thrown in createRequest * [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (Issue swagger-api#6432) The constructor of StringEntity can throw UnsupportedEncodingException, which is not catch nor thrown by createRequest method. Therefore the build of android client fails with: ApiInvoker.java:448: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown This commit adds a try ... catch on UnsupportedEncodingException in invokeAPI methods and declare this exception to be thrown in createRequest * [ANDROID][Volley] Handle UnsupportedEncodingException (Issue swagger-api#6432) Throw more precise ApiException * [haskell-http-client] update readme; improve lens generation; fix dateFormat (swagger-api#6448) * point readme links to canonical locations * use lenses for non-required model fields, instead of traversals * fix .gitignore generation * fix dateFormat cli option bug * add jfastnacht to php tech comm * Genesys acquired Interactive Intelligence (swagger-api#6453) See http://www.genesys.com/about/newsroom/news/genesys-completes-acquisition-of-interactive-intelligence * [haskell-http-client] update documentation; refactoring; add 'strictFields' cli option (swagger-api#6458) * update readme; remove unused DeriveAnyClass extension * refactor request/param utility functions * add strictFields cli option * add CONTRIBUTING.md * add note to deprecate swift generator * [C#] Enabled inheritance to prevent property duplication (swagger-api#6335) * Issue#3829. [CSharp] Enabled inheritance to prevent property duplication when using allOf and discriminator * tabs removed * Petstore sample updated * update c# petstore samples * add presentation by Jesse Collis * add square blog post by roykachouh, retrofit post * fix NPE in get swagger type (swagger-api#6462) * add R to the list of supported languages * add more links to presentations, blog posts, etc * add https://pycon.jp/2017/ja/ presentation * add more blog posts * [Python][Flask] Upgraded connxion to 1.1.15 (now supports multi collection format arrays) (swagger-api#6463) * [Python][Flask] Upgraded connxion to 1.1.15 (now supports multi collection format arrays) * Was modified by ./bin/python-petstore.sh * [ObjC] fix NPE when getting swagger type (swagger-api#6465) * fix npe in swagger type (objc) * remove trailing spaces * Better logic to handle tags with special characters (swagger-api#6466) * better logic to handle tag with special characters * update test cases * comment out swift test cases * restore the swift tests * fix link to fehguy twitter account * Handle when response is a file URL. (swagger-api#6469) This is the equivalent change in the swift4 module which was made in the swift3 module in this PR: swagger-api#6274 This updates AlamofireImplementations.mustache to handle when the response is an URL. It also makes changes in the generated sample code for: * default configuration (no promisekit or rxswift) * promisekit * rxswift Also, in order to build, the generated code needed to be updated with the change in CodableHelper which changes dataDecodingStrategy to ".base64" from its previous definition in earlier Xcode 9 betas. * * Support object schemas with only additionalProperties. (swagger-api#6492) Previously, we had implemented the Codable protocol by simply claiming conformance, and making sure that each of our internal classes also implemented the Codable protocol. So our model classes looked like: class MyModel: Codable { var propInt: Int var propString: String } class MyOtherModel: Codable { var propModel: MyModel } Previously, our additionalProperties implementation would have meant an object schema with an additionalProperties of Int type would have looked like: class MyModelWithAdditionalProperties: Codable { var additionalProperties: [String: Int] } But the default implementation of Codable would have serialized MyModelWithAdditionalProperties like this: { "additionalProperties": { "myInt1": 1, "myInt2": 2, "myInt3": 3 } } The default implementation would put the additionalProperties in its own dictionary (which would be incorrect), as opposed to the desired serialization of: { "myInt1": 1, "myInt2": 2, "myInt3": 3 } So therefore, the only way to support this was to do our own implementation of the Codable protocol. The Codable protocol is actually two protocols: Encodable and Decodable. So therefore, this change generates implementations of Encodable and Decodable for each generated model class. So the new generated classes look like: class MyModel: Codable { var propInt: Int var propString: String // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: String.self) try container.encode(propInt, forKey: "propInt") try container.encode(propString, forKey: "propString") } // Decodable protocol methods public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) propInt = try container.decode(Int.self, forKey: "propInt") propString = try container.decode(String.self, forKey: "propString") } } class MyOtherModel: Codable { var propModel: MyModel // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: String.self) try container.encode(propModel, forKey: "propModel") } // Decodable protocol methods public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) propModel = try container.decode(MyModel.self, forKey: "propModel") } } * Add support for reserved-words-mappings to cpprest (swagger-api#6501) * Also handles automatic escaping for reserved words, i.e. by default, no need to provide a mapping. Fix swagger-api#6498 * [haskell-http-client] use katip logger, default strict (swagger-api#6478) * change strictFields cli option default to True; * use katip logging; add cli-option for monad-logger * fix date parsing * remove package.yaml * [Python] Add configuration.{connection_pool_maxsize, assert_hostname} (swagger-api#6508) * Backport kubernetes client features: - assert_hostname - connection_pool_maxsize - cleanups * Update petstore sample * [QT5][CPP] Fixing issue with maps in models (swagger-api#6479) * [QT5][CPP] Fixing issue with maps in models - Adjusted init function to init map correctly - Adjusted cleanup function to cleanup maps correctly * Fixed formatting for samples * Eliminate all Java compilation warnings for swift4 codegen module (swagger-api#6467) * [6313] Add imports to perl objects. (swagger-api#6500) * update perl petstore sample * [PHP] Fix swagger-api#6474: Bug with 'format: date' when using --model-name-prefix (swagger-api#6510) * Add test case which repeats the issue swagger-api#6474 * Add "date" to type mapping * Update samples ./bin/php-petstore.sh ./bin/security/php-petstore.sh * [Java] Added Play! WS filters support for retrofit2 client (swagger-api#6499) * added play! ws filters support * samples updated * Fix abcsum with abcsun * various readme update * add https://www.elastic.co/ to list of co using sw * Fixing conversion when it's an item of a collection + add missing isUuid in objects (swagger-api#6473) * Add Jenkins World 2017 talk. (swagger-api#6542) * update elasticsearch to elastic * produce correct enum for jaxrs resteasy eap (swagger-api#6489) * Add link to Gradle Swagger Generator Plugin (swagger-api#6481) * Zend Expressive fix and upgrade to version 2 (swagger-api#6461) * upgraded zend-expressive from version 1 to 2 * Changed error handler for compatibility with Zend Expressive 2 * generated newest sample files for Petstore ze-ph * removed ErrorMiddleware because it is never been used anymore. Regenerated samples * removed ErrorMiddleware Template from Codegen * remove ErrorMiddleware from petstore sample * Fixed some code styles * regenerated ze-ph samples with corrected code styles * added new line at the end of the file * Propsed fix for the ApiClient runtime crash (swagger-api#6523) * update cpprest petstore samples * [TypeScript][Angular] Better support for "Accept", "Content-Type" (swagger-api#6454) * add consumes and produces as corresponding headers if present * add check for empty array fix copy/paste error * fix styling * add isJsonMime filter produces- and consumes-Arrays for json-mime items * update ts angular v2, v4 petstore samples * [Typescript-jQuery] Fix for issue swagger-api#6505 (swagger-api#6541) * Fix that prevented the default version to generate the model files * Add generated samples * update ts jquery petstore samples * [typescript-angular] apply encodeURIComponent to path-parameter (swagger-api#6525) * swagger-api#6524: [typescript-angular] apply encodeURIComponent to path-parameter * swagger-api#6524: [typescript-angular2] update samples * swagger-api#6524: [typescript-angularjs] update samples * [PHP] Improve Model template (swagger-api#6460) * Update samples ./bin/php-petstore.sh * Remove unnecessary implements entry ModelInterface, ArrayAccess are already implemented in parent * Remove field `container` which is already defined in parent * Change snake case to lower camel case - invalid_properties - allowed_values * Improve doc commenct style * Improve description length * Improve length * Doc comment short description must start with a capital letter * Add a line between @param and @return * Delete an additinal blank line at end of doc comment * Udpate petstore-security-test * [Java][RESTEasy] fix resteasy dependency issue in pom.xml (swagger-api#6556) * fix resteasy dependency issue * add java resteasy petstore to circleci test * fix swagger-api#6353 (swagger-api#6514) * [PHP] Improve Api template (swagger-api#6507) * Improve spacing in doc comment * Improve grouping of parameter tags * Improve line length * Fix undefined variable $_tempBody * Improve indent * [Scala] Decommission "async-scala" generator (swagger-api#6552) * remove async-scala generator * remove async-scala related scripts * add ackintosh to php tech committee * use parameter name as description if not defined (swagger-api#6557) * add scala test, rearrange test order * Bugfix: Handle all different types of security (swagger-api#6528) The only special handling was for security definition type `apiKey` in `query`. All the other security configurations should result in the same generated code. Moves the handling of the special query parameters outside of the `parameters without specific cardinality` section. To cover the scenario where `elif` was being used, simply leverage the builtin `continue` statement to stop processing the specific query parameter and continue to the next available query parameter, if any. Manually test with multiple different combinations. Resolves: swagger-api#6526 * [Bash] Add test setting for Bash client (swagger-api#6558) * add pom.xml and travis.yml for bash * create travis.yml.bak, test .travis.yml.bash * restore travis.yml * Add class prefix to tag with numbers (swagger-api#6561) * add class prefix to tag with numbers, update java to default tag name * update codegen test * add encodeURIComponent to encode path parameters (swagger-api#6551) * add link to netflix blog * add new item to copy technical committee in PR * revise wording for PR template * [Scala] Add support for PATCH via X-HTTP-Method-Override (swagger-api#6539) * Added support for http PATCH to the scala client using X-HTTP-Method-Override header * Update Petstore sample * [Java] Play! framework + retrofit2 client exception converter, bug fixes (swagger-api#6543) * added exception converter * underscore removal fix * samples updated * added test * test whitespace * [python] Add default Configuration (swagger-api#6554) * Add default configuration * Fix assert_hostname bug in rest.py * Update petstore sample * add "npm run build" to ts angular * Bugfix: Resolve lint errors for generated client (swagger-api#6563) Updates the bash client template to allow the generated client code to be free of lint errors. Resolves: swagger-api#6562 * Fix some bugs for the R client (swagger-api#6535) * * Fix bugs in api.mustache, model.mustache, mostly bracket errors or small typos * Added section about installation in README.mustace TODO: fix tests in testthat TODO: fix bug in description.mustace regarding package name * Updates to sample for R client caused by running ./bin/r-petstore.sh (or .\bin\windows\r-petstore.bat) * Add R specific files to .gitignore * [R] add additional files generated by the petstore sample. (see swagger-api#6520) * add SAP blog post by Radu Simen * add links to https://shinesolutions.com/ * update swift link, add kotlin, powershell * [Elixir] Add Elixir Petstore sample to Shippable CI (swagger-api#6575) * add elixir petstore to shippable ci * use oracle sdk * [Elixir] Improve Elixir client (swagger-api#6550) * Fix dependencies and generate model classes * Better elixir client generation. Responses are parsed and serialized by Poison into the model structs. Use shared helper functions to generate the request. Extract client connection configuration from api calls. Elixir client can sanitize the operationId Correctly output the model variables. Fix typos Fix path replacement when there are multiple replacements Cannot separate globally shared parameters from operations Error handling for the tesla response update templates Can generate clients that compile Can make requests - parse optional params, build query Add oauth to connection. Fix connection directory Add basic auth helper for creating a connection Fix map types. Fix guard clauses for creaing connections Add licenceInfo template. Parse config for moduleName via standard invokerPackage option Can provide and inject a license header into all source files fix location of connection.ex Move shared code into reusable modules Elixir filenames should be underscored Fix visibility of helper functions Parse the packageName from config options Handle date and datetime fields with DateTime.from_iso8601 Fix indentation Update documentation, add typespecs Generate a standard elixir .gitignore typespec is calculated recursively in java Use the JSON middleware and using Poison.Decoder.decode on already parsed structs move decoded struct into java Fix handling of non-json responses Switch basic auth to use the provided Tesla.Middleware.BasicAuth Update README template to include the appDescription Update sample elixir client remove junk client models that don't belong with petstore Only implement Poison.Decoder protocol if needed Update samples with skipped Poison.Deocder impl * Handle multipart file uploads Handle building form params in the body Files are handled as strings for input * Requests with no defined return type will return the Tesla.Env response * Run the bin/elixir-petstore.sh * Use valid JS RegEx (swagger-api#6584) * fix elixir model naming * Feature: Adds doc generation (swagger-api#6570) Reference swagger-api#2359 * fix JS help text * Bugfix: Path replacement regex not working (swagger-api#6580) A previous change to make the regex a variable to allow proper linting resulted in the regexp not having access to the value associated with the variable and the path variable not being replaced. Moves the regexp variable inside the for loop to allow the value to be used and the path variable to be replaced with the provided value. * Swift3: non dictionary body type (swagger-api#6531) * Adding support for non dictionary body types. * Adding test for rest of the swift3 types * Cleaning up implementation of makeRequest and adding better error handling. * Adding ClientError for error produced before request is sent. * Changing how encoding of body data is handled. * Cleaning up code that was modified. * add jvelilla to eiffel tech committee * add kenjones-cisco to bash tech comm * [CPPREST] Fixed multipart files upload implementation (swagger-api#6518) * [Scala] format the Scala code style templete (swagger-api#6532) * The templete of scala code style refactor * more reformat * more reformat * generate petstore client * update tech comm, fix broken link to 2.0.17 * add cbornet to python tech committee * Add optional support for HttpClient (swagger-api#6295) * fix compilation error in eclipse by updating package declarations in moved files (eclipse validates that package and folder names match) * permit specifying the full angular version simplifying the templates by moving trivial case splits to the model * remove dead code this method is never called ... * support HttpClient in addition to Http, clean up generated code Fixes swagger-api#6080 * added new sample, and regenerated existing samples * updated samples this time with the freshly build generator ... * improve formatting * updated samples * fix compilation error in generated code the overload for blobs does not have a type parameter * added the first test for the utils package * fix extra trainling commas in function argument lists * regenerated samples * fix comma in method without parameters * use String() to convert num, update TS angular samples * add haskell to shippable ci (swagger-api#6600) * [haskell-http-client] fixes for fake-endpoints (swagger-api#6597) * fix compile errors / sanitization for petstore-with-fake-endpoints-models-for-testing.yaml * correct mimetype logic * add makefile * Pre-calculate type aliases before processing models (swagger-api#6559) A type alias in this context is where a model is simply another name for a primitive type, such as `MyString` in the following model definitions: MyList: type: array items: $ref: '#/definitions/MyString' MyString: type: string It is valid to use a type alias as a property in another object or array model, even if the object/array is defined before the alias is, as in the example above. However, the current alias logic only looks "back" in list of previously defined models, meaning that `MyList` would not know that `MyString` is an alias. This change fixes the incorrect behavior by pre-calculating the list of aliases before any models are processed. It also changes the test endpoint to verify the correct behavior even when an object is defined before an alias it uses. * [NancyFx] provide option to override package context (swagger-api#6593) * Retrofit2: Return ResponseBody if response if file. Until now -------------------- If a swagger endpoint returned a file (e.g. an image), then the Retrofit2 template has choosen the return type java.io.File. However, retrofit cannot deal with this and throws a com.google.gson.stream.MalformedJsonException. New: ------------------- If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint will return a okhttp3.ResponseBody which can be used to retrieve the file. * Add the option packageContext for nancyFx which allows a better adjustment of the namespace. * run nancyfx-petstore-server.bat * Fix for self-referential imports in typescript-angular client (swagger-api#6450) * cache stack in shippable ci * cache elixir deps * add links to blog posts in techium.jp * add partial header to haskell http client (swagger-api#6606) * [nancyfx] fix interface prefix (swagger-api#6595) * Retrofit2: Return ResponseBody if response if file. Until now -------------------- If a swagger endpoint returned a file (e.g. an image), then the Retrofit2 template has choosen the return type java.io.File. However, retrofit cannot deal with this and throws a com.google.gson.stream.MalformedJsonException. New: ------------------- If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint will return a okhttp3.ResponseBody which can be used to retrieve the file. * fix Interface Prefix * CsharpDotNet2Client - Use clientPackage in additionalProperties (swagger-api#6581) * CsharpDotNet2Client - Use clientPackage in additionalProperties if provided * Give execution rights for csharp-dotnet2-petstore.sh * Fix generation of C#.net2 apiPackage, modelPackage, clientPackage * Fix modelPackage property missing when generating models * Initialize clientPackage in constructor * add link to ntt presentation * rename silex-PHP to php-silex (swagger-api#6612) * rename CsharpDotNet2 to csharp-dotnet2 (swagger-api#6611) * add new language "ada" * [Ada] Adding Ada support for client code generator (swagger-api#6602) * Ada language support (generic generator) Implement the AbstractAdaCodegen class with the Ada keywords and global behavior for Ada language * Ada language support (main generator) Implement the AdaCodegen class for the Ada client and server code generator Initial implementation based on a mix from CppRestClientCodegen, NodeJSServerCodegen * Ada language support: register the AdaCodegen generator class * Ada language license template * Ada language model templates (spec and body) * Ada language client spec and body templates * Ada language server spec and body templates * Fix escaping Ada keywords for parameter name * Generate GNAT project and update type mappings - Use 'p_' as escape prefix for parameter names because identifiers are not allowed to start with '_' - Add GNAT project file generation - Update the type mappings to use the Swagger package types * Fix generation of operations with no parameters * Fix instantiation of Ada.Containers.Vectors package in generated model files * New template for the GNAT project file generation * Fix datatype generation for Ada language - Override the getTypeDeclaration function to specify the datatype - Fix definition of language predefined types * Add a Serialize procedure declaration for the Ada model generation * Add a Serialize procedure for the Ada template model generation * Fix operation name and parameter name for Ada - Declare and implement toAdaIdentifier function to verify and turn some identifier to Ada identifier following Ada style - Override toOperationId and use toAdaIdentifier for generation of operation name - Update toParamName to use toAdaIdentifier * Media type support for Ada code generator - Implement postProcessMediaTypes function to add a 'adaMediaType' member to each media type and map it to some Ada enumeration - Post process the 'produces' and 'consumes' media type of an operation * Use x-has-notes extension to avoid emitting notes when they are empty * First generation for Ada client operation body * Add a x-has-uniq-produces and x-has-uniq-consumes to media types to indicate that the list contains only one item, this is necessary for Ada generator for generation of arrays with one item only * Add a postProcessParameter for Ada code generator to emit a x-is-model-type attribute * Update Ada client body template for the serialization of data * Fix postProcessParameter in Ada code generator to take into account file parameters * Update the Ada client body to support form parameters * Fix type name used for mapped types in the Ada generator * Declare a Deserialize procedure for the Ada generated model * Override the fromOperation for Ada client code generator - Emit a x-codegen-response extension with the response description type - Emit a x-id-model-type extension for each type property * Update the Ada client package spec template to declare the result type * Add support to extract response and return result in Ada client code * Fix Ada postProcessModels to handle container properties and emit a correct x-is-model-type attribute * Add support for Deserialize procedure in the Ada model generator * Fix indentation of generated Ada client body package * Add projectName option to configure the GNAT project name * Update the GNAT project name for the Ada code generator * Cleanup implementation and remove unused code * Cleanup implementation and remove unused code * Fix javadoc errors * Use 'ada' for the language name to follow swagger-codegen convention Add (beta) to the help description Fix a NPE that occurs with incomplete yaml descriptions * Typo error fix (swagger-api#6620) * [R] Added ApiClient and fixed other issues (swagger-api#6571) * Added namespace mustache to be generated * Fixed syntax issues with package generation * Added Response and Element mustache templates * Added ApiClient * Fix: Only required parameters needed for api operations * Added documentation generated code * Regenerated petstore samples * Fixed url paths for operations * Fixed based on comments in issues swagger-api#6520 * Regenerated petstore samples * add link to MS machine learning server * Note precisely which clients and servers can be used with Haskell. (swagger-api#6625) * [Elixir] Improve Elixir Client about primitive type spec (swagger-api#6623) Fix following dialyzer warnings in the sample: ``` :0: Unknown type 'Elixir.Float':t/0 :0: Unknown type 'Elixir.Integer':t/0 ``` * fix inconsistent java naming (swagger-api#6624) * [PHP] Fix: Type object not handled properly in setParameterExampleValue (swagger-api#6619) * Add test which reproduce the warning swagger-api#5338 swagger-api#5338 (comment) `[main] WARN io.swagger.codegen.languages.PhpClientCodegen - Type object not handled properly in setParameterExampleValue` * Fix Type object not handled properly in setParameterExampleValue * Update samples - /bin/php-petstore.sh - /bin/security/php-petstore.sh * [GO CLIENT] Fix issue with generating code for API key (swagger-api#6630) * [GO CLIENT] Fix Go security query parameter generation by using correct string literal and using the Add method. * Add generated files. * [objc] Let the developer specify the timezone to be used for date serialisation (swagger-api#6628) * [objc] Update deployment target to 8.0 Updates the test project deployment target to 8.0, as that's the lowest supported by the latest XCode. * [objc] Update petstore tests based on current master Makes sure the tests are based on the latest version of master. * [objc] Allow specifying the serialization timezone Now it's possible to specify the timezone used for serializing dates * [haskell-http-client] add support for auth methods (swagger-api#6622) * add support for auth methods * use newtypes for required params * fix duplicate operationId issues * prevent aliasing of vendorextension references in fromOperation * add --fast to stack ci build * [Scala] Properly handle csv collectionFormat (swagger-api#6540) * Add support for lists of path parameters (eg instances), and default params for optional case classes * Update Petstore sample * Revert defaulting of case class fields to None * Update Petstore sample * represent swagger enums as union of literal types (swagger-api#6233) * represent swagger enums as union of literal types enabling their easy use in angular templates, structural subtyping among enums (in particular, different instances of the same enum are now mutually assignable), improving type safety by preventing incorrect widening, and permitting numeric enum values (albeit without descriptive names) Fixes swagger-api#6206, swagger-api#5146, swagger-api#3500 * update samples * restore blank lines at end of file * fix typo * add ada style guide * [Ada] Adding Ada client samples (swagger-api#6634) * 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 * Issue 5431 Support jaxrs client api interfaces (swagger-api#6412) * Adds the ability to create code for an interface-based jaxrs client. * Adds shell script and sample files for jaxrs-spec-interface * rebase into adds shell * Fixes bug in creation of Produces/Consumes in method annotation. Allows for instance "application/json; charset=utf-8" * Fixes generated pom.xml * Generate pom.xml by default * Prettier output from api.mustache * Fixes bug in mediatype, allowing charset-specification in swagger.yaml. * Merges generation of interface-based jaxrs client/api into jaxrs-spec. * Moves jaxrs-spec server interface to match location of jaxrs-spec server * Makes Generated-annotation in genereated classes slightly prettier. * [JavaScript] Fix licenseNames (swagger-api#6605) * [JavaScript] Fix licenseName in package.mustache * Fix invalid SPDX license expression in resources/2_0 * Update JavaScript samples * remove unused JS files * swagger-api#3904 Inheritance support java client retrofit gson (swagger-api#4729) * merge with master * remove zoo specific artifact names * fix duplicate doublequote * swagger-api#3904 add samples for retrofit2 * swagger-api#3904 clean json field retrieval * swagger-api#3904 allow non-abstract parent class * Fix class path for DeferredResult (swagger-api#6452) * fix NPE reported in swagger-api#6519 (swagger-api#6635) * fix underscore to handle spaces (swagger-api#6637) * add link to ada's article * use japanese name of taxpon * Fix for regression in issue: swagger-api#6472 (swagger-api#6480) * add java version to pom in resteasy eap java8 * update java server samples * Updated feign library dependency to io.github.openfeign (swagger-api#6652) Changed groupId from “com.netflix.feign” to “io.github.openfeign” from gradle and sbt mustache templates. * Add Serializable import to JaxRS-spec models if serializableModel is set (swagger-api#6651) * Swift4: Fix inline enum issue (swagger-api#6640) * Add addiitional files from upstream * Remove mis-added files * Fix compilation issue with Swift4 inline enums. This change fixes this issue: swagger-api#6607 The problem was that I was using "datatype" instead of "datatypeWithEnum" in the model.mustache file. When you have a the following model property: "myInlineStringEnum": { "type": "string", "enum": [ "inlineStringEnumValue1", "inlineStringEnumValue2", "inlineStringEnumValue3" ] } Then we were generating: public enum MyInlineStringEnum: String, Codable { case inlinestringenumvalue1 = "inlineStringEnumValue1" case inlinestringenumvalue2 = "inlineStringEnumValue2" case inlinestringenumvalue3 = "inlineStringEnumValue3" } However, when we decode this, we were using type of the enum ("datatype") rather than the enum type itself ("datatypeWithEnum"). So we were generating: myInlineStringEnum = try container.decodeIfPresent(String.self, forKey: "myInlineStringEnum") rather than: myInlineStringEnum = try container.decodeIfPresent(MyInlineStringEnum.self, forKey: "myInlineStringEnum") * [angular-typescript] fix using form data (swagger-api#6574) * swagger-api#6457: fix sending form params * swagger-api#6457: fix sending form params using files * swagger-api#6457: fix sending form params with files for angular 4.3 * swagger-api#6457: generate samples * swagger-api#6457: [typescript-angular] fix form data submission in IE/Edge * re-apply [typescript-angular] add customized encoder to use '+' char in query parameter swagger-api#6306 (swagger-api#6334) * adapt for HttpClient: [typescript-angular] add customized encoder to use '+' char in query parameter swagger-api#6306 (swagger-api#6334) * generate samples * swagger-api#6457: fix url parameter encoder imports for angular <4.3 * swagger-api#6457: generate samples * [haskell-http-client] bug fixes; path & newtype generation issues (swagger-api#6638) * fix path generation/param-substitution issues * fix newtype de-duplication issues * refactoring only * correct version in comments * prevent duplicate MimeTypes * sort parameter newtypes * comment out swift test due to build image changes * revise wordings for powershell generator * Update README.md (swagger-api#6656) Add my slide to README.md * Updated api client, Required parameters {{#required}} .. {{/required}}, are mapped to Eiffel (swagger-api#6653) Void Safety Rules, optional parameters are translated to detachable TYPE. Validation Rules are mapped to preconditions, at the moment maximun and minimun validation has been added. Improved API_CLIENT.parameter_to_tuple feature to accept a LIST [ANY] instead of LIST [STRING_32]. Improved model template to generate the model output. * [kotlin] Fix syntax errors on localVariableHeader in api.mustache (swagger-api#6660) * Swift4: Add additional initializer for initializing model object with properties. (swagger-api#6642) * Add addiitional files from upstream * Remove mis-added files * Add additional swift4 initializer for initializing model object with properties. This change fixes this issue: swagger-api#6641 It adds an additional initializer which allows model objects to be initialized using the properties. For exxample, if we had this model: "ErrorInfo": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "details": { "type": "array", "items": { "type": "string" } } }, "description": "Example Error object" }, This we generate an initializer for this model object like this: public init(code: Int?, message: String?, details: [String]?) { self.code = code self.message = message self.details = details } * Add hasVars checks around initializers and re-run all scripts to re-generate * [PHP][Symfony] Generate valid PHP code (swagger-api#6578) Fixes swagger-api#5985 We were experiencing syntax issues when generating the Petstore example. See some of the examples below: StoreApiInterface.php namespace Swagger\Server\Api; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Swagger\Server\Model\Order; **use maparray<string,int>;** use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; UserApiInterface.php public function createUsersWithArrayInput(**User[]** $body); public function createUsersWithListInput(User[] $body); As far as I know, it is not possible to use array of objects in this way. PetApiInterface.php namespace Swagger\Server\Api; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Swagger\Server\Model\Pet; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Swagger\Server\Model\ApiResponse; **use string[];** use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; public function findPetsByStatus(string[] $status); public function findPetsByTags(string[] $tags); * add Edubits to swift tech comm * add back petstore test (swagger-api#6663) * add jaz-ah to swift, android tech committee * golang: trailing whitespace fails gofmt (swagger-api#6669) Signed-off-by: Vincent Batts <[email protected]> * update go petstore samples * - Removed unnecessary line in in Restbed Codegen Constructor (swagger-api#6675) - Updated samples * Included Open Systems International in the list of companies using Swagger Codegen (swagger-api#6692) * Add operationId as nickname to @ApiOperation (swagger-api#6688) * Add operationId as nickname to @ApiOperation * Refresh samples after adding nicknames to @ApiOperation * Swagger eiffel:fix (swagger-api#6674) * Updated api client, Required parameters {{#required}} .. {{/required}}, are mapped to Eiffel Void Safety Rules, optional parameters are translated to detachable TYPE. Validation Rules are mapped to preconditions, at the moment maximun and minimun validation has been added. Improved API_CLIENT.parameter_to_tuple feature to accept a LIST [ANY] instead of LIST [STRING_32]. Improved model template to generate the model output. * Updated API_CLIENT.parameter_to_string feature, missing STRING representation. * Updating sample using the latest modifications. * [kotlin] Fix causing NoClassDefFoundError at runtime on Android device (swagger-api#6661) * Fix causing NoClassDefFoundError at runtime on Android device. * Add samples modified by bin/kotlin-client-petstore.sh * Add enum support for flask (swagger-api#6684) * update python flask petstore samples * There was no validation when a required field was null, creating crash and null pointer exception further down the line in the business code. Now, it throws a InvalidArgumentException. (swagger-api#6673) * Added support for enums in Dart. (swagger-api#6516) * Added support for enums in Dart. * Pick non-private names for enum values. The _ prefix denotes a private member in Dart, so avoid generating enum values starting with this character. * Properly encode enum values into query paramters. * Various cleanups. * Add support for x-enum-values extension. Use class instead of enum for better ergonomy. Better generated enum names. * Fixed test. * Support enum descriptions. * Adding a new Scala client codegen (swagger-api#6572) * Adding a Scalaz codegen client * Fixing imports and removing commented code * Adding the bash file and updating the Pet store samples for Scalaz. * Finalizing Scalaz generation so that it works for the Petstore.yaml * Removing some unnecessary files and comments * Removing some files that were accidentally generated for the wrong Scala * add tbrown1979 as template creator for scalaz * add scalaz to cirleci * add beta to scalaz generator * Add http://www.nttdata.com (swagger-api#6713) * [PHP] Fix swagger-api#5338: InvalidArgumentException (swagger-api#6685) * Add endpoint definition which reproduces swagger-api#5338 bug * Update samples * Add test case which reproduces swagger-api#5338 bug * Fix "InvalidArgumentException: Invalid resource type: object" * Update samples - ./bin/php-petstore.sh - ./bin/security/php-petstore.sh * [Elixir Client]Improve elixir client typings (swagger-api#6665) * [Elixir Client] Improve primitive typings * [Elixir Client] Add type to models Fix following dialyzer warnings in the sample: ``` :0: Unknown type 'Elixir.SwaggerPetstore.Model.ApiResponse':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Client':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Order':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterBoolean':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterComposite':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterNumber':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterString':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Pet':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.User':t/0 ``` * revise go header, minor formatting fix (swagger-api#6695) * JAXRS-SPEC: fix container return type (swagger-api#6659) * JAXRS-SPEC: fix container return type * Run ./bin/jaxrs-spec-petstore-server.sh ./bin/jaxrs-spec-petstore-server-interface.sh * add jaxrs-spec-interface to circle ci * [C++] Sanitize operation ids. (swagger-api#6664) * [C++] Sanitize operation ids. * [C++] Handle reserved words in `toOperationId`. * [C++] Re-order reserved words alphabetically. * [C++] Add missing reserved words. * ContentType selection fix for csharp. (swagger-api#6633) * ContentType selection fix for csharp. Updated to reflect java implementation. Previously any request body of type string was having the content type overridden to 'application/json'. This prevented custom json ContentTypes * updated the petshop codegen for C# * Fixed content type selection test for csharp * Replaced tabs with 4 spaces * Removed trailing space / string comparison * Prefix local vars to prevent conflict with params (swagger-api#6717) * Prefix local vars to prevent conflict with params Fixes swagger-api#6698 * Update test snapshots * update all petstore security samples * add resteasy-all shell script * new files genreated by security shell scripts * [haskell-http-client] handle Alias models + refactoring. (swagger-api#6712) * handle Alias models with newtypes * add inlineConsumesContentTypes cli option * generate swagger.yaml instead of swagger.json * check for/validate unhandled authMethods * refactoring * Fix spring api operation annotation (swagger-api#6700) * * Fix apioperation annotation using generics in class reference for spring server generation * * Regenerate classes for new spring template * [Java][JAX-RS-CXF] Add JsonProperty to POJO (swagger-api#6710) * Included Open Systems International in the list of companies using Swagger Codegen * Force Jackson to use the real names of the properties of the Data type defined in the YAML * 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 * Changed {{name}} for {{baseName}} following the correction posted by @wing328 * Update of the Petstore CXF server sample * [New Generator] Rust API client/server generator (swagger-api#6613) * Rust API client/server generator * `Future::boxed()` has been deprecated - replace with `Box::new(...)` * rebasing to rust * MMMLS211 use empty vec over none * MMMLS211 rebuild after merge from rust * MMMLS211 YAML array examples not wrapped in Some() * MMMLS211 Array parameters bad mustache fix * MMMLS211 don't parse map containers * MMMLS211 Tidy container types * MMMLS-211 rebuild example * MMMLS211 mvn rebuild * Percent-decode parameters contained in the path * Produce warnings when unknown fields are present We still accept unknown fields and discard them. However, to improve diagnosability, we now write a warning log and return a `Warning` header. Note that this is server-only * Markup * MMMLS211: Make optional arrays Options again * 211 markups * Temporary attempt at tweaking Cow ownership tweak while merging changes from rust branch * Remove to_string call while parsing path parameters, which requires definining a temporary var in a block because rust can't tell where a Cow reference gets dropped * Fix rustfmt to the correct version * Fix rustfmt to the correct version * Add more response information to ApiError in client * Re-add missing brace * Code review markups * Allow converting out of wrapper types * Store arrays in new-types too * Use a new hyper_client every request * Add vec-like traits to array types * Xml support - new branch * Moved conversion from serde_xml_rs::Error to ApiError from swagger-rs to client code until upstream PR is accepted * MMSUB-172 Don't set Content-Type when there's no body. If we don't have a body we've serialized, then don't declare any content type for the nonexistent body. This is really important for 204 No Content responses, but it's also morally important for all other non-bodied responses. * MMSUB-172 Move to swagger 0.6. * Manually implement debug for the client * Allow `Context` to be bound to `Api`, and not passed on every function call * Support "." in parameter names * Support generate's "--reserved-words-mappings" option * Support "." in parameter names * Support generate's "--reserved-words-mappings" option * bug fixes (swagger-api#6743) * [Rust] rename rust2 to rust-server (swagger-api#6747) * rename rust2 to rust-server * update rust-server batch file to use petstore test spec * Bugfix/6750 name clash between npm request and parameter called request (swagger-api#6753) * rename request to $request * update examples files * rename $request to localVarRequest * rename oder variables to localVar... * revert changes to fakes yaml (swagger-api#6758) * revert changes to fakes yaml the yaml currently includes invalid definitions that do not exist: ('#/definitions/xmlObject'). revert to known good yaml state. * update template creators * [JavaScript] Handle custom request.agent (swagger-api#6737) * Handle custom request.agent * better semantic * update JS petstore samples * update ruby petstore samples * Fixed link to open issues (correct label is 'help wanted') (swagger-api#6779) * remove unused files from Ruby petstore client * [Java][JAXRS-CXF] Improve API documentation in the CXF Server stub and Client generation (swagger-api#6708) * Inclusion of API documentation in CXF Server stub generation * Inclusion of API documentation in CXF client generation * 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 * Changed {{{appDescription}}} to {{appDescription}} to use the HTML-escaped value in handling special characters like <, > in the description following the correction made by @wing328 * Update of the Petstore CXF samples * Add Metaswitch to list of companies (swagger-api#6773) * Update README.md (swagger-api#6783) Add my company to `Companies/Projects using Swagger Codegen` * Fixed Python client docstrings (swagger-api#6780) * Updated api_client and configuration docstrings ApiClient: Removed host param, added configuration and cookie param Configuration: Docstrings are only read from the @Property decorated function, not the setter, moved the more descriptive docstrings from the setters to property functions * Ran bin/python-petstore.sh * [TypeScript-Angular] Path URI Encoding Update (swagger-api#6769) * Replaced the method for updating path to prep for URL encoding. The new method will switch TypeScript-Angular variables from snake_case to camelCase in the URL generation. Imported StringBuffer, Matcher, and Pattern, since the new solution needs them. Some extra whitespace on blank lines was removed. * Since these were not up to date with the current master, I ran them and am commiting them here. This way, the changes are shown here instead of after future commits. * Simplified the code for the path conversion A LOT. New version is much simpler to follow, and very efficient - only one iteration through the length of the string. Removed regex Matcher and Pattern classes, since they weren't needed anymore. * [PHP][Symfony] Enhancements (swagger-api#6615) * Removed commented code * Input validation is now supported as strict JSON validation * [PHP][Symfony] Improve the implementation Closes swagger-api#6614 * Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer * Updated shell script because shippable tests were failing * Allow using help command with run-in-docker.sh (swagger-api#6706) * Change version * Add baikal repositories
Why the typescript enum type generate with
And when I use Is there any reason to add this generic? |
With TypeScript 2.4, you should not need the |
Any update on this topic? Removing |
@gpassero Did you find a solution for this? |
@Kierchon the solution we adopted was to manually edit the code generated by codegen to fix this and other issues we had (for instance, we fine tuned the auth logic of the client). we saved the manual changes in a patch file (diff from auto vs auto+manual changed applied), then everytime we changed the API spec and regenerated the client, we'd reapply the patch file. Eventually, there were conflicts we had to resolve manually. |
Description
swagger-codegen
emits TypeScript enums in the form of:This is a hack to support string-based enums, since TypeScript's built-in support for enums only support numbers. However, this workaround is extremely dangerous, since it allows incorrectly widening the enum value to the
number
type even though it is a string:Swagger-codegen version
As late as 55443da
Swagger declaration file content or url
Any declaration file containing a string enum
Command line used for generation
Any
swagger-codegen
invocation that generates TypeScriptSuggest a Fix
According to a TypeScript dev, since TS 2.1, you can safely write string-based enums without the builtin
enum
keyword. This approach has minimal overhead and exploitskeyof
, lookup types, and type inference.The text was updated successfully, but these errors were encountered: