5759 Commits

Author SHA1 Message Date
Kazuhiro Fujieda
b5fe7d02b0
[csharp-netcore] Fix keys of the enum reference map (#13242) 2022-08-24 01:46:30 +08:00
bgong-mdsol
9afcbabcd8
fix the issue of inline-enum for array (#13250)
update doc
2022-08-24 00:59:57 +08:00
Justin Black
d6fb08d837
[python-experimental] moves composed schemas into cls (#13255)
* Composed schemas moved into cls

* Fixes tests

* Other sample regenerated

* Reverts version files
2022-08-22 16:50:46 -07:00
Justin Black
fac576a2bf
[python-experimental] move validations into cls (#13252)
* Adds null checks to validation properties

* Modifies the templates to move validations into the cls

* Regnerates unit test spec

* Template update to get rid of cls factory for validations

* Updates samples for unit test spec

* Moves SchemaValidator class

* Removes SchemaValidator

* Fixes 2 tests in v3 sample

* Reverts version files

* Reverts 2 files
2022-08-22 15:34:48 -07:00
João Neto
ed10360fc6
Fix javascript-apollo generator/template (#13191)
* bump apollo-datasource-rest to 3.6.1

* Fix RESTDataSource import

* fix ApiClient template

* fix parameters in callApi, add requestInit param

* change parameters to RESTDataSource convenience methods

* add .babelrc file, even in ES6

* simplify .babelrc... no need for all those fancy things, i think

* fix API test mustache template

* Update package.mustache

* add Set as a language-specific primitive

* Update JavascriptApolloClientCodegen.java

* make babel packages dev dependencies only

* Get inspiration from the main Javascript Generator 😖

* correctly get the basePath from spec

* fix basePath template reference

* Do not sanitize project description

Project descriptions are a multiline string — we just need to escape a few special characters (which we're already doing by invoking escapeText() on line 334)

* Fix module name when generating scoped package

If we set the project name to "@myorg/mypackage" (scoped package[1]), running `npm test` will fail, as it will generate faulty code.

[1] https://docs.npmjs.com/about-scopes
2022-08-22 18:39:50 +08:00
lsalgo
fa22ba9dd9
feat: [JAVA] [resttemplate] [#13146] added support for abstract file in operation response for rest template (#13168) 2022-08-22 18:06:42 +08:00
William Cheng
e0c72702c3
update undertow to newer version (#13238) 2022-08-20 22:10:31 +08:00
William Cheng
308f9d1509
minor code improvement in model utils (#13237) 2022-08-20 16:19:28 +08:00
William Cheng
2feaf0510b
better handling of NPE in k6 client generator (#13236) 2022-08-20 15:14:34 +08:00
William Cheng
344d6b19b2
fix string comparison in scala sttp client (#13235) 2022-08-20 14:58:32 +08:00
Justin Black
640010ad38
[python-experimental] style + naming cleanup (#13234)
* Updates templates

* Samples update

* Other sample updated

* Removes unserscore prefix from Validators

* Samples regenerated
2022-08-19 21:09:57 -07:00
Justin Black
52eb13f662
Standardizes import gathering code (#13137)
* Uses the same util to add all imports

* Removes unneeded class variable definition

* Samples regenerated for Groovy

* Fixes imports in Lua so object import does not show up

* Fixes nim imports

* Fixes proto generation

* Removes accidental new protobuf sample

* Improves proto allOf test

* Controls import addition with parametersAndResponsesImportFromV3SpecLocations

* More import protection in fromFormProperty

* More test fixes

* Samples regenerated

* Do not import composed schemas if those features are not supported

* Samples regenerated

* Adds new param importContainerType

* Fixes tests

* Samples regenerated

* Turns off importContainerType in JavaMicronautAbstractCodegen and regens samples

* Reverts most import changes, puts original imports behind a constant check

* Samples regenerated

* Updates model imports, samples regenerated

* Removes typeMapping and instantiationMap types from getImports

* Reverts template and regens samples

* Revers generator java files

* Stops setting complexType on codegenParameter

* Adds missing import back in

* Reverts languageSpecificPrimitives changes

* Samples regenerated

* Regnerates samples

* Reverts proto files

* Removes hoistParameterArrayItemBaseTypeHigher

* Samples regen

* Reverts parameter property

* Turns off importContainerType in getContent

* Samples regenerated

* Uncomments java test

* Adds imports for codegenParameter.schema

* Changes property name to importFromV3SpecLocations

* Changes property name to addSchemaImportsFromV3SpecLocations

* Removes unused java codes

* Fixes javadoc

* Removes extra docs file
2022-08-19 16:37:02 -07: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
Justin Black
3239f28e09
[python-experimental] code quality improvements (#13221)
* Changes http to https

* Refactors method to be simpler, removes unused json encoder

* Samples regen, test fixed, consolidated redundant return

* Samples regenerated

* Updates composed model property names

* Samples regenerated using composed schema name update

* Samples regen, removed unused arg in __get_oneof_class
2022-08-18 09:41:50 -07:00
William Cheng
4916774a21
fix rdoc type (#13216) 2022-08-18 14:23:19 +08:00
Justin Black
b1dec24ae8
[python-experimental] improves docs, add migration guide (#13210)
* Adds comments and migration readme section

* Samples regenerated

* Samples regenerated
2022-08-17 14:27:02 -07: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
Dillen Meijboom
c135139e3d
fix null ref on invalid requestBody reference (#13199) 2022-08-17 15:28:29 +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
Matthew Davis
01a9c55b6e
Fix #6899 - python-flask now uses the pre-existing getter/setter validators (#6911)
* make python-flask set attributes via existing setter

* regenerate python-flask templates

Co-authored-by: Matthew Davis <Matthew.Davis.2@team.telstra.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-5-110.ap-southeast-2.compute.internal>
2022-08-16 10:59:52 -07: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
Jacob Halsey
4e123436d0
[rust-server]: Update help (#13194) 2022-08-16 15:35:51 +08:00
Noor Dawod
9d9e0a4335
Make "applyToParams" a Future + add "this." when decoding JSON (#13120)
* Bump jimschubert/query-tag-action from 1 to 2

Bumps [jimschubert/query-tag-action](https://github.com/jimschubert/query-tag-action) from 1 to 2.
- [Release notes](https://github.com/jimschubert/query-tag-action/releases)
- [Commits](https://github.com/jimschubert/query-tag-action/compare/v1...v2)

Signed-off-by: dependabot[bot] <support@github.com>

* Use a normal variable name inside a function, no need to make it private.

* Pass on authentication names because authentication implementations may need those!

* Generate Petstore samples.

* Allow authentication implementations to apply header and query parameters asynchronously.

* Allow inherited implementations to define a type for authentication class.

* Generate Petstore sources.

* Remove `authNames` from API client and authentication classes.

* Reference properties with `this.` in case one of them has the same name as a local variable.

* Regenerate Petstore source code.

* Revert adding a generic T in `ApiClient`.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-16 00:53:59 +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
Mostafa Aghajani
17f9a28093
Avro fix arrays with items as a ref to defined enum (#13162)
* avro-schema generation fix for arrays with ref to enum (or any non primitive type) to include modelPackage prefix

* sample scenario and generated outputs for avro-schema

* create avro-schema dedicated test file
2022-08-16 00:22:49 +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
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