7223 Commits

Author SHA1 Message Date
William Cheng
2e89004683 update go samples 2022-08-24 23:43:57 +08:00
João Neto
1a5d3926b3
Javascript Generator: two small sanitization changes 🦠 (#13268)
* Javascript Generator: small sanitization changes

Sanitize module name, do not sanitize description.

If we set the project name to "@myorg/mypackage" (scoped package[1]), running `npm test` will fail, as it will generate faulty code due to the module name including the '@' symbol, which is not a valid JS identifier.

Additionally, we don't need to sanitize the description - spaces and special characters are fine. We just need to make sure they are escaped, which we're already doing by invoking escapeText() on line 329

[1]anitize module name, do not sanitize description

* update JS samples
2022-08-24 23:18:30 +08:00
Christoph Linder
b9a6be0cba
fixes #13131: support matrix parameters and other parameter styles in typescript-angular (#13132)
* fix TypescriptAngularPetstoreIntegrationTest

(since this has been abandoned for a long time: just copy the generated code the the "expected" directory)

* fix TypescriptAngularArrayAndObjectIntegrationTest

(since this has been abandoned for a long time: just copy the generated code the the "expected" directory)

* fix TypescriptAngularAdditionalPropertiesIntegrationTest

(since this has been abandoned for a long time: just copy the generated code the the "expected" directory)

* fixes #13131: add custom path parameter expansion to typescript-angular

* fixes #13131: add example for typescript-angular: paramExpansionStrategy=custom

* fixes #13131: document usage of paramExpansionStrategy=custom in README.mustache

* fixes #13131: fix unit tests and sample url for http-param-expander package

* fixes #13131: update samples

* fixes #13131: drop new cli parameter, handle encoding in template only

* fixes #13131: add TestNG groups to all Typescript tests

* fixes #13131: old angular/typescript does not understand type imports

* Apply suggestions from code review

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

* fixes #13131: implement backwards-compatible behavior for format: 'date-time'

* fixes #13131: update typescript-angular integrationtests

* fixes #13131: review fixes + lots of documentation

* fixes #13131: update integrationtests

* fixes #13131: update docs/examples

* fixes #13131: update integrationtests

* fixes #13131: unify enums to union-types to make the api feel mora angular-ish

* fixes #13131: update examples

* fixes #13131: update docs/examples after merge of master

Co-authored-by: Christoph Linder <post@christoph-linder.ch>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2022-08-24 09:35:40 +02:00
jtvmatos
4f94d449dc
fix: Deepcopy fail for allOf schemas (#13130) 2022-08-23 23:07:37 -07:00
William Cheng
8ee22b8e97
Better enum tests for scala-sttp (#13261)
* better petstore tests for scala-sttp

* test scala sttp in github workflow

* test with jdk 11

* comment test
2022-08-24 01:55:45 +08:00
Nikos Epping
719f429107
[typescript-fetch] Serialize Set of primitives as array (#13195)
* [typescript-fetch] Fix array of primitive items where unique-items is true

* [typescript-fetch] Update examples

* [typescript-fetch] Split template into multiple lines
2022-08-19 17:44:40 +02:00
Jacob Halsey
6d82ac0806
[rust]: Remove unmaintained samples and specs (#13193)
* [rust]: Remove unmaintained samples and specs

* Fix checks

* move test file

* Fix test file
2022-08-19 15:45:48 +08:00
William Cheng
ed3666fbde
[R] Minor improvements to the documentation (#13226)
* minor improvement to r doc

* better scopes
2022-08-19 14:59:01 +08:00
Nikos Epping
18bb5466bb
[typescript-axios] Ignore unused imports when using 'withSeparateModelsAndApi' (#13204)
* Add typescript-axios/with-separate-models-and-api-inheritance sample as test for #13203

* [typescript-axios] Add // @ts-ignore to imports in models if withSeparateModelsAndApi is set

* [typescript-axios] Update samples
2022-08-18 20:23:51 +02:00
William Cheng
7e4f3c9b67
[R] Add fromJSONString method to oneOf/anyOf in R client (#13223)
* add fromJSONString method to oneOf/anyOf in R client

* update code samples
2022-08-19 01:39:02 +08:00
William Cheng
4916774a21
fix rdoc type (#13216) 2022-08-18 14:23:19 +08:00
William Cheng
9f3fac53c1
[R] Fix warnings reported by r cmd check (#13205)
* fix warnings reported by r cmd check

* fix assignment
2022-08-17 20:17:30 +08:00
William Cheng
65d57a8bf1
[R] Add generateWrapper option (#13198)
* add generateWrapper option

* fix bug, add tests

* update doc
2022-08-17 15:05:57 +08:00
Zorp
904674c934
Add support for Angular v14 (#12901)
* Add support for Angular v14

- Support Angular 14
- Support rxjs 7.5.5, tsickle 0.46.3, ngPackagr 14.0.2, zonejs 0.11.5
- Requires typescript >= 4.6.0 and < 4.8.0

* Review comments

- Remove duplicate tests
- Added openapi-generator-ignore

* Update samples/client/petstore/typescript-angular-v14-provided-in-root/pom.xml

* Update samples/client/petstore/typescript-angular-v14-provided-in-root/pom.xml

* Update samples/client/petstore/typescript-angular-v14-provided-in-root/pom.xml

* Review comments

- Added typescript-angular-v14-provided-in-root test module to root pom.

* update samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
2022-08-17 08:02:44 +02:00
antssilva96
7e5ee2142c
Fixed regular expression in python client codegen that was removing any trailing chars instead of only expected ones (#13164)
* Fixed regular expression in python client codegen

The previous regular expression was too loose, including any last character in the second group. This commit fixes that, making sure we only remove leading forward slashes, trailing forward slashes or trailing `\i`.

This commit closes 13069.

* Added generated files

* Edit comment

* Add test cases

Co-authored-by: antonio.silva <antonio.silva@feedzai.com>
2022-08-16 09:06:53 -07:00
William Cheng
cfb35f97ef update samples 2022-08-16 15:35:01 +08:00
devhl-labs
7e4fa70067
Update allOf to not always be nullable (#12861)
* added nonNullableVars

* added return property to operation

* added return property to operation

* build samples

* added inner enum

* build samples

* allOf no longer always nullable

* added a comment
2022-08-16 00:47:51 +08:00
Christian Bartolo Burlò
2a196ce362
Fixed scala-sttp generator (#11949)
* fixed scala-sttp generator

* pr checklist

* fixed issue with imports in scala-sttp

* fixed samples

* changed isUnit to isDefault

* fixed errors

* Update modules/openapi-generator/src/main/resources/scala-sttp/api.mustache

Co-authored-by: João Ferreira <jtjeferreira@gmail.com>

* updated samples

Co-authored-by: João Ferreira <jtjeferreira@gmail.com>
2022-08-15 18:42:06 +08:00
William Cheng
c4dd42e7a0
fix r model validations, add tests (#13181) 2022-08-15 00:27:10 +08:00
William Cheng
9e20b01b12
[R] allow oauth scopes customization, remove unused import (#13179)
* add oauth scopes, remove unused import

* fix null check
2022-08-14 22:50:36 +08:00
William Cheng
1f42b09b33
fix issues reported by roxygen in r client (#13176) 2022-08-13 12:23:49 +08:00
William Cheng
123f92d136
add validations to R models (#13157) 2022-08-12 17:09:36 +08:00
William Cheng
456d7d0159
Add tests to Rust (hyper, reqwest) clients (#13165)
* add tests to rust clients

* add new file
2022-08-12 13:50:32 +08:00
Ewoud Kohl van Wijngaarden
9abaa53db1
Replace use of deprecated Faraday::UploadIO (#13127)
Faraday 0.16.0 added Faraday::FilePart as an alias to Faraday::UploadIO
and deprecated Faraday::UploadIO. In Faraday 2.0 the deprecated UploadIO
was removed.

Fixes: e12100b033c13b835fc3b3f1de159dc7f4634fc0
2022-08-11 15:18:39 +08:00
William Cheng
c5a0374d2b
[Ruby] add useAutoload option to use autoload instead of require (#13153)
* [Ruby] Use Ruby autoload to lower memory usage and load times

Fixes #12648

Requiring all models up front can be very expensive in both time and
memory if there are many models. In an example client with 6000 models,
this would consume nearly 400MB of memory and take about 7 seconds to
load. This is mostly unnecessary as most users of the client library
will only actually use a small percentage of the library.

The changes in this commit use Ruby's autoload capability to defer the
loading until the constant is actually used. In that same example client
with 6000 models, when initially requiring the library, the memory
usage dropped to ~20MB and loaded in 0.3 seconds. As the constants are
loaded on-demand, the memory would increase towards that 400MB ceiling,
but if only a few constants are actually used, then memory will never
actually hit that ceiling.

An additional side effect of using Ruby's autoload is that the order of
declaring the constants is not important, as Ruby will naturally load
them in the correct order when they are needed. Thus, this commit obviates
PR #9103 and fixes #4690.

* add option to use autoload in ruby client

* test ruby clients only

* add tests

* update samples

* Revert "test ruby clients only"

This reverts commit 0aaf71cd4cc5d266f824b261a4d312f07bd589e5.

* update doc

Co-authored-by: Jason Frey <fryguy9@gmail.com>
2022-08-11 12:45:13 +08:00
shubham-lakhiwal
91e8fcbd38
[Typescript-axios] Dot prefix on every query parameter (#13149)
* [#12887] dot prefix fixed for pr #13051

* [#12887] dot prefix fixed for pr #13051

* [#12887] review comment incorporated #13051
2022-08-10 22:04:46 +02:00
shubham-lakhiwal
d547a89f4e
[#12887] typescript-axios: nested object as query parameter (#13051)
* [#12887] typescript-axios: object as query parameter resolved

* Added samples for typescript-axios

* minor variable name change

* minor indentation fixes

* [OpenAPITools#12887] typescript-axios: backward compantiability maintained

* [OpenAPITools#12887] typescript-axios: backward compantiability maintained

* [OpenAPITools#12887] typescript-axios: backward compantiability maintained

* [#12887] Review comments incorporated

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

* Review comment incorporated

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

* [#12887] samples updated

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2022-08-10 15:33:07 +02:00
William Cheng
a6ce5f711b
Better logic to handle duplicated properties in parent, child models (#13135)
* better logic to handle duplicated properties in child, parent models

* add tests, update samples
2022-08-10 14:15:25 +08:00
RomainPruvostMHH
032e1a42d6
[Spring] Fix generated api ignore basePath (#10573)
* remove @RequestMapping from the apiController.mustache file and add it
to the api.mustache file

* move the defaultBasePath.mustache file in src/main/resources/JavaSpring
so that it commun with all Spring server-side libraries (spring-boot,
spring-mvc). The value of default context path is the value of
contextPath variable.

* added a unit test to verify it

* update the outputDir variable to samples/server/petstore/spring-stubs in
the  bin/configs/spring-stubs.yaml file because it generates Spring
server-side classes. And not on the client-side as the output directory
seemed to suggest.

* Results of "generate-samples.sh bin/configs/spring*" command

* Remove default value of url in @FeignClient

* resolve conflicts with origin/master

* merge remote/master into branch

* fix samples after a merge with master

* delete the directory samples/client/petstore/spring-stubs because it
moved to samples/openapi3/...

* add samples/client/petstore/spring-stubs just for the CI build (normally
it is unnecessary))

* delete 3 kotlin class files commited by error in
samples/server/petstore/kotlin-springboot and
samples/server/petstore/kotlin-springboot-reactive

* Update the unit test SpringCodegenTest.doAnnotateDatesOnModelParameters
because one more annotation is generated (@RequestMapping)

Co-authored-by: rpruvost <rpruvost@ITEM-S78402.emea.msad.sopra>
Co-authored-by: rpruvost <rpruvost@ITEM-S78402>
Co-authored-by: rpruvost <rpruvost>
2022-08-08 15:43:23 +08:00
William Cheng
3c4948ac08
skip client id, secret validation to allow multiple auth schemas (#13126) 2022-08-08 01:39:07 +08:00
William Cheng
fb29284a99
improve r regular expression handling (#13125) 2022-08-08 00:56:43 +08:00
William Cheng
f287dde875
[R][httr2] better support for OAuth authoriziation flows (#13123)
* better oauth support in r client

* better comment

* update samples

* remove commented code

* update samples

* fix mustache tag
2022-08-07 21:49:04 +08:00
Linus Klöckner
fca13eb9e9
[csharp-netcore] Form data serialize non-primitive objects (#12967)
* csharp-netcore: serialize non-primitive objects in form-data

* csharp-netcore: update samples
2022-08-06 21:59:06 +08:00
William Cheng
d3a268924f
better validation for r parameters (#13119) 2022-08-06 21:06:39 +08:00
AnaTofuZ
462f927b87
Fix Perl cannot string bind undef (#13114)
* fix and add perl client tests

* fixed undefined value in Perl

* update perl client sample

* fix test case
2022-08-06 21:05:37 +08:00
William Cheng
35feca98cf fix test 2022-08-06 16:34:21 +08:00
Krzysztof Łabuś
641d5159eb
C# API Client CancellationToken, Base Validation and Nullable/Required (#13049)
* Ensure CancellationTokenSource disposal in CSharp clients

* Fixed broken BaseValidate in CSharp models

* Ensure final CancellationToken is used in CSharp API clients

* Ensure EmitDefaultValue true for required properties in CSharp clients

* Regenerated samples

* Fixed broken C# ApiClient.ExecAsync disposable resources
2022-08-06 16:33:18 +08:00
William Cheng
f5900c7015
[R] fix auto-generated doc, add checks for bearer/access token (#13112)
* update readme to show bearer auth

* fix doc

* fix doc
2022-08-06 16:32:18 +08:00
William Cheng
247574aa0c
fix assignment, clean up tests, use !!! operator (#13075) 2022-08-05 14:09:24 +08:00
jiangyuan
72991e6be3
[Java] apache-httpclient serialize support custom contentType (#13058)
* java http-client multiPartBuilder support custom contentType for textBody

* java apache-httpclient serialize support custom contentType

* modify getContentType method
2022-08-04 00:41:18 +08:00
Thomas Hansen
1e3a39b460
[PHP] Add support for server variables in operations (#12982)
* [FEATURE] Support for server variables in operations

* [AUTOGENERATED] update samples

* [PHP] Added tests for server variables in operations
2022-08-04 00:15:51 +08:00
Flux Xu
6d1c51c95b
[rust] fix incorrect Cargo.toml generated when supportAsync & withAWSV4Signature are both enabled. (#13015) 2022-08-04 00:11:08 +08:00
William Cheng
13d34b9b63
[R][httr2] Fix form parameter support (#13057)
* fix form parameter support in the r client

* fix query param

* fix form parameters
2022-08-03 23:45:12 +08:00
William Cheng
aa1f6276f3
[R][httr2] fix HTTP header (#13066)
* add test for header parameters

* fix header parameter in r httr2 client
2022-08-03 15:05:39 +08:00
William Cheng
e0fca517cc update samples 2022-08-03 11:56:36 +08:00
William Cheng
d8771de9c1
fix query param, fix spec (#13065) 2022-08-03 11:49:34 +08:00
William Cheng
4635dda518
[R] Add httr2 support (work in progress) (#13005)
* add httr2 support to r client gen

* fix headers

* add accepts, content-types

* update samples

* fix req

* update samples

* various fixes

* add data file test

* fix streaming, add tests
2022-08-01 00:58:19 +08:00
William Cheng
6b6403b2bf
enhance api exception in r client (#13046) 2022-07-31 16:20:39 +08:00
William Cheng
054264df90
[R] refactor the client to prepare additional HTTP library support (#13045)
* remove httr functions from api files

* fix comments
2022-07-31 10:52:57 +08:00
Yohei Kitamura
6a3226d004
[Ruby] Remove configuring verbose option from Faraday template (#13037) 2022-07-30 15:30:10 +08:00