Commit Graph

3661 Commits

Author SHA1 Message Date
Jinkui Shi
063e885c2f [Scala] format the Scala code style templete (#6532)
* The templete of scala code style refactor

* more reformat

* more reformat

* generate petstore client
2017-09-29 17:24:34 +08:00
Vlad Frolov
924a8e5efe [CPPREST] Fixed multipart files upload implementation (#6518) 2017-09-29 15:46:16 +08:00
Akito Nozaki
25812fc526 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.
2017-09-29 00:16:32 +08:00
Kenny Jones
87a9caa33f 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.
2017-09-28 14:14:47 +08:00
Kenny Jones
d04b7642f6 Feature: Adds doc generation (#6570)
Reference #2359
2017-09-28 13:17:48 +08:00
wing328
2c7dcbe3e5 fix elixir model naming 2017-09-28 09:55:53 +08:00
yissachar
bd5b586028 Use valid JS RegEx (#6584) 2017-09-28 09:49:05 +08:00
Jeff Ching
4b9ee1f194 [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
2017-09-28 09:32:17 +08:00
wing328
3ac2b803f9 [Elixir] Add Elixir Petstore sample to Shippable CI (#6575)
* add elixir petstore to shippable ci

* use oracle sdk
2017-09-27 20:53:27 +08:00
Jakob Schelbert
e3ba06cabb 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)
2017-09-27 00:06:53 +08:00
Kenny Jones
5e9d977a03 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
2017-09-26 21:53:05 +08:00
wing328
451218bfb0 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-09-26 17:16:31 +08:00
wing328
c53ebf6c45 add "npm run build" to ts angular 2017-09-26 17:10:08 +08:00
Mehdy Bohlool
d2b91073e1 [python] Add default Configuration (#6554)
* Add default configuration

* Fix assert_hostname bug in rest.py

* Update petstore sample
2017-09-26 14:16:48 +08:00
lukoyanov
e2916fdc13 [Java] Play! framework + retrofit2 client exception converter, bug fixes (#6543)
* added exception converter

* underscore removal fix

* samples updated

* added test

* test whitespace
2017-09-26 14:14:04 +08:00
Greg Marzouka
0a9e3782c5 [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
2017-09-26 12:22:01 +08:00
wing328
96137e5677 add encodeURIComponent to encode path parameters (#6551) 2017-09-25 16:28:30 +08:00
Kenny Jones
4b0314498b 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
2017-09-24 23:07:12 +08:00
wing328
2d44d7f291 use parameter name as description if not defined (#6557) 2017-09-24 21:18:49 +08:00
Akihito Nakano
b31a80448a [PHP] Improve Api template (#6507)
* Improve spacing in doc comment

* Improve grouping of parameter tags

* Improve line length

* Fix undefined variable $_tempBody

* Improve indent
2017-09-24 15:40:06 +08:00
Alex
ac99fe6b2d fix #6353 (#6514) 2017-09-24 14:47:40 +08:00
wing328
639f88918a [Java][RESTEasy] fix resteasy dependency issue in pom.xml (#6556)
* fix resteasy dependency issue

* add java resteasy petstore to circleci test
2017-09-24 12:49:43 +08:00
Akihito Nakano
8f8515486f [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
2017-09-23 21:36:05 +08:00
Esteban Marin
4a89d23619 [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
2017-09-23 17:23:45 +08:00
wing328
209158aa9d update ts jquery petstore samples 2017-09-23 17:07:21 +08:00
wing328
16678b8106 update ts angular v2, v4 petstore samples 2017-09-23 15:55:14 +08:00
stoetti
07df0759d3 [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
2017-09-23 15:48:05 +08:00
wing328
b1e7a4f724 update cpprest petstore samples 2017-09-23 15:45:17 +08:00
lukoyanov
7f6bccb4ed [Java] Added Play! WS filters support for retrofit2 client (#6499)
* added play! ws filters support

* samples updated
2017-09-20 12:32:52 +08:00
Akihito Nakano
594b390e11 [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
2017-09-19 18:07:37 +08:00
wing328
e27d4577c1 update perl petstore sample 2017-09-19 10:20:47 +08:00
Larry Bordowitz
65d788396b [6313] Add imports to perl objects. (#6500) 2017-09-19 10:11:38 +08:00
Mehdy Bohlool
f3c41e866c [Python] Add configuration.{connection_pool_maxsize, assert_hostname} (#6508)
* Backport kubernetes client features:

- assert_hostname
- connection_pool_maxsize
- cleanups

* Update petstore sample
2017-09-19 01:25:33 +08:00
Jon Schoning
d928617b69 [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
2017-09-19 01:24:38 +08:00
ehyche
b807f6ff96 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")
    }

}
2017-09-19 01:04:50 +08:00
ehyche
8067612e06 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.
*
2017-09-12 14:37:39 +08:00
wing328
591149bcb7 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
2017-09-12 11:41:14 +08:00
wing328
9e0911b376 [ObjC] fix NPE when getting swagger type (#6465)
* fix npe in swagger type (objc)

* remove trailing spaces
2017-09-11 17:39:12 +08:00
Lance Hannestad
a6d6432e6d [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
2017-09-11 10:23:38 +08:00
wing328
e733bfa67d update c# petstore samples 2017-09-09 21:19:21 +08:00
IvanovJohn
bbb901549f [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
2017-09-09 18:19:57 +08:00
Jon Schoning
4fb612c2e8 [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
2017-09-09 17:11:46 +08:00
Jon Schoning
4310ea326c [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
2017-09-07 23:17:49 +08:00
ecolleu
3cd3b907f6 [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
2017-09-07 18:12:09 +08:00
jaz-ah
565844585e [Swift3/Swift4] update all cocoapods for swift3/swift4 (#6441)
* [Swift] update all cocoapods for swift3/swift4

* fix subspec specification
2017-09-07 00:56:48 +08:00
wing328
845f54da99 [Java] fix bug to only remove "CustomInstantDeserializer" for Play v2.5 (#6444)
* fix bug to only remove CustomInstantDeserializer for play25

* revise logic

* fix logic for CustomInstantDeserializer.java
2017-09-07 00:18:39 +08:00
manuc66
a41e8bed97 [csharp] Support inheritance instead of duplicating parent properties in derived classes (#5922)
* [csharp] Explicitly set supportsInheritance

* [csharp] set supportsInheritance for client

This includes supportsInheritance only for the client codegen at the
moment, because setting in AbstractCSharpCodegen would require the
change to be tested in all derived generators, possibly including
similar template changes to this commit's.

* include nice improvement of https://github.com/jimschubert/swagger-codegen/tree/csharp/3829 and leverage https://github.com/manuc66/JsonSubTypes for subtype deserialization

* remove duplicate base validations

* remove useless tests

* restore documentation for properties coming from parent

* launch bin/security/csharp-petstore.sh

* it's impossible to call an explicitly implemented interface-method on the base class
(https://stackoverflow.com/questions/5976216/how-to-call-an-explicitly-implemented-interface-method-on-the-base-class)

* restore portion of code that was lost

* regenerate more

* fix missing using

* take the multi .net compatible revision

* keep generated model simple when no hierarchy involved

* regenerate with:
- bin/csharp-petstore-all.sh && bin/security/csharp-petstore.sh
- bin/csharp-dotnet2-petstore.sh && bin/csharp-petstore.sh && bin/csharp-petstore-netcore-project.sh && bin/csharp-petstore-net-standard.sh && bin/csharp-property-changed-petstore.sh

* fix sln indentation and the missing windows runner for dotnet2

* fix inheritance GetHashCode and Equals

* override instead of hiding the base method
+ fix the csharp-property-changed-petstore.bat

* By default the value of the discriminator property must be the name of the current schema

* Add test for subtype deserialisation from parent type

* add missing '.bat' and use the 'call' template from javascript-petstore-all.bat

add missing file to trigger it on windows

* fix default value bug

* cleanup copyright information

* formatting after merge

* fix merge

* applying bin/csharp-petstore-all.sh

* applying bin/security/csharp-petstore.sh
2017-09-06 17:22:20 +08:00
wing328
b8183fbd09 remove spaces in templates 2017-09-06 16:54:36 +08:00
lukoyanov
f623aa1f5b [Java] Play! retrofit2 client content-type handling fixes (#6440)
* proper content-type handling (npe fixed when content-type is absent, improved content-length calculation)

* samples updated

* fixed missing imports, samples updated
2017-09-06 15:43:19 +08:00
Jon Schoning
c7d145a4ba add haskell-http-client-generator (#6429) 2017-09-06 00:33:48 +08:00
Alex
4eab5406c5 Added ModelInterface for PHP Models (#6331)
All Model classes include a set of methods - it makes sense to align them to a concrete interface to improve strict typing when referencing these models.
2017-09-05 22:22:18 +08:00
Takuro Wada
84bb749cc3 [typescript-angular] add customized encoder to use '+' char in query parameter #6306 (#6334) 2017-09-05 22:04:23 +08:00
wing328
a4c0975aa4 [R] Add new R client generator (#6351)
* add r client codegen

* update r api, model templates

* various fix

* rename Json to JSON

* more enhancements

* fix json handling

* add file upload support, var name to handle hyphen

* use httr::upload_file
2017-09-04 00:21:32 +08:00
wing328
c1f5de91bb add comment, update ruby, php samples 2017-09-03 23:20:55 +08:00
jaz-ah
19694ae4e3 [Swift3] Make sure decode doesn't fail on optional arguments (#6423)
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name

* update samples

* one step closer

* closer implementation

* break on optional decode failing since it's an optional we don't want to fail the whole decode

* update samples
2017-09-03 22:30:42 +08:00
jaz-ah
b19fa25521 [Swift3] Missing decoders for Array elements (#6422)
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name

* update samples

* one step closer

* closer implementation

* add back in array decoders

* regenerate samples
2017-09-03 22:30:21 +08:00
wing328
1097375d7f fix file upload in retrofit2 (without play) (#6425) 2017-09-02 17:35:46 +08:00
wing328
2a011d0a1e update retrofit2 petstore samples 2017-09-02 01:31:00 +08:00
Ahmed Charles
60766c6210 Make the Rust codegen compile. (#6411)
* Use the right package name for the Rust crate.

* Change getters on models to return Option for non-required fields.

* Cleanup Rust generation and get example compiling again.

* Use underscore names for functions.
2017-09-02 00:06:55 +08:00
Darshana Sanjeewan Adikari
a28ce0b604 [python-client] Thread pool fix (#6396)
* [python-client] Added close() and join() for threadpool at ApiClient destructor.

* Updated stuff for CI
2017-09-01 18:18:03 +08:00
wing328
0f1a61d9c2 update retrofit2 petstore samples 2017-09-01 17:14:43 +08:00
lukoyanov
a2c4f0baf4 [Java] Implemented support for Play! 2.5.x (java8) for retrofit2 client (#6007)
* Implemented support for Play! 2.5.x / java8

* Added petstore sample for play25

* implemented play25 support
implemented version switch via playVersion config option

* fixed compilation failure after merge

* Disabled generation of CustomInstantDeserializer if dateLibrary equals to java8
2017-08-31 23:02:09 +08:00
David Fischer
506c58ec74 [JaxRS] Fix response annotation generation (fixes #2588) (#6373)
* [JaxRS] Fix response annotation generation (fixes #2588)

* [JaxRS] Fix jaxrs jersey1 usetags sample provider

* Revert "[JaxRS] Fix jaxrs jersey1 usetags sample provider"

This reverts commit 73fef2e451e376b23f6c1d43d8781f0b4a0bd1f5.

* [JaxRS] Fix jaxrs jersey1 sample generator

* [JaxRS] Fix samples for jersey1 and jersey2

* [Server: Java] Fix diamond operator defaultValue for Java < 1.7
2017-08-30 00:31:56 +08:00
jaz-ah
b0db394855 [Swift3] fix for unwrapRequired compilation when we have a "result" as one of the parameters (#6377)
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name

* update samples

* one step closer

* closer implementation

* fix unwrapRequired models when we have a parameter named result
2017-08-30 00:01:47 +08:00
wing328
ccfe7f5cbf minor fix to ts angularjs bin script 2017-08-28 18:36:37 +08:00
Damien Pontifex
14f0375bdd Codegen class rename for Angular and AngularJS to reflect naming guidelines (#6109)
* Rrename for angular and angularjs to reflect naming guidelines

see http://angularjs.blogspot.com.au/2017/01/branding-guidelines-for-angular-and.html
- move makes typescript-angular -> typescript-angularjs
- move makes typescript-angular2 -> typescript-angular
Language string with generate was already this so generation shouldnt change
but class naming follows this convention now

* Fixing merge problems
2017-08-28 18:32:50 +08:00
Ahmet Taha Sakar
17b71f1707 Swift3 arrayenums (#6354)
* added headers to makeRequest function for swift3 template

* added support for enum arrays
2017-08-28 15:08:28 +08:00
Isman Usoh
3ecc374682 [Typescript-Fetch] Support additionalproperties, Enum, Auth and more. (#6130)
* Support additionalproperties and more.
- Upgrade to TypeScript 2
- Use type definition from npm instead of typings, typings is deprecation
- Use Enum instead of String Literal Types
- Use typescript es6 lib for target es5
- Support additionalproperties
- Support JSDoc
- Add snapshot and npmRepository option
- Update typescript-fetch run script for linux
- Create typescript-fetch run script for windows

* Update and fix
- Fix circle run script
- Fix duplicate query parameter

* Rename typescript-fetch folder to lowercase

* Fix for review and update new line end of file

* Fix end of file

* rename script to {lang}-petstore-all.sh and fix test

* Fix override query string
https://stackoverflow.com/a/7517673/1077943
2017-08-25 23:26:32 +08:00
stmeyer
6c8bd6b83e [QT5CPP] General Improvements (#6315)
* - check C++ keywords
- setter for SSL configuration

* recreate example QT5CPP

* only emit error signal if error happens

* provide more error information

* regenerate example QT5CPP

* * use reserved words in abstract cpp generator
* update CppRest examples

* remove tabs
2017-08-25 18:35:56 +08:00
jaz-ah
1b05960a74 [Swift3] Fix unwrapRequired parameter which wouldn't compile (#6340)
* two fixes: 1) extra ?'s at end of some url's 2) enums not being called out w/ rawValue to get the proper string name

* update samples

* one step closer

* closer implementation

* fix build when using unwrapRequired option
2017-08-25 18:19:26 +08:00
Krzysztof Karol
4ee557aa24 Fix swagger-api/swagger-codegen#6345. Wrap optional JSDoc parameter (apiClient) in square brackets (#6346) 2017-08-24 10:39:34 +08:00
Christian Röder
88e99f1a42 Kotlin: Fix trailing comma for data classes (#6323)
If a data class has no optional parameters, a trailing comma (which was
supposed to delimit the list of required and optional parameters) will be
inserted after the last required paramter, leading to a syntax error in
Kotlin.
2017-08-19 11:56:29 +08:00
wing328
7eb3ab8bf5 Merge branch 'master' of https://github.com/swagger-api/swagger-codegen 2017-08-15 16:49:01 +08:00
wing328
2944bf8876 update java petstore (security) 2017-08-15 16:45:03 +08:00
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
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
Ramkumar Chandrasekaran
59663c0f1f Remove License File (#6312) 2017-08-15 14:40:05 +08:00
Daniel Woodel
024916c425 [swift3] Download file fix #6274 (#6274) 2017-08-15 12:11:23 +08:00
wing328
958ad9af87 update petstore samples 2017-08-14 16:54:33 +08:00
Ramkumar Chandrasekaran
3de6a8f0f2 Adding R Petstore Client Package (#6307) 2017-08-14 16:06:08 +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
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
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
wing328
79a5620fbc remove lua sample in preparation for lua generator release 2017-08-10 21:51:47 +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
daurnimator
5d14f3f733 samples/client/petstore/lua: Add lua sample (#6244)
* samples/client/petstore/lua: Add basic lua GET request

* samples/client/petstore/lua: Add classes
2017-08-08 11:35:17 +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
43e53dadda remove old petstore powershell sample 2017-08-07 15:41:30 +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
646c2bc23c update java petstore (okhttp-gson) samples 2017-08-05 00:54:01 +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
wing328
e60034ec7d update swift petstore samples 2017-08-04 01:01:19 +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
wing328
7aee5b6ee7 update java petstore sample, reenable test for resttemplate-withxml 2017-08-03 17:09:38 +08:00
mobreza
b433afebdd withXml replaces useJaxbAnnotations (#6152)
* Regenerated bin/jaxrs-*

* Replace `useJaxbAnnotations` with `withXml`
2017-08-03 15:35:33 +08:00
wing328
54d00084f7 update php, ruby petstore 2017-08-02 23:38:46 +08:00
wing328
8c487d5dbe update python ,swift petstore sample 2017-08-02 21:23:06 +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
wing328
92b129708d update spring samples 2017-08-02 16:43:54 +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
wing328
fab49e80a8 update Java jersey 1,2 to handle */* 2017-07-31 13:26:56 +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
wing328
a6f594bfd2 use jersey 2.6 for java6 (#6198) 2017-07-28 01:59:31 +08:00
wing328
82835db670 fix issue with api key (query) in c# (#6199) 2017-07-28 01:51:39 +08:00
Mykola Yashchenko
bb2a53ac9c added additional properties to manage Android version numbers more easily (#6160) 2017-07-27 19:27:59 +08:00
Vaughn Dice
40ae715392 [go] add http request host override for api client (#6174) 2017-07-27 15:53:33 +08:00
wing328
927055a681 [Java] MIME type "*/*" default to JSON (#6188)
* update java petstore

* minor fix to docstring

* roll back resttemplate with xml petstore due to errors

* minor fix to resttemplate isjson check
2017-07-27 11:36:29 +08:00
Duan Shiqiang
f9eaef8f24 Ts node angular2 typings (#6178)
* removed typings for typescript-node language and updated typescript version

* updated sample of typescript-node by running .\bin\windows\typescript-node.bat
2017-07-26 20:29:46 +08:00
wing328
e807b81471 Better control on setter, getter (for boolean, non-boolean) (#6177)
* better control on setter, boolean getter

* improve test casees for getter and setter
2017-07-26 19:57:50 +08:00
Andrea Rossi
66f2f70634 Add execute permissions to gradlew (#6168)
Some of the gradlew files don't have execution permission, so this adds it.
2017-07-26 15:30:09 +08:00
Halil İbrahim Şener
7696ca1658 [Java][Client] Add Deprecated annotation and update samples (#6166) 2017-07-26 01:07:30 +08:00
Eric O'Connell
2540db8adf More flexible subclassing of ApiClient possible by s/private/protected/g (#6159)
* More flexible subclassing of ApiClient possible by s/private/protected/g

I found myself in a situation where I needed to change the configured `Feature`s, but
because of all the private variables I was not able to do so. Perhaps this is a bit too
broad of a stroke, but I changed all fields and methods to `protected` instead of `private`.
In this way, future extensibility should be improved.

Also, to solve my particular problem, I added a new empty method called
`performAdditionalClientConfiguration` which will allow subclasses to add specific features,
or do anything else possible with a `ClientConfig`.

* Updated samples
2017-07-25 14:56:34 +08:00
wing328
64658f0bea update eiffel petstore 2017-07-25 00:03:15 +08:00
wing328
5497ce5b23 update python petstore samples 2017-07-24 00:32:26 +08:00
wing328
43d8fe5047 update java (jersey2) petstore samples 2017-07-23 23:38:15 +08:00
wing328
570f0a9bee Squashed commit of the following:
commit e3210cf8cc679c54f5c0d8d4fda2db6af1ee5bcf
Author: wing328 <wing328hk@gmail.com>
Date:   Sun Jul 23 17:41:44 2017 +0800

    comment out failed kotlin test

commit ed6bd1b92464f56885bc3cfa5d30936ce4a3d53d
Author: wing328 <wing328hk@gmail.com>
Date:   Sun Jul 23 17:17:20 2017 +0800

    test kotlin the last

commit a601445d04d0935f6a80a5052f1b4c6c3ee514d2
Author: wing328 <wing328hk@gmail.com>
Date:   Sun Jul 23 16:56:40 2017 +0800

    add test for kotlin client
2017-07-23 18:25:36 +08:00
wing328
188e998683 add petstore samples for typescript aurelia 2017-07-23 15:52:02 +08:00
wing328
b54bd0581a update ts fetch petstore samples 2017-07-23 02:24:18 +08:00
roberterdin
e710405778 [TypeScript Fetch] Optional URL query parameters not sent anymore (#6032)
* [TypeScript Fetch] Optional URL query parameters not sent anymore
This prevents empty URL parameters from being sent, e.g. http://some-api/endpoint?param=SOMETHING?v= will now be http://some-api/endpoint?param=SOMETHING.
Solution suggested by @TiFu. Fixes #6003.

* Fixed indentation

* fixed missing semicolon
2017-07-23 02:12:41 +08:00
wing328
6c922fdae1 Squashed commit of the following:
commit b33232e52b9642e9edf724429dc99afe39d9df07
Merge: e3a1e30 3e76185
Author: wing328 <wing328hk@gmail.com>
Date:   Sun Jul 23 01:38:09 2017 +0800

    Merge branch 'add-petstore-support-typescript-jquery' of https://github.com/StingrayDigital/swagger-codegen into StingrayDigital-add-petstore-support-typescript-jquery

commit 3e76185d906d8b53cc3e7a198546b9e111a0cca4
Author: Jean-François Côté <jcote@stingray.com>
Date:   Thu Jul 20 13:50:01 2017 -0400

    Add working npm generator.

commit 5c27df7c4822fed10ddb81b8a35f60ca40b60914
Author: Jean-François Côté <jcote@stingray.com>
Date:   Fri Jul 7 14:39:39 2017 -0400

    Fix suggested by @wing328 's review

commit 41da37b3576a82ad6056434d36e9d579ef495492
Author: Jean-François Côté <jcote@stingray.com>
Date:   Wed Jul 5 15:47:40 2017 -0400

    Add petstore integration and updated sample
2017-07-23 01:39:36 +08:00
wing328
e3a1e308c4 update smaples, skip ts angular test. 2017-07-22 17:27:10 +08:00
Vladimir Pouzanov
1f133e8ecd [New Generator] Rust API client generator (#6092)
* Added rust client example

* Added a proper apiclient / configuration based example
2017-07-21 21:58:31 +08:00
Alessandro
faa62ee40c Swift3 code enhancements (#6034)
* Improve generated code in APIs so to use the most of Swift SDK
Improve generated code in APIHelper so to remove duplicated code and reuse existing checks

* run ./bin/swift3-petstore.sh

* Run ./bin/swift3-petstore-all.sh to update all the Petstore samples

* Restore old implementation and fix using .isEmpty in place of .count

* Run scripts to update pet store samples

* Reverte changes that use reduce

* Bug fixes on APIHelper template
2017-07-21 21:43:21 +08:00
ehyche
2be2ee080b Fixes for swift4 language (#6116)
* Fix build error in Xcode 9 beta 3, as .compact is no longer defined

* Add test schema for Swift 4 and associated script and config files

* Add test app for swift4Test.json schema

* Make integer, Integer, int, and Int32 types map to Swift Int type instead of Int32 type

* Add CodingKeys to model template, which allows us to serialize/deserialize variable names that are different than property names

* Make updates to Swift 4 test schema

* Fixes for unit test app for swift4Test.json Swift 4 test schema
2017-07-20 15:45:09 +08:00
David Pasztor
1fd5e79180 run ./bin/swift3-petstore-all.sh 2017-07-19 15:27:14 +01:00
David Pasztor
fa555cf452 shell script ran under /bin/swift3-petstore.sh 2017-07-18 17:20:42 +01:00
Greg Huang
dafefc06f1 fix issue #6029 (#6033) 2017-07-18 14:16:35 +08:00
Alex Nolasco
93415af92d [Objc] Class not identified due to Circular imports (#6069)
* [Objc] Class not identified due to Circular imports

* Pet store generated sample
2017-07-17 17:14:05 +08:00
Réda Housni Alaoui
a2d19a1feb Bugfix: Generated typescript-angular code fails to compile when models.ts file is empty (#6076)
* Fixed

* Fixed
2017-07-17 16:37:37 +08:00
wing328
a04dfe0ccc update ts angular2 petstore samples 2017-07-17 16:15:28 +08:00
wing328
11d9cbd597 Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-16 16:10:08 +08:00
wing328
34e94fbed0 Updated versions for 2.2.3 release and other minor enhancements (#6070)
* update pom to prepare 2.2.3 release

* add header support to qt5, update samples

* update version in java help

* update to xcode 9

* rollback to xcode8.2
2017-07-16 01:03:40 +08:00
wing328
d9ed238ccc update ts fetch samples 2017-07-15 03:04:40 +08:00
wing328
c1825b417c use html-escaped description for C# (client, server), Java server (#6061) 2017-07-14 23:36:24 +08:00
Lars Wander
9c56bb63d8 [Java] Escape descriptions in javadocs (#6040)
The [java8 doclint](http://openjdk.java.net/jeps/172) rejects unescaped
HTML chars such as `<`, making some generated clients unbuildable with
java8. Seems a few property descriptions were using the `{{{` instead
of `{{` preventing those HTML chars from being escaped properly.
2017-07-14 22:07:19 +08:00
wing328
fd87359a1b update c# petstore sample to remove pattern check for byte array 2017-07-14 16:17:00 +08:00
wing328
921e4a779e update c# petstore samples 2017-07-14 15:49:03 +08:00
wing328
bd1ab72776 update c# petstore samples 2017-07-14 13:17:56 +08:00
wing328
523e42160e Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-14 13:11:47 +08:00
wing328
ba704e3ac8 add @summary tag to ts client (#6052) 2017-07-14 13:10:36 +08:00
wing328
094dbd00ed Merge remote-tracking branch 'origin/master' into 2.3.0 2017-07-13 23:35:22 +08:00