11973 Commits

Author SHA1 Message Date
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
Justin Black
8cd0d38446
Adds $ref data to schema classes (#13163)
* Adds getRef/setRef

* Adds ref to CodegenModel

* Adds ref to CodegenProperty

* Adds ref to CodegenParameter

* Adds ref to CodegenResponse

* Sets ref on CodegenModel and CodegenProperty

* Samples regenerated
2022-08-11 12:57:00 -07:00
Elric Milon
7fede83a56
Fix template for nullable models in rust new() fns (#10778)
Co-authored-by: Elric Milon <whirm@gmx.com>
2022-08-12 00:38:51 +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
Jacob Peterson
c987e75f92
Fix missing import in api.mustache for Typescript generator (#13105)
* Fix missing import in `api.mustache` for Typescript generator

This fixes issue OpenAPITools/openapi-generator#11288.

* Generate samples
2022-08-11 08:27:52 +02: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
thrykol
e58b8b14c3
Cleaned up cargo clippy warnings (#13011)
* Cleaned up cargo clippy warnings

* Re-add clippy allow statements; don't lowercase variable names
2022-08-11 10:29:08 +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
1c0d6d84d8
[Go] Fix missing import for array/map of file (#13143)
* fix missing import for array/map of file in go client

* add new files
2022-08-10 16:26:10 +08: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
William Cheng
fd56b8f26b
[Java] enum space value must not be generated as underscore (#13136)
* [Java] enum space value must not be generated as underscore

as this is invalid in Java 9

this closes #9607

* script changes

Co-authored-by: Sven Meier <sven@meiers.net>
2022-08-09 11:05:27 +08:00
Laurens-W
9a04113258
Allow useInlineModelResolver to be influenced by generator options (#13056)
* Move logic so that it can dynamically be influenced by opts

* Or should it be here?

* We handle the useInlineModelResolver logic in configureGeneratorProperties after processOpts

Co-authored-by: Westerlaken, H.L. (Laurens) <laurens.westerlaken@devolksbank.nl>
2022-08-08 16:04:13 -07:00
Justin Black
9610a81a13
Adds requiredVarsMap (#13117)
* Adds requiredVarsMap

* Fixes imports

* Adds requiredVarsMap to CodegenParameter

* Updates CodegenResponse

* Adds feature to codegenModel

* Fixes codegenProperty

* Switches to getRequiredVarsMap

* Uses curly braces for set definition

* Added blocked examples back n to test spec now that the required bug is fixed

* Sample regenerated

* Handles escaping required property names

* Fixes CI tests

* Samples regenerated

* Samples regnerated

* Fixes test
2022-08-08 09:47:43 -07:00
lsalgo
186ad25cee
fix: [JAVA/SPRING] [#12692] fixed optional config property legacyDisc… (#12713)
* fix: [JAVA/SPRING] [#12692] fixed optional config property legacyDiscriminatorBehavior always being overwritten to false in spring codegen

* feat: [JAVA/SPRING] [#12692] spaces instead of tabs

* feat: [JAVA/SPRING] [#12692] spaces instead of tabs in test

* fix: [JAVA/SPRING] [#12692] added comment

* fix: [JAVA/SPRING] [#12692] spaces instead of tabs

* fix: [JAVA/SPRING] [#12692] spaces instead of tabs in test
2022-08-09 00:06:28 +08:00
fbl100
d3dd676960
Issue 13043: Improved handling of recursive schemas (#13109)
* Issue 13043: Improved handling of recursive schemas

Converted Exception to a warning when a Schema is doubly added to the includedSchemas list
Broke recursion in a more reasonable place when generating example values

* Addressed comments from PR
2022-08-08 08:39:17 -07: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
y-tomida
5644e23128
[Kotlin] Add reserved word contract (#13108) 2022-08-07 09:50:47 +01: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
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
Max K
a4a89caf73
Added parameter to add models in seperate project (#13044)
Samples and build for seperate model projects
2022-08-05 13:46:58 +08:00
Justin Black
aa1b0a15da
[python-experimental] removes print (#13107)
* Removes print

* Samples regenerated
2022-08-04 17:04:03 -07:00
Justin Black
8c3a734c64
[python-experimental] moves model and api docs into subfolders (#13106)
* Regens docs in new locations, adds endpoint anchors

* Updates readme links and top of page link

* Model updates so the readme links work

* Samples regenerated

* Adds missing module names to apis and models
2022-08-04 14:03:21 -07:00
Justin Black
69121a9b8f
3.0.3 spec updated with json schema tags (#13104)
* Spec updated with json schema tags

* Samples regenerated
2022-08-04 12:14:06 -07:00
William Cheng
cdc9683331
[jaxrs-spec] to fix default values for array (#13076)
* fix 13025 with correct default values for array

* fix missing curly bracket
2022-08-05 00:13:22 +08:00
Justin Black
a3490d7379
Revert "Issue 13043: converted an exception to a warning" (#13074)
* Revert "Issue 13043: converted an exception to a warning for doubly adding schemas to the includedSchemas list (#13070)"

This reverts commit bbf463f7275b69053345630c61444b909d6e345d.

* Samples regen
2022-08-03 13:22:32 -07:00
William Cheng
0d50b4044f
fix TS model tests in Windows (#13072) 2022-08-04 01:24:15 +08:00
plotbox-io
4fa427c653
Update php-symfony/model_variables.mustache to fix template bug (#13060) (#13061) 2022-08-04 01:12:40 +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
fbl100
bbf463f727
Issue 13043: converted an exception to a warning for doubly adding schemas to the includedSchemas list (#13070) 2022-08-03 08:18:03 -07:00
fbl100
4da8176b04
[python experimental] Issue 13043: fixes toExampleValueRecursive stackoverflow (#13062)
Fixes an issue in python-experimental that was causing a stackoverflow
error.

* Fixed by adding composed schemas to the list of 'includedSchemas'
* Fixed an additional issue that was causing a schema to be added to the
'includedSchemas' list
* Added a unit test with a minimal GeoJson spec to confirm results
2022-08-03 07:28:33 -07: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
d8771de9c1
fix query param, fix spec (#13065) 2022-08-03 11:49:34 +08:00
Marco Martinelli
1cf9d178d6
Update tsconfig.mustache (#12753)
Fix #12728
2022-08-02 12:26:00 +02:00
Justin Black
c959a6cf38
[python-experimental] Fixes issue 12986 (#13054)
* Adds fix for api names and tag names

* Removes sample spec

* Samples regenerated
2022-08-01 15:17:25 -07:00
Justin Black
68fb5a96c5
[python-experimental] consolidates endpoints into paths module (#13007)
* Adds endpoint creation in path modules

* REgens samples

* Adds BaseApi so there can be 2 class interfaces for http method and operationid

* Adds paths init

* Adds enum containing paths

* Uses path enum for endpoint paths

* Adds camel case to undersce converstion in to ineum var name

* Fixes path enum generation

* Moves path api combination module into apis

* Moves tag apis into a tags module

* Adds path_to_api

* Changes module path to paths

* Fixes tag api imports

* Fixes self type in endpoint methods

* Adds test changes

* Adds tag enum

* Adds tag_to_api

* Adds missing tag

* Fixes self types in endpoint methods

* Refactors java endpoint generation to be simpler

* Further refactors generateEndpoints

* Generates one test file per endpoint

* Updates v3 samples

* Fixes endpoint tests, all tests passing now

* Samples regenerated

* Fixes petstore tests

* Generates separate endpoint test methods on each endpoint

* Fixes api docs and enum string values in those docs

* Regenerates samples

* Removes pass to fix tests
2022-08-01 11:22:35 -07: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