5759 Commits

Author SHA1 Message Date
agilob
c2186a0b0d
Flash: remove (#10535) 2021-10-09 15:51:45 +08:00
Hugo Alves
331b61dc1c
[Java][Feign] Expose response headers for feign client (#10507)
* Add .circleci/config.yml

* Add the property exposeResponseHeaders to feign client

This new property indicates if the feign client should expose the response headers on the API class.

* Generate new docs for exposeResponseHeaders additional property

* Rename HeaderAwareResponse to HttpResponse

* Update samples

* Refactor the implementation to use the same approach as the c# generator.
Creates a new feign operation with the suffix WithHttpInfo, this operation returns the response encapsulated in a HttpResponse class.
The HttpResponse class contains the decoded body and the response headers

* Refactor the implementation to use the same approach as the c# generator.
Generate samples

* Refactor the implementation to use the same approach as the c# generator.
Generate docs

* Use Void instead of void for HttpResponse parameterized type
2021-10-09 15:50:55 +08:00
Mickael Magniez
ba55332f4c
fix: don't send just " " in body, send an empty string (#10561)
Co-authored-by: Mickael MAGNIEZ <mmagniez@veepee.com>
2021-10-09 15:45:30 +08:00
agilob
cd9bd969d7
Remove eclipse formatter plugin (#10547) 2021-10-09 15:44:53 +08:00
William Cheng
08296c2b1d
Ruby: Fix deprecation warning for Faraday (#10559)
* Fix deprecation warning for Faraday

* test only ruby

* Revert "test only ruby"

This reverts commit 2ca650e66becab1042b954b782f219232d2ae9ff.
2021-10-08 12:06:53 +08:00
Oleg Orlov
8b8654facc
Fix deprecation warning for Faraday (#10558)
To avoid this warnings while running rspecs
```
WARNING: `Faraday::Connection#basic_auth` is deprecated; it will be removed in version 2.0.
While initializing your connection, use `#request(:basic_auth, ...)` instead.
See https://lostisland.github.io/faraday/middleware/authentication for more usage info.
```
2021-10-08 11:37:39 +08:00
William Cheng
96c65fea61
[Java] add an option to customize gradle.properties (#10540)
* add an option to customize gradle properties

* add more info to gradle.properties
2021-10-08 11:20:50 +08:00
William Cheng
6c5f6d2400
[java] Update Gradle to 7.2 (#10538)
* update gradle to 7.2

* update samples

* use gradle-7.2-bin.zip instead
2021-10-08 10:48:27 +08:00
agilob
5b1b74e48d
Dart-jaguar: remove (#10534) 2021-10-08 10:47:17 +08:00
William Cheng
0bfa28f844 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-10-06 12:00:02 +08:00
agilob
8d7be74b79
Dart json_serializable: remove experimental generator (#10533) 2021-10-06 01:38:50 +08:00
William Cheng
72cec10edf
Fix Windows build failure in some environments (#10529)
* update surefire to newer version

* more fixes

* update pet.proto

* update model protobuf template

* add charset

* set line separator

* set proper line break in proto test

* minor fix

* use UTF-8

* use FileUtils.contentEquals

* remove line break

* remove line breaks

* revert utf-8 change
2021-10-05 20:37:24 +08:00
Bodo Graumann
9aadd7724c
Add message and more context to RequiredError (#10530) 2021-10-05 12:41:49 +02:00
andrew-matteson
22d98c177d
Correct a dependency resolution failure in generated angular typescript packages for Angular 12 (#10525)
* Update version

* Rebuild sample
2021-10-05 10:14:58 +02:00
Josh Burton
f5e8f54b21
[dart-dio-next] Adds an option for using the dio_http package (#10497)
* [dart-dio] Adds an option for using the dio_http package

Relates to #10305

* [dart-dio-next] Generates new dio_http sample

* [dart-dio-next] renames dio_http sample, adds pom.xml

* [dart-dio-next] Removes executions not required
2021-10-05 14:03:48 +08:00
RomainPruvostMHH
1735ab9d27
[Java] Replace Java EE 8 dependencies by Jakarta EE 8 (#10513)
* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5

* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5 for sbt

* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5 for gradle

* Commit samples files after the execution of the command
"generate-samples.sh for configs java and kotlin

* Delete org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec
from the exclusion section of org.jboss.resteasy:resteasy-client in the
resteasy module because jboss-annotations-api_1.2_spec isn't a
transitive dependency

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for maven

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for gradle

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for sbt

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.ws.rs:javax.ws.rs-api to
jakarta.ws.rs:jakarta.ws.rs-api:2.1.6 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.json.bind:javax.json.bind-api to
jakarta.json.bind:jakarta.json.bind-api:1.0.2 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.json:javax.json-api to jakarta.json:jakarta.json-api:1.1.6
for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.xml.bind:jaxb-api to
jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.el:el-api to jakarta.el:jakarta.el-api:3.0.3 for maven

* Migrate javax.servlet:servlet-api to
jakarta.servlet:jakarta.servlet-api:4.0.4 for maven

* Delete the property servlet-api-version in pom files because it is
useless

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.activation:activation to
jakarta.activation:jakarta.activation-api:1.2.2 for maven

* Delete javax.activation:activation from the exclusion section of
org.jboss.resteasy:resteasy-client in the resteasy module because
javax.activation:activation isn't a transitive dependency

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Fix the name of property jakarta.activation-version

* Fix a missing property 'jakarta-annotation-version' in
JavaJaxRS/resteasy/pom.mustache

* generate samples

* Fix version value of jakarta.validation-api artifact in
Java/libraries/rest-assured/pom.mustache

* Fix missing property jakarta-annotation-version in
jaxrs-resteasy/eap/pom.mustache

* generate samples

* Revert changes in sample files after running the command
generate-samples.sh in gitBash

* Fix files in
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8

* Replace the old dependency javax.validation:validation-api by the new
Jakarta EE 8 jakarta.validation:jakarta.validation-api in
openapi-generator-online

Co-authored-by: rpruvost <rpruvost@ITEM-S78402.emea.msad.sopra>
Co-authored-by: rpruvost <romain.pruvost@soprasteria.com>
2021-10-05 09:47:29 +08:00
John Gallagher
2ceccfbe3c
[REQ] [RUBY] [FARADAY] Allow middleware to be configured (#10495)
* feat: allow configuring middleware in setup

* fix: stop requiring Faraday middleware unnecessarily

* chore: regenerate petstore samples

* chore: regenerate openapi3 client

* chore: ci fails so rebuild
2021-10-04 17:09:21 +08:00
madsvonqualen
45e0b461ba
[Java] [jaxrs-spec] Add @JsonTypeName to Pojo's (#10489)
* Add @JsonTypeName annotation to pojo's in order to make Jackson deserialize superclass instances

* Generate samples
2021-10-04 16:43:29 +08:00
Larry Diamond
10b310d33f
Optimize: entrySet is faster than keySet + get to prevent N lookups (#10496)
* Optimize: replace keySet + N get calls with entrySet saving N calls to get method in a few places

* missed one performance optimization

* Rolling back a change that was dependent on Java 11
2021-10-04 16:37:34 +08:00
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
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
Surya Asriadie
68285bcd0a
[Kotlin] Fix prevent string default value to be escaped (#10501) 2021-10-02 11:48:34 +08:00
NouemanKHAL
1224283c84
use array examples in ruby (#10500) 2021-10-02 11:46:15 +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
xiedaxia1hao
c09c6261eb
[Java] Fix Potential Flaky Tests (#10485)
* fixed flaky test

* fix flaky test

* update import to the original

* recover indent

* fix format

* finalize
2021-09-28 11:55:35 +08:00
William Cheng
5dcd76d9cb
add decimal support to R client generator (#10487) 2021-09-28 11:47:43 +08:00
William Cheng
334b18ae24
add decimal support to powershell (#10486) 2021-09-28 11:38:36 +08:00
William Cheng
51d468e2f6
add decimal support to ruby generators (#10484) 2021-09-28 11:38:19 +08:00
Derek Strickland
bfce822c34
Use packageName in all of install instructions (#10480)
Thanks for fixing the issue with the non-templatized package name in the install instructions. I'm submitting this slight improvement to

- instruct the user to name the folder after the packageName
- set the path to that new folder name
2021-09-28 10:12:34 +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
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
871b9ab5b6
update phpunit xml to newer format (#10470) 2021-09-25 13:58:27 +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
jakubskopal
56b060c6fa
Fix missing import for JsonTypeName (#8815)
Attempt to fix #8157
2021-09-25 13:47:10 +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
Himanshu Pant
538f12c36d
fix: 🐛 Added ability to override basePath while creating ApiClient instance (#10327)
Solves #9179
2021-09-23 14:23:56 +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
msmerc
916791de7c
Add semicolon as a special case (#10451)
Please could you also add `;` as a special case in enums?
2021-09-23 10:51:02 +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