5759 Commits

Author SHA1 Message Date
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
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
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
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
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
ND Tai
fe63b0e28e
Fix typo on rust client (#10096) 2021-08-07 20:53:27 +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
Braden Mars
39901c824f
[typescript-inversify] fix: Sets IsCollectionFormatMulti to true on multi file uploads (#9796) 2021-08-06 09:25:10 +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