20091 Commits

Author SHA1 Message Date
William Cheng
eec30f2cda update sha256 for JSONTest.java 2024-05-12 00:08:27 +08:00
Max
d4d4c77fee
[BUG] [Java] Invalid code generation for oneof types. (#18544)
* [BUG] [Java] Invalid code generation for oneof types. #18517

* update samples

* [BUG] [Java] Invalid code generation for oneof types. #18517

* [BUG] [Java] Invalid code generation for oneof types. #18517

* [BUG] [Java] Invalid code generation for oneof types. #18544
2024-05-12 00:07:02 +08:00
Aniokrait
2a3f63f9e3
[html2] Support oneOf (#18642) 2024-05-11 23:34:36 +08:00
Aniokrait
3d96a404e6
[html2] Support alias types (#18579)
* [html2] Support alias models to render html docs.

* [html2] Fix compile error

* [html2] Update sample
2024-05-11 23:33:47 +08:00
Esteban Dugueperoux
4637658f78
fix: Upgrade testng to avoid CVE-2022-4065 (#18635) 2024-05-11 23:19:57 +08:00
William Cheng
42536932da
downgrade gradle to 7.6.4 (#18641) 2024-05-11 16:58:25 +08:00
William Cheng
65bdb99f96
update java version in build.gradle (#18640) 2024-05-11 15:23:30 +08:00
William Cheng
40c7adccd8
[gradle plug-in] update jvm target (#18639)
* update jvm target

* fix jvmTarget
2024-05-11 14:06:16 +08:00
William Cheng
4368eb45e8
update kotlin version to 1.9.0 (#18638) 2024-05-11 13:02:12 +08:00
Thorsten Hirsch
3805cf366c
upgrade resteasy to junit5 (#18615)
* upgrade resteasy to junit5

* fix echo_api tests

* updated gradle/sbt/pom and generated samples with bin/generate-samples.sh

* fix xml syntax error

* forgot to run generate-samples.sh
2024-05-10 10:51:50 +08:00
Thorsten Hirsch
854e521a06
upgrade java native to junit5 (#18617)
* upgrade java native to junit5

* upgrade build.gradle, optimize imports

* upgrade gradle, re-generate samples

* migrate api_test.mustache and petstore tests of native-async & native-jakarta
2024-05-10 10:50:54 +08:00
William Cheng
29cfa3335d
update python fastapi dependencies (#18624) 2024-05-09 13:23:16 +08:00
Charles Treatman
75dd531e65
upgrade swagger-parser to latest version (#18436)
* upgrade swagger-parser to latest version

* additional upgrades to address gradle failures
2024-05-09 12:29:33 +08:00
William Cheng
98f9c07bc4 update meta-codegen pom.xml 2024-05-09 12:29:04 +08:00
Thorsten Hirsch
5614eef995
upgrade openapi poms and codegen tests to junit5 (#18619) 2024-05-09 12:19:56 +08:00
Amrita Venkatraman
89c2664e4c
updating config options (#18614)
Co-authored-by: Amrita Venkatraman <amrita.venkatraman@mavenclinic.com>
2024-05-09 10:46:00 +08:00
Max Nachlinger
03389dfdbd
Bump Rust edition to 2021 and a few crates (#18608)
* bump Rust edition to 2021, update a few creates

* bump Rust edition to 2021, update a few creates
2024-05-09 10:43:11 +08:00
Thorsten Hirsch
b67a019cf9
upgrade apache-httpclient to junit5 (#18616) 2024-05-09 09:54:32 +08:00
William Cheng
4441ab303f
[jaxrs-spec] fix nullable import, migrate tests to 3.0 spec (#18606)
* update samples

* fix nullable, better test (jaxrs-spec)

* Revert "update samples"

This reverts commit 2377d98de3b38a105fc970e8a97282fafb8a48ad.

* update samples
2024-05-08 17:45:43 +08:00
William Cheng
8226ff8f96
[python-flask] deference parameter schemas before further processing (#18605)
* update samples

* deref parameter, add null check

* Revert "update samples"

This reverts commit 2377d98de3b38a105fc970e8a97282fafb8a48ad.
2024-05-08 17:00:19 +08:00
Daniel Schreiber
9db0e3237c
[php-flight] fix: always set http status in streaming response and use http status from spec (#18604)
This additionally adds streaming stubs for all methods (rather err on the side of too much stubs).
2024-05-08 14:26:41 +08:00
Max Nachlinger
ac649b2e2f
Disable clippy::too_many_arguments in generated Rust client code. (#18601) 2024-05-08 11:52:20 +08:00
Ween Jiann
8f6a2860bf
[go-server] Fix: error handling and linting (#18550)
* Update error.go and fix lint

* Regen

* Fix incorrect change

* Fix handler issue

* Regenerate
2024-05-08 00:06:45 +08:00
myz-dev
06499605e1
[RUST-AXUM] Fix #18580: disableValidation does not create superfluous code (#18592)
* fix: Respect `disableValidator` CLI option

Setting the `disableValidator` option to `true` used to generate
validation code but avoid calling it from the route handlers.
This generated invalid code in some cases.
This commit renders the `server-operation-validate` only, when the
`disableValidator` option is set to false (the default value).

* test: Update examples and run integration test

The generated samples are updated with:
`./bin/generate-samples.sh ./bin/configs/manual/*.yaml`
The relevant integration test
`mvn integration-test -f samples/server/petstore/rust-axum/pom.xml`
passes.

* test: Add integration test

This integration tests provokes the generation of code that would
not compile (see #18580). The new change that makes sure validation
logic is not rendered when disabled, makes sure the faulty code is not
generated and therefore the project compiles.

* test: Update examples and run integration test

The generated samples are updated with:
`./bin/generate-samples.sh ./bin/configs/manual/*.yaml`

The relevant integration test
`mvn integration-test -f samples/server/petstore/rust-axum/pom.xml`
passes.
2024-05-07 21:02:45 +08:00
myz-dev
2d967ccae8
[Rust-Axum] Fix uuid in header params causing compilation errors (#18563)
* fix: Fix uuid in header params causing errors

Routes with header parameters with a `format` of `uuid` in the openAPI
specification used to cause a compilation error in the resulting
Rust Axum code.
This commit fixes the issue by including the correct conversion trait
implementation on the condition that at least one header parameter of
`format` `uuid` is included in the specification.

* refactor: Add final to boolean

* fix: Bring str::FromStr optionally into scope

The trait needs to be in scope for the TryFrom implementation:
`TryFrom<HeaderValue> for IntoHeaderValue<uuid::Uuid> `
It will only be brought into scope when the implementation is rendered.

* test: Add integration test and its specification

This commit adds an integration test that tests the bug fix for #18554.
A header parameter of `format: uuid` is included in one route.
This makes the example create a route handler that tries to extract a
Rust `uuid::Uuid` type from the header. The integration test will check
that the generated code compiles.

* test: Update examples and run integration test

The generated samples are updated with:
`./bin/generate-samples.sh ./bin/configs/manual/*.yaml`
Most example projects have their version numbers bumped. Some changes
show, that there are some other unrelated changes to the files, which
indicates that some prior commit did not update the samples accordingly.
The relevant integration test
`mvn integration-test -f samples/server/petstore/rust-axum/pom.xml`
passes.
2024-05-07 21:02:19 +08:00
William Cheng
9929d35166
[refactor] Use getType in ModelUtils (#18577)
* use getType in model utils

* add tests

* update
2024-05-07 18:05:22 +08:00
keyjh2
be94c22d08
[C++][Pistache] Compile error when nesting references (#16711) (#18586)
When components/schema/<object> reference other objects, validate() was
getting called on the referenced objects with no arguments. The return
value was void, but checked as if it was a boolean value.
2024-05-07 17:15:42 +08:00
kiwi-oss
dec8a430df
[Microprofile] Add option to use tags a client keys and server generator (#16673)
* [Java/Microprofile] Add support for Jackson serialization & async interfaces using Mutiny in Java Microprofile library

* Regenerate samples & docs

* Add server generator

* Update client to set configKey by classname

* Remove debug remains and comments

* Adapt method override to upstream changes

* Regenerate samples

* Revert "Regenerate samples"

This reverts commit b5bcbdea90c71a2819a3ea6339c3878f249f97b4.

* Move additional 2xx response to dedicated OpenAPI document

Some other generators than those for Micronaut don't seem to be able to
handle this case, so we don't add it to the general pet store document.

* Make filename consistent with other files in the folder

* Regenerate Microprofile client and server samples

* Generate samples

* Update documentation

* Generate samples

* Remove left-over `*.orig` files from Git merges

* Regenerate samples

* Regenerated samples

* changed generator name to "java-microprofile"

* added the new folder to .github/workflows/samples-java-server-jdk8.yaml so that CI will test it moving forward

* Renamed JavaMicroprofileServerCodegen.java

* regenerated samples

* only enable configKeyFromClassName if configKey is not set

* Updated documentation

* Change samples to use junit 4

* Fix junit 4 test classes

* run ensure up-to-date script

* fix kotlin test errors

---------

Co-authored-by: pravussum <pravussum@users.noreply.github.com>
Co-authored-by: frank <frank.buechel@kiwigrid.com>
Co-authored-by: Oscar <oscar.obrien@kiwigrid.com>
Co-authored-by: oscarobr <133783370+oscarobr@users.noreply.github.com>
2024-05-07 16:24:23 +08:00
William Cheng
dc63444789 update samples 2024-05-07 12:30:21 +08:00
Reinhard Handler
2fb41ac529
[JAVA] Fix generation of remove method of map entries (#18562)
* Fix generation of remove method for map entries

Map::remove in java removes entries by key, therefore the key must be used as parameter.

* Fix generation of remove method for map entries

Map::remove in java removes entries by key, therefore the key must be used as parameter.

---------

Co-authored-by: Reinhard Handler <reinhard.handler@ssi-schaefer.com>
2024-05-07 12:13:15 +08:00
keyjh2
228b47a953
[go-server] Fix: missing sample changes from previous commit (#18546) (#18588) 2024-05-07 11:27:19 +08:00
Ween Jiann
cefbf62060
[go-server] Fix: missing quotes for string default value (#18546)
* Update controller mustache

* Add tests to openapi doc

* Regen
2024-05-06 14:17:44 +08:00
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