11973 Commits

Author SHA1 Message Date
Yannick Schutz
85b2b3c2e4
Add mime/multipart missing import in go server (#8790) 2021-02-27 14:50:16 +08:00
nitschy
a8b74d10ec
FIX: Error in mustache.api (#8800)
When a GET/PUT/POST operations includes queryParams, then the feign generator wrongly generates the Basename instead of the paramName. That leads to
a java.illegalstateException ("Body parameters cannot be used with form parameters") in Feign Contract when attempting to invoke the Method.
i.e: a generated feign client:
public interface PersonClientTest extends RestApi {
    @RequestLine("GET /personen/{kundenNummer}?mitUnterstruktur={mitUnterstruktur}")
    @Headers({
            "Accept: application/json",
            "If-None-Match: {ifNoneMatch}"
    })
    PersonOut getPersonByKundenNummer(@Param(value="kundenNummer", expander=ParamExpander.class) String kundenNummer, @Param(value="If-None-Match", expander=ParamExpander.class) String ifNoneMatch, @Param(value="mitUnterstruktur", expander=ParamExpander.class) Boolean mitUnterstruktur);
}

in the headers:
 "If-None-Match: {ifNoneMatch}"
but in the method:
 @Param(value="If-None-Match", expander=ParamExpander.class) String ifNoneMatch
the value should be ifNoneMatch instead of "If-None-Match"
2021-02-27 14:47:11 +08:00
Blackclaws
f8770d7c33
C# Aspnetcore Generator. Fix Parameters missing (Name = ) Property (#8826)
* Fix parameter Name= missing.

* Update samples

* Fix wrong name in template

* Update samples again
2021-02-25 23:36:35 +08:00
Peter Leibiger
3e9c1e1fc3
[dart] Remove old leftover format parameter from path (#8834) 2021-02-25 20:29:34 +08:00
Peter Leibiger
fbe2bb7c97
[dart][dart-dio] API class/template refactoring (#8825)
* [dart][dart-dio] Refactor API template

* first construct a `RequestOptions` instance with all parameters etc. inline
* then construct and serialize the body data
* then send the request and await the response
* then deserialize the response
* always use the `specifiedType` for built_value (de)serialization instead of a mix of ways (this does the same as finding the serializer directly)
* use indent of 2 spaces (as per Dart convention)
* prefix all local variables to prevent name clashes with parameters

* Add tests that (de)serialize collections and add API key header
2021-02-25 20:24:21 +08:00
agilob
9fc33f6a73
[Dart] Add configuration to add new generators and add json_serializable (#8789)
* Add Dart configuration flag to set new generator

* Change templates to add json_serializable generator

* Fix dart tests

* Add custom serialization for standard generator

* this change opens us a way to allow adding more than 2 generators

* Add sample project for json_serializer

* Use basename for json field name

* Update samples with basename as json key

* Update dart generator docs

* Create AbstractDartCodegen class

* Update docs, dart-dio and dart-jaguar dont get json_serializable yet

* Deduplicate method calls

* Dix dart-dio generation

* Revert formatting change in dart mustache

* Fix formatting changes again

* Improve dart serialization documentation

specify default serializer

* Better name for cli option

* Rename default dart generator to 'native'

* Another attempt to reduce whitespace noise

* Fix api-client and api-helper

* Rename default serialization mode to include word serialization

* Remove trailing whitespace in enums
2021-02-25 17:11:16 +08:00
Rafael Ceron
34c77c2807
typescript-nestjs: removed unused basePath from api.service template (#8811)
* (nestjs) removed unused basePath from api.service template 8810

* Update modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* added missing parenthesis on Global() decorator

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2021-02-25 08:43:21 +01:00
William Cheng
df1ae03960
[Refactor] create Python abstract class (#8817)
* create python abstract base class

* refactor AbstractPythonConnexionServerCodegen

* update doc
2021-02-25 14:10:49 +08:00
Adrien CABARBAYE
a31dba5b88
[GO] use latest available oauth2 version (#8764)
* [GO] use latest available oauth2 version

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-02-25 02:32:49 +08:00
Thomas Hervé
f9b1f98d21
Fix base type naming in Go (#8819)
Go generation didn't properly named base type in `getSchemaType`, which
ends up breaking some doc generation.
2021-02-25 02:31:59 +08:00
Peter Leibiger
4f4f1d4128
[dart][dart-dio] Remove manual json encode/decode calls in API classes (#8812)
* [dart][dart-dio] Remove manual json encode/decode calls in API classes

Dio automatically adds a default transformer which does call `json.encode` and `json.decode` when the content-type is `application/json`. When the content-type is different, then it  is up to the consumer to configure the Dio instance correctly to support custom content-types.

Also tests!!!

* [dart] Constraint test library to < 1.16.0 as it requires Dart 2.12.0

* Fix more constraint problems for the new test project
2021-02-24 23:29:41 +08:00
Martin Delille
b5c665472c
Qt client handle deprecated (#8766)
* Qt client handle deprecated

* Update sample

* update VERSION

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-02-24 11:46:07 +08:00
William Cheng
91805936e6
[maven plugin] fix security issues (#8795)
* use Files.createTempFile in maven plugin to avoid security issues

* error check when creating a folder
2021-02-24 11:45:44 +08:00
William Cheng
c31e6e79d0
[online] use Files.createTempFile to address security concerns (#8788)
* use Files.createTempFile to address security concerns

* Update modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java

Co-authored-by: Jonathan Leitschuh <Jlleitschuh@wpi.edu>

Co-authored-by: Jonathan Leitschuh <Jlleitschuh@wpi.edu>
2021-02-24 00:33:06 +08:00
William Cheng
c653051997
Revert "[Ruby] force users to specify the temp folder path to address security concerns (#8730)" (#8807)
This reverts commit 18a6f5a941f3b5777977693f3b59ac5d200928a8.
2021-02-24 00:31:43 +08:00
Gabriel Féron
a7c6eccced
Rust: Add support for lists (and sets) of enum values (#8693)
* Add support for arrays of enums for Rust

* Rust: Use HashSet if uniqueItems is true
2021-02-23 19:02:01 +08:00
Francesco Guardiani
4bf09833f4
[Java][Vert.x] Make ApiHandler reusable (#8720)
* Fix #8710

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Reintroduced default constructor

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Deprecated

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2021-02-23 15:38:57 +08:00
William Cheng
42d3dbd5d1
Fix bugs to ensure unique parameter names (#8762)
* fix unique parameter naming

* add tests
2021-02-23 14:49:44 +08:00
agilob
e7f50f66a3
Make all loggers non-static (#8799)
* Make all loggers non-static

Reduces memory usage on startup by between 2 and 4 MB

* Fix compile error in some autogenerated? module
2021-02-23 14:46:56 +08:00
Ronny Pfannschmidt
eb3d6d2f16
[python][template] move _path_to_item of simple init to avoid name error (#8737)
* [python][template] move _path_to_item of simple init up so its avaliable for missing default errors

* update generated examples
2021-02-22 21:00:14 -08:00
William Cheng
19f43b5330
use Files.createTempFile in asciidoc tests if possible (#8794) 2021-02-23 11:57:05 +08:00
William Cheng
1b6cabb97d
[Java] use Files.createTempFile instead (#8787)
* use Files.createTempFile

* fix import

* add missing import
2021-02-23 11:40:37 +08:00
William Cheng
d85f61ff0c
[TS] Revert changes in nestjs readme (#8793)
* revert changes to nestjs readme

* update samples
2021-02-23 11:33:32 +08:00
William Cheng
00c7ebab66
use Files.createTempFile (#8791) 2021-02-23 11:33:10 +08:00
William Cheng
764a3b044c
replace tab with spaces, minor code format change (#8774) 2021-02-22 19:46:11 +08:00
Daniel Friesen
047a71c574
[typescript-axios] Support array query arguments (#8772)
* [typescript-axios] Support array query arguments

typescript-axios does not correctly output query arguments when you use `explode: true` for a parameter.

fixes #7966
fixes #7973

* Fix mistake in query parameter setting
2021-02-21 17:27:46 +01:00
Kamil Piotrowski
a9e797c6ca
Add additional AWS v4 signature parameters to go client generator (#8706) 2021-02-21 22:07:22 +08:00
James Gilliland
f3c164d1ad
[PHP] Use a valid php type for maps (#8718)
* Use a valid php type for maps

* Convert type hint to correct format

Align map array format to that expected by phpdoc and associated tools.
2021-02-21 18:07:45 +08:00
William Cheng
c636f7e08d
update jackson to 2.12.1 (#8783) 2021-02-21 17:53:23 +08:00
William Cheng
e432dfa59a update gradle.properties to fix appveyor build issue 2021-02-21 14:47:37 +08:00
William Cheng
e9d4886e70
replace tab with spaces, minor code format change (#8775) 2021-02-21 12:14:52 +08:00
William Cheng
ea428d6048
update jackson dependencies to address security issues (#8778) 2021-02-21 11:40:24 +08:00
Govind
04bd1ece23
fix for 8760 (#8761) 2021-02-20 11:54:48 +08:00
William Cheng
9c20050bdc
Add an option to skip operation examples (#8731)
* add flag to skip operation examples

* reset to false
2021-02-20 11:51:21 +08:00
William Cheng
ba4aae5074
[Go] bug fix (breaking), minor code format enhancement (#8715)
* go minor code format enhnacement

* fix required vars in the model new

* remove comma
2021-02-20 11:50:27 +08:00
William Cheng
ee12a6f7ee
revise invalid spec error message (#8735) 2021-02-20 11:49:31 +08:00
William Cheng
18a6f5a941
[Ruby] force users to specify the temp folder path to address security concerns (#8730)
* address security issue when downloading files in the ruby client

* update samples

* fix double quote
2021-02-20 11:49:10 +08:00
William Cheng
095019a6d8
replace tabs with 4-space (#8757) 2021-02-19 23:06:20 +08:00
William Cheng
d19bfebeda
replace tabs with 4-space in dart templates (#8740) 2021-02-19 18:02:54 +08:00
Anthony Whitaker
bb712013f8
Fix misleading warning message for missing output directory. (#8742)
Change warning message to info.
Add name of directory checked to message.

Resolves #4627
2021-02-19 11:48:54 +08:00
William Cheng
bed5ab17ef
Remove flash templates (#8741) 2021-02-19 10:55:44 +08:00
William Cheng
d5a9b53bdc
replace tabs with 4-space (#8739) 2021-02-19 10:54:55 +08:00
Martin Delille
df5050f3b0
[cpp-qt5-client] Fix qt5.15 check (#8711)
* Fix qt5.15 check

* Fix check fix
2021-02-18 11:54:10 +08:00
Peter Leibiger
c916df9381
[dart][dart-dio] Nullable support/improvements (#8727)
* [dart-dio] Disable nullable fields by default

This is not in line with the OAS and will prevent future Dart nullabilty features (NNBD) from being useful as all types would be optional.
Users can still opt-in for this.

* [dart-dio] Properties are nullable when not required AND not nullable

* [dart][dart-dio] Support nullable/required fields

* properties in built_value need to be nullable when they are nullable in OAS or when they are not required in OAS
* built_value does not support serializing `null` values by default as it is based on a serialization format based on iterables/lists and not maps
* dart-dio uses the built_value json plugin to convert the built_value format to regular json
* by generating a custom serializer for each class we can add support for serializing `null` values if the property is required AND nullable in OAS
* this is a breaking change as not all properties in the models are nullable by default anymore

* Implement required/nullable for dart

* Changes for set types and enum names after rebase

* Add some comments and fix built_value fields with default being nullable

* More rebase changes and regenerate docs
2021-02-17 21:44:21 +08:00
Peter Leibiger
7704ff3d08
[dart][dart-dio] Allow API key authentication with multiple API keys (#8728)
Remove the break stopping after the first key.
2021-02-17 21:40:27 +08:00
William Cheng
55292dd22b
Add ASP.NET Core 5.0 support (#8717)
* add aspnet core 5.0 support

* skip overwriting Org.OpenAPITools.csproj

* update doc

* update doc
2021-02-17 18:58:13 +08:00
Oleh Kurpiak
135c8f45a4
[Java][native] extend native ApiClient (#8557) 2021-02-16 21:47:44 +08:00
Peter Leibiger
683dcb8889
[dart][dart-dio] Raise min Dart to 2.7.0 & update built_value constraint (#8684)
* raise min Dart version to 2.7.0 / Flutter 1.12.0
* update constraints for built_value to support new major versions with null safety
2021-02-16 18:00:59 +08:00
Peter Leibiger
608242b4d8
[dart][dart-dio] Improve prefixing of inner enums with classname (#8685)
* [dart][dart-dio] Improve prefixing of inner enums with classname

* prevent further name conflicts by correctly naming the enum, until now there could potentially occur conflicts e.g. 2x `MapTestInnerEnum` by renaming the `items` child property
* correctly set `enumName` to match `datatypeWithEnum`

* Unrelated test regeneration
2021-02-16 17:59:54 +08:00
Patrick McGleenon
3c4015b897
[REQ] [GO] Added enumClassPrefix option to go-gin-server. Used same appro… (#8681)
* [REQ] Added enumClassPrefix option to go-gin-server.  Used same approach as #7008 (go-server)

	modified:   docs/generators/go-gin-server.md
	modified:   modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java
	modified:   modules/openapi-generator/src/main/resources/go-gin-server/model.mustache

* Fixed CI error in docs
2021-02-16 17:54:00 +08:00