11973 Commits

Author SHA1 Message Date
Thibault Duperron
24fda2ab59
[Kotlin] Use array for generated annotation (#7800)
* Use array for generated annotation

fix #7799

* Add generation for kotlin spring delegate pattern

* Sample

restart tests
2020-12-14 17:57:14 +08:00
Michael Czolko
bc6da8c082
Update apiController.mustache (#7248)
If the delegate is optional, put it as optional in constructor
2020-12-14 16:10:26 +08:00
dpolyakov987
0cbf064d2b
fix kotlin-spring generator does not add @Valid annotation to nested classes (#8037) 2020-12-14 16:09:06 +08:00
Peter Leibiger
351377ca29
[dart-dio] Fix x-www-form-urlencoded body not working (#8175)
* only use `FormData.fromMap()` for multipart content, `FormData` does not work with `x-www-form-urlencoded`
* use a basic map for `x-www-form-urlencoded` content
* fix formatting
2020-12-14 15:36:18 +08:00
Peter Leibiger
7f9012c554
[dart-dio] Use built_value collection types without string replacement (#8153) 2020-12-14 00:00:18 +08:00
Peter Leibiger
cd0257b0e5
[dart][dart-dio] Enum improvements (#8149)
* [dart] Always use the correct enum data type

* use raw strings for enum string values

* [dart-dio] Use raw strings for built_value enums

`@BuiltValueEnumConst` does some wierd string handling in the generated code `r'\$'` becomes `'$'`. This is different compared to the wireName in `@BuiltValueField`
2020-12-13 23:59:29 +08:00
agilob
79395de9b7
[java] Generate "static final" instead "final static" (#8158)
* Generate java code with "static final" instead "final static"

* Regenerate code with "static final"
2020-12-11 10:51:57 +08:00
Peter Leibiger
a93a60b6eb
[dart] Handle enumVarNames for negative names (#8143) 2020-12-10 18:59:23 +08:00
Aliaksei Zhuk
9e5610488f
[Go] Fix for 'Invalid code for files array in multipart/form-data request'… (#8103)
* Fix for 'Invalid code for files array in multipart/form-data request' (OpenAPITools#8093)

* Executed ensure-up-to-date

* Replaced spaces with tabs.
2020-12-10 18:48:45 +08:00
Christophe Bornet
f2d8e3a25b
[Java/okhttp] Add dynamic operations option (#7916)
* Add dynamicOperations option to okhttp gen

* Add tests

* Add apiclient tests

* Fix apiclient template

* Add dependencies in gradle and sbt
2020-12-10 18:22:39 +08:00
William Cheng
5521d7745d
Fix IndexOutOfBoundsException with no model definition (#8110)
* fix IndexOutOfBoundsException with no model

* better code format
2020-12-09 23:40:48 +08:00
Peter Leibiger
4ad6d0bfe5
[dart] Variable/Operation/Model naming (#8123)
* [dart] Properly escape param/var names that clash with Dart types

* [dart] Add tests for var/enumVar names

* note: public and private are no keywords in Dart
* some tests are still wrong, some are commented out

* Fix typo

* [dart] Improve variable name escaping

* add more tests

* [dart] Fix operationId naming

* [dart] Fix upper case var name with leading underscore

* [dart] Correctly support model prefix/suffix

* [dart] Support spaces in property names

* Call super for empty operationId

* [dart] Fix and improve enumVar naming/generation

* use same handling for all 3 generators
* allow `updateEnumVarsWithExtensions` to have access to the data type
* improve `x-enum-values` handling and add supprt for other enum vendor extensions
* remove duplicate and outdated tests from `DartDioModelTest`
* add more tests to `DartModelTest`
* no longer force lowercase enums for plain dart generator (breaking)
* this change also removes the trailing underscore from plain dart generator (breaking)
2020-12-09 23:21:08 +08:00
Hui Yu
828e924a3e
[C][Client] Update free function when a map is deleted (#8122) 2020-12-09 22:34:37 +08:00
Peter Leibiger
2cdbfd63eb
[dart][dart-dio] Enum fixes specific to Dart DIO (#8114)
* [dart-dio] Fix wrong escaped serializer names

* [dart-dio] Prevent enum name collisions in inlined enums

Prefix the private built_value instances with the enum class name. Prevents clashes when multiple inline enums contain the same value - for example `EnumTest`.  No breaking changes here as all the changed fields/references are private and automatically re-generated with built_value.
2020-12-09 21:12:03 +08:00
Alexandre
933a5dc2c6
[Swift] Add default values to model initializers (#8118) 2020-12-09 16:54:12 +08:00
Jean-François Côté
476dba42d4
Use import play.libs.Files.TemporaryFile instead of import play.api.libs.Files.TemporaryFile because it doesn't work at runtime. (#8130) 2020-12-09 11:31:14 +08:00
Peter Leibiger
144e08b4fc
[dart] Use raw strings for json/header parameter names (#8131)
This should fix all problems related to unescaped characters in strings that are assumed to be raw - e.g. `json[r'$special[property.name]']`
2020-12-09 11:12:48 +08:00
Josh Burton
e346593766
[dart-dio] fixes Enum classes with integer values (#8129)
* [dart-dio] Enum classes with int values now generate correct BuiltValueEnumConst annotation

* [dart-dio] Address PR comments
2020-12-09 11:09:57 +08:00
Josh Burton
7fb5e2538b
[dart-dio] Fixes errors when primitive return types are attempted to … (#7411)
* [dart-dio] Fixes errors when primitive return types are attempted to be deserialized as json

* Updates samples

* Removes old files
2020-12-09 11:07:29 +08:00
William Cheng
61777b4a7c
Revise wordings for options (#8127)
* revise wordings for options

* update
2020-12-09 10:42:54 +08:00
Francesco Montorsi
bb6785ad70
[cpp-restbed-server] Allow to implement validation of input data for enumerations (#7717)
* Allow to implement validation of input data for enumerations

* Regen petstore sample
2020-12-09 00:34:35 +08:00
Sampo Kivistö
d1ea6ac839
[Csharp] Bugfix: Updated all C# templates ToJson method not to conflict reference withmodel properties (#8087)
* Updated all C# templates ToJson method not to conflict reference with model properties.

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-08 17:12:40 +08:00
Cody Mikol
f9d6c6fb21
CHORE[DEPENDENCIES]: bump swagger-parser => 2.0.22 (#7597)
this fixes a bug where the parser would return
null when missing parameters rather than reporting
some useful error.

Fixes N/A
2020-12-08 15:18:07 +08:00
alfabetacain
9e0badb3d7
added support for cookie parameters to jaxrs-spec generator (#8117) 2020-12-08 14:55:33 +08:00
Peter Leibiger
7fae4ab411
[dart] type improvements (#8111)
* [dart] Configure and use import mapping

This prevents models from being generated which would clash with exisiting dart types, e.g. List.

* [dart] Fix decimal format not supported

* [dart-dio] Remove redundant modelToIgnore & ignore dart:core import

* modelToIgnore is now handled via importMappings the same way other generators do this
* choose not to import dart:core as this is available by default

* [dart-dio] EnumClass is a reserved word in built_value

* Review changes

* Fix regenerate docs
2020-12-08 12:00:12 +08:00
fbl100
99d83712a8
Fixes issue #8014, _check_type flag not being honored. (#8053)
* Fixes issue 8014, _check_type flag not being honored.

Updated model_utils.mustache to pass the check_type flag into attempt_convert_item(). Failure to do so
results in type validation errors occurring when the user has specifically requested that they be disabled.

* regenerated samples

Co-authored-by: Frank Levine <frank.levine@blacklynx.tech>
2020-12-07 12:18:16 -08:00
Ülgen Sarıkavak
e00ac502f1
[python] Update python versions (#8042)
* Remove redundant encoding definitions

UTF-8 is already the default encoding in Python 3.

* Remove Python3.4 related requirements

* Remove dead Python version 3.5

* Add Python 3.9 to CI and test configs

* Update petstore example
2020-12-07 12:07:35 -08:00
itaru2622
35d616c9af
Fix bug [python][client] generated python client code cannot POST object in multipart/form-data (#8075)
* encode object in json and add content-type:application/json for multipart/form-data

fix issue https://github.com/OpenAPITools/openapi-generator/issues/8068

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

* non-ascii chars supported in encoding object to json, and add "content-type:application/json; charset=utf-8"

* update samples again, by ./bin/generate-samples.sh

* update comment(docstring) in parameters_to_multipart according to the discussion in PR review.

* fix default value in parameters_to_multipart function as described in PR review comment.

* update samples again, by ./bin/generate-samples.sh
2020-12-07 09:50:09 -08:00
Peter Leibiger
751ffad8db
[dart] Cleanup and OAS3 support (#8085)
* [dart] Cleanup and regnerate old/wrong tests and docs

* docs path seems to be doc now in all dart generators
* generated tests are very old and use wrong classes

* [dart-dio] Improve formatting

* [dart][dart-dio] Restructure tests to same layout

* remove duplicate/old openapi sample for which there is no generation config
* generate to `petstore_client_lib` for both generators
* run generated tests as integration tests for dart2 even if empty - this makes it easier to find compile errors

* [dart] Improve gitignore handling for Dart generators

* globally ignore all dart related files that should not be commited
* remove old ignores that are no longer valid

* [dart][dart-dio] Add OAS3 generation and integration tests

Dart2 doesn't compile, needs fixes.

* [dart] Do not attempt to deserialize binary content from JSON fields

Not sure if that case is ever relevant but for now there doesn't seem to be a better option.

* [dart] Fix integration tests for OAS3 petstore

Some POST operations now return 200 with content.

* [dart] Generate Petstore Fake API but don't add to integration tests yet

Explicitly not adding the new integration tests to the master POM. They do not work but having them allows for quickly iterating on open issues without breaking existing basic OAS2/OAS3 petstore examples. Instead they should be run manually until everything is fixed.
2020-12-07 21:38:39 +08:00
William Cheng
ed72843668
better operationId in elm client generator (#8109) 2020-12-07 18:29:38 +08:00
BrMtssk
e732804a68
[BUG][typescript-axios] Sets 'isCollectionFormatMulti' flag to true on multiple file uploads (#8105)
* [typescript-axios] Sets 'isCollectionFormatMulti' to true on file uploads.

Fixes #8104

* Safely checks if dateFormat is "binary" #8105

Co-authored-by: Bruno Matissek <bruno.matissek@gmail.com>
2020-12-07 09:27:33 +01:00
sahan
a3aa19927e
feat(config): pull the basePath from config is exists (#8078)
* feat(config): pull the basePath from config if the basePath doesn't exist

* chore: update samples

* chore: use the basePath from the base class

* chore: update all the samples
2020-12-07 09:25:02 +01:00
Toby Murray
cbe1fd9728
Bump Gradle in generated Java projects to 6.7.1 (#8079)
* Bump Gradle in Java projects from 6.0.1 to 6.7.1

Regular maintenance, 6.0.1 was released November 18th, 2019 and the latest release (November 16th, 2020) is 6.7.1. This updates all the wrapper templatesto the latest version.

* Updated generated Java samples

Generated via `./bin/generate-samples.sh bin/configs/java-*`

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-07 10:44:23 +08:00
Javier Velilla
c0c2f2b804
[Eiffel] various enhancements (#8076)
* Updated Eiffel code generator.
	Added missing language reserved words.

Updated mustache templates to use the latest Eiffel rules to avoid obsolte
feature calls and Cat-Calls.
Updated Eiffel configuration files (ecf's)
Updated comments styles.
Updated Travis CI file to use the latest Eiffel compiler.
Updated EIffel sample to use https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml

* Added missing mapping decimal to REAL_64
Added Eiffel Kernel classes to importMapping to avoid generate models for
them.
Fixed issue with Eiffel feature name generation, updated toOperationId(String) method.
Simplified toInstantiationType method implementaetion.
Improved model.mustache to generate Eiffel models.

* Updated Eiffel sample.

* Removed unneeded tabs.

* Added AnyType mapping to ANY
Removed unneeded tab
Updated model name, remane models that starts with _.

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-07 10:07:03 +08:00
Hui Yu
3195338c47
[C][Client] Fix memory leak when free a map (#8107) 2020-12-07 08:59:03 +08:00
kannkyo
43fa47a51d
Support mediaType (#8100) 2020-12-07 08:58:13 +08:00
Sergey
13f1c610d9
[python] Re-merge Subclass Python exceptions (#7321) (#8095)
* Subclass Python exceptions (#7321)

* Subclass Python exceptions:
- UnauthorizedException (401)
- ForbiddenException (403)
- NotFoundException (404)
- ServiceException [500 - 599]

Fixes #2151

* add generated sample code

* use Python 2 flavor inheritance

* regenerate samples

* update samples

Co-authored-by: Ryan Rishi <ryan@ryanrishi.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-05 12:02:00 -08:00
Ajith Kumar
3de537062d
[Java][Spring] Fixes incorrect request body for map type in reactive spring (#8046)
* [java][spring] updated template to support proper reactive map type

* [java][spring] supporting unit test for spring boot reactive request map issue

* [java][spring] updated samples

* [java][spring] refactoring the issue test spec
2020-12-05 18:32:57 +08:00
Julien Feltesse
adcf54bc09
[ruby] document the *_with_http_info methods (#8094) 2020-12-05 18:27:49 +08:00
fuxs
38dbcdd752
[Go] Fixes missing return statement (#8072) (#8090) 2020-12-05 18:24:22 +08:00
Hui Yu
bac913f384
[C][Client] Fix memory leak when the type of query parameter in request url is integer or boolean (#8096) 2020-12-05 18:23:56 +08:00
kannkyo
5e4d0978dc
Support body params for jmeter (#8101) 2020-12-05 18:23:22 +08:00
stephanpelikan
a4f1d1b5b1
Fix for 'Reactive paramter ServerWebExchange's properties appear in Swagger-UI' (#8031) (#8032)
* [Spring] Add @ApiIgnore to parameter ServerWebExchange of reactive style (#8031)

* [Spring] Apply contribution guidelines (#8031)
2020-12-04 15:09:06 +08:00
nitoqq
25c7ccf30c
JS Client: Allow dot in path parameter name (#6116)
* JS Client: Allow dot in path parameter name

* JS Client: Allow dot in path parameter name

* Delete ApiClient.js

* Delete ApiClient.js

Co-authored-by: Nikolai Konovalov <konovalov.nikolai@gmail.com>
2020-12-04 12:27:44 +08:00
William Cheng
bcf4f8ade6
[C#] Fix oneOf derserialization with additional properties (#8057)
* fix oneOf derserializaoneOf deserialization with additonal prop

* fix tests due to better handlding of additional prop
2020-12-04 10:50:26 +08:00
Robert Pyke
7644f3ee83
[R] Bug - Invalid code generated for POST with no request object (#8067)
* Default body to NULL

* update samples

* Update to set body to NULL only when no hasBodyParam

* Revert any whitespace changes.

* Makes defaulting body conditional on hasFormParams also not being set

Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Robert Pyke <robertpyke@fb.com>
2020-12-03 16:21:08 +08:00
Peter Leibiger
033d985cf7
[Dart-dio] Add basic integration testing and fix compile errors (#8025)
* [dart-dio] Add basic integration test POM

This basically just fetches dependencies, runs the built_value generator and empty test cases. Even running empty test cases is more than is currently possible and at least finds compile errors.

There are compile errors atm which need to be fixed.

* [dart-dio] Fix missing BuiltSet import in models that use enums

* [dart-dio] Fix compile error when the return type is a Map

* the compile error was `serializerForType(Map<String, int>)` in `StoreApi` which needs to be  `serializerForType(Map)`
* use final instead of var in response handling

* [dart-dio] Generate docs after changes

* [dart-dio] Add integration test to CI execution list
2020-12-02 21:35:07 +08:00
William Cheng
82c5021df2
Revert "Bugfix swift5 code generation 2966 (#7301)" and provide a better (#8066)
fix for the stackoverflow issue
2020-12-02 21:20:44 +08:00
Thomas Hervé
634c4c09e4
Fix generation of map model examples (#8063)
When generation examples of objects with additional properties, we use
the map syntax inside a model instantiation, which is incorrect. This
fixes it by checking for model at the right place.
2020-12-01 19:04:23 -08:00
Ghufran Zahidi
64ade2ce8f
[powershell] Implemented the psdata property for module manifest file (#8048)
* Implemented the psdata property for module manifest file (Tags, LicenseUri, ProjectUri, IconUri, ReleaseNotes)

* fix string.format

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-01 16:52:12 +08:00