11973 Commits

Author SHA1 Message Date
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
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
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
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
William Cheng
865510ea59
Update test build files to the latest SNAPSHOT version (#10090)
* fix versions in test build files

* test branch

* Revert "test branch"

This reverts commit 00ce0f029d4b524fcfc266ed787512e13cd85e5a.
2021-08-04 17:03:54 +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
Nathan Baulch
c1c5775271
[go] More idiomatic godoc comments (#10044)
* [go] More idiomatic godoc comments

* [go] Mark deprecated fields and functions

* [go] Minor mustache readability/consistency fixes

* [go] Mark deprecated operation parameters

* [go] Deprecate a petstore component property for testing

* [go] Apply deprecated godoc in Go servers also
2021-08-03 17:11:16 +08:00
Sem Schilder
4210b41f84
[php-symfony] Add backslash to "load" namespaces from global namespace (#9740)
* Add backslash to load namespace from global namespace

* Update example

* Remove hardcoded slash

* Add backslash from java side

* Update samples

* Fix first sample

* Fix other snapshot

* Update version file
2021-08-03 17:09:52 +08:00
William Cheng
c28c1253a4
fix missing jackson-databind-nullable in okhttp java client (#10078) 2021-08-03 17:07:14 +08:00
Hui Yu
c21e6de7da
[C][Client] Treat the data type "byteArray" same as "string", part 2 (#10067) 2021-08-03 16:50:14 +08:00
Ween Jiann
bea17c9d68
[typescript] Fix: any type (8 liner PR) (#10080)
* [typescript] Fix: any type (1 liner PR)

* Add toAllOfName override

* Add tests

* Add line at EOF
2021-08-03 16:48:20 +08:00