Commit Graph

7138 Commits

Author SHA1 Message Date
Akihito Nakano
7674d11d75 Fix missing RequestBody.required of inline request body (#1847)
* Add test case that reproduce the issue #1782

* Fix missing RequestBody.required

* Update samples

./bin/utils/ensure-up-to-date

* Run ensure-up-to-date script

./bin/utils/ensure-up-to-date
2019-01-14 12:28:21 +08:00
William Cheng
470fc2065d
better NPE handling for undefined request body (#1896) 2019-01-13 12:25:35 +08:00
Jyhess
80ca67cfda Python AIOHTTP server generator (#1470)
* Astract factory for generators based on connexion

* Add aiohttp server generator

* Fix flask tests

* Normalize python-flask folder names
2019-01-11 23:35:21 +08:00
Akihito Nakano
4652023b7c Fix a problem that points to a folder that doesn't exist (#1863)
* Add test case that reproduce issues

* Fix a problem that points to a folder that doesn't exist

* Improves for windows

* Run ensure-up-to-date script

./bin/utils/ensure-up-to-date
2019-01-11 19:16:45 +08:00
Jacob Floyd
00a9cfdbc9 Python: Update api_doc_example for multiple auth (#1870)
APIs may more than one auth method (for example both an app key and basic auth).
This changes the example to only initialize the config option once instead of once per auth method.
2019-01-11 19:15:03 +08:00
Jim Schubert
4fa926604f [gradle] Add 4 boolean properties supported by codegenConfigurator (#1881)
* [gradle] Add 4 boolean properties supported by codegenConfigurator

* [gradle] Add Windows workaround for Android Studio

After release 3.0.0, a guava dependency was updated and this exposed an
issue in Windows where Guava's CharMatcher.ASCII is called to validate a
path. The version of Guava referenced by OpenAPI Generator causes a
'NoSuchField' error because the referenced dependency names this static
field CharMatcher.Ascii.

This error is not surfaced on macOS, and appears to be Windows-specific.

This adds a potential workaround to the Gradle plugin's readme.

See #1818 for more details.
2019-01-11 19:14:05 +08:00
Jérémie Bresson
8305df6b4a [java-client][okhttp-gson] no oauth2 usage when hasOAuthMethods is false (#1872)
* Fix Javadoc error

* [java-client][okhttp-gson] no oauth2 usage when hasOAuthMethods is false
2019-01-10 22:00:45 +08:00
Sebastian Rühl
faf1f5d81d [BUG-1848] Remove redundant right parenthesis (#1864) 2019-01-10 02:33:16 +08:00
Jérémie Bresson
d584833781 Support for "x-enum-descriptions" (#1752) 2019-01-10 00:47:55 +08:00
sunn
3b7f4c3879 Fix typo in template (#1859) 2019-01-09 16:13:10 +08:00
Hemant Zope
87d5484f2e add isModel to updatebooleanflagwithcodegenproperty (#1844) 2019-01-09 11:22:51 +08:00
Justin Black
539ec23298 [python-client] Add model default values (#1776)
* Adds two models to the v2.0 spec, uses examples as defaults in python client

* Adds array default and type_holder_default and type_holder_example tests

* Re-generated python security client with ./bin/security/python-petstore.sh

* Changes comment text, rebased master

* Updates client + server samples

* Adds missing samples updates

* Changes python client to look for true or false with booleans in toDefaultValue

* Changes boolean casting to use Boolean.valueOf

* Adds deserialization fix for python tests

* Changes Mock to namedtuple in python deserialization tests

* Actually remove unittest.mock
2019-01-09 11:18:35 +08:00
Daisuke Shimada
189849319c fix: force to decode as utf-8 when header contains application/json to avoid text garbling. (#1700)
* fix: force to decode as utf-8 when header contains application/json to avoid text garbling.

The original processing is using `response.body` to deserialize as json.
However, this is decoded by latin1 if the header contains only "application/json" instead of "application/json; charset=utf-8".

Because of this behavior, if the response body is encoded UTF-8 but the headers doesn't contain charset, the body will garbling.

cf: https://github.com/dart-lang/http/issues/175

Since playframework 2.6 returns "Content-Type: application/json" without "charset=utf-8", I changed this parsing algolithm.

* fix: force to decode as utf-8 when header contains application/json to avoid text garbling on error.
2019-01-09 11:08:35 +08:00
William Cheng
60dd3d51be
Better support for composed schema (allOf) (#1842)
* better support for composed schema

* remove commented code
2019-01-09 10:50:02 +08:00
Adrian Price
4c14c85542 Add additional properties to Java CodegenModel (#1854)
Fixes the first part of https://github.com/OpenAPITools/openapi-generator/pull/1729#issuecomment-451991109 (see https://github.com/OpenAPITools/openapi-generator/pull/1729#issuecomment-449937728). The second part was fixed by https://github.com/OpenAPITools/openapi-generator/pull/1845 (commit d65dd763d814fba356a61abeae6dd1dbc4193fd2).
2019-01-09 10:49:43 +08:00
FallenRiteMonk
9331df791f Minor Angular type improvements (#1843)
Update api.service.mustache

update samples
2019-01-09 00:30:37 +08:00
d3v-cl
9ccf872290 [DART] fix: set fields to null if json value is null. (#1798)
* fix: set fields to null if json value is null.

* rebuild dart2 petstore

* rebuild dart petstore

* rebuild petstore

* [DART]fix: set fields to null if json value is null.
2019-01-09 00:26:46 +08:00
William Cheng
293066bb0d
add options to maven plugin (#1845) 2019-01-08 21:32:51 +08:00
William Cheng
fbf570e7bd
fix unqiue name in handling forward slash (#1839) 2019-01-08 07:51:25 +08:00
William Cheng
ed5bd5ffb0
better handle of oauth (#1838) 2019-01-08 07:51:02 +08:00
Hemant Zope
233ce093e5 [C] Support for authentication methods (#1628)
* added auth support in apiClient

* added httperror response in detail

* added apikey to apiClient create

* remove unnecessary print statements

* remove freeing of apiclient object from apiclient_free function

* added auth params to apiClient_free function

* free only received data and apiClient object to be freed by user
2019-01-07 23:31:42 +08:00
William Cheng
b7971e2e3d better error message when parameter ref not defined (#1837) 2019-01-08 00:29:13 +09:00
Akihito Nakano
6e4556772c Delete langs command (#1836)
* Delete langs command

* Delete "langs" from docker entrypoint script

* langs -> list

* langs -> list
2019-01-07 08:57:05 -05:00
William Cheng
60776b8cb5
deprecated initialCaps (#1821) 2019-01-07 17:47:07 +08:00
sredbull
eff0c5e8d0 Added proper error response (#1814) 2019-01-07 12:19:50 +08:00
sredbull
1189362466 [JavaScript] Added plugins variable for the javascript/ES6 client (#1797)
* Added plugins variable for the javascript/ES6 client

* Ran the javascript and javascript-es6 shell script
2019-01-07 12:18:03 +08:00
William Cheng
f0f214743e
Use JS ES6 as the default (#1825)
* set JS ES6 as the default

* update doc
2019-01-07 11:43:11 +08:00
sunn
651395d426
Update base class due to failed compilation in case of plain object type with no properties or additionalProperties specified (#1826) 2019-01-06 18:20:23 +01:00
sunn
fda35ea263
Fix missing const keyword in array and maps (#1828) 2019-01-06 18:19:08 +01:00
sunn
c65ef987af
Emit worker also in response signal (#1829) 2019-01-06 18:18:20 +01:00
William Cheng
b015ac9307
use 4-space instead of tab in perl templates (#1830) 2019-01-07 00:22:24 +08:00
Akihito Nakano
bdf32775fb
Add test cases for ExampleGenerator (#1802)
* Add test case : generateFromResponseSchemaWithArrayOfModel

* Add test case : generateFromResponseSchemaWithArrayOfPrimitiveTypes

* Add test case : generateFromResponseSchemaWithModel

* Add test case : generateFromResponseSchemaWithNoExample

* Use String.format for windows

* Specify locale to prevent issues due to locale
2019-01-06 13:27:27 +09:00
William Cheng
1a2deb016b
Fix security issue with dependencies (#1820)
* fix security issue with dependency

* update samples

* update pom and sample
2019-01-05 23:30:59 +08:00
William Cheng
8f561f1ef3
[C#][Refactor] Fix nullable required property in the constructor (#1819)
* add serialization test, fix nulllable reuqired

* remove vs folder
2019-01-05 18:54:29 +08:00
Marco
b931da2909 [java][webclient] Register Jackson modules on ObjectMapper (#911)
* [java][webclient] register jackson modules on object mapper

* Regenerate client

* Removed findAndRegisterModules() call

* ObjectMapper is initialized only if NOT provided by client

* Remove (now) useless DateFormat inside buildWebClient signature and regenerate client
2019-01-05 18:29:49 +08:00
Yuriy Belenko
fa9bd1f567 [Slim] Add ApiKey and OAuth authentication middleware (#1207)
* [Slim] Add fork of token middleware

This commit will be dropped, when official repo approves submitted PRs.
Right now it's for test purposes only.

* [Slim] Adds token middleware to template

* [Slim] Move auth implementation to external classes

* [Slim] Update readme

* [Slim] Add config example

* [Slim] Remove deprecated package

Considered to use dyorg/slim-token-authentication for all authentication
schemes. User needs to decode and parse Basic token himself, but it's
pretty simple task and there are many code examples in
the web. Most of time solution is two lines of code.

* [Slim] Format phpdoc comments

I've changed PHP version to 7 and updated comments to follow  main
recommendations. Used PHPCodesniffer rules are Generic.Commenting,
Squiz.Commenting, PEAR.Commenting. Of course I applied only reasonable
sniffs from this standards.

@category tag has been deleted as deprecated accordingly to
phpDocumentor offical docs.

Ref: http://docs.phpdoc.org/references/phpdoc/tags/category.html

* [Slim] Refresh samples
2019-01-05 11:32:23 +09:00
William Cheng
d35f4b08d9
Fix various typos in the templates (Ruby, C#) (#1803)
* Fix typos

* update petstore samples
2019-01-05 09:39:10 +08:00
William Cheng
ad5184efc1
Add process utils class to add index to properties (#1796)
* add process utils to add index to properties

* fix javadoc warning
2019-01-03 16:06:22 +08:00
Jim Schubert
8fd474d4a7 [gradle-plugin] Fix test, ensure tests run in CI (#1789)
* Update GenerateTaskDslTest to remove "Pets" array model which is no longer generated
* Ensure check on uploadArchives task
2019-01-02 17:15:01 +08:00
Akihito Nakano
af6757ccde Refactor InlineModelResolver (#1788)
* Extract a method "flattenPaths" to reduce the scope of method

* Tweak

* Rename parameter name

* Extract a method "flattenModels" to reduce the scope of method

* Rename parameter name

* Rename: models -> components

* Delete comment

* Extract a method "flattenRequestBody" to reduce the scope of method

* Extract a method "flattenParameters" to reduce the scope of method

* Extract a method "flattenResponses" to reduce the scope of method

* Tweak types

* Reduce indentation
2019-01-02 17:14:34 +08:00
Akihito Nakano
9334dd391a
Improve test codes of InlineModelResolver (#1787)
* Delete unnecessary "throws"

* Delete unnecessary cast expressions

* Tweak redundant assertions

* Delete unnecessary comment
2019-01-01 13:14:23 +09:00
Akihito Nakano
d6fa9e60c6
Add test case for InlineModelResolver: arbitrary models (#1786)
* Add test case : arbitraryObjectModelInline

* Delete legacy test case : testArbitraryObjectModelInline

* Add test case : arbitraryObjectModelWithArrayInlineWithoutTitle

* Delete legacy test case : testArbitraryObjectModelWithArrayInlineWithoutTitle

* Add test case : arbitraryObjectModelWithArrayInlineWithTitle

* Delete legacy test case :
testArbitraryObjectModelWithArrayInlineWithTitle

* Add test case : emptyExampleOnStringTypeModels

* Delete legacy test case : testEmptyExampleOnStrinngTypeModels
2019-01-01 11:51:20 +09:00
Akihito Nakano
6abb9ddf30
Add test case for InlineModelResolver: arbitrary response (#1785)
* Add test case : arbitraryObjectResponse

* Delete legacy test case : testArbitraryObjectResponse

* Add test case : arbitraryObjectResponseArray

* Delete legacy test case : testArbitraryObjectResponseArray

* Add test case : arbitraryObjectResponseArrayInline

* Delete legacy test case : testArbitraryObjectResponseArrayInline

* Add test case : arbitraryObjectResponseWithAdditionalProperty

* Delete legacy test case : testArbitraryObjectResponseMapInline
2019-01-01 10:27:52 +09:00
Akihito Nakano
e559474880
Add test case for InlineModelResolver: arbitrary request body (#1784)
* Uncomment a valid test case

* Add test case : inline request body with title

* Delete legacy test case

* Delete unused import

* Delete legacy test case which is already implemented by other test

see InlineModelResolverTest#resolveInlineArrayResponseWithTitle()

* Delete legacy test case which is covered by other test

* Add test case : arbitraryObjectBodyParam

* Delete legacy test case : testArbitraryObjectBodyParam

* Add test case : arbitraryObjectRequestBodyProperty

* Delete legacy test case : testArbitraryObjectBodyParamInline

* Add test case : arbitraryRequestBodyArray

* Delete legacy test case : testArbitraryObjectBodyParamWithArray

* Add test case : arbitraryRequestBodyArrayProperty

* Delete legacy test case
2019-01-01 07:28:29 +09:00
Akihito Nakano
354db2f3e6 Fix: Inline models can't be generated (#1768)
* Add a test case

* Fix that the inline models couldn't be flatten when "components" doesn't exist

* Rename yaml file

* Rename method name
2018-12-31 17:00:28 +08:00
Akihito Nakano
f96e64bd9e Add test case for InlineModelResolver: inline object response with additionalProperties (#1781)
* Add test case : inline object response with additionalProperties

* Delete legacy test case
2018-12-31 14:36:30 +08:00
William Cheng
3ec90a86cb
Add an option to generate the alias (map, array) as model (#1729)
* add option to generate alias as model

* fix issue due to incorrect merge
2018-12-31 11:59:58 +08:00
William Cheng
2f6381cb19
Add nullable support to C# client (refactor) (#1775)
* add nullable support to c# client (refactor)

* clean up methods

* move typemapping to constructor
2018-12-31 10:44:02 +08:00
Akihito Nakano
5730f6224a Delete unused method (#1744)
* Delete unused method

* Delete unused property "typeMapping"

* Delete unused "import" declaration
2018-12-31 10:10:07 +08:00
Christophe Bornet
0fca90133c Use JsonNullable wrapper on nullable/x-nullable fields (#1762)
* Use JsonNullable wrapper on nullable/x-nullable fields

Fix #1250

* update samples
2018-12-31 10:04:26 +08:00
William Cheng
2c051f265c
Add an option to use reflection in equals, hashCode (Java client) (#1767)
* add option to use reflection in equals, hashcode (java)

* add model test template to java client only

* update pestore samples

* update java samples

* update doc

* update usage, remove unused file
2018-12-31 10:03:05 +08:00
Yuriy Belenko
e8ac630ca5 [Slim] Encode path to support non-latin characters (#1687)
* [Slim] Add encodePath method

* [Slim] Add tests for encodePath method

* [Slim] Use unescaped path in router

Both variables basePathWithoutHost and path are already urlEncoded in
codegen itself. Builtin html encoding in mustache is redundant. We can
use these raw codegen values with no fear.

* [Slim] Refresh samples
2018-12-31 10:02:45 +08:00
Erik Timmers
a0e5b74b2b [elm] Add support for sending headers (#1704) 2018-12-31 09:58:45 +08:00
Akihito Nakano
321416e960
Add test case for InlineModelResolver: inline array response (#1778)
* Add test case : inline array response

* Add test case : inline array response with title

* Delete legacy test cases
2018-12-30 17:53:36 +09:00
William Cheng
2e727f6dc7
fix group parameter logic (#1779) 2018-12-30 16:50:21 +08:00
Akihito Nakano
7cee999543
Add test case for InlineModelResolver: inline array request body (#1777)
* Add test case : inline array request body

* Delete legacy test case

* Tweak code format

* Delete unused import
2018-12-30 12:12:50 +09:00
Akihito Nakano
77b5cea518
Add test case for InlineModelResolver: inline array schema (#1772)
* Add test case

* Delete legacy test case

* Add a test case: inline array schema

* Delete legacy test case

* Fix test yaml
2018-12-30 10:32:02 +09:00
Akihito Nakano
6a4f3385d8 Fix type inference error (#1773)
* Fix type inference error

* Update samples

bin/openapi3/kotlin-client-petstore.sh
bin/kotlin-client-petstore.sh

* Update samples
2018-12-29 12:14:34 -05:00
William Cheng
e821a58fd1
skip default value for contaier in spring (#1725) 2018-12-29 18:50:10 +08:00
Yuriy Belenko
5400a7e445 [Slim] Add PHP CodeSniffer config template (#1764)
* [Slim] Add PHP_CodeSniffer config template

* [Slim] Update doc

* [Slim] Add local configs to gitignore

PHPUnit and PHP_CodeSniffer provides the same developing pattern when
user overrides global config with local one. In local config he can
set environment variables. Official doc recommends to not commit local
config files.

* [Slim] Remove phpcsStandard CLI option

Now user have full freedom to override config file. This option is not
used and not necessary anymore.

* [Slim] Refresh samples
2018-12-29 15:58:15 +09:00
William Cheng
1db105b6f9
Use CompareNetObject for object comparison in C# client (refactor) (#1765)
* add pet, array of array test, use CompareNetObject for comparision

* add an option, should trigger ci failure

* update doc

* use useCompareNetObjects in csharp-refactor petstore

* fix project template
2018-12-29 14:45:49 +08:00
Akihito Nakano
06a67ce6e4
Add test case for InlineModelResolver (#1771)
* Add a test case of resolving inline request body

* Delete legacy test case

* Add a test case of resolve inline request body with required

* Delete legacy test case
2018-12-29 14:38:46 +09:00
Christophe Bornet
5952bec6bf Add online gen tests (#1759) 2018-12-28 14:18:43 +08:00
Akihito Nakano
5f2d79b669 Resolve inline models before preprocess (#1761) 2018-12-28 11:13:30 +08:00
William Cheng
177deb918a
better handling of allOf (composition) (#1757) 2018-12-27 16:01:18 +08:00
Akihito Nakano
5d98fc6beb
Fix UUID support (#1746)
* Add custom type adapter to deserialize UUID

* Update samples

./bin/kotlin-client-threetenbp.sh
./bin/kotlin-client-string.sh
./bin/kotlin-client-petstore.sh
2018-12-27 08:59:57 +09:00
Daiki Matsudate
292d987f15 Use appInfo.version for podspec (#1760) 2018-12-27 00:19:29 +08:00
Daiki Matsudate
c2273a651a [Swift 4] Add createURLRequest method (#1727)
* add create URL Request method

* add comment
2018-12-27 00:19:11 +08:00
William Cheng
902a4b4099
remove self-reference import (#1758) 2018-12-26 18:11:26 +08:00
Daiki Matsudate
c13e089c85 [swift4] Use RequestBuilder directly for RxSwift and PromiseKit (#1718)
* remove default implementation

* avoid insert blank lines
2018-12-26 18:01:26 +08:00
William Cheng
c62a1f11ee
maven dep version update (#1754) 2018-12-26 10:53:53 +08:00
Akihito Nakano
aa1cfd81fe Minor fixes for InlineModelResolver (#1756)
* Delete unused methods

* Improve access modifiers declaration

* InlineModelResolver#flatten can be package-private

* Delete unused import declaration

* Sort properties
2018-12-26 10:53:39 +08:00
William Cheng
e4f80dcc0e
various fix for free-form object (#1751) 2018-12-26 10:38:07 +08:00
William Cheng
120c0a05f0
Restore Ruby tests after parser update (#1753)
* uncomment ruby test after parser update

* remove comment
2018-12-26 10:36:58 +08:00
zigen
7595baef00 Fix composed oneof type 1749 (#1750)
* add test to check that DefaultCodegen generates composed oneof schema properly

* fix composed-oneof type generation bug (#1749)
2018-12-24 17:46:42 +08:00
William Cheng
0dee995ebb
Fix discriminator name not following variable naming convention (#1742)
* fix discrimintator name not following variable naming convention

* fix test

* update samples

* use discriminator name directly in php

* single quote array index
2018-12-24 10:17:43 +08:00
tanmen
aed2c882da add nullable support to typescript-axios (#1743) 2018-12-24 00:59:13 +08:00
Jim Schubert
92badd8d49 [kotlin-spring] Allow DateTime to be remapped to others (LocalDateTIme) (#1740) 2018-12-24 00:34:47 +08:00
Yuriy Belenko
72dcee9d86 [Slim] Abstract API controllers (#1483)
* [Slim] Add abstract prefix to API controllers

* [Slim] Add userClassname property to codegen

* [Slim] Add src folder to Composer autoload

* [Slim] Change template to produce abstract controllers

* [Slim] Update API tests template

* [Slim] Add implementation note

* [Slim] Remove deprecated AbstractApiController

* [Slim] Refresh samples
2018-12-23 23:51:26 +08:00
Akihito Nakano
f1831533d4 [Java] Update dependencies (#1735)
* Update retrofit2

refs:
https://nvd.nist.gov/vuln/detail/CVE-2018-1000850
https://nvd.nist.gov/vuln/detail/CVE-2018-1000844

* Update samples

./bin/java-petstore-all.sh

* Implement okhttp3.Call#timeout

refs https://github.com/square/okhttp/pull/4363

* Update samples

./bin/java-petstore-all.sh

* Update Play26CallFactory

* Fix indent
2018-12-23 19:03:50 +08:00
Akihito Nakano
05107032d1
Fix missing closing parenthesis (#1739)
* Add a script to generate kotlin client samples from OAS3

* Generate kotlin client

* Fix missing closing parenthesis

* Update samples

* Add build folder to gitignore
2018-12-23 09:54:51 +09:00
William Cheng
667275fb25
Fix C# client warnings (#1737)
* fix csharp warnings

* fix incorrect line break removal
2018-12-23 08:06:55 +08:00
Jérémie Bresson
a7dfc650b6 Swagger parser update: 2.0.8-OpenAPITools.org-1 (#1721)
* Update Swagger-Parser Version

* Update samples

* surpress javadoc warning

* fix TS tests

* Set version to 2.0.8-OpenAPITools.org-1
2018-12-22 18:12:08 +08:00
Steven Masala
43abd61144 Typescript nullable (#1730)
* fix name sanitation when using kebab case filenaming

* remove whitespaces

* nullable

* remove test comment
2018-12-22 16:49:44 +08:00
William Cheng
77edec0c65
Revert "[Rust] Support formParams and fix list-params." (#1732)
* Revert "Disable rust-reqwest petstore test"

This reverts commit 9e1cce2e7b.

* Revert "Fix various CI issues (#1722)"

This reverts commit 77270a0118.

* Revert "[Rust] Support formParams and fix list-params. (#1678)"

This reverts commit 4a494b45d3.
2018-12-22 16:28:55 +08:00
Marco Farrugia
4a494b45d3 [Rust] Support formParams and fix list-params. (#1678)
* [Rust] Support formParams and fix list-params.

Form params were previously unsupported, and list-params would produce code that didn't compile.

* update rust samples
2018-12-21 10:08:00 +08:00
Jim Schubert
10ecc0e52f [csharp-refactor] Minor csharp refactor changes (#1723)
* [csharp-refactor] Minor changes to JSON mime usage

🐎 This maeks the regex static to reduce GC overhead for active clients.
This also removes the lowercase call on the mimetype before evaluating,
as the regex already uses the inline modifier for case insensitivity.

* [csharp-refactor] Regenerate sample
2018-12-21 09:57:38 +08:00
Tomasz Prus
89a0ffa66c feat: [python/asyncio] use ssl argument instead of ssl_context (deprecated from aiohttp>=3.0.0) (#1724) 2018-12-21 09:52:27 +08:00
Jérémie Bresson
d38b9e588b
[core] support for 'x-enum-varnames' for enums in arrays (#1703) 2018-12-20 16:30:34 +01:00
William Cheng
b6e80e86b2
Add nullable support to JAXRS-CXF parameters (#1679)
* add nullable support to jaxrs cxf parameters

* remove end of file line break

* fix default value for list

* update samples
2018-12-20 16:07:45 +08:00
William Cheng
f188fa08e5
fix enum and map of neum (regression) (#1706) 2018-12-20 16:07:22 +08:00
William Cheng
93c13074ff
various fixes to csharp refactor client (#1711) 2018-12-20 16:06:29 +08:00
Daiki Matsudate
9ff8a24895 fix description (#1710) 2018-12-20 15:55:29 +08:00
gndrm
98ae7a816c Introduced GeneratorProperties as a thread-safe clone of System Properties (#1598)
* Introduced GeneratorProperties as a thread-safe clone of System Properties

* Removed unnecessary SmartBear copyright
2018-12-19 21:46:05 +08:00
William Cheng
81cf611aa4
add nullable support to perl api parameter (#1690) 2018-12-17 17:11:23 +08:00
William Cheng
d7d994620c
Add multiple inheritance support to Perl client (#1681)
* add multiple inheritance support to perl client

* remove allof test from fake petstore
2018-12-17 15:28:20 +08:00
William Cheng
b6a23986b3
fix java instantiated lists (#1683) 2018-12-17 14:42:04 +08:00
Joe Elliott
33fbd9c78b [Swift] Updates for Swift 4.2 (#1443)
* [Swift] Update Alamofire version and update tests and Swift version to 4.2 for default and RxSwift variants

* Update promiseKit for Swift 4.0

* Update project files.

* Merge branch 'master' of https://github.com/OpenAPITools/openapi-generator into OpenAPITools-master

# Conflicts:
#	samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj

* Merge in latest master

* Remove typo in bash file
2018-12-17 15:41:06 +09:00
Yuriy Belenko
3896821d5e [Slim] Add phplint cache to gitignore (#1686)
* [Slim] Add phplint cache to gitignore

* [Slim] Refresh samples
2018-12-17 14:21:39 +08:00
William Cheng
fb15a4baf3 [core] Update parser and core to latest version (#1569)
* Update swagger-parser to 2.0.7
* Update swagger-core to 2.0.6
2018-12-17 06:56:46 +01:00
William Cheng
c05dc24e6a
Mark swift3 generator as deprecated (#1675)
* mark swift3 as deprecated

* update windows batch scripts
2018-12-16 19:20:37 +08:00
David Cloutier
06150767f4 Proposed fix for issues #1654. fix isSerializable for java jaxrs-cxf (#1656)
* Update model.mustache

fix serializable import for cxf-cdi

* Update pojo.mustache

add implements to the pojo if isSerializable is true

* Update model.mustache

add import statement to fix compile issue when {{#serializableModel}} is true

* Update pojo.mustache

remove extra space to prevent unecessary diffs in petstore examples: diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/*
2018-12-15 17:04:45 +08:00
Dec12 | Fujigon
7609398150 Fix the bug header bean validation is not performed (#1661)
* update template

* update template

* update samples
2018-12-15 16:37:25 +08:00
meganemura
82fcde1d91 Improve model class of ruby-client (#1670)
* Add Model.build_from_hash

* Use Model.build_from_hash instead of Model.new.build_from_hash

* Update sample for ruby-client

* Update sample for openapi3 ruby-client
2018-12-15 16:24:03 +08:00
William Cheng
8c599ebf12
Add support for multiple inheritance (#1664)
* add all parent names

* clean up supportsInheritance

* fix npe

* fix allVars, fix test cases

* add more tests, remove comments

* update docker m2 cache dir, add more tests, fix mandatory

* update samples

* regenerate js spec files

* add logic to detect self reference

* add isSelfReference flag to codegen property

* add ruby tests for cat model

* remove debugging info

* fix JS allvars not have x-js-doctype

* update samples

* update js samples
2018-12-15 00:24:36 +08:00
William Cheng
587bd56655
add mavencentral to build.gradle (#1674) 2018-12-15 00:22:11 +08:00
Jim Schubert
1f95b54cef Include mavenCentral in java build.gradle (#1653)
the android dep is currently missing from jcenter. This adds
mavenCentral as an additional repository to the default java generator's
build.gradle.
2018-12-14 21:23:06 +08:00
ccozzolino
95c744381b [JAVA][Server] Fixed issue #1525: Fix model class field initializations (Regression since 3.3.1) (#1549)
* Fixed issue #1525. Adjust class field declarations with proper initializations.

* Adjusted templates to add default only when it is exists.
2018-12-13 01:11:47 +08:00
William Cheng
66cff2b05a
fix alias to free form object & map (#1638) 2018-12-10 22:46:41 +08:00
feihongmeilian
489c404783 Add instructions for erlang-server (#1643) 2018-12-10 17:45:19 +08:00
Denis Korenevskiy
a27224e50d [php] bugfix: Array and Map inner schema definition can be missing. (#1586) 2018-12-10 17:43:44 +08:00
Juan Facorro
87bc9d436f Introduce optional weight function for commands and other improvements (#1618)
* Generator erlang-proper

Used to generate PropEr generators for property-based testing

* Rearrange *_statem.erl functions and remove *_statem.hrl

* Optional weight function

* Optional argument to override generated values

* Export function with arity 1

* Move syntactic sugar to header file

* Only provide body when its allowed

* The weight function should not depend on the state
2018-12-10 11:41:12 +08:00
Akihito Nakano
f19794464b
Delete --lang option (#1592)
* Delete --lang option

* Fix -l

* Fix -l flag (windows)

* Add migration guide

* Change to -g

* Remove lang option

* Change to -g
2018-12-09 19:26:51 +09:00
Akihito Nakano
7e3e9dba11 Replace Class.newInstance() with Constructor.newInstance() (#1635) 2018-12-08 22:31:57 +08:00
John Bush
c4f0521e10 Fix escaped regex values in Python client (#1517). (#1539)
* Fix escaped regex values in Python client (#1517).

* Override PythonClientCodegen toRegularExpression() method to correct
  issue with backslashes being escaped. This issue was a result of
  calling escapeText() in the parent DefaultCodegen class.

* Only escape unescaped forward slashes in PythonClientCodegen.

* Override addRegularExpressionDelimiter in PythonClientCodegen.java
  such that only unescaped forward slashes in the pattern get escaped.
* Adds a new test resource .yaml file for specifically testing this
  issue.

* Check for regular expression modifiers in PythonClientCodegen.

* Adds check in postProcessPattern() in PythonClientCodegen.java to
  check if regular expression has modifiers defined. If so, it throws an
  exception as modifiers are not currently supported in the Python
  client.

* PythonClientCodegen warns that regex modifiers are not supported.

* Changes behavior in PythonClientCodegen.java to no longer throw an
  IllegalArgumentException in the case that a pattern contains
  modifiers. A warning message will be logged instead stating that
  modifiers are not currently supported by the codegen class.

* Remove warning for PythonClientCodegen regex modifier support.

* Removes warning message from PythonClientCodegen.java stating that
  regular expression modifiers are not currently supported. Further
  code review and testing revealed that this feature is already
  supported and working.

* Add updated Python client sample files.
2018-12-08 11:32:55 +08:00
Phil Adams
2d39f14882 Fix NPE in ModelUtils.isFreeFormObject() (#1625)
Fixes #1696

An object schema containing no properties that also has additionalProperties
set to an object schema with no properties will cause
ModelUtils.isFreeFormObject to throw an NPE.
This PR adds additional checking to avoid the NPE.
2018-12-07 23:16:58 +08:00
William Cheng
2f4bea6967
remove isNotContainer (#1629) 2018-12-07 23:10:35 +08:00
Tomek Cejner
922532da6a [core] Prevent NPE when enpoint did not define responses (#1617) 2018-12-07 11:57:16 +01:00
William Cheng
774013c7e1
Better OpenAPI spec v3 support: allOf, anyOf, oneOf (#1360)
* add oneOf support to Ruby

* add anyOf support to ruby client

* add discriminator support to ruby client

* fix typo

* update samples, fix NPE

* better format in ruby generator

* fix test cases, disable mapping test

* fix update script, update samples

* add test, fix mapping

* update exit code

* reenabled discriminator test

* remove duplicated properties

* add test for duplicated properties

* update samples, add new spec

* fix ruby test cases

* fix hasMore after removing duplicates

* refactor method, comment out haskell client test

* fix hasMore and update samples

* fix parent detection

* fix discriminator check

* [haskell-http-client] need to use {{vars}}{{required}} instead of {{requiredVars}}

* remove deprecated methods in default codegen (#1031)

* regenerate samples

* remove commented code
2018-12-07 00:30:20 +08:00
Erik Timmers
c0634ac213 [elm] Enable setting Http request trackers (#1609) 2018-12-06 23:41:44 +08:00
Jaumard
d40cbf9dbd add default timeout to calls (#1596)
add properties to send or not null values
update deps
2018-12-06 18:34:01 +08:00
William Cheng
d57009d14d Merge branch 'master' of https://github.com/OpenAPITools/openapi-generator 2018-12-06 17:22:19 +08:00
Atsushi Hanaoka
ced6e0502e [typescript] Avoid strictNullChecks errors for apiKeys (#1611)
* [typescript] Avoid strictNullChecks errors for apiKeys

fix #1607

* Run ./bin/{LANG}-petstore.sh

- ./bin/typescript-angular-petstore-all.sh
- ./bin/typescript-inversify-petstore.sh

* Run ./bin/security/{LANG}-petstore.sh

- ./bin/security/typescript-angular.sh
- ./bin/security/typescript-angular2.sh
- ./bin/security/typescript-inversify.sh

* [typescript] Fix parameter name sanitization

* Fix invalid consumes of petstore-security-test.yaml

* Run ./bin/security/typescript-*.sh
2018-12-06 17:10:45 +08:00
William Cheng
314b4cc54f
remove deprecated methods in default codegen (#1031) 2018-12-06 16:17:32 +08:00
William Cheng
21b2b20c2d Merge remote-tracking branch 'origin/4.0.x' 2018-12-06 12:21:14 +08:00
Prateek Malhotra
1e023f3b6e [Typescript][Fetch] Fix bugs with new typescript-fetch generator (#1545)
* [Typescript][Fetch] Always initialize queryParameters

* [Typescript][Fetch] Resolve date and date-time formats to parameter type Date

* [Typescript][Fetch] Update models template

- Add `readonly` modifier to readOnly parameters.
- Omit readOnly parameters from requests when serializing models
- Use allVars in models template when serializing/deserializing requests

* [Typescript][Fetch] Omit time component when parameter format: date

* [Typescript][Fetch] Add moduleResolution: node option to tsconfig.json

* [Typescript][Fetch] Added non-model enums
2018-12-06 12:20:34 +08:00
Hemant Zope
df19c13347 [C] Resolve some issues from #1473 (#1497)
* change folder structure for external and added list as primitive type

* modified gitignore for C generator

* change include statement as per directory structure

* added projectname variable for using in cmakelists

* modified cmakefile:compile files irrespective of testfiles and add support for make install

* updated readme with how to compile and how to use

* CMakeLists change curl to 7.58.0

* fix indentation

* add remove as reserved word
2018-12-06 11:39:30 +08:00
William Cheng
4be605bcb7
GraphQL Server (#1603)
* Add GraphQL express/apollo server generator

* add basic resolvers; adjust parameters/input types

* small adjustments and improvements

* adjust logger config for GraphQL generators

* remove MaxPermSize form bash script as it will be removed from later Java versions; add isNullable utility helper method; Adjust TODOs for graphql implementation

* re-created samples for graphql config and server generators

* re-added templates for graphql config generator

* add graphql-config-petstore bash script

* add isNullable utility method

* fix javadoc issues

* adjust licence headers

* rename Generator to Codegen for GraphQL classes

* renaming, minor enhancement to graphql generator

* add graphql server samples

* add windows batch files, rename directory
2018-12-05 18:20:53 +08:00
William Cheng
01ac429954
fix TS version check (#1616) 2018-12-05 18:06:55 +08:00
Philipp Kainz
10ea00066a [typescript-angular] Angular 7 compatibility of dependencies and package generator (#1613)
* added Angular v7 compatibility version support

* fix logic error

* updated petstore samples

* fixed failing tests and added Angular 7 client test app
2018-12-05 15:15:51 +08:00
Mark Thebridge
4930f75dc7 Generic JSON body support in rust-server (#1523)
* Ensure that generic JSON bodies are correctly autogenerated

Generates valid Rust for an arbitrary JSON response body of type `object` with no other schema.
2018-12-04 16:51:59 +00:00
William Cheng
8795bff35e Merge remote-tracking branch 'origin/4.0.x' 2018-12-04 23:26:52 +08:00
Fabrizio Ferrai
6976a8c775 Upgrade haskell-servant generator to latest LTS (#1469)
* [Haskell Servant] Upgrade to lts-12

- Upgrade Servant to the latest version
- Add Maybe for optional values
- Add UUID, UTCTime and Day types
- Fix the URL configuration so that it has one param with all data
- Add Data and ToSchema instances to models
- Switch to TLS http manager so it can connect to https urls
- Add nicer API to call the endpoints
- Add Nix support

* [Haskell Servant] Upgrade Petstore

* [Haskell Servant] Delete old swagger-petstore samples

* [Haskell Servant] Use generics for ToForm and FromForm instances

* [Haskell Servant] Generate ToSchema instance only if it's safe to do
2018-12-04 19:03:08 +08:00
Rubén Martínez
110d057384 [csharp] Fixed issue #1524: useDateTimeOffset not working in openapi generator 3.3.3 (#1544)
* Run ./bin/utils/ensure-up-to-date to re-generate samples run in the CI.

* Fixed issue #1524 that caused the `useDateTimeOffset` additional property for the `csharp` generator not to work.
2018-12-04 18:59:15 +08:00
Erik Timmers
d75392e056 [elm] Enable setting base path for each request (#1538) 2018-12-04 18:36:55 +08:00
Juan Eugenio Abadie
e84c59f4cc [cpp rest-sdk] Add status code to response handler (#1541)
* Add status code parameter to the response handler

* Update PetStore
2018-12-04 18:35:39 +08:00
Kiran-Sivakumar
0a33ad465f [Java][okhttp-gson] Fix bug when performing OAuth token retry (#1576)
* Fix access token retry bug

* Update petstore samples

* Remove newline

* Import Pair and List in RetryingOAuth template

* Update petstore samples

* Update petstore samples
2018-12-04 18:33:10 +08:00
Denis Korenevskiy
8ee1553654 Replace <tt> tags with <code> to make new jacadoc work. (#1585)
Replace <tt> tags with <code> to make new javadoc work.
2018-12-04 18:16:23 +08:00
Christophe Bornet
001f89f1d9 Add tests to online generator (#1591) 2018-12-04 18:14:50 +08:00
Rubén Martínez
e3ab059530 [csharp] Fix #1531 with non-nullable enums on operation parameters not compiling (#1543)
* Run ./bin/utils/ensure-up-to-date to re-generate samples run in the CI.

* Fixed issue #1531. Now in C# operation parameters are post-processed to correctly mark them as enumerations. The api.mustache C# template now marks parameters as nullable when they're non-required enums.

* #1531 Added fix for enum, non-required parameters to the interface of the auto-generated C# Apis.

* Fixed error with the development of ticket #1531, which duplicated nullable question marks for primitive types.
2018-12-03 17:28:08 +08:00
William Cheng
dfa7e616c0 Merge remote-tracking branch 'origin/master' into 4.0.x 2018-12-01 19:18:27 +08:00
William Cheng
2f4dc9a049
Prepare 3.3.4 release (#1583)
* update release version

* update doc for 3.3.4 release

* comment out stack installation due to error in travis
2018-12-01 01:00:06 +08:00
Christophe Bornet
54b5093381 Improve online gen resolution of host for the download link (#1580)
Fix #1517
2018-11-30 22:04:17 +08:00
William Cheng
cf2ddb8b8c
Fix header parameters display in the documentation (#1579)
* fix header parameters display in html

* fix cwiki header, remove test header parameter
2018-11-30 20:57:52 +08:00
William Cheng
8f8d3547f6
Update JS client dependency (#1578)
* update js dep

* fix missing comma

* remove unused test files in JS

* remove StringBooleanMap.spec.js

* remove StringBooleanMap.spec.js
2018-11-30 18:47:32 +08:00
William Cheng
b226f52d13 Merge remote-tracking branch 'origin' into 4.0.x 2018-11-30 10:16:16 +08:00
sunn
308515bbc1
[cpp-qt5] client response headers and validation of properties for client and server (#1508)
* Add validation of required properties
Add Header extraction for client
* Remove some todos
* Add Test for Store API
Improve some checks for serialization
2018-11-29 11:00:37 +01:00
Michael Ramstein
6930433def [elixir] Typespec - allow null on optional struct-attributes (#1514)
* Typespec - allow null on optional parameters

* Run Petstore for elixir

* considers 'nullable' in model template, fixes 'isRequired'
2018-11-29 15:58:32 +08:00
Akihito Nakano
f7c857cc39
[Spring] Add an option to return success code (#1197)
* Returns status code which defined at Response Object

* Tweak indent

Remove the spacer "{{#async}} ... {{/async}}" "{{^async}} ... {{/async}}"

* Update samples^

* Fix broken indentation

* Update samples

* Revert methodBody.mustache

* Revert "Fix broken indentation"
  * This reverts commit 95b6a00f8b1d92a65e0d4467b5c4f034a9579e43.
* Revert "Tweak indent"
  * This reverts commit ba2cedc89723ed480e8282c0a4e07ab2d3670262.
* Revert "Returns status code which defined at Response Object"
  * This reverts commit f676a89e230dde6741aa96d7b2e27e04b35dbf5a.

* Example contains status code

* Update samples

./bin/spring-all-pestore.sh

* Fix syntax error

* Update samples

* Run bin/utils/ensure-up-to-date

* Make the changes an option `returnSuccessCode`

* Run bin/spring-all-pestore.sh to update samples

* Run ./bin/utils/export_docs_generators.sh
2018-11-29 11:51:25 +09:00
Simas Abramovas
777bf1f3aa Kotlin collection type (#1564)
* Allow specifying type

* Add test

* Update docs

* Don't modify types if the default option is chosen
2018-11-29 10:33:55 +08:00
William Cheng
c63f58f1ef
[Elixir] fix ":body" handling (#1504)
* Fix swagger-api/swagger-codegen/issues/8138 swagger-api/swagger-codegen#8138

When JSON payload needs to be in the body (`"in": "body"`), it must not generate a multi-part body, but embed directly in HTTP body.

* update elixir samples

* update elixir client samples

* remove double quote
2018-11-28 21:35:50 +08:00
Kiran-Sivakumar
9df70798b3 [Java][okhttp-gson] Add option to employ builders for API requests (#1341)
* Generate APIs that use the builder pattern

* Add option to use builders for API requests

* Fix template spacing

* Add new sample-generation script and generated samples

* Update docs

* Add new sample-generation script for Windows

* Replace config option with vendor extension

* Remove useBuildersForApiRequests config option

* Remove builders sample-generation scripts

* Replace config option with vendor extension in api_test template

* Remove okhttp-gson-requestBuilders sample

* Rename x-builders-for-api-requests to x-group-parameters

* Add modified api_doc.mustache under okhttp-gson resources

* Add modified README.mustache under okhttp-gson resources

* Update petstore samples

* Fix FakeApiTest.java in petstore samples

* Add whitespace to rerun checks

* Remove whitespace to rerun tests

* Fix FakeApiTest.java in parcelable petstore sample

* Update versions in samples

* Update versions in samples
2018-11-28 17:53:36 +08:00
Akihito Nakano
3efe56752e Improve error message when the spec is not found (#1495)
* Improve error message when spec not found

* Add test yaml

* Fix invalid yaml file path

* Fix typo
2018-11-28 16:50:52 +08:00
rasmusfaber
d8dde6855f Use checksum to decided if input spec has changed. (#1502) 2018-11-28 16:43:00 +08:00
meganemura
ebf67e683c Fix regexp in ruby-client (#1521)
* Fix regexp in ruby-client

* Remove tests for unknown regexp patterns
2018-11-28 16:40:58 +08:00
feihongmeilian
5b4a19849e Upgrade the erlang-server dependency from cowboy1.x to cowboy2.x (#1364)
* Upgrade the erlang-server dependency from cowboy1.x to cowboy2.x

* Update erlang-server sample

* Fix a bug for erlang-server test
2018-11-28 11:50:08 +08:00
William Cheng
9b99b6b6bf
better hanlding of string type with different format (#1558) 2018-11-28 11:21:54 +08:00
Michael Ramstein
d31fa4f7c4 Typespec: Fixes issue with formated primitivs (#1534) 2018-11-27 21:34:54 +08:00
Michael Ramstein
247bd68880 Decodes list with primitvs (#1536) 2018-11-27 17:00:10 +08:00
Michael Ramstein
4eae430cca [elixir] Fixes BadMapError for header parameters (#1537)
* Adds :headers as expected param mapping

* Gen Petstore
2018-11-27 16:59:16 +08:00
Erik Timmers
172448fa28 Add support for UUIDs (#1516)
And fix naming for `decode` functions.
2018-11-27 13:47:06 +08:00
William Cheng
46a4ffe64c
Skip model generation if it's a top-level map or array (#1296)
* update samples

* remove string boolean map spec

* add logic to skip array alias being generated as model

* fix alias to array

* remove unused ruby files

* remove unused ruby (oas3) files

* unalias response schema

* fix NPE when no model defined

* fix ruby openapi3 script

* update samples

* add global openapi, schemas for unaliasing

* minor code cleanup/refactoring using globalSchemas

* Revert "minor code cleanup/refactoring using globalSchemas"

This reverts commit 20a2bbc6fc4267a0e0768dcf5f15d4194ce9647b.
2018-11-26 22:01:53 +08:00
Yuichi Okada
ce0253892c [PHP client] Fix README.md template for php (#1540)
* Fix README.md template for php

* update php openapi3 samples
2018-11-26 13:41:27 +08:00
Akihito Nakano
34abedeb8a
[PHP] Bump minimum required version to PHP7.1 (#1491)
* Bump minimum required version to PHP7.1

ref: http://php.net/supported-versions.php

* Bump phpunit

* Update [api|model]_test.mustache

* Update samples

bin/openapi3/php-petstore.sh

* Update namespace of PHPUnit ("tests" folder)

* `setExpectedException` is deleted in PHPUnit 7.4

* Update namespace of "Assert" class

* The attribute 'name' is required

* Add anotation to exclude the test from risky testcheck

* Update samples (samples/client/petstore/php)

* Apply updates to "test" in openapi2 folder (samples/client/petstore/php)

b3495ecbfe
15e00ae89d
2fc6917d13
0d016c00ed

* Install php7.1

* Switch to php7

* Update samples (security)

bin/security/php-petstore.sh
2018-11-26 08:59:22 +07:00
William Cheng
7db12aa4af Merge remote-tracking branch 'origin' into 4.0.x 2018-11-24 17:48:17 +08:00
William Cheng
bf2932d41c
fix array of enum class in JS (#1484) 2018-11-24 17:04:59 +08:00
William Cheng
f8ada391c4
Fix boolean value handling in HTTP request body (#1515)
* fix boolean http body handling

* fix typo in parameter name
2018-11-24 16:42:32 +08:00
Christian Schneider
0ba9278308 #1506 Bump Zone.js to remove warnings when using angular >=6. (#1522)
* 1506 allow zonejs 0.7.x and 0.8.x to support a wider range of angular versions

* #1506 Removed zone.js as peer since it comes with angular itself

* #1506 Removed zone.js as peer since it comes with angular itself
2018-11-24 16:42:09 +08:00
Erik Timmers
e91d6d735d
[elm] Add support for nested Lists & Dicts (#1528)
And rename Union Types to Custom Types and Aliases to Records.
2018-11-23 16:03:07 +01:00
Erik Timmers
5f1362daad
Update Elm for elm/http 2.0.0 (#1510) 2018-11-23 16:02:55 +01:00
Juan Eugenio Abadie
dd33434064 [cpp rest-sdk] Reponse headers handler (#1511)
* Add support to set a Response headers handler
* Update PetStore
* Fix missing names
* Update PetStore
2018-11-23 11:38:40 +01:00
William Cheng
cf04ba30db
Fix the function name starting with numbers (#1513)
* update elixir samples

* fix function name starting with numbers

* add new files
2018-11-23 17:32:51 +08:00
William Cheng
5aa1da7c2e
Add utility methods for free-form objects (isFreeFormObject) (#1338)
* add utility methods for models

* add isFreeFormObject tag

* add object mapping for elixir client

* minor fix to free form object check
2018-11-22 18:46:09 +08:00
Jon Schoning
9be5b99266 [haskell-http-client] fix typename generation bug for array params; update deps
- fix build for example-app + tests-integration in Samples (due to change in Category)

  - upgrade stack to 12.18

  - fix typename generation bug for array params
2018-11-20 18:38:07 -06:00
Alwin Garside
792f95eb09 [PHP] Use appDescription in composer.mustache (#1485)
* Use appDescription in composer.mustache

* Update petstore files

* More updated php petstore files

* Yet another updated php petstore file

* Use "{{{appDescription}}}" instead of "{{appDescription}}"
2018-11-20 10:30:14 +09:00
William Cheng
2b58f6737a
fix typo in java client docstring (#1494) 2018-11-19 21:14:03 +08:00
William Cheng
363b095721
better warning, default value (#1492) 2018-11-19 20:55:29 +08:00
William Cheng
f58bd6d839
fix NPE for scala gatling generator (#1479) 2018-11-19 11:06:16 +08:00
William Cheng
0e693cd9a8
Fix NPE with cpp-restsdk client generator (#1477)
* fix_cpprest_npe

* fix_code_format
2018-11-19 11:05:44 +08:00
William Cheng
65a86eee3b Merge remote-tracking branch 'origin/master' into 4.0.x 2018-11-18 18:54:29 +08:00
PLACE
334415dec2 Typescript fetch fork (#569)
* added my fork from https://github.com/Place1/swagger-codegen-typescript-browser

* ran bin/typescript-fetch-petstore-all.sh

* use FormData.append rather than .set for IE11 compat

* reverted change to licenseInfo.mustache

* reverted some comments

* added package.json and tsconfig.json back to the generator

* added support for blob (application/octet-stream) responses

* models and apis are now in folders

* added support for modelPropertyNaming based on the spec

* bug fix

* updated samples

* Restore pom.xml for typescript project

* Restore samples/client/petstore/typescript-fetch/tests/default/package.json
≈

* added support for response type Date conversion

* updated samples

* Rework pom in "samples.ci"

* Restore "samples/client/petstore/typescript-fetch/tests/default"

* updated configuration class to use property getters to allow clients to implement configuration values as getters

* added {{datatype}}ToJSON functions to handle serialization and naming conversions

* fixed missing import

* fixed compilation error. updated samples

* 1 character change to get CI to run again

* updated samples

* added support for array type request body

* updated tests

* support for optional request bodies

* updated models json converters to handle undefined inputs (to simplify usage in optional contexts like optional request bodies)

* updated samples

* updated tests

* changed to typescript version 2.4

* updated samples

* support for optional properties being null, undefined or omitted

* updated samples

* bug fix

* bug fix

* updated samples

* ran npm install in test project

* patch to get tests running

* added support for retrieving raw response. added support for binary request bodies. added support for blob data type for files/binary.
2018-11-18 13:24:24 +08:00
Ludovic Montel
7f8ff35245 fix #1272 Fix wrong PHP Symfony typehint (#1453)
A model with an array property used to have the wrong PHP typehint in
the setter: the array item object type instead of "array"
2018-11-18 12:38:44 +08:00
William Cheng
941b3ea015 fix NPE in the C# Nancy generator (#1478) 2018-11-17 10:11:14 -05:00
William Cheng
edc05df774
Add C client generator (#516)
* add c generator (1st commit)

* udpate c model template

* more fixes

* Add string replace function for C generator (#908)

* Add string replace function for C generator

* Fixed replacement for variable only

* Fixed problem for different datatypes of paramName

* store return value of modified path

* set str_replace variable to be same as original variable.

* [C] Fixed coding style issues

* add uncrustify support

* update petstore sampmles

* add Locale.ROOT

* added test-api-client.c to include test cases for strReplace function

* added header and body mustache and made changes to ClibcurlClientCodegen.java accordingly

* [C] renamed functions in apiKey.c.mustache according to apiKey.h.mustache

* [C] changes in import statement

* renamed apiKey.h to keyValuePair.h and made necessary changes in the codes

* changed apiKey.c according to keyValuePair.h

* fixed import statement in model

* added code for generating struct in model-header.mustache

* added typedef struct for model-headers

* updated sample/client/petstore/C

* fix locale

* [C] Function addition and modification of major structs (#1020)

* added readme file

* fixed parameters in api headers functions

* made changes to add readme file and typemapping of array to list

* fixed header import statement in apiheader files

* modified struct of model type in model header

* updated sample

* modified README file

* updated sample

* parse from json function added

* modified struct and create function

* added include for model

* modified parsefromjson function

* modified struct and create function for more datatypes

* added mapping for date-time and modified model import return statement

* modified function parameters

* modified include statement

* fix function in api body

* updated sample

* clean up files

* regenerate c petstore

* fix error message when setting uncrustify

* add version to uncrustify usage

* added uncrustify rules in  mustache (#1021)

* added uncrustify rules in  mustache

* updated sample

* updated same with crustify

* updated sample with uncrusitfy 0.67

* modified readme about uncrustify requirements

* fixed mistakes in readme mustache and sample readme

* fix file import, unformat c petstore

* fix import in test files

* fix model with complexType

* fix free string, format the code using uncrustify

* modified sample

* Modified sample to check

* return type issue figured,more to do to fix it

* minor fixes to make complete code compile

* Compiling sample code. Store has issue with map.

* comment out test file generation which is not req.

* commented operation name

* fixed various issues responsible for code not compiling

* test mustache temporary for testing

* updated sample add,del,getbyid works, formparam yet to do

* few minor changes and added fuction to add different header and content type in apiClient

* added code to upload image

* added function to test upload image

* fixes for fileupload and various other small things

* fixed issue due to xml produces

* updated sample:working sample add,del,find,uploading:tocheck ,

* added free functions for variable where memory is allocated

* rename imagecontainer struct to filestruct

* fix issues with if functions for all list types

* fixed issue with primitive return type in header file

* updated sample w/ free functions

* update c samples

* remove corrupted file

* update samples

* test cases for APIs

* added function to generate test cases from new mustache

* mustache files for manual written test cases

* added default content type to application/json

* fixed issue with primitive return type

* fixed issue with bool type

* added file apiKey.c

* updated sample tested

* update c environment variable (#1090)

* add mapping for map (#1103)

* minor update

* revert list paramter check to NULL

* modified return type for primitive(map - list_t)in mustache

* removed apiClient_free as it was two times

* updated sample

* fixed issue of path parameter when string less than parameter len

* fixed issue for form paramters upload

* added checks to avoid seg faults

* updated sample

* added check for null value in form parameter

* modified size of mallocs to dynamic

* updated sample

* Add C Petstore to Travis CI (#1136)

* setup CI for C petstore

* update bash script permission

* unit petapi test

* fixed memory leak in strReplace and apiClient Functions

* modified return value for status generation

* added enum defination and functions to convert and back from string

* added function for enum and made changes to free memory at necessary places

* added datatype handling for enum

* fixes regarding memory allocation and free

* updated mustache of test files

* updated sample

* renamed manually written test files

* manual test file for pet

* cleaned common api test file for time being

* renamed test files

* added renamed test files to build test bash

* added file null pointer check

* modified uncrusitfy rules

* minor update to c templates (#1161)

* [C] Fixed enum function declaration  (#1178)

* fixed enum function declaration in model headers

* fixed enum declaration in header files for sample

* disable curl verbose mode and add response code variable

* added response code variable in apiClient struct

* modified apiClient header and source file

* added response and removed commented code api-body mustache

* removed commented code from model-body mustache

* removed unnecessary print statements from test mustache

* updated sample

* fixed spaces issue

* Better format in C templates (#1224)

* better format in the c template

* minor format fix

* [C] changed base url from static to dynamic (#1225)

* changed basePath from static to dynamic

* removed unnecessary header declaration

* updated sample

* [C] added curl version check in CMakeList.txt (#1248)

* added curl version check in CMakeList.txt

* Updated README for latest curl version

* [C] Major changes to keyValuePair function (#1282)

* removed static declaration

* changed static declaration

* added difference for string and non string

* added more code for different function for string and non string

* fix issue with param name

* change value in keyPairValue to void

* fixed issue of difference in function name cases

* added support for non char parameters in api

* fix issue of map return data

* modified manual-StoreAPI map return data handling

* fix minor mistake

* added support for map and changed code to support value of keyvaluepair as char and other

* updated sample

* fixed api header declarations

* change map declaration in header

* resolved issues realted to map data handling

* fix minor issues

* add N at start if enum variable starts with number

* override toParamName method

* changed paramters to paramName from baseName

* change variables in apibody from baseName to paramName

* Skip test file generation (#1459)

* skip test file generation

* skip overwriting CMakeLists.txt
2018-11-17 01:32:18 +08:00
Benjamin Gill
32b8d7fee7
[rust-server] Always derive Debug (#1404)
* Add test for file response

* Always derive Debug

Now that we're using a byte array, we can guarantee that deriving Debug will always work
2018-11-16 12:28:05 +00:00
Shengpeng Liu
dc3a3dd15a Fix openapi_types generation error (#1256) 2018-11-15 21:38:45 +08:00
William Cheng
2bcf5b2263 Merge remote-tracking branch 'origin/3.4.x' into 4.0.x 2018-11-15 17:49:44 +08:00
William Cheng
a87a544bf5 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-11-15 17:11:01 +08:00
William Cheng
8d9542207a
Prepare 3.3.4 snapshot (#1450)
* change version to 3.3.4-snapshot

* updat readme

* update samples
2018-11-15 16:21:15 +08:00
James Addyman
653601bef2 Fix #1424 [SWIFT4] Date Encoding Issues (#1442)
Ensure the same date format string is used throughout the generated code (use the one set in Configuration.swift).

Ensure the same date formatter options are used when encoding dates as well as decoding dates. If a consumer has set their own date formatter on CodableHelper, use that when encoding dates too.

Adds DateFormatTests to the SWIFT4 unit tests.

Updates the SWIFT4 petstore samples
2018-11-15 11:20:39 +09:00
William Cheng
7564d629e7
prepare 3.3.3 release (#1447) 2018-11-14 23:56:58 +08:00
William Cheng
f647b2f24b
Add file post-processing to C++ client, server generators (#1440)
* add file post processing to cpp generators

* use clang to auto format cpp-restsdk code

* restore cpp-restsdk samples without clang format
2018-11-14 16:43:14 +08:00
William Cheng
0165b0fb33
test all generators with fake petstore spec 2.0, 3.0 (#1439) 2018-11-14 15:55:09 +08:00
Jim Schubert
df1819daa9 C# template refactor (#737)
* [csharp] Refactor to support third-party customization more easily

* [csharp] Regenerate OpenAPIClient sample

* create new csharp-refactor client gen

* update samples

* fix Locale.ROOT

* fix import

* remove outdated files, update samples
2018-11-14 14:41:42 +08:00
William Cheng
3c28946f1e
[Android] Fix compilation errors when there's no model defined (#1438)
* remove model import when there is no model

* fix android http client no model issu due to import
2018-11-14 14:02:05 +08:00
TNM Technologies
22902e72a1 fix(#1423): [JAVA] generating Map with jaxrs-reasteasy does not import (#1426)
* fix(#1423): [JAVA] generating Map with jaxrs-reasteasy does not import
the hashmap

https://github.com/OpenAPITools/openapi-generator/issues/1423

* fix(#1423): fix ensure-up-to-date issues for jaxrs-resteasy joda
samples

https://github.com/OpenAPITools/openapi-generator/issues/1423
2018-11-14 10:18:53 +08:00
William Cheng
efde4a8eb8
Fix issue with C# generator when the model name is "File" (#1428)
* fix get schema type in abstract c# class

* update c# petstore sample
2018-11-14 09:43:31 +08:00
Akihito Nakano
c8837ea414
Change entrypoint to docker-entrypoint.sh (#1413)
Run entrypoint script
2018-11-13 17:24:04 +09:00
William Cheng
7e3149e675
fix npe when paramName is null (#1416) 2018-11-12 22:06:58 +08:00
meganemura
9db62f459a Fix return_type parameter examples in ruby-client (#1399)
* Fix return_type parameter examples

* $ bin/openapi3/ruby-client-petstore.sh
2018-11-12 14:26:05 +08:00