12694 Commits

Author SHA1 Message Date
Hugo Alves
197cdac1e0
[JAVA][FEIGN] Automatically retry request that fail due to a 401 or 403 (#10021)
* Renew the access token after receiving a 401/403

Feign clients tries to renew the access token after it receives a 401 or 403. It Retries the request 1 time

* Add unit test for exhausted retries

* Update samples
2021-08-22 11:45:04 +08:00
Antoine Reilles
4a9a922abf
java cxf generator should not depend on jaxb when not withXml (#10204)
Only depend on jaxb when whichXml is true.
This makes things much easier with java11
2021-08-22 11:42:56 +08:00
Hippolyte HENRY
5b072ea66b
Add extension to store oneOf/anyOf/allOf objects as full properties (#9977) 2021-08-22 11:35:03 +08:00
William Cheng
90fca17de1
[haskell-yesod] Better code format, mark generator as beta (#10222)
* better code format, mark haskell-yesod as beta

* fix copyright

* update doc
2021-08-22 11:31:38 +08:00
William Cheng
3de5483aa0
[JAVA] Add apache httpclient library to java clients (#10218)
* Add apache java client option

* Add sample apache client config

* Switch serialization library, use time formatter

* Add pom template for apache dependencies

* Add initial implementation of ApiClient using apache

* Add apache api template

Plus switch to TypeReference to handle generic types

* Add support for sending json data

* Generate test stubs with @Ignore

* Add accept header

* Remove unnecessary builder assignments

* Set responseHeaders instance variable

* Switch to general serialize / deserialize functions

* Handle sending url encoded form data

* Split response processing into new method

* Allow requests without body

* Use general HttpResponse interface

If the method doesn't need to close it

* Use clients connection timeout

* Add constructor accepting custom client

* Handle multipart and direct file uploads

* Support file downloading

Based on the implementation in the jersey client

* Handle missing content disposition

* Raise error if body given for an unexpected method

* Use try with resources for response handling

* Remove unused url parameter encode method

* Handle content type parse exception

* Improve response content type handling

Would have had issues with content type headers containing a charset

* Make all set methods return client

* Add basic readme

* Send content type with files

* Set domain and path on cookies

Otherwise they will be excluded from the request

* Use consistent quoting in error messages

* Add generated apache sample

* Add generated docs changes

* update samples

* rename library, update samples, docs

* update readme

Co-authored-by: Harry White <hwhite@atlassian.com>
2021-08-22 11:17:31 +08:00
Ghufran Zahidi
a71258d7f7
[chsarp-netcore]handle the exception to get correct error message. (#10207)
* handle the exception to get meaningful message.

* minor code format enhancement, update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-08-22 01:24:24 +08:00
Kenzo Yotsuya
4e3a98cee4
New server generator for Haskell/Yesod (#10193)
* Add a new server generator for Haskell/Yesod

* Fix missing locale
2021-08-21 23:57:18 +08:00
Isaac van Bakel
aff4d2f4c2
Correct #9916, fix Produces instances (#10185)
While the fix in #9916 correctly made endpoint types which did not
produce content return the `NoContent` type, those endpoint still
generated `Produces` instances with the wrong mime types due to not
resetting the `hasProduces` variable. This corrects that fix so that the
`Produces` instance for `MimeNoContent` is generated instead of any
other instance.
2021-08-21 22:52:14 +08:00
Johannes Wienke
f47dc4d84b
Document JSON-B as microprofile client target (#10172)
The documentation for the Java microprofile client wrongly states that
Jackson is used. This commit corrects this to JSON-B.

Relates to: #8015
2021-08-21 22:32:04 +08:00
Richard Willis
ff13923f55
[typescript-fetch] Fix config getter type issue (#10216)
The return type now matches the config fetchApi type
2021-08-21 08:32:32 +02:00
Kuzma
3fd5e4111f
[Typescript] Add application/x-www-form-urlencoded content support (#9960)
* Add application/x-www-form-urlencoded content support

* cs fix

* cs fix

* add samples

* fix double content type

* fix samples

* fix util.canConsumeForm

* revert unrelated ghanges

* regenerate samples

* change includes to indexof

* regenerate samples

* regenerate samples
2021-08-20 16:07:43 +02:00
Marius Møller
9312ed831f
[Typescript-Angular] Fix invalid property in generated code
* fix_issue_10182

* Step 3

* update samples

Co-authored-by: Marius Møller <mm@carbuddii.com>
Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
2021-08-19 19:49:15 +02:00
BigBadBassMan
cf4523fa1b
use specific jms/serializer annotation on simple date fields (#10048) 2021-08-19 13:30:46 +08:00
Christie Williams
7a64d5912c
AnyType support for ruby generator (#10192) 2021-08-19 12:23:11 +08:00
Bradley Friedman
81269b867d
[cpp-ue4] fix for generating formParams in json requests (#10177)
* fixed non-functional template which assumed a bodyParam requests and made no effort to construct json body from formParams.

* changed spaces to tabs for new lines from last commit

* fixed further indent and tab issues
2021-08-19 12:16:41 +08:00
Vikrant Balyan
245aec14eb
[python] Fixes a breakage while deserializing the read-only attributes (#10155)
* fixes a breakage while deserializing the read-only attributes

* updating generated samples

* taking care of the PR comments

* updating samples

* protect against cases where _spec_property_naming may not be present

* updating samples

* adding tests for this issue

* other generated files

* taking care of the comments

* updating the generated samples

Co-authored-by: Aanisha Mishra <aanisha.mishra05@gmail.com>
2021-08-18 12:01:58 -07:00
Adrien Guerard
a7de7095a7
[Java][Native] Add an async response interceptor in ApiClient (#10027)
Prior to this change, clients generated with asyncNative=true
could not intercept the responses using the existing repsonse
interceptor. This adds another response interceptor solely for
asyncNative=true clients.
2021-08-18 21:11:29 +08:00
Ahmed Fwela
63562dc2c3
[dart-dio-next] Improve handling nullable objects (#10118)
* handle nullable objects

* reverted java code

* Rewrote type generation to be recursive

* checking for isRequired only makes sense in the model class

* remove comments

* remove whitespaces

* regen samples

* use const once https://dart.dev/guides/language/effective-dart/usage#dont-use-const-redundantly

* remove const from mustache

* added space between comma and type

* fixed formatting

* remove commas

* regen samples

* bad whitespaces
2021-08-18 18:28:06 +08:00
William Cheng
97b92e351b replace tabs with spaces 2021-08-18 17:22:38 +08:00
Nikita Karnaukh
2be2195660
fix registering gradle tasks when apply plugin to project (#10079)
Co-authored-by: n.karnaukh <n.karnaukh@tinkoff.ru>
2021-08-18 16:42:27 +08:00
guy-har
50acdcb4a3
Fix python generated markdown documentation for Jekyll (#10111)
* Fix python generated markdown documentation

* Generated `build the project` and upate sample scripts
2021-08-18 16:25:30 +08:00
Marc Lherbette
d9f3a02d5b
Fix #8890 (part 2) in every JaxRS pom.mustache templates (#10132) 2021-08-18 16:23:48 +08:00
michaelgrahamevans
4da3d45c21
[markdown] Add primitive types to Markdown generator (#5449) (#10106) 2021-08-18 16:20:02 +08:00
Johannes Wienke
c71e66835b
[Java] Add missing imports for Set in java clients (#10171)
* Add missing imports for Set in microprofile client

In case of array properties declared with uniqueItems: true, the
generated Java code uses Sets but imports are not present for them in
the Api and Test classes.

* Add missing imports for Set in java native clients

In case of array properties declared with uniqueItems: true, the
generated Java code uses Sets but imports are not present for them in
the Api and Test classes.
2021-08-18 15:48:12 +08:00
William Cheng
0204bf4ae2 Squashed commit of the following:
commit c5a0d0f7394aa742fa336fff7e7c1d3049761868
Merge: 8c4991ba3ed f8ff8c87609
Author: William Cheng <wing328hk@gmail.com>
Date:   Tue Aug 17 18:28:12 2021 +0800

    Merge branch 'mustache-linting' of https://github.com/NathanBaulch/openapi-generator into NathanBaulch-mustache-linting

commit f8ff8c87609b1ca36fa26fb8474806999638195e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:12:47 2021 +1000

    Reorder tags that handle missing values

commit f5d8a33709d6a3f846a9fe4520b78c3d637051d9
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:08:59 2021 +1000

    Use dot notation where possible

commit 493d14921e2333f3ae19ef6fc89318b7e263a80c
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:10:49 2021 +1000

    Remove empty tags

commit 32480dc53f48227d55531b94e307d72671373737
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 10:41:58 2021 +1000

    Remove redundant sections

commit a8edabd722c34aa094b4aeb11c22664529c3a219
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 22:02:22 2021 +1000

    Trim extra EOF new lines

commit e89bd7458e3594bf0d30e580bc9408e45b018a57
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 21:59:26 2021 +1000

    Trim trailing whitespace
2021-08-17 18:37:51 +08:00
agilob
7edddb6531
Add map property in url params (#10154)
* Add map property in request params

* Regenerate samples to include map in url property
2021-08-17 18:31:53 +08:00
Peter Leibiger
4cbb33bb28
[dart][dio] Parameter with default value must not be required (#10163)
Fixes a bug introduced in #10147
2021-08-17 18:30:48 +08:00
William Cheng
8c4991ba3e
minor update to use 5.3.0 (#10168) 2021-08-17 18:26:50 +08:00
William Cheng
eaa76f8e1f Merge remote-tracking branch 'origin/master' into 6.0.x 2021-08-17 18:10:59 +08:00
Guillaume TOURBIER
9ece1b5111
[Java] refactor: improve additionalModelTypeAnnotations generation (#8269)
* refactor: improve additionalModelTypeAnnotations generation

Split by ';' and/or newline
Trim value

fix: #7032

Run ./bin/generate-samples.sh to regenerate model files

Revert "Run ./bin/generate-samples.sh to regenerate model files"

This reverts commit da509c39f363da046fbd457e1ab67ef0f62f3561.

refector: remove unnecessary import

test: multiples tests for AdditionalModelTypeAnnotations

Add a getter to test the list

refactor: remove duplicate AdditionalModelTypeAnnotations

Without using Set to avoid any side effect somewhere, I use stream and
distinct to avoid duplicates

refactor: using Set instead of stream

Remove stream distinct for performance reason, use newHashSet
Keep AdditionalModelTypeAnnotations as List

doc: update info additionalModelTypeAnnotations

refactor: move doc in code for autogen

style: tab in java class

doc: run ensure-up-to-date

refactor: add imports lost in rebase

docs: regenerate docs

docs: update

* fix: docs
2021-08-17 18:10:19 +08:00
William Cheng
764a462711 Merge remote-tracking branch 'origin/5.3.x' 2021-08-16 21:38:34 +08:00
William Cheng
8403e59aa0
Prepare 5.2.1 release (#10161)
* prepare for 5.2.1 release

* update samples
2021-08-16 19:08:29 +08:00
Vikrant Balyan
849fec29b0
[CSharp-Netcore][Go] Optimize time taken to generate CSharp code (#10152)
* adds memoization to speed up csharp code generation

* takes care of review comments

* memoize adds to toModel for Go generator as well

Co-authored-by: Aanisha Mishra <aanisha.mishra05@gmail.com>
2021-08-16 12:11:04 +08:00
William Cheng
8eb31d0c7c
minor improvements to php-dt generator (#10159) 2021-08-16 12:05:02 +08:00
William Cheng
87554ecb2d
[java][micronaut] minor improvements (#10158)
* mark java micronaut generator as beta

* update doc
2021-08-16 12:04:42 +08:00
Andriy Dmytruk
09aa7bfd0a
Add support for Micronaut Client (#10063)
* Create initial version of openapi micronaut generator

* Update validation, authorization, query parameters and time format

* Move micronaut to its own generator

* Add micronaut documentation

* Refactor and add tests to JavaMicronautClientGenerator

* Refactor model mustache for micronaut client

* Refactor model enum and pojo mustache files for micronaut client

* Move micronaut client generation to micronaut 3.0.0-M5 version

* Generate samples for micronaut client

* Add hidden files of generated samples for micronaut client

* Add and configure micronaut tests as maven profile

* Add option to choose between junit and spock for micronaut client generator

* Add tests for micronaut 'build' and 'test' options; regenerate micronaut samples
2021-08-15 22:36:45 +08:00
Arthur Mogliev
2210c9f016
[PHP] New client generator php-dt (#10041)
* - new PHP client generator php-dt

* - samples regen after rebase

* - README update

* - fix missing options for php-dt-modern config

* - use another workaround to prevent special treatment of form media types in DefaultGenerator - GlobalSettings usage mangled behaviour of other generators
- fix of missing spaces in generated docs

* - samples update after rebase
2021-08-15 22:15:44 +08:00
David Hutchison
fce10c7284
fix: correctly checks the hash file when using a classpath input spec (#9840)
The skipIfSpecIsUnchanged did not work when the input spec came from a
classpath resource, which could lead to infinite build loops when the
plugin was used in eclipse

#5805
2021-08-15 16:04:57 +08:00
Peter Leibiger
5fe76c2453
[dart][dio] Nullable parameters & defaults for header/query parameters (#10147)
* respect the nullable flag for all parameters (except path params where this is not allowed)
* generate default values for header and query parameters that are not collections
* we can not handle default values for collection with built_value atm. (not const)
* we can not handle default values for form/body parameters atm. as those can be enums which we can not construct easily
2021-08-15 13:49:32 +08:00
LeComptoirDesPharmacies
7d35e8dd9b
[python-flask] Fix NoneType when deserialize optional date (See #5813) (#10081)
* Bug #5813 :

As "deserialize_date" and "deserialize_datetime" are used outside of "deserialize_model", we should check 'None' value before parsing string.

* Bugfix 5813 :

Update samples and docs
2021-08-15 00:41:14 +08:00
shayan-eftekhari
8569ff8203
[cpp-pistache-server] Fix missing semicolon in template and missing code to set default values of model schema (#10136)
* BUG FIX: A missing semicolon in cpp-pistache-server generated code.

* BUG FIX: Provide default values of schema in cpp-pistache-server generated code.

* BUG FIX: Provide default values of schema in cpp-pistache-server generated code.
2021-08-15 00:32:14 +08:00
Ahmed Fwela
55ff5a0807
Don't use encodeCollectionQueryParameter on maps (#10116) 2021-08-13 23:16:09 +08:00
Ghufran Zahidi
8ee400305b
Fixed the utc time issue for httpSigning auth. (#10139) 2021-08-13 22:47:46 +08:00
Peter Leibiger
c72e69f28a
[dart][dio] Update built_value to =>8.1.0 (#10122) 2021-08-13 12:57:30 +08:00
Hui Yu
bd8efe2f91
[C][Client] Allocate memory for the element of array when the type is number (#10124) 2021-08-11 21:12:46 +08:00
Sampo Kivistö
f9dd448451
Fixed typo in csharp-netcore httpclient generated code (#10119) 2021-08-11 10:58:58 +08:00
Marley
d0788cdbc1
Typescript-angular: Added missing semi colon to interface export in apis.ts template file. (#10121) 2021-08-10 14:00:57 +02:00
Marius Møller
664aa2d946
Fix issue 10020: [BUG] [typescript-angular] Add "header" to reserved words (#10091)
* Rename queryParameters to localVarQueryParameters

* Rename headers to localVarHeaders

* Rename credential to localVarCredential

* Rename httpHeaderAcceptSelected to localVarHttpHeaderAcceptSelected

* Rename formParams to localVarFormParams

* Rename useForm to localVarUseForm

* Rename convertFormParamsToString to localVarConvertFormParamsToString

* Step 3

* update doc

Co-authored-by: Marius Møller <mm@carbuddii.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-08-08 20:48:00 +02:00
NouemanKHAL
74e28a7709
[typescript] FIX: Generate documentation and examples #9413 (#9857)
* generate docs for typescript

* commit changed files

* Fix NullPointerException on ComposedSchema

* Fix merge issues
2021-08-07 23:27:13 +02:00
Justin Black
cb71ae95a6
Feat adds has discriminator with non empty mapping (#9667)
* Adds hasDiscriminatorWithNonEmptyMapping getter and setter

* Removes venv

* Adds hasDiscriminatorWithNonEmptyMapping to CodegenModel

* Removes python-experimental folder

* Adds hasDiscriminatorWithNonEmptyMapping to CodegenProperty

* Adds hasDiscriminatorWithNonEmptyMapping to CodegenParameter

* Adds hasDiscriminatorWithNonEmptyMapping to CodegenResponse

* Sets hasDiscriminatorWithNonEmptyMapping in codegenModels

* Samples updated

* Adds getHasDiscriminatorWithNonEmptyMappin checks in existing discriminator tests
2021-08-07 07:52:10 -07:00