9299 Commits

Author SHA1 Message Date
Heikki Haapala
38b8685b00
[typescript-axios] Fix invalid query params usage (#10512)
* fix: axios query params from options

Remove passing query params from options to setSearchParams. Options
were already passed to Axios in full so this removes some duplicate
logic. Axios does merge query params given in path and through params
option so no change in outcome.

* chore: generate samples
2021-10-03 16:30:06 +02:00
Heikki Haapala
755359c031
[typescript-axios] Fix model property naming (#10447)
* fix: typescript-axios property names

Disables MODEL_PROPERTY_NAMING for typescript-axios generator as this
was never supported (templates have no mapping between original property
names and formatted names). Wraps all properties in model interfaces
with '' to support most characters except ' for now. Also fixes missing
options typing that was any before.

* chore: add new sample, generate samples

* chore: update generator docs
2021-10-02 08:06:29 +02:00
William Cheng
8602fbc87c update ruby samples 2021-10-02 13:10:13 +08:00
NivathaSV8
0eb7189fae
[Ruby][Faraday][#10137] Fix config request options and timeout (#10405)
* Update default timeout of Faraday request to 60 seconds

* Fix request options of Ruby Faraday client
2021-10-02 13:05:41 +08:00
Justin Black
638a2faa3d
Updated model generation, addProps handling moved into type object and anyType handling (#10505)
* Updates fromModel helpers

* Samples regenerated

* updateModelForComposedSchema made protected so it can be overridden
2021-10-01 13:09:32 -07:00
Richard Kolkovich
8c059a8663
[typescript-node] Set model default values (#10262)
* fix: add default value, if present, for model properties (closes #10261)

* update samples

* fix: set default to null to allow #defaultValue to work in templates

* fix: escape the string default value, leverage super rather than copy-pasta

* update samples again
2021-09-30 07:43:16 +02:00
William Cheng
51d468e2f6
add decimal support to ruby generators (#10484) 2021-09-28 11:38:19 +08:00
William Cheng
d22e9fb1c1 update rust samples 2021-09-28 11:34:07 +08:00
William Cheng
1a50f1f493
[PHP] fix numeric value in model enum (#10474)
* fix number value :win model enum

* fix tests
2021-09-28 10:10:59 +08:00
Justin Black
d4b8ff60a1
[Java] Fixes schema class type booleans for composed schemas (#10334)
* Adds get/setIsString interface to IJsonSchemaValidationProperties

* Adds get/set isNumber interface in IJsonSchemaValidationProperties

* Adds get/set isAnyType in IJsonSchemaValidationProperties

* Adds and uses ModelUtils.isAnyType, adds setTypeProperties

* Adds missing descriptions of isAnyType parameters

* Uses ModelUtils.isAnyType

* Samples regenerated

* Moves isArray handling higher up in fromProperty

* Moves isAnyTypeSchema handling higher up in fromProperty

* Moves isFreeFormObject handling higher up in fromProperty

* Refactors fromProperties, updates tests

* Fixes the fromProperty refactor, tests now pass

* Uses setTypeProperties to set isNumber, isNull, isArray, and isUnboundedInteger

* Sets isAnyType in setTypeProperties

* Sets isMap in setTypeProperties

* Sets property.isPrimitiveType in isFreeFormObject, tweaks if condition order

* Adds fix for JavaClientCodegenTest.testJdkHttpClientWithAndWithoutDiscriminator

* Refactors fromProperty

* Adds updatePropertyForObject updatePropertyForAnyType

* Sets binary and file types to not be strings

* Updates samples

* Adds updatePropertyForString

* Adds testComposedPropertyTypes

* Fixes python test

* Samples updated

* Switches all isAnyTypeSchema usages to ModelUtils.isAnyType

* Refactors model enum handling higher up

* Moves m.dataType assignent higher into fromModel

* Moves m.isNullable setting higher into isModel

* Adds updateModelForComposedSchema

* Further fromModel refactoring, all schema checks are now at the same indentation level

* Further refactors fromModel, adds isTypeObjectSchema block

* Moves addVars into anyType or objectType blocks in fromModel

* Turns off isNullable n isAnyType array

* Fixes typescript CodegenParameers

* Adds updatePropertyForAnyType to typescript-axios so property.isNullable will be false for AnyType

* Adds testComposedModelTypes

* Updates ComposedAnyType schema

* Fixes tests for JavaJAXRSCXF by adding updateModelForObject method

* Updates go and csharp to handle object model differently

* Adds updateModelForAnyType

* Fixes name reference

* Adds testComposedResponseTypes

* Refactoring fromResponse

* Further refactoring of fromResponse

* Uses setTypeProperties in fromResponse

* Tests now pass for testComposedResponseTypes

* Sets COdegenResponse dataType using getTypeDeclaration

* Begins refactoring of fromRequestBody

* Adds updateResponseBodyForPrimitiveType

* Adds all needed type if else blocks in fromRequestBody

* Fixes JavaJAXRSCXFExtServerCodegenTests

* Fixes RubyClientCodegenTests

* Adds fixes for clients that need custom isMap for body parameters

* Ruby broken, samples regened, debugging

* Adds updateRequestBodyForArray, renames updateRequest.. methods

* Samples regenerated

* Removes changes from Ruby generator

* Reverts RubyClientCodegen.java

* Reverts changes to GoClientCodegen.java

* Reverts PowerShellClientCodegen.java

* Reverts CrystalClientCodegen.java

* Removes updateRequestBodyForObject from JavaCXFServerCodegen.java

* Adds comment about refed models

* Tweaks made to fromProperties to add an explanatory comment

* Updates RustServer to have ByteArray request bodies not be strings

* Sets types in fromFormProperty

* Adds testComposedRequestBodyTypes

* Fixes when validation syncing is done in syncValidationProperties

* Removes redundant validation code from fromParameter

* Moves parameter inX setting higher up before schema logic in fromParameter

* More refactoring in fromParameter, uses early return to reduce levels of indentation

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForArray

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForObject

* Removes setParameterBooleanFlagWithCodegenProperty from  updateRequestBodyForPrimitiveType

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForMap

* Removes setParameterBooleanFlagWithCodegenProperty from addBodyModelSchema

* Removes setParameterBooleanFlagWithCodegenProperty from fromFormProperty

* Refactors parameter array handling code into fromFormProperty

* Simplifies fromRequestBodyToFormParameters

* Removes setParameterBooleanFlagWithCodegenProperty from fromParameter

* Adds deprecated docstring to setParameterBooleanFlagWithCodegenProperty

* Refactors ModelUtils.isFileSchema out of string schema check

* Removes ModelUtils.isFileSchema from RustServer updateRequestBodyForString

* Improves comment text

* Fixes RustServer uuid type setting for CodegenParameter

* Removes unneeded parens

* Fixes array property examples

* Removes unused code

* Renames variable to itemsProperty

* Adds testComposedRequestQueryParamTypes

* Adds updatePropertyForAnyType to rustserver will not have changed model properties

* Hoists arrayInnerProperty._enum into parameter for html2 generator

* Moves turning string type off into the codegen files

* Adds two more missing locations in rustserver

* Moves addVarsRequiredVarsAdditionalProps into anytype and objecttype handling

* More refactoring of where addVarsRequiredVarsAdditionalProps is used

* Samples regenerated
2021-09-27 16:12:40 -07:00
Eugene
60b29e1f8e
#10472 csharp-netcore client - allow to specify content-type for files (#10473) 2021-09-26 23:31:37 +08:00
William Cheng
119370079a update spec template, samples 2021-09-25 18:14:26 +08:00
romanblack1
7384a1e513
Define content type only if the body is not empty (#9766)
* define content type iff the body is not empty

* update samples
2021-09-25 15:05:38 +08:00
William Cheng
00ea470e49 update ruby tests 2021-09-25 15:03:01 +08:00
romanblack1
622a936358
Define content type if and only if the body is not empty (#9910)
* rubypatch

* moving change to api.must

* fix content_type to content-type

* added end to if
2021-09-25 14:53:58 +08:00
William Cheng
323065e53f Merge branch 'master' of https://github.com/openapitools/openapi-generator 2021-09-25 13:59:06 +08:00
William Cheng
871b9ab5b6
update phpunit xml to newer format (#10470) 2021-09-25 13:58:27 +08:00
William Cheng
150e304b4c update samples 2021-09-25 13:56:00 +08:00
Wim Van Renterghem
4e029e99ea
Remove type erasure of the Error response, as it is always the same type (#10460) 2021-09-25 13:52:50 +08:00
William Cheng
c9047a6faa
[php] enhance type mapping (#10457)
* map BigDecimal to float

* enhance type mapping in php generators

* update tests

* update doc, samples

* remove primitive types from phpdt, mezzio
2021-09-25 12:09:34 +08:00
Bodo Graumann
be3bd2e6c7
[Typescript] Improve exception for unknown responses (#10361)
* Clean up tests

* Change pets to async-await

* Use different pets for each test

* Workaround multiple petstore server instances

* Add test for unknown error response code

* Remove call duplication

Running the petstore server locally fixes all issues.

* Make body of unexpected error responses available

* Regenerate all consolidated typescript samples

* Remove json heuristic for unknown error responses
2021-09-24 23:53:37 +02:00
Yoann Ricordel
476a82cb75
[bash] Force Content-Length: 0 on empty posts (#10462)
In the case where we are making empty posts, use -d '' to force curl to
set the Content-Length header to 0. Some backends (among which Microsoft
Kestrel) are sensitive about POST without a Content-Length set.
2021-09-24 01:13:22 +08:00
Pi Delport
5096a00087
Rust client docs improvements (#10461)
* docs(rust,client): link from parameter structs to operation methods

* docs(rust,client): move "more information" text up

This prevents the "more information" text from flowing into the previous
bullet point.

* docs(rust,client): use code formatting for generatorClass

* docs(rust,client): use packageName variable for Cargo.toml dependencies example

* chore(rust,client): capture sample updates
2021-09-24 01:03:01 +08:00
William Cheng
1d934643fd update samples 2021-09-23 14:29:33 +08:00
Pi Delport
31342580cb
feat(rust,client): derive Default for operation parameter structs (#10432)
* feat(rust,client): derive Default for model & api structs

This makes operations with many parameters easier to work with.

* chore(rust,client): capture sample changes: derive Default
2021-09-23 11:31:09 +08:00
Bruno Coelho
7c133be617
[swift5][client] add support for async await (#10442)
* [swift5][client] add support for async await

* [swift5][client] disable CI for the async await sample project temporarily
2021-09-23 10:53:57 +08:00
William Cheng
a55f8afc81 update samples 2021-09-22 14:09:54 +08:00
William Cheng
acd747ca6d Merge remote-tracking branch 'origin/master' into 6.0.x 2021-09-22 12:13:44 +08:00
Pi Delport
de95e2a144
fix(rust,client): re-enable TLS support for reqwest with supportAsync (#10439)
* fix(rust,client): keep default reqwest features with supportAsync

This avoids disabling TLS support entirely.

* chore(rust,client): capture sample changes

This avoids disabling TLS support entirely.
2021-09-22 12:08:56 +08:00
William Cheng
acdf357b76
Revert "Accept header forces application/json type even if server (#10337)" (#10440)
This reverts commit 18301d00112e064d80d94f1ca5d6ca6032808ddd.
2021-09-21 18:17:05 +08:00
Aleksandr Nekrasov
ef0186c9cf
[scala] Fix Array[Byte] type for Openapi type string format byte (#10426)
* [scala] fix byteArray mapping in AbstractScala

* fix testng framework instead of junit for sttp codegen

* regenerate scala examples

* regenerate docs and examples

* fix test
2021-09-21 12:15:49 +08:00
Wojciech Trocki
18301d0011
Accept header forces application/json type even if server (#10337)
* fix!: accept should not force application JSON 

Generated code offen provides range of accept methods.
This method improperly takes JSON as preferred

Example:
	localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"}

* chore: generated changes
2021-09-21 12:04:00 +08:00
Wojciech Trocki
a939676c0d
fix: expose allowed values of the enum (#10386)
* fix: expose allowed values of the enum

Fixes #10385

* chore: update examples
2021-09-21 11:58:38 +08:00
William Cheng
1947f130c0 update doc, samples 2021-09-21 11:52:33 +08:00
adessoDpd
1a48c5f19f
[Wsdl] Handle schema property of type array with oneOf items and other minor updates/fixes (#10434)
* add handling of array of oneOfs

* handle res model-type lowercase name +shorten code

* remove unnecessary vendor-extension model enum

* handle openapi lowercase schema name for array res

* change xs:anytype to string for file responses

* update checkstyles

* remove not needed imports again

* update samples

* upper/lowercase use local getdefault

* update  samples again
2021-09-21 11:46:05 +08:00
RomainPruvostMHH
04e67acd0a
Fix issue 8352: [Java][RestTemplate][WebClient] Incorrect handling of free form query parameters (#10428)
* [Java][RestTemplate][WebClient] fix issue #8352 handling of free-form
query parameters with Java

* replace tab by spaces

* commit samples files generated by the generate-samples.sh script
2021-09-21 11:40:56 +08:00
Jon Schoning
1247e77453
[haskell-http-client] add ability to choose additional characters in querystring which should not be encoded (e.g. "+" or ":") (fixes #3459) (#10424) 2021-09-19 02:02:22 -05:00
William Cheng
e3b558c0f1 update samples 2021-09-19 12:40:33 +08:00
Pi Delport
2bd20a08de
fix(rust,client): use local_var prefix for configuration (#10419)
* fix(rust,client): use local_var prefix for configuration

This avoids conflicting with params named "configuration".

* chore(rust,client): capture updated samples
2021-09-19 11:44:42 +08:00
Thomas Leplus
80fb9e9889
Use 'this' to assign to class field. (#10417) 2021-09-19 11:42:34 +08:00
Surya Asriadie
0936b43dfd
[Kotlin] Fix default value for kotlin class (#10407)
* Fix default value for kotlin class

* fix style: remove trailing line

* fix ktorm schema
2021-09-17 01:12:41 +08:00
Foorack / Max Faxälv
f9320cae68
[typescript-axios] Upgrade axios from 0.21.1 to 0.21.4 (#10381)
* Upgrade typescript-axios from 0.21.1 to 0.21.4

* Update samples
2021-09-16 10:39:38 +08:00
Jon Schoning
df877a8cf9
[haskell-http-client] fixes for GHC 9 (#10400)
- update stack/deps to LTS 18.10 for ghc-8.10.7
- fixes for GHC 9
- update samples
2021-09-14 16:15:58 -05:00
bflaton
9479d35081
Python client docstring (#10339)
* Updated template so that generated code now renders docstrings and function parameters nicely in IDE.

Endpoints are still accessible in generated code, mainly to satisfy some test cases.

* fixed manual tests
2021-09-14 09:38:48 -07:00
Bruno Coelho
084e0930d0
[kotlin][client] fix warning (#10390) 2021-09-14 21:20:16 +08:00
Bruno Coelho
27727acf52
[swift5][client] Fix issue 9953 (#10387)
* [swift5][client] Fix issue 9953

* [swift5][client] update docs
2021-09-14 11:39:32 +08:00
Bruno Coelho
0211f7b82e
[kotlin][client] add support for okhttp requests with empty body (#10369)
* [kotlin][client] add support for okhttp requests with empty body

* [kotlin][client] add support for okhttp requests with empty body
2021-09-14 11:33:06 +08:00
Martin Delille
dd6e399ff5
Fix ci again (#10388)
* Fix ci again

* Improve .gitignore
2021-09-14 11:23:18 +08:00
Bruno Coelho
2732c45cc1
[swift5][client] code formatting and dependencies ordering (#10370) 2021-09-13 20:00:20 +08:00
Noor Dawod
495f6eb30c
Dart2 template linting (#10263)
* 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>

* Updated Dart2 template to fix linting errors when using recommended rules.

* Updated Petstore code.

* Revert to having no EOF marker at end of few files.

* Fix a call on null value.

* Updated Petstore code.

* Add more checks for nulls.

* Updated Petstore code.

* Updated Petstore code.

* Revert back decoding an enum value.

* Revert back decoding an enum value.

* Updated Petstore code.

* Revert to older version of _convertParametersForCollectionFormat method.

* Updated Petstore code.

* Updated template and Petstore files.

* Adjust doc for analysis_options file.

* Updated Petstore sources.

* Shorten command to replace path parameters.

* Updated Petstore code.

* Add a space for readability.

* Adjust template per feedback.

* Remove unneeded break statements.

* Updated Petstore code.

* Keep a new line character when replacing parameter names (like before).

* Remove string interpolation.

* Updated Petstore code.

* Remove commented code.

* Regenerate Petstore code.

* Regenerated Petstore code.

* Use another parameter name to stop variable shadowing.

* Regenerated Petstore code.

* Put description adjacent to the class.

* Add another global ignore for all files: constant_identifier_names

* Use const for contentTypes and authNames.

* Regenerate Petstore code.

* Use shorter code to check for an empty array.

* Regenerate Petstore code.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-13 09:40:15 +08:00