Commit Graph

5484 Commits

Author SHA1 Message Date
lukoyanov
936c586df3 fixed error handling (now retrofit2.HttpException is thrown instead of RuntimeException on API error) (#6302)
value adapter now supports both F.Promise<Model> and F.Promise<Response<Model>> in retrofit interface
switched dataLibrary to java8
2017-08-15 16:03:19 +08:00
Morten Christensen
e31cef8c71 Added modelPropertyNaming option to the csharp generator - Almost 100% based of the implementation of the option for Scala (#6305) 2017-08-15 15:30:35 +08:00
Ali
7f50b3c300 [Java] fix a bug whereby OAuth intercept method calls itself forever (#6290)
* fix a bug whereby OAuth intercept method calls itself forever

When the response is 401 or 403, the interceptor assumes that it is because of token so it keeps retrying the request with new token. However if the response status is due to the fact that authorization to the api endpoint failed, and not due to invalid token, then a recursive operation of updating token and re-requesting the failed request happens.

* change binary OR operator: | to normal OR operator: ||

although binary may work, it's unusual and likely was unintentional.
2017-08-15 14:57:26 +08:00
Daniel Woodel
024916c425 [swift3] Download file fix #6274 (#6274) 2017-08-15 12:11:23 +08:00
Ramzi Maalej
c714b1ab00 Strip package name from the class name (#6293) 2017-08-14 17:02:45 +08:00
Lars Wander
23d0fedc9c [Java] Fix okhttp-gson datetime converter compilation (#6230) 2017-08-14 16:50:02 +08:00
Yusuke Tsutsumi
d39b1ff76f [python] asyncio support (#6245)
* trying an approach with providing asyncio as a framework.

* adding example of asyncio.

* removing sample client to help PR look more manageable.

* possibly fixing a unit test

* getting unit test to pass again.

* addressing comments.
2017-08-14 16:16:55 +08:00
Ahmet Taha Sakar
da4fe86402 Swift3 xcodewarnings (#6298)
* added headers to makeRequest function for swift3 template

* Swift3 update to dismiss Xcode warnings
2017-08-13 13:09:23 +08:00
Manuel Kiessling
105fe4958e [php] Fixed typo in codedocs (Swaagger -> Swagger). (#6299) 2017-08-12 21:36:19 +08:00
Thomas Townsend
01477de711 Add useTags option to JavaJersey server codegen (#6278) 2017-08-12 18:02:31 +08:00
ephemera
11424a8cdd fix #6264 (#6276) 2017-08-12 17:57:13 +08:00
lopesmcc
2ebb1bcaf0 [JAVA-VERTX] make Vertx client support running on different contexts (#6283)
* [java-vertx] make vertx client support running on different contexts

* [java-vertx] make vertx client support running on different contexts (samples)
2017-08-12 17:56:20 +08:00
mferguson-gb
bc633766f8 Retrofit2 rxjava2 adapter imports (#6294)
* Update retrofit2 rxjava2 adapter dependencies

* Update sample code
2017-08-12 17:34:03 +08:00
Michael Kaye
c2ababbb5b [swift3] empty model with only additional properties (#6273) 2017-08-12 01:03:37 +08:00
Jean-François Côté
ab28c7c825 [Java Play Framework] Remove most warnings + bug fixes (#6275)
* Removals of most of the warnings found by lint

* Removals of most of the warnings found by lint (PART 2)

* Removals of most of the warnings found by lint (PART 3)

* Removals of most of the warnings found by lint (PART 4)

* Removals of most of the warnings found by lint (PART 5)

* Fix conversion error

* Removal of unnecessary import. Other will need more complex login in the generator itself (not in the mustache files)

* Add missing imports + fix to the regex. Generation of the samples
2017-08-11 15:38:18 +08:00
Gökberk Karaca
b0333af8bd Fix unexpected text error in javadoc by replacing url with html tag (#6279) 2017-08-11 08:50:36 +08:00
stevecookform3
adfe4b6e6c add @Valid/@Validated annotations to controller methods/nested models (#6254)
* add @Valid/@Validated annotations to controller methods and nested models

* update spring samples
2017-08-11 08:44:51 +08:00
wing328
06686d65fa [Lua] Add new Lua client generator (#6252)
* 1st commit of lua generator

* add petstore sample

* various fixes based on feedback

* better return handling

* check status code 1st letter

* add support for query parameters, auth, body param

* more fixes based on daurnimator feedback

* more fixes based on daurnimator feedback

* fix a few more issues found by luac -p

* use lower case for http header key name

* more fixes based on feedback

* update lua sample

* skip auto-generated readme, doc, test files

* use tab instead of 2-space

* fix container return type

* fix cast method call

* fix cast function call
2017-08-11 01:41:29 +08:00
Jean-François Côté
1e991be5f3 [JavaPlayFramework] Fix for issue #6100 (#6128)
* Fix issue #6100. Tested with all the samples.

* Fix multiple issue with the examples. Removing all of this.
Adding fake endpoint .sh but it is not compiling right now.
2017-08-09 22:00:46 +08:00
Davide Zipeto
5c384d0f15 string used instead of bolean (#6268)
Deprecated should be a boolean otherwise the parser does not validate
2017-08-09 17:16:48 +08:00
Jean-François Côté
00b46e8a94 [Typescript-Jquery] Fix file upload (#6262)
* Fix a bug with the file upload that was not working

* Prevent unnecessary append to the FormData
2017-08-09 17:05:00 +08:00
wing328
c05db535e1 Merge branch 'issue-3371' of https://github.com/gcernier-amadeus/swagger-codegen into gcernier-amadeus-issue-3371b 2017-08-08 15:31:52 +08:00
Gökberk Karaca
53f9ae277b Add externalDocs support (#6255) 2017-08-08 01:11:00 +08:00
wing328
fca8d81b2b [JS] fix template directory for ES5 (#6253)
* fix #5845 (template dir)

* fix js petstore test case
2017-08-07 22:10:56 +08:00
wing328
cc848a1c24 fix replaceAll with replace 2017-08-06 17:52:19 +08:00
wing328
4cb7f1d613 [Rust] add new Rust client generator (#6105)
* add rust generator (1st release)

* update based on feedback

* fix reserved keyword

* fix string parameter

* Convert String to &str in trait definition

* Only pass pathParams to uri builder

* Fixed the html escaping in return type

* Fixed the hashmap constructor

* Added models into API scope

* removed models subimport, reference from super

* update returntype in method signature

* Fixed the remaining templates inconsistencies

* Fixed issues that floated up in kubernetes swagger file

* add hash support, fix docstring

* fix map parameter, update api.mustache

* use baseName for parameter

* use fully-qualfiied model name

* add rust tests

* fix test cases

* Rust gen slightly more idiomatic (#6247)

* Go -> Rust in README

* Remove leftover go file in rust sample

* rust: Regenerate sample

* rust: Rename *Impl -> *Client

* rust: one-line use line

More in line with common style

* rust: Replace tabs (in java) with 4 spaces

* Added trivial getter implementation (#6249)

* update rust petstore samples
2017-08-06 16:59:08 +08:00
wing328
ffe7f0fb86 fix typo in java docstring 2017-08-06 15:39:14 +08:00
wing328
18c57a65ed Fix returnBaseType in Map response (#6246)
* fix returnBaseType for map response

* fix javadoc string
2017-08-05 22:24:46 +08:00
Lars Wander
86f2ea5e3e [Java] okhttp-gson content-type fix for */* (#6232) 2017-08-05 00:47:52 +08:00
Javier Velilla
e4276853d7 Fixed typo in the Abstract Eiffel class. (#6239)
Fixed typo in shell script
Added support for Outer Enums, inner enums not supported.
Added missing UUID library in ecf template.
Improved Model inheritance.
2017-08-05 00:38:50 +08:00
Hans-Christian Esperer
3cb36738b1 Fix issue #6212 POD Generated podfile doesn't include all generated swift files #6212 (#6220)
* Reference all generated swift files in the podfile

* Update test files
2017-08-04 00:46:01 +08:00
Mark Thebridge
9cadfd45d7 Scala import fix (#6227)
* Fix typo in Scala import generation

* Update test files
2017-08-03 18:40:58 +08:00
mobreza
b4e0854823 Improved support for XML wrapped items (#6150)
* Improved support for XML wrapped items

* XML @annotation whitespace fixed
2017-08-03 16:44:17 +08:00
mobreza
b433afebdd withXml replaces useJaxbAnnotations (#6152)
* Regenerated bin/jaxrs-*

* Replace `useJaxbAnnotations` with `withXml`
2017-08-03 15:35:33 +08:00
ehyche
32906ea7ce Add Objective-C compatibility for Optional scalars in swift4 just as we added in swift3. (#6158)
This change adds Objective-C compatibility for Swift Optional scalars in the swift4 language just like we added in swift3 here:

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

It also adds unit tests for the swift4 language. Currently those unit tests are the same as the swift3 unit tests, but will change soon as we iterate on the swift4 language generator.
2017-08-02 21:19:48 +08:00
ehyche
dd46ba9ef6 Add additional cli option and properties to swift3 for Objective-C compatibility. (#6129)
Currently, in the swift3 language, if you have an optional integer, number, or boolean property in a model, then the generated swift3 model class might look like:

class SomeModel {
    var someInt: Int?
    var someFloat: Float?
    var someDouble: Double?
    var someBool: Bool?
}

This works fine if you are accessing this model only from Swift code. However, it is very common for iOS codebases to contain both Swift AND Objective-C. If you need to access this model from Objective-C, then those 4 properties are not accessible, since Optional scalars do not translate to Objective-C.

Therefore, in the swift3 language, we want to add some code for Objective-C compatibility:

1. We add a "objCompatible" boolean command-line option. If objCompatible=true, then this enables some additional code generation to make these types of properties accessible from Objective-C. If objCompatible=false, then the generated code is exactly as it currently is. The default is objcCopmatible=false.

2. If objCompatible=true, then for these types of Objective-C-inaccessible properties (Optional scalars), then we add a "x-swift-optional-scalar=true" vendor extension in the CodegenProperty.

3. Then, in the model.mustache template, if we see x-swift-optional-scalar=true, then we add an additional computed property which returns an optional NSNumber.

So, for example, when objcCompatible=false (the default case), then the generated code for the "declawed" property of the Cat model looks like:

open class Cat: Animal {

    public var declawed: Bool?

    ...

But when objcCompatible=true, then it looks like:

open class Cat: Animal {

    public var declawed: Bool?
    public var declawedNum: NSNumber? {
        get {
            return declawed.map({ return NSNumber(value: $0) })
        }
    }

   ...
2017-08-02 18:20:01 +08:00
ToreJohansson
218273e9a8 Fixed x-example (#6195) 2017-08-02 18:14:35 +08:00
Chandan Singh
1c4e77585f Issue 6172 (#6173)
* Changes to allow field names as examples for string properties and multiple items in array during example generation

* Reverting the version to 2.3.0-SNAPSHOT and autogenerated petstore files
2017-08-02 17:59:54 +08:00
Jeff
6e72018a64 Add polymorphism support for python (#6208)
* Add polymorphism support for python

* Update api_client

* Remove leading spaces

* Bugfix

* Catch case where swagger_types is none but get_real_child_model is defined
2017-08-02 17:15:26 +08:00
ToreJohansson
34e5838924 Added all models to postProcessOperations (#6194)
* Added all models to postProcessOperations

* Added new postProcessOperationsWithModels
2017-08-02 16:14:34 +08:00
lopesmcc
66d48a0c71 [Java-VertX] Java Vertx client (#6204)
* #6165 - Java Vertx client

* #6165 - Java Vertx client (samples)

* #6165 - Java Vertx client (tests generation)

* #6165 - Java Vertx client (fixed test samples)
2017-07-31 20:04:11 +08:00
Mykola Yashchenko
be9a9a3837 [Java] Jersey, Jersey2 and Resteasy clients do not support HTTP-HEAD (#6210) 2017-07-31 19:03:25 +08:00
wing328
fab49e80a8 update Java jersey 1,2 to handle */* 2017-07-31 13:26:56 +08:00
Halil İbrahim Şener
182807ed9a [Java][Client] Add javax.validation.validation-api dependency for Bean Validation API support to jersey2 (#6203) 2017-07-31 13:15:44 +08:00
Halil İbrahim Şener
a6f981350e [Java][Client] Add PATCH method support for jersey2 (#6197) 2017-07-31 13:08:30 +08:00
wing328
443b0f142b remove ref to SO (#6209) 2017-07-29 18:53:08 +08:00
Pavel Tavoda
d412bcfd6c Fix to #6141 - [BASH] Bug generating access_token when "in: query" (#6187)
* Fix to #6141 - [BASH] Bug generating access_token when "in: query"

* Fresh petstore scripts
2017-07-28 16:00:44 +08:00
ToreJohansson
68966ac34e Added year to default generator (#6196) 2017-07-28 15:58:58 +08:00
wing328
cd43ad8c62 set auth, request package based on invokerPacakge (#6200) 2017-07-28 13:31:47 +08:00
wing328
a6f594bfd2 use jersey 2.6 for java6 (#6198) 2017-07-28 01:59:31 +08:00