Commit Graph

9529 Commits

Author SHA1 Message Date
wing328
27850d9596 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-10-17 22:53:34 +08:00
wing328
d093a34499 add jaxrs-spec-interface to circle ci 2017-10-17 22:53:04 +08:00
Giacomo
abe1be1a14 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
2017-10-17 22:51:37 +08:00
wing328
5143fb58a4 revise go header, minor formatting fix (#6695) 2017-10-17 22:31:06 +08:00
niku
62627f20bc [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
```
2017-10-17 21:59:25 +08:00
Akihito Nakano
07b408a44a [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
2017-10-17 21:22:49 +08:00
Hidetake Iwata
381acd28ea Add http://www.nttdata.com (#6713) 2017-10-17 15:45:48 +08:00
wing328
5c14f907d6 add beta to scalaz generator 2017-10-16 22:33:12 +08:00
wing328
62794c1d60 add scalaz to cirleci 2017-10-16 22:23:26 +08:00
wing328
15450754ec add tbrown1979 as template creator for scalaz 2017-10-16 22:15:07 +08:00
Taylor Brown
488aa989bf 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
2017-10-16 22:07:57 +08:00
P.Y. Laligand
1050aa9a06 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.
2017-10-16 21:28:21 +08:00
Jean-François Côté
8b70f24371 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) 2017-10-16 21:23:05 +08:00
wing328
619c391be9 update python flask petstore samples 2017-10-16 11:48:13 +08:00
Logan Patino
12a85bb09d Add enum support for flask (#6684) 2017-10-16 11:34:31 +08:00
Yukio Ejiri
8bcceb4a10 [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
2017-10-16 11:05:41 +08:00
Javier Velilla
3067da2877 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.
2017-10-16 11:02:19 +08:00
Elias Ovchynnikov
3f7f6b8599 Add operationId as nickname to @ApiOperation (#6688)
* Add operationId as nickname to @ApiOperation

* Refresh samples after adding nicknames to @ApiOperation
2017-10-16 10:18:32 +08:00
Gustavo Paz
1f97caf960 Included Open Systems International in the list of companies using Swagger Codegen (#6692) 2017-10-16 10:17:40 +08:00
stkrwork
027fb2fe47 - Removed unnecessary line in in Restbed Codegen Constructor (#6675)
- Updated samples
2017-10-15 23:38:46 +08:00
wing328
96444d374f update go petstore samples 2017-10-13 18:27:13 +08:00
Vincent Batts
eb453791b6 golang: trailing whitespace fails gofmt (#6669)
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2017-10-13 17:02:20 +08:00
wing328
b22fb30891 add jaz-ah to swift, android tech committee 2017-10-13 00:35:04 +08:00
wing328
e9f49abfee add back petstore test (#6663) 2017-10-12 19:31:36 +08:00
wing328
278bcfe96b add Edubits to swift tech comm 2017-10-12 18:27:56 +08:00
naelrashdeen
5ffdee4479 [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&lt;string,int&gt;;**
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);
2017-10-12 17:40:11 +08:00
ehyche
b716b378c4 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
2017-10-12 17:35:59 +08:00
Yukio Ejiri
590754f4f4 [kotlin] Fix syntax errors on localVariableHeader in api.mustache (#6660) 2017-10-12 17:31:09 +08:00
Javier Velilla
3bd24c3e5c 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.
2017-10-12 17:28:00 +08:00
Jumpei Takiyasu
02a053e2b6 Update README.md (#6656)
Add my slide to README.md
2017-10-12 17:26:57 +08:00
wing328
30a176126a revise wordings for powershell generator 2017-10-11 21:16:53 +08:00
wing328
b5a01b51c6 comment out swift test due to build image changes 2017-10-11 20:58:27 +08:00
Jon Schoning
db67840ded [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
2017-10-10 23:01:48 +08:00
Esteban Marin
dc88ed99ae [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
2017-10-10 22:55:50 +08:00
ehyche
02d25f5a14 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")
2017-10-10 22:53:17 +08:00
Graham Johnson
1bdb104738 Add Serializable import to JaxRS-spec models if serializableModel is set (#6651) 2017-10-10 22:45:47 +08:00
Jihun Lee
676af62122 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.
2017-10-10 22:41:18 +08:00
wing328
39ae041975 Merge branch 'update_java_server_samples' 2017-10-09 23:33:32 +08:00
wing328
d054a43b65 update java server samples 2017-10-09 23:00:44 +08:00
wing328
3b134319fa add java version to pom in resteasy eap java8 2017-10-09 22:51:58 +08:00
Jean-François Côté
e6d4362012 Fix for regression in issue: https://github.com/swagger-api/swagger-codegen/issues/6472 (#6480) 2017-10-09 22:51:32 +08:00
wing328
e90a40bfce use japanese name of taxpon 2017-10-09 10:18:46 +08:00
wing328
07c71e342e add link to ada's article 2017-10-09 09:39:05 +08:00
wing328
164f5bbb72 fix underscore to handle spaces (#6637) 2017-10-09 09:28:31 +08:00
wing328
81e0357561 fix NPE reported in #6519 (#6635) 2017-10-08 18:38:23 +08:00
Sasa Vilic
41b7950dcd Fix class path for DeferredResult (#6452) 2017-10-08 18:29:48 +08:00
Lukasz Konopski
73b38dd19e #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
2017-10-08 18:25:38 +08:00
wing328
1dc3fb4f37 remove unused JS files 2017-10-08 17:16:48 +08:00
Halil İbrahim Şener
1f9f8c5a3e [JavaScript] Fix licenseNames (#6605)
* [JavaScript] Fix licenseName in package.mustache

* Fix invalid SPDX license expression in resources/2_0

* Update JavaScript samples
2017-10-08 17:15:21 +08:00
jarlesat
8a7940f199 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.
2017-10-08 15:28:12 +08:00