20009 Commits

Author SHA1 Message Date
myz-dev
b1fac19a75
Fix #18572 rust server: Silence clippy lints by refactoring (#18575)
* refactor: move closure definition to own statement

A clippy lint recommends not using a closure inside of a statement.
The code generation used to produce code that triggered this warning,
which caused the rust-server integration test to fail because clippy is
configured to return lint violations as errors.
For details for the lint see:
https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions

* refactor: Remove unnecessary qualification

A GitHub action test used to fail because of a clippy warning that was
emitted due to not using an imported symbol but qualifying its use.
A failed test can be seen here:
https://github.com/OpenAPITools/openapi-generator/actions/runs/8958257509/job/24603984954?pr=18563
With the relevant error being:

error: unnecessary qualification
  --> output/openapi-v3/src/client/callbacks.rs:88:9
   |
88 |         futures::future::ok(Service::new(

This commit simply removes the qualification.

* test: Update examples and run integration test.

Updated examples by running
`./bin/generate-samples.sh ./bin/configs/rust-server-*`
The integration test with the following command passes:
`mvn integration-test -f samples/server/petstore/rust-server/pom.xml`
2024-05-06 12:24:33 +08:00
Stefan Koppier
f145b8962d
[kotlin-client] Update Gradle and dependencies (#18571)
* [kotlin] Target correct library in jvm-spring-webclient sample

* [kotlin] Fixed warning in jvm-spring-restclient

* [kotlin-client] Bump Gradle version

* [kotlin-client] enableFeaturePreview no longer needed as it's enabled by default

* [kotlin-client] Bump kotlin, spotless, and reactor versions

* [kotlin-client] Generated code

* [kotlin-client] Missed a generated sample

* [kotlin-client] Bumped gradle and java version in kotlin-client workflows

* [kotlin-client] First attempt to fix jvm-volley

* [kotlin-client] Use standard gradle action instead of custom one

* [kotlin-client] Use original gradlew action but without specific version

* [kotlin-client] Moved sample kotlin-spring-cloud to servers instead of clients

* [kotlin-client] Added previously missing generated file

* [kotlin-client] Corrected sample path
2024-05-05 21:40:58 +08:00
Manuel Covas
296a6ac516
[typescript-fetch] Restore pre-es2017 compatibility in modelEnum template (#18418)
* [typescript-fetch] Restore pre-es2017 compatibility in modelEnum template

Restore pre-es2017 compatibility in modelEnum template by not using Object.values in instanceOf{{classname}} function

* [typescript-fetch] Regenerate samples

* [typescript-fetch] Regenerate samples documentation

* [typescript-fetch] Add curly brackets

* [typescript-fetch] Regenerate samples

* [typescript-fetch] Use typed comparison

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* [typescript-fetch] Regenerate samples

---------

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2024-05-05 09:05:12 +02:00
Marc Le Bihan
fde8c772fb
[BUG] [C++][Pistache] cpp-pistache-server generating API include unde… (#18553)
* [BUG] [C++][Pistache] cpp-pistache-server generating API include undefined "Object.h" (#2769)

Should handle Object.h, AnyType.h correctly. Set.h also tested.

   - #include Object.h removed and replaced by a typeMapping.put(object, nlohmann::json) like suggested in other issues
   - object had an invalid syntax: ':' instead of '::' in types with namespace
   - extra include of #include nlohmann/json.h removed when there's already #include <nlohmann/json.hpp>
   - nlohmann::json is excluded from model namespace

Tested with custom petstore played, with suggested openapi specs coming from issues #2769, #10266, #14234

   ```bash
   rm -rf samples/server/petstore/cpp-pistache-everything/ && ./bin/generate-samples.sh ./bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml  && cd samples/server/petstore/cpp-pistache-everything/ && mkdir build && cd build && cmake .. && cmake --build . --parallel
   ```

* - Adding to samples/server/petstore cpp-pistache-everything

* - .md and FILES missing
2024-05-04 21:59:49 +08:00
Philzen
d3b156d694
Add .sdkmanrc for easy Java and Maven version management (#18552)
* Add .sdkmanrc for easy Java and Maven version management

https://sdkman.io/

* Bump required Maven version for building to 3.8.8
2024-05-04 21:05:10 +08:00
Philzen
38b8f60e54
Update broken JSON schema links (#18565)
Using archive.org snapshots in case the URLs change again, like they
apparently have in the past.

Also fixing formal JavaDoc error, which does not allow bare URLs.
2024-05-04 12:31:11 +08:00
Hidan
73f2d8289b
fix(typescript-axios): Correct the content type for a list of objects in form-data when contentType is present (#18505)
* fix content type for list of objects in form-data

* updated the samples
2024-05-03 15:43:57 +02:00
Tristan
06b00e657c
Support optional singleRequestParameter (#18467) 2024-05-03 15:10:06 +02:00
En0s0und
0e809d4800
[typescript-fetch] Support fileNaming option (#18283) (#18284)
* [typescript-fetch] Support fileNaming option (#18283)

* [typescript-fetch] Support fileNaming option - add tests (#18283)

* [typescript-fetch] introduce constants
2024-05-03 15:07:54 +02:00
Jeffrey Yasskin
67a504a2f3
[typescript-fetch] Remove a cycle in the discriminator dependency graph. (#18503) 2024-05-03 15:07:02 +02:00
Aniokrait
8cb23db8c0
[html2] Fix rendering of arrays of objects in html2 docs (#18561)
* [html2] Fix array parameter rendering.

* [html2] Update html2 sample.
2024-05-03 16:54:02 +08:00
Stefan Koppier
30dc35de44
[kotlin][client] fix warning (#18560)
* [kotlin] Target correct library in jvm-spring-webclient sample

* [kotlin] Fixed warning in jvm-spring-restclient
2024-05-03 16:47:55 +08:00
Nicklas Wiegandt
ef2fa03e96
[Java][Client] Add support for the new Spring RestClient (#18522)
* feat (JAVA SPRING RESTTEMPLATE) 17571: initial commit for Spring RestClient

* feat (JAVA SPRING RESTTEMPLATE) 17571: Copied and changed the webclient mustache files

The RestClient API is oriented on the WebClient API so many parts of the templates can be the same

* fix (JAVA SPRING RESTTEMPLATE) 17571: Renaming error & add README template

The README must be changed because the minimal Java Version for this client is 17

* fix (JAVA SPRING RESTTEMPLATE) 17571: Imports, compile errors and cookie setting

* feat (JAVA SPRING RESTTEMPLATE) 17571: Add generated samples

* test (JAVA SPRING RESTTEMPLATE) 17571: Add tests

* feat (JAVA SPRING RESTTEMPLATE) 17571: Update doc

* Add the restcilent to samples-java-client-jdk17.yam

The minimum Java version of the used Spring Version is 17

* fix (JAVA SPRING RESTTEMPLATE) 17571: Workflow paths to petstore samples

* fix (JAVA SPRING RESTTEMPLATE) 17571: Regenerated samples

* feat (JAVA SPRING RESTTEMPLATE) 17571: Generated echo-api sample for RestClient

* fix (JAVA SPRING RESTTEMPLATE) 17571: Missing import

* fix (JAVA SPRING RESTTEMPLATE) 17571: Missing body class exception when null body is set

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api Auth test

* fix (JAVA SPRING RESTTEMPLATE) 17571: Gradlew file permissions

* feat (JAVA SPRING RESTTEMPLATE) 17571: Reggenerate samples after rebase

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api Body gif test

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api octet stream body test

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api multipart form data test

* fix (JAVA SPRING RESTTEMPLATE) 17571: Form as body when body is null

Also regenerated the restclient samples
2024-05-02 00:15:20 +08:00
William Cheng
d573f00e84 update go samples 2024-05-01 22:52:26 +08:00
William Cheng
9f57684dad
[PHP] Update php.md - marked Multiserver as true (#18545)
* Update php.md - marked Multiserver as true

Mulitiserver support was fully implemented 2 years ago, on PR #12982

* update php feature

* update

---------

Co-authored-by: Thomas Hansen <thomasphansen@users.noreply.github.com>
2024-05-01 19:29:48 +08:00
rledisez
230e8ce887
[go-server] add field name in parsing error messages (#18533)
Currently when a parsing rule of a field is not respected (eg: min/max
value, required, ...), the api only returns an  error message without
providing the field name to help the user to fix the request. This commit
add the field name to the error message to help the user of the API.
2024-05-01 19:28:51 +08:00
Richard Lavoie
10897caf37
[go-server] fix imports with go generation (#18514)
* fix imports with go generation

* Wrong copy over

* Missing new line

* tab vs space

* Fix new line between router and std go libs

* Add both use case, add samples to CI validation

* Update samples
2024-05-01 18:13:03 +08:00
Daniel Wischolek
afd3a78e20
scala-sttp: fix for issue 15785 api returns unit. (#18537) 2024-05-01 18:12:04 +08:00
Daniel Wischolek
5e40fe7f8f
scala-sttp4: fix for issue 15785 api returns unit. (#18536) 2024-05-01 18:11:52 +08:00
William Cheng
2a1b4f90df
Add new option allArgConstructor for java client, spring generators (#18538)
* allArgConstructor for java

* Remove leftover from builder pattern branch

* Rename generateConstructorWithAllArgs and use x- in vendorExtensions

* Test issue #18340

* Add evidences for allVars issue (#18340)

* remove eol

* update doc

---------

Co-authored-by: jpfinne <jeanpaul@finne.be>
2024-05-01 18:10:35 +08:00
Simon Podlipsky
98d026118c
feat(php): allow to pass raw boolean to api (#18520)
This allows users to use APIs that require booleans in query params not to be cast to int, e.g. `&foo=true`. Currently, `true` is cast to `1` so it's passed as `&foo=1`. That might not be supported by the target API.

The fix contains copy-pasted function from guzzlehttp/psr7 `Query::build()` with minor tweak.
2024-05-01 18:10:00 +08:00
Bruno Coelho
0768ddcd7c
[swift] support content type application json variants (#18539)
* [swift] support content type application json variants

* [swift] support content type application json variants
2024-04-30 11:16:28 +01:00
Arivanandan
a4cf255dce
Add useSingleRequestParameter to typescript-nestjs generator (#18476)
* feat: change template to use useSingleRequestParameter

* chore: add useSingleRequestParameter option

* chore: generate-samples, docs and fix spacing in template

* chore: remove random white space
2024-04-30 15:07:57 +08:00
Phellippe Lima
e36172090e
fix: ExampleGenerator for composed child schemas and array schemas (#18479)
* fix: ExampleGenerator for composed child schemas and array schemas correctly

* fix: refactor to remove code duplication

* fix: fixes test assertion encoding

* fix: adds doc to new method
2024-04-30 14:36:49 +08:00
Zishun (Zack) Wei
81fab15a33
[PYTHON] Fix for failing to lookup discriminator value using AllOf and discriminator (#18498)
* fix issue 18495

* add tests and update samples

* update samples
2024-04-30 14:21:20 +08:00
Erko Risthein
bd02e65f88
[Java] Update Java version in GitHub actions (#18513)
* Update Java version in Github actions

* Generate samples

* [java] Upgrade Gradle wrapper to 8.7

* Generate samples

* [Java] Add resttemplate-jakarta to CI

* Upgrade CI machines to ubuntu-2204:2024.04.4 which use Java 21

* Change CI machines to ubuntu-2204:2024.01.1 which use Java 17

* Change CI machines to ubuntu-2004:2024.01.1

* [ruby] Update Gemfile.locks

* Use gradle wrapper for samples-java-client-jdk17
2024-04-30 13:57:01 +08:00
jase
8faa77cd1c
fix(typescript-angular): make sure basePath is defined before assignment (#18457)
* fix(typescript-angular): make sure basePath is defined before assignment

* Update modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* chore(typescript-angular): update examples

---------

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2024-04-29 18:07:45 +02:00
William Cheng
5f136557ba update php samples 2024-04-29 09:38:58 +08:00
Daniel Schreiber
7070255dc5
[php-flight] fix: parsing class/enum models (#18528) 2024-04-29 09:32:12 +08:00
Tadas Krivickas
06ed7c8205
[dart] [dart-dio] Support Dart3 (#18001)
* Support both dart 2.x and 3.x

* Append dart3 keywords

* Update docs
2024-04-28 22:09:10 +08:00
William Cheng
f8d91510a9
clean up supporting-mustache (#18524) 2024-04-28 20:45:42 +08:00
Ashish Mathew
519eaf6bf3
fix post process file type (#18519) 2024-04-28 20:30:54 +08:00
martin-mfg
c16f7f0aad
better example of user defined supporting file (#18512) 2024-04-27 15:35:49 +08:00
William Cheng
1751163f36
fix null type check when simplifying any type (#18504) 2024-04-26 13:16:59 +08:00
William Cheng
a5ccd7a77e fix array default check in php nextgen 2024-04-26 10:10:13 +08:00
Jeffrey Yasskin
fd90aa6347
Use the current Java version in devcontainer.json. (#18502) 2024-04-26 09:38:23 +08:00
William Cheng
a5d463d90f
made the HttpSigning method public to get the signed header. (#18496)
Co-authored-by: Ghufran Zahidi <18732053+Ghufz@users.noreply.github.com>
2024-04-25 16:08:57 +08:00
William Cheng
a00549cd65
Add an option to skip unmarshall json in Go client generator (#18448)
* feat(go): Add a vendor extension to option out of generating the UnmarshalJSON method

* add generate unmarshal json option in go client generator

* update doc

---------

Co-authored-by: Radoslav Kotsev <radoslav.kotsev@cellpointmobile.com>
2024-04-25 12:52:48 +08:00
William Cheng
3bd6d67cc0
(java client) minor code enhancements (#18493)
* (java client) minor code enhancements

* update doc
2024-04-25 12:51:18 +08:00
William Cheng
1bb4d42216
update readme, format code (php flight) (#18492)
* update readme, format code (php flight)

* add flight to the list

* update samples
2024-04-25 10:58:11 +08:00
Elric Milon
d7b808e2e9
[Rust] Add support for base64-encoded byte arrays (#18469)
Co-authored-by: Elric Milon <whirm@gmx.com>
2024-04-25 10:26:34 +08:00
Aaron Pritzlaff
efb7e5624d
Cask version fix (#18486)
* using artefact version in build

* using artefact version in build

* cask knows how to honour artifact versions
2024-04-24 23:50:14 +08:00
Alexander Karkossa
50945d0e17
[Kotlin] fix wrong type- and importMapping for kotlinx.date (#17597) (#18488) 2024-04-24 16:42:57 +01:00
Even André Fiskvik
fbe2e0b18f
Fix enum value issues in path or query (#18483) 2024-04-24 12:57:25 +01:00
Aaron Pritzlaff
4dc8531a67
fix for the artefact names in scala cask (#18480)
* fix for the artefact names in scala cask

* updated the sample
2024-04-24 18:50:00 +08:00
William Cheng
59ba346306 update samples 2024-04-24 15:34:02 +08:00
Amin Yahyaabadi
7036b99e91
[cpp-restsdk] add support for AnyType (#18463)
* [cpp-restsdk] add support for AnyType

* [cpp-restsdk] fix the AnyType header generation path
2024-04-24 13:44:21 +08:00
Amin Yahyaabadi
dc96d648f7
docs: add instruction for building the binary (#18473) 2024-04-24 13:36:55 +08:00
William Cheng
1d67d0632d update samples 2024-04-23 21:32:52 +08:00
Duc Nguyen
d71df6ab85
fix incorrect JsonProperty in pojo constructor (#18421) 2024-04-23 15:45:10 +08:00