9299 Commits

Author SHA1 Message Date
William Cheng
4fcf1f56fb update samples, doc 2021-08-22 01:49:22 +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
Esteban Gehring
65e9e92282
enable typescript unit tests (#10211)
* enable typescript unit tests

* disable failing isomorphic fetch tests
2021-08-21 10:04:47 +02: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
Esteban Gehring
8462bf3790
typescript-angular: copy tests to angular 11 samples (#10209) 2021-08-20 13:17:24 +02:00
Esteban Gehring
c772d8292b
typescript-angular: fix angular tests by using in-memory fake backend (#10208) 2021-08-20 11:25:06 +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
William Cheng
67cba32d3a
update cpp-ue4 samples (#10194) 2021-08-19 12:24:54 +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
cba76c4b91 Merge branch 'master' of https://github.com/openapitools/openapi-generator 2021-08-18 16:44:09 +08:00
William Cheng
a26422cfa2 update samples 2021-08-18 16:43:55 +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
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
William Cheng
eaa76f8e1f Merge remote-tracking branch 'origin/master' into 6.0.x 2021-08-17 18:10:59 +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
William Cheng
23fdd1b7d8 update samples 2021-08-15 22:41: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
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
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
William Cheng
7dcca2e891 update samples 2021-08-11 12:10:37 +08: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
Tino Fuhrmann
ccccb6aa67 Add missing samples for #9857 2021-08-07 23:48:41 +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
devhl-labs
930643b7bc
Add switches (authentication collections) to support files (#9884)
* added authentication switches to support files

* build samples

* build samples

* added documentation
2021-08-07 21:54:23 +08:00
Ahmed Fwela
dbd80fbf8a
[dart-dio-next] improve encodeCollectionQueryParameter to handle cases where collectionFormat is null (#10105)
* improve encodeCollectionQueryParameter to handle cases where collectionFormat is null

* updated samples
2021-08-07 21:53:36 +08:00
Ween Jiann
11d29eb22b
[go-server] Feat: add required assertions to models (#10068)
* Add RequiredError

* Add IsZeroValue helper

* Add AssertRequired method to all models

* Add AssertRequired call for body param

* Regenerate files

* Add DisallowUnknownFields

* Regenerate samples

* Use hasRequired in model to remove unnecessary code

* Revert disallowUnknownFields

* Use isAdditionalPropertiesTrue for disallowing unknown fields

* Updated samples

* Fix indent

* Add require checks for nested slices

* Add new tests

* Regenerate samples

* Regenerate samples after merging
2021-08-07 21:29:14 +08:00
Yorick Holkamp
189b44b191
[dart2] Include request body on DELETE call (#10100)
* Include request body on DELETE call

This change updates the generated `ApiClient` to include the request body on DELETE calls. [Per the RFC on page 2][1], DELETE calls are allowed to have a request body, even though the behavior may be undefined. I've not come across many APIs that use this behavior but there are a few, in particular the [Ory Kratos API][2] does so, not forwarding the body prevents such an API from being used. An API spec that does not define a request body should continue to function as expected.

[1] https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.5
[2] https://www.ory.sh/kratos/docs/reference/api/#operation/submitSelfServiceLogoutFlowWithoutBrowser

* Samples generated with dart2 template change
2021-08-07 21:11:03 +08:00
James Gilliland
09a4da0970
Make php's array a primitive (#10093)
Fixes a bug where code generation would sometimes treat arrays as
objects and break serialization and code documentation.
2021-08-07 21:02:40 +08:00
Richard Willis
6d8791c3da
[typescript-fetch] Fix double comma arguments due to initOverrides. Refs #10050 (#10101) 2021-08-06 10:21:05 +02:00
ota42y
e2ff39d3e3
[TypeScript-fetch] disable lint in index file (#9675)
* [TS] disable lint in index file

We disable lint in typescript-fetch in this PR
https://github.com/OpenAPITools/openapi-generator/pull/4110

But we doesn't disable index.ts files so we'll get error with [no-cycle](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-cycle.md) rule.

- index.ts [import all classFiles](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-fetch/models.index.mustache#L4) to exporting
- When model use another models (i.e. article model have user model as author), model import another model [using index.ts](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache#L10)

So we need disable all generated file.

* generate files

Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
2021-08-06 09:22:24 +02:00
Richard Willis
c4b9804139
[typescript-fetch] Add initOverrides (#10050)
You can now pass in fetch initOverrides per request.

This change is mainly to add support for request cancellation (via AbortSignal).
2021-08-06 09:14:52 +02:00
duxiaofeng
c05ec99182
make typescript-fetch code compatiable with nodejs environment (#10072) 2021-08-06 08:59:40 +02:00
Peter Leibiger
75181210d5
Add tests for enum query encoding (#10054) 2021-08-05 18:16:59 +08:00
Nathan Baulch
ca5de9d503
[php] Deprecated annotation on operations and fields (#10085) 2021-08-04 17:29:19 +08:00
Nathan Baulch
dc23267580
[csharp] Obsolete attribute on deprecated operations and properties (#10084) 2021-08-04 17:28:45 +08:00
Peter Leibiger
ccd23ec75a
[dart-dio] Fix parameter generation problems (#10061)
* fix parameter with list of `MultipartFile` being generated as single `MultipartFile`
* generate serializer factories for all container params, not only body params
* fix compilation errors when `skipFormModel=false`
2021-08-04 14:25:26 +08:00
Gareth Smith
98e4eb708f
[BUG]Java] Fix a race condition in RetryingOAuth.mustache (#10087)
If there were multiple concurrent requests at a time at which the OAuth token had expired, only a single request would be retried. The other requests would fail because of the expired token, but not be retried and so the failures would be propagated to the caller.
2021-08-04 10:06:39 +08:00
William Cheng
4d0a40e982 update samples 2021-08-04 01:21:22 +08:00