18059 Commits

Author SHA1 Message Date
William Cheng
40044a3007 update html2 samples 2022-08-27 13:47:51 +08:00
Scott Coldwell
eaa80be526
Fix for issue 13272 - Syntax error in generated html (#13293) 2022-08-27 13:42:11 +08:00
William Cheng
b7c224b374
minor enhancement to the JS apollo generator (#13297) 2022-08-27 13:39:58 +08:00
William Cheng
97946e421f
fix protobuf variable name (#13296) 2022-08-27 13:31:24 +08:00
João Neto
62a0878bae
Combine javascript and javascript-apollo generators (#13270)
* Combine javascript and javascript-apollo generator functionality

* Combine javascript and javascript-apollo templates

* update configs

* deprecate javascript-apollo generator

* bonus magic string deletion 

* update samples

* update generator docs

* fix: include .babelrc in apollo generation

* update samples

* update samples

* rename javascript-apollo to javascript-apollo-deprecated

* fix javascript apollo library template

Apollo library now uses the partial_model_generic template file from the ES6 library, as it includes many fixes and improvements (including handling models with ill-named attributes)

* update samples

* Create javascript-apollo-deprecated.md

* Updated javascript generator template's gitignore

Updates .gitignore with that from https://github.com/github/gitignore/blob/main/Node.gitignore

Main reason for the update is to ignore the 'dist' folder with compiled files by default.

* javascript generator: merge api_test template files

The only difference is that Apollo is not designed for browser, so having a "if(browser)" check is useless, but doesn't hurt.

* update docs

* cleanup

* avoid possible config clash

* update javascript-apollo sample

* update javascript-es6 sample

I kept the pom.xml from before

* update javascript-promise-es6 sample

kept pom.xml

* update samples
2022-08-27 13:29:35 +08:00
William Cheng
2c22a01779
fix return in r (#13294) 2022-08-27 10:14:10 +08:00
Justin Black
fe934dc1b4
[python-experimental] improves type hints (#13271)
* Templates updated, dict properties moved into Meta

* Fixes tests

* Renames _discriminator to discriminator

* Moves required vars into required

* Renames _additional_properties to additional_properties

* Adds MetaOapgTyped

* Adds type hints for MetaOapg to classes that neen it

* Adds StrMixin

* Adds DecimalMixin

* Adds BoolMixin

* Adds NoneMixin

* Adds TupleMixin

* Adds FrozenDictMixin

* Regenerates unit test samples

* Only quotes type hints if they are imported

* Moves _items into Meta

* Renames _items to items, various small type hint fixes

* Adds type hints for object model new signature

* Adds type hints for body schema primitive types

* Adds primitive types to all query/path/header/cookie params

* Samples regenerated for unit test api

* Version files fixed
2022-08-26 07:09:08 -07:00
snebjorn
50a9d3323a
fix: [typescript-angular] .join does not exist on type Set (#13278)
fixes #11782
2022-08-26 12:47:58 +02:00
William Cheng
37c8a745c5
[protobuf] fix set, add tests (#13286)
* fix set, add tests for protobuf

* add new files

* update doc

* remove yaml
2022-08-26 18:25:16 +08:00
Jacob Halsey
dc7ae051b8
[rust] [rust-server] Add AbstractRustCodegen (#13231)
* Add AbstractRustCodegen

* Fix minor bug

* Fix copy-pasting mistake

* Simplify addApiNamePrefixAndSuffix
2022-08-26 12:11:19 +08:00
William Cheng
96521f2234
Add more tests for Gradle plugin in Github workflows (#13280)
* add more tests for gradle plugin

* update gradlew to 6.8.3

* fix typo

* update comment
2022-08-26 12:08:47 +08:00
snebjorn
0bd5ae4063
fix: [typescript-angular] incorrect import when model starts with number (#13277)
fixes #13201
2022-08-25 16:51:10 +02:00
Ikelio
1d8051e857
fix: [csharp-netcore]: anyOf fixes for Primitive types (#13172)
* fixed null-coalescing operator incorrectly used for primitive types with the same change than @jafin in https://github.com/OpenAPITools/openapi-generator/pull/11427
2022-08-25 00:32:36 +08:00
DmitryGlushkov
3103b437b1
Allow override CodegenConfigurator in GenerateTask (#13140)
* Update 'GenerateTask'. Allow override config

* Update 'GenerateTask'. Allow override config

Co-authored-by: Dmitry Glushkov <daglushkov@alfabank.ru>
2022-08-24 23:53:57 +08:00
William Cheng
2e89004683 update go samples 2022-08-24 23:43:57 +08:00
Fraser Waters
544dc60c5a
Add missing golang tag in code markdown (#13248) 2022-08-24 23:38:25 +08:00
Sorin Florea
2d73a4df2e
Explode query params for kotlin generator (#13154) 2022-08-24 23:33:31 +08:00
ivkesh
1fbc047478
fix(cpp-pistache-server): Fix enum generation for useStructModel=true mode (#13249) 2022-08-24 23:32:52 +08:00
William Cheng
3a2b4b9bdd
better null check in default codegen (#13264) 2022-08-24 23:18: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
Justin Black
3f2b167360
[python-experimental] creates + uses MetaOapg cls to store non-properties schema keywords (#13256)
* Uses MetaOapg

* Fixes some tests

* Fixes tests

* Removes pass

* Generates unit test sample

* Samples regenerates

* Reverts version files

* Changes uniqueItems to Boolean type

* Samples regenerated

* Fixes code in addImportsForPropertyType

* Fixes codegenModel and codegenProperty

* Fixes CodegenParameter

* Adds getUniqueItemsBoolean/setUniqueItemsBoolean

* Updates template to use getUniqueItemsBoolean

* Adds printing of uniqueItemsBoolean in codegenModel

* Samples regenerated
2022-08-23 17:26:43 -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
sheabot
8c79f6d2c9
fix(cpp-pistache-server): Add support for AnyType objects (#13232)
Co-authored-by: Ryan Shea <ryan.shea3@t-mobile.com>
2022-08-24 01:48:51 +08:00
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
William Cheng
ff03e1ac8d update doc 2022-08-22 18:50:29 +08: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