5759 Commits

Author SHA1 Message Date
William Cheng
ba0d673eaa
fix NPE for enum (#5445) 2020-02-27 12:04:38 +08:00
Richard Whitehouse
ca9376fdbb
[Rust Server] Support RFC 7807 (#5407)
* Support RFC 7807 - Problem Details for HTTP APIs
* Add test for RFC 7807
* Update samples
2020-02-26 18:18:01 +00:00
Akihito Nakano
427adc74f2
[Ruby] Add error output (#5428)
* Add error output to the log so that we can make sure why the error occurred

* Fix forbidden method invocation using default charsets
2020-02-26 12:57:48 +09:00
Herve DARRITCHON
f6ef4fbec7
[kotlin][client] Add Jackson as serialization library (#5236)
* [kotlin][client] Add Jackson as serialization library

* [kotlin][client] Add kotlin-client-jackson.sh to kotlin-client-all.sh

* update kotlin client samples

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-02-25 23:41:09 +08:00
dwlabcube
ece48d0bbc
Removal of Encoding in the Query-Params in order to prevent double Encoding. (#5255)
This way letting WebClient do its Job in encoding the URL.
2020-02-25 18:10:40 +08:00
sunn
2d6311cbdc
Change the Model template (#5222) 2020-02-25 17:21:44 +08:00
William Cheng
54c2956461
[Erlang][Server] fix import for multiple API key auth (#5424)
* fix multi api key import in erlang server

* update samples

* better code format for cpp server generator
2020-02-25 16:43:01 +08:00
Sem Schilder
c0fcffdfe4
Add return types to getter and fluent setter (#5348)
* Add return types to getter and fluent setter

* Add build example output
2020-02-25 11:46:43 +08:00
Alexej
b05df5d3ef
[Java] Error generating java due to a default for a date #5086 (#5333)
* Fix OpenAPITools#5086 handling date examples in openapi 3.0

* Fix OpenAPITools#5086
created test for handling date value
renamed variable p to schema
created field birthday in test yaml

* Fix OpenAPITools#5086
reverted birthday, because breaking tests

* Fix OpenAPITools#5086
create String in ISO format for date default. That can be converted to LocalDate
fixed Test
2020-02-25 11:24:14 +08:00
Çağdaş
8f738a9b41
[erlang] Do not export function if not defined. (#5394)
Logic added to logic_handler.mustache so that it does not export authorize_api_key/3 when the function is not defined, leading to compilation error.
2020-02-25 10:45:16 +08:00
Alexander Weaver
04cad77caa
Add reserved word option to Pistache and Restbed generators (#5418)
* Add reserved word option to Pistache and Restbed generators

* Regenerate docs
2020-02-25 10:37:43 +08:00
Alexander Weaver
231ec6bcac
[BUG][C++] Avoid using plain underscore when escaping reserved words (#5269)
* Don't use plain underscore when escaping reserved words

* Regenerate petstore output

* Add CLI option for reserved word prefix

* Ensure CLI option isn't cleared in cpprest client codegen

* Regenerate docs
2020-02-24 21:24:43 +08:00
Åsmund Grammeltvedt
23e76f2a50
[typescript] Add ReadonlyArray to native types (#5399)
* [typescript] Add ReadonlyArray to native types

This allows mapping the array type to TypeScript's ReadonlyArray

* Update docs

* restart travis
2020-02-24 11:13:13 +01:00
Hector Jusforgues
2b1a64159d
kotlin-server: fix features' imports (#5404)
make the import conditional, and add a few that were missing

without this, setting `featureCORS` or `featureConditionalHeaders` to true produces invalid code
2020-02-23 17:44:50 -05:00
Jim Schubert
ef008549b3
[handlebars] Honor supporting files when applying bundles (#5364)
* [handlebars] Honor supporting files when applying bundles
2020-02-23 16:59:37 -05:00
Tomasz Prus
3f0c163f0c
[python] add method to set/get default configuration (#5315)
* [python] add method to set/get default configuration

* [python] change method name and fix handling api_key

* python: using modified deepcopy to set/get default configuration

* python: update samples

* python: update samples
2020-02-23 14:10:44 -06:00
Jim Schubert
e4823cf4e6
[go][java] Document new parameterized server support (#5380)
* [go][java] Document new parameterized server support

* [java] Regenerate samples
2020-02-22 20:06:38 -05:00
Richard Whitehouse
1b3094be87
[Rust Server] Add support for untyped properties and models (#5339)
* [Rust Server] Add support for untyped properties
* [Rust Server] Improve support for untyped data
* Update samples
2020-02-22 20:29:51 +00:00
Richard Whitehouse
71aef72bbd
[Rust Server] Support objects as query parameters (#5338)
- Support objects as query parameters
- Update samples
2020-02-22 18:25:57 +00:00
Richard Whitehouse
71f532072b
[Rust Server] Support header objects (#5337)
[Rust Server] Support header objects

Support operations with objects in the header
2020-02-22 15:55:26 +00:00
Sebastien Rosset
e08e05a2c7
[Python] add discard_unknown_keys parameter (#5362)
* add discard_unknown_key parameter

* add discard_unknown_key parameter

* add discard_unknown_key parameter

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* discard unknown keys in composed schema if configuration.discard_unknown_keys is set

* run sample scripts for python

* code reformatting

* execute script in bin directory

* improve unit tests for discarding properties
2020-02-21 16:51:24 -06:00
Hinrik Örn Sigurðsson
972ba18e6a
[PHP] Remove model prefix/suffix from inline enum var names (#4489)
* [PHP] Remove model prefix/suffix from inline enum var names

This resolves issue #4403.

On a model `Foo` with an inline enum `Bar` which has a possible string
value `baz`. we should generate a `FooDTO::BAR_BAZ` constant, not
`FooDTO::BAR_DTO_BAZ`.

* Empty commit for another CI run
2020-02-21 16:37:17 +09:00
Artem
78cc5dae6c
[PHP] Fix additionalProperties annotation in models. (#5318)
* Fix additionaVariables in php-symfony model

* Fix additionaVariables in php-symfony model (second try, tested)
2020-02-21 16:34:16 +09:00
Jiri Kuncar
222393123b
[go] Fix filenames with $GOOS and $GOARCH sufixes (#5283)
* [go] Fix filenames with $GOOS and $GOARCH sufixes

* Too early commit

* Use suffix instead of name
2020-02-21 09:30:11 +08:00
Slavek Kabrda
010dad209a
[go-experimental] Add model constructors to initialize non-container vars with defaults (#5175)
* [go-experimental] Add model constructors to initialize non-container vars with defaults

* Add docstring and extend model_doc to include the constructor

* Make variable names in constructor follow Go naming guidelines

* Provide 2 different constructurs as suggested + couple fixes to generate constructors right under all circumstances

* Fix defaults for enums

* Properly escape vars that have reserved names
2020-02-20 10:13:53 -05:00
LoveIsGrief
33483b2f20
Respect usenose for Python CI (#5376)
* python: Respect useNose option in generated CI templates

Travis and Gitlab CI now use nosetests or pytests depending on the "useNose" option that is passed.

* python: Update CI samples

They now respect the "useNose" option
2020-02-20 21:47:13 +08:00
topce
fa5beeecd0
typescript-angular: support angular 9 (#5370)
* fix code to support ng9
also render in tempate module with providers

* execute script .\bin\windows\typescript-angular-petstore-all.bat
and commit result

* re-generate samples

* remove whitespace, re-generate samples

* re-generate samples

* code cleanup

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2020-02-20 13:50:26 +01:00
jornhd
28f649a078
Issue 5306 support for client certificates (#5328)
* Issue #5306: Added support for client certificates for csharp-netcore

* Added missing windows petstore scripts

* Updated sample client

* Added missing openapi3 samples

* Added missing images causing openapi3 test projects to fail
2020-02-20 09:49:49 +08:00
William Cheng
056a3ec0f6
[K6] minor improvements (#5368)
* update readme

* minor improvement

* add windows batch file for k6

* update template to reference openapi-generator

* update samples

* update doc
2020-02-20 09:25:11 +08:00
William Cheng
b16e07cff4
add post processing to nodejs express server (#5369) 2020-02-20 00:30:08 +08:00
Igor Savin
734a35a45a
Update maven-javadoc-plugin for Java 11 support (#5361)
* Resolves `An error has occurred in Javadoc report generation: [ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module` error that happens when using Java 11

* Resolves `An error has occurred in Javadoc report generation: [ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module` error that happens when using Java 11

* Fix duplicate configuration entries

* Fix okhttp poms

* Remove letter that shouldn't be there
2020-02-20 00:28:21 +08:00
Jiri Kuncar
a09271e76d
[java] Support templated servers (#4998)
* [java] Support templated servers

* Deprecate old signature of invokeAPI method

* throw ArrayIndexOutOfBoundsException

* Update modules/openapi-generator/src/main/resources/Java/ServerConfiguration.mustache

* [java] Regenerate samples

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-02-19 09:27:45 -05:00
Mostafa Moradian
79caba8d84
[k6] OpenAPI code generator for k6 API load-testing tool (ES5.1+) (#5300)
* Add generator for converting OpenAPI spec to k6 script

* Fixed names and URL

* Add @wing328's proposed changes to fix the builds
2020-02-19 16:04:39 +08:00
Akihito Nakano
37556c2d96
Fix: "isAlias" of CodegenModel (#2758)
* Add test case to reproduce the issue

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

* Fix: an alias of "an alias of simple OAS type" has an incorrect property `isAlias: false`

* Use ModelUtils instead of referring the "type" value directly

* Delete an unnecessary condition

* Tweak: the order of conditions

* Fix wrong "isAlias" value on ComposedSchema
2020-02-19 14:54:54 +08:00
William Cheng
7882c614b9
update wording about title field (#5366) 2020-02-19 11:50:41 +08:00
Alexander Eggers
a7f2791783
[Kotlin][Client] Enum toString handling (#5327)
* Added toString to enum_class script

This toString avoids using the enum var name and uses the enum's value instead. This will fix cases when enum var name and value are quite different.

* Updated enum template

Co-Authored-By: Jim Schubert <james.schubert@gmail.com>

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-02-18 21:30:13 -05:00
Jim Schubert
db47b95fc9
[cli][core] Add support for dry-run and display (#5332)
* 👕🎨 Minor refactor DefaultGenerator

This cleans up some lint warnings and improve general code cleanliness
of DefaultGenerator.

Specifically:

* logger strings are now using the built-in log formatter rather than
  constructing new strings regardless of log level.
* Diamond operators are used where possible
* Some long-unused commented code has been removed
* Lambdas are used where possible
* Redundant operations are merged (HashMap constructor used rather than
  subsequent putAll on a collection, for example)

* [cli][core] Add support for dry-run and display

CLI now supports `--dry-run`, which will output a file change status
similar to git status --porcelain.

The user may also specify `--verbose` for a one-liner below each file
explaining why the change operation might take place.
2020-02-18 20:36:17 -05:00
Ermolay Romanov
1ec2c26053
[BUG][typescript-rxjs] Fix nully type coalescing in Configuration getters (#5329)
* [typescript-rxjs] fix coalescing in Configuration

- eliminate nully "" (empty string) value via conditional check
- use concrete "string" type in typeof check
    ("function" may be returned for Object types

* [typescript-rxjs] update petstore sample

* run petstore-all

- run the script for updating all petstores
   ./bin/typescript-rxjs-petstore-all.sh
2020-02-18 21:28:26 +01:00
Sai Giridhar P
4f7d45f603
[r] Handling CRAN feedback for example snippets (#5345)
* fix(r): Updating donttest to dontrun

* fix(r): Updating donttest to dontrun
2020-02-18 21:26:29 +08:00
Hui Yu
f9a040d1a7
[C-libcurl] Guard memory free for query parameters to avoid coredump (#5356)
* [C-libcurl] Guard memory free for query parameters to avoid coredump

* [C-libcurl] Guard memory free for query parameters to avoid coredump (2nd)
2020-02-18 21:19:11 +08:00
pallxk
15b8210e1f
[JavaScript] Avoid setting Content-Type header if body is not used (#5344) 2020-02-17 23:31:27 +08:00
LoveIsGrief
910ce9fa89
python: Add gitlab-ci.mustache (#5342)
* python: Add gitlab-ci.mustache

It does the same stuff as in the .travis.yml but just for Gitlab CI

#5340 - Python .gitlab-ci.yml

* python: Run all scripts in bin

find bin/ -type f -name 'python*.sh' -exec {} \;

Had to update all samples
2020-02-17 22:36:21 +08:00
Alexey Makhrov
acf85921e4
[typescript] Remove incomplete support of Date type (#5314)
* Remove DateTime mapping from concrete TypeScript generators that do not have full support for Date deserialization

* Fix model unit tests

* Regenerate samples
2020-02-17 07:52:50 +01:00
Sebastien Rosset
527c118210
[codegen] Improve java code comments and argument documentation; Fix issue with ComposedSchema that has undeclared properties (#5316)
* improve documentation

* Add use case of composed schema with additional properties
2020-02-16 20:23:00 -05:00
Bruno Coelho
ffb196151f
[kotlin][client] improve debug experience (#5286)
* [kotlin][client] remove null message on server error

* [kotlin][client] avoid breaking change

* [kotlin][client] add response to client and server exceptions

* [kotlin][client] improve message on ClientException and ServerException
2020-02-16 11:00:14 -05:00
Jim Schubert
dc50585401
[templates] Update templates vendor ext standards (#5295)
* [templates] Update to vendor extension standard keys

* Fix missed value in Java template, also implements=>x-implements. Evaluate Haskell Client changes

* Fix missing accept/content-type update for vendor extension format
2020-02-15 16:26:32 -05:00
William Cheng
118b5e7747
[C++] minor improvements (#5319)
* minor code format, make sure cpp samples updated

* add new files
2020-02-14 10:58:15 +01:00
Alexander Rashed
3f490ea7ee
typescript-angular: single request parameter documentation (#5308)
* Feature: Add JSDoc to request parameter interface members

* Add petstore after generation changes
2020-02-14 09:34:45 +01:00
William Cheng
edd7cab22a
[Java] mark Feign 10.x (instead of 9.x) as the default (#5310)
* set feign 10x as default, mark 9x as deprecated

* update doc
2020-02-14 13:58:44 +08:00
rtp
a50bb28e78
added implementation of declared function. (#5253) 2020-02-13 23:37:40 +01:00