12694 Commits

Author SHA1 Message Date
William Cheng
44ec0caba4
use originl value in comments (#7803) 2020-10-27 18:14:46 +08:00
William Cheng
042fc81f31
add anyOf support (#7801) 2020-10-27 17:02:05 +08:00
Julien Herr
5d27799bad
[typescript-axios] Fix multipart with file array (#7814)
* Force isCollectionFormatMulti in case of binary/file

* Manage multipartFormData in isCollectionFormatMulti

* Update petstore

Co-authored-by: Julien Herr <julien@nabu.io>
2020-10-27 08:58:08 +01:00
Francesco Montorsi
4860eb65e1
[cpp-restbed-server] make the restbed SERVER generator more extensible (#7679)
* Simple fix to allow users to override the Api class and set handlers

* fix definition order

* Regen petstore example files
2020-10-27 15:35:10 +08:00
William Cheng
3d6bd48b67
[JAX-RS] replace isListContainer with isArray (#7806)
* replace isListContainer with isArray

* update serviceFormParams.mustache
2020-10-26 12:38:01 +08:00
Dénes Harmath
1b67171d39
[javascript-flowtyped] Fix Flow error (#7382) (#7786)
* [javascript-flowtyped] Fix Flow error (#7382)

Fix deletion of search field

* [javascript-flowtyped] Regenerate sampe (#7382)
2020-10-26 10:28:33 +08:00
William Cheng
fe38a50365
[Ruby][faraday] fix response streaming (#7734)
* test file return

* fix stream response

* use options

* use local var

* fix nil tempfile

* fix tempfile

* fix tempfile

* use stream

* check content

* open temp file

* test ruby file download

* fix stream data

* test faraday

* catch connection error

* catch Faraday::ConnectionFailed

* catch all error

* use sream

* refactor

* fi download file in faraday

* local fix

* fi streaming download

* undo changess to spec, test

* undo changes to spec
2020-10-26 10:07:45 +08:00
Jon Schoning
37743c059b
[haskell-http-client] have applyOptionalParemeter (-&-) append values in headers or querystrings instead of replacing values (#7805) 2020-10-25 19:15:43 -05:00
Maksym Melnychok
b70edd7f1b
[python] Add option to return None instead of raising exception when accessing unset attribute (#7784)
* add option to return None instead of raising exception when accessing unset attribute

* update python samples

* reimplement getattr using getitem or get depending on attrNoneIfUnset

* move getattr and setattr to respective templates

* update docstrings, def get/setattr methods to have docstrings in them, use __dict__ to avoid recursion issues

* revert required_properties change

* add manual tests for .get method
2020-10-25 09:13:22 -07:00
William Cheng
07c23f4d1a comment out tests causing failure 2020-10-25 18:54:12 +08:00
itaru2622
3c62cc4867
Fix multi-part binary form parameters for jaxrs-jersey templates (#7363)
* Fix [jaxrs-jersey][java][jersey] multipart/form-data file array issue on generating jaxrs-jersey.

This commit aims to fix https://github.com/OpenAPITools/openapi-generator/issues/7330 with described solution 'choice C'.

* add test code [jaxrs-jersey][java][jersey] for multipart/form-data file on generating

* update test code [jaxrs-jersey][java][jersey] for multipart/form-data file on generating

followed latest master branch of OpenAPITools/openapi-generator

* update samples/* by executing ./bin/generate-samples.sh

* update mustaches for JavaJaxxRS/libraries/jersey1/* and samples/* to resolve failure of CI test on PR.
2020-10-25 18:05:43 +08:00
Aidan Hobson Sayers
c0e36b3ff6
Add impls for Error trait for Rust reqwest (#7462)
* Add impls for Error trait for Rust reqwest

* Update Rust samples
2020-10-25 18:00:50 +08:00
Rainer
e11a427cf5
changed request method from protected to public (#7603)
* changed request method from protected to public

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-10-25 17:54:21 +08:00
Dean Eastwood
3be89e4c00
Fixes #7791 (#7792) 2020-10-23 19:51:13 +08:00
Andreas Metsälä
490068ad90
[typescript-fetch] serialize complex type in multipart/form-data as JSON (#7658) (#7677)
Complex types need to be serialized as JSON to avoid FormData.append()
from converting them into strings through .toString(). The generated
ToJSON mapper is used in case the value name has underscores or other
unusual characters.

Signed-off-by: Andreas Metsälä <andreas.metsala@gmail.com>
2020-10-23 09:01:21 +02:00
BenICE
9af73d0a0c
[typescript-rxjs] Added support for servers (#7771)
* adding multiple servers support to typescript-rxjs

* regenerated typescript-rxjs samples

Co-authored-by: Schwartz, Benjamin <benjamin.schwartz@cgi.com>
2020-10-22 13:09:03 +02:00
Jim Schubert
a5aeb5fdec
[core] Remove java specific imports from DefaultCodegen (#7763) 2020-10-22 17:43:17 +08:00
William Cheng
50f3706c5c
Add gitignore to C# 2.0, Nancyfx generators (#7776)
* add gitignore to c# 2.0, nancyfx generators

* comment out csharp netstandard
2020-10-22 15:43:32 +08:00
cgensoul
aa28775295
Fixes #7757. Replace '.' characters by '_' in enum type names since OCaml doesn't allow to use '.' in any kind of identifiers. (#7767) 2020-10-22 15:35:00 +08:00
bullett445
8c084e2dc0
[php] Implement JsonSerializable in php Model class (#7768)
* Update model_generic.mustache

Implemented the JsonSerializable interface which allows to use json_encode() on the model object.
2020-10-22 10:34:15 +03:00
Jakesterwars
7e7bfc74de
[cwiki] Path parameter generation fix for split rows (#6894)
* fix: path parameter issues

* chore: run generate samples once again

Co-authored-by: Jacob Keith <jkeith@aegistg.com>
2020-10-22 11:25:25 +08:00
William Cheng
e09d1bee43
[Java][webclient] fix missing dependencies in build.gradle (#7777)
* fix build.gradle in java webclient

* update junit version in samples
2020-10-21 21:29:53 +08:00
William Cheng
ee3dd70636
chagne codegen type to schema (#7775) 2020-10-21 18:56:56 +08:00
Dalibor Karlović
240c046f35
Small tweaks for php generator, PHPStan level 3 (#7616) 2020-10-21 10:38:10 +03:00
William Cheng
ec74b06d2c
[Ruby] Replace DateTime with Time (#7656)
* replace DateTime with Time

* add require time

* update doc
2020-10-21 14:13:59 +08:00
William Cheng
b059b786a5
update c# gitignore (#7774) 2020-10-21 13:41:41 +08:00
Justin Black
28e92f9e32
Adds additionalProperties to core schema classes (#7761)
* Implements additionalProperties in CodegenParameter

* Implements additionalProperties in CodegenProperty

* Adds additionalProperties to CodegenModel

* Adds additionalProperties to CodegenResponse

* Adds additionalProperties examples for CodegenModel and CodegenProperty

* Adds test cases for CodegenParameter and CodegenResponse

* Adds testAdditionalPropertiesPresentInModelProperties

* Adds testAdditionalPropertiesPresentInResponses

* Adds underscore name for additionalProperties property, needed for CppTizenClientCodegen

* Changes prop name back to empty string, fixes CppTizenClientCodegen
2020-10-20 12:19:13 -07:00
William Cheng
19249e597c
[C#][netcore] Add custom converters for oneOf models (#7766)
* add custom converter for oneof models

* remove custom logic when deserializing oneof response
2020-10-20 23:10:31 +08:00
William Cheng
072b309100
[C#][netcore] Add nullable support to oneOf models (#7750)
* add nullable support to C# oneOf models

* fix null reference exception
2020-10-20 14:50:03 +08:00
Ghufran Zahidi
12acf2eb72
[C#][netcore]Fixed the HTTPSigning to calculate the body diegest without CamelCase (#7755)
* Fixed the HTTPSigning to calculate the body diegest without CamelCase

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-10-20 14:26:38 +08:00
Thibault Duperron
b1ea1ece87
[Ocaml] Fix missing space on models (#7742)
fix #7738
2020-10-20 13:32:12 +08:00
agilob
7318ff72d7
[Java][JVM] Move java specific import mappers to JVM specific code gen (#7569)
* Move java specific import mappers to java specific code gen

* Use JVM specific import mappers in kotlin, scala, groovy

* Update generators docs

* Add autogenerated files
2020-10-19 22:15:44 -04:00
William Cheng
d6c71ff0fb
[java][jersey2] add proxy support (#7752)
* add client config getter and setter

* update gradle, sbt config

* update client config

* update samples

* add code sample to set proxy
2020-10-20 10:11:01 +08:00
William Cheng
c1f2b1cad9
[c#][netcore] add proxy support (#7741)
* add proxy support to c# netcore client

* add test, update doc
2020-10-20 10:05:37 +08:00
Go Shibata
5bac98cd99
[kotlin][jvm-retrofit2] Update templates (#7592)
* Fix indent of return tag

* Trim trailing whitespace

* Update samples

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-10-19 21:55:49 -04:00
Alex Facciorusso
1dec9ebfb8
[kotlin][jvm-retrofit2] Better code for OkHttp client passed to Retrofit builder (#7556)
* Better code for building Retrofit

By removing the nullable `usedClient` passed to Retrofit, the code is compatible with newer Retrofit versions which don't allow null as client.

* Updated Kotlin retrofit2 samples ApiClient
2020-10-19 21:48:14 -04:00
William Cheng
b733312707
update doc to include proxy instruction (#7749) 2020-10-19 22:14:34 +08:00
William Cheng
e8ba2901df
auto load system web and net (#7748) 2020-10-19 13:55:43 +08:00
Justin Black
3d337db207
Unifies naming for isArray in Schema class properties (#7691)
* Updates key java files

* Adds all lingering isArray fixes

* Adds two files

* Reverts two cs files

* Fixes lingering isListContainer + isArrayModel references

* Some ensure up to date updates
2020-10-18 21:58:59 -07:00
Justin Black
2ee0913d4a
Changes lingering isMapContainer to isMap (#7747)
* Changes lingering isMapContainer to isMap

* Adds ensure up to date updates
2020-10-18 20:07:33 -07:00
Cody Mikol
fed9d0637a
CHORE[CORE]: replace deprecated methods (#7600)
replace setConfig and setOpenApi with the
non-deprecated config / openAPI methods

Co-authored-by: Peter Somogyvari <petermetz@users.noreply.github.com>
2020-10-18 21:56:43 -04:00
William Cheng
30fad9defa
[PS] Add proxy support (#7739)
* add proxy support to powershell

* update api_client

* add proxy tests

* fix check

* add more check

* update samples

* fix proxy setting

* update docstring
2020-10-19 09:30:23 +08:00
Jim Schubert
ee1cbf6f4b
[bug][maven] Fix custom windows classpaths in maven plugin (#7587)
* [maven] Fallback to templates using classpath rather than OS-specific paths

Previous checks would cause logic in Windows to return early, for
built-in templates only. This reorganizes and simplifies the ordering
behavior.

* Match classpath check in WorkflowSettings with that in TemplateManager

* [maven] Much needed unit/integration tests

This follows similar approach used in PMD and other plugins managed by
maven.

Unit tests simply verify we can load configuration as expected into the
Mojo.

Integration tests execute actual sample projects bound to the current
build's Maven plugin. This uses maven-invoker-plugin, which also allows
for specifying the maven options in invoker.properties to execute the test.
It also provides a verification framework using groovy files with the
required naming convention of "verify.groovy". This allows us to quickly
and easily check that certain files are outputted by generation, and we
may also spotcheck file contents.

templateResourcePath option is skipped on windows. I've tested back to
version 3.3.3 and this doesn't seem to have worked consistently with how
the property works on non-Windows.

* Set groovy 3.0.5 for test harness

* Print stacktrace on Maven error in Travis

* [maven] Set groovy version in tests to supported in Java 11+

* Puts maven integration tests in separate profile called 'integration'
2020-10-18 12:05:56 -04:00
Ben Sorohan
34d2e25899
[Typescript][Angular] Fix generated README when using apiModulePrefix (#7725) 2020-10-16 17:15:47 +02:00
William Cheng
c387d58d26
remove outdated scala files (#7723) 2020-10-16 22:50:34 +08:00
Ben Sorohan
cc5e0fee2d
[FEAT][TYPESCRIPT-ANGULAR] Add configurationPrefix option to allow generating unique configuration token (#7731)
Closes #4101
2020-10-16 15:02:44 +02:00
Jim Schubert
41851b45e1
[bug] Fix FILES sort and path provider issue (#7729)
The FILES metadata is supplementary, but was logging a warning while
generating Ada client that FILES couldn't be written. An exception was
being thrown because Path was being reported as two different "types of
Path". One would be reported as mac file, while the other was reported
as a unix file. The fix here is to disconnect path details from the
underlying file system provider by creating a new Path based on the
file's absolute path. This change also fixes sorting so it works
alphabetically in ascending order.
2020-10-16 00:34:34 -04:00
William Cheng
e1e38c8783
better csharp tests (#7727) 2020-10-16 10:24:11 +08:00
Hippolyte HENRY
8afb067ec9
[go] Improve examples generation (#7576)
* fix go examples

* use constructor with required args
2020-10-16 00:04:30 +08:00
Michał Zubkowicz
e58b1f6abb
Fixes #7635: typescript-inversify generator wrongly handles array type parameters (#7636) 2020-10-15 17:10:10 +02:00