2387 Commits

Author SHA1 Message Date
Aaron Pritzlaff
e6964482b8
Service api fix (#18767)
* moved service api into shared source

* moved service api into shared source

* This Scala cask change makes the service traits available to 
Both JVM and JS platforms.

It does this by moving the api interfaces into the cross-platform
Shared sources
2024-05-26 21:37:35 +08:00
Jimmy Praet
6a9b10075e
Make JAX-RS BuilderImpl class non-final to fix WELD-001503 issue (#18724)
Fixes #17875
2024-05-26 16:43:32 +08:00
cvkem
5e8b589bea
Fix rust server auth (#18692)
* Added authentication via Bearer-token api_key and basic for server and client

* Improved errorhandling

* Added check on oAuth audience to example

* Updates of the petstore files for Rust-server

* Moved module import to prevent issue in callbacks

* updated samples

* Fix for unused-qualifications issue

* updated sampmles
2024-05-26 16:04:14 +08:00
Ievgen Rozdymakha
0daf9ffa5b
Fix javaJaxRS template: remove deprecated in JDK9 method usage (#18728)
* Fix javaJaxRS template: remove deprecated in JDK9 method usage

* Fix javaJaxRS api template: regenerate samples
2024-05-26 15:58:41 +08:00
William Cheng
ea7609f35b
update requests in python-fastapi to newer version (#18726) 2024-05-22 00:37:02 +08:00
Renato Mameli
bfa26ea6be
Add missing underscores for PascalCase enum values #4837 (#18594)
Co-authored-by: Renato Mameli <renato.mameli@teamviewer.com>
2024-05-21 15:29:34 +08:00
William Cheng
9398c6444a update samples 2024-05-21 14:58:21 +08:00
Evgenii
73598b9dbb
[REQ] [ASPNETCORE] Add value types for the ASPNETCORE generator (#18646)
* Add value types for the ASPNETCORE generator

* generate samples
2024-05-21 14:45:54 +08:00
Stefan Koppier
27120357aa
[kotlin-wiremock] New generator for generating WireMock stubs using Kotlin (#18705)
* [kotlin] Target correct library in jvm-spring-webclient sample

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

* [kotlin-wiremock] added generator and sample

* [kotlin-wiremock] First version with petstore

* [kotlin-wiremock] Small typo

* [kotlin-wiremock] Added echo-api test

* [kotlin-wiremock] Split stub and stub builder

* [kotlin-wiremock] Added default values and jackson annotations to models

* [kotlin-wiremock] Small default value fix

* [kotlin-wiremock] Use Gradle wrapper version in samples-kotlin-server GitHub workflow

* [kotlin-wiremock] Added default artifact name

* [kotlin-wiremock] Added kotlin docs

* [kotlin-wiremock] Fixed capitalization in kotlin docs

* [kotlin-wiremock] Added kotlin-wiremock echo_api sample to GitHub workflow

* [kotlin-wiremock] Added new generator to README.md

* [kotlin-wiremock] Generated docs

* [kotlin-wiremock] Generated docs (missed commit)

* [kotlin-wiremock] Explicit Gradle wrapper version in kotlin server generators

* Revert "[kotlin-wiremock] Explicit Gradle wrapper version in kotlin server generators"

This reverts commit 71e1c47def93fdcb9c7e4efe999fc34e21d7518c.

* [kotlin-wiremock] Revert Gradle in workflow samples-kotlin-server and moved kotlin-wiremock samples to separate workflow

* [kotlin-wiremock] Use Java 11 instead of Java 8

* [kotlin-wiremock] ensure-up-to-date
2024-05-21 13:53:44 +08:00
William Cheng
741bf0c035
Prepare 7.7.0-SNAPSHOT (#18709)
* Revert "7.6.0 release"

This reverts commit d76f9d32d11a03be2b40ebff728ef0ff86332fcb.

* prepare 7.7.0 snapshot in master

* update samples
2024-05-20 17:27:17 +08:00
Kalvin Pearce
e9f961e36e
[rust-axum] Split up api trait per tag (#18621)
* [rust-axum] Feat: split up api trait per tag

* [rust-axum] Fix: missing types in api files

* [rust-axum] Fix: add samples output

* [rust-axum] Feat: handle mutli tagged operations

* [rust-axum] Fix: spacing between generated operations

* [rust-axum] Fix: coding standards
2024-05-19 17:13:01 +08:00
William Cheng
2fe397cb3e
synn beea validation template (jaxrs) (#18697) 2024-05-17 17:39:59 +08:00
Aviv Levitski
affb6bc1f7
[GO] Add assert constraints checks for complex types in the model template (#18654)
* [GO] Add assert constraints checks for complex types in the model template

* [GO] Update samples

* [GO] revert AssertRecurseInterface naming
2024-05-15 16:59:35 +08:00
Marc Le Bihan
1fa2d474b4
[[BUG][C][cpp-restsdk] Missing Set.h when trying to generate from Twitter OpenAPI JSON #9969](https://github.com/OpenAPITools/openapi-generator/issues/9969) (#18631)
- Handling `std::set` in cpp-restdsk
    - Member variables using `std:set` added to `Pet` in cpp-restsdk 3.0 Petstore sample

[cpp-pistache-server] taking into account a remark on this issue about cpp-pistache-server and its set management

    - Switching `std::vector` to `std::set` for openapi set type in cpp-pistache-server
2024-05-15 14:51:59 +08:00
William Cheng
4e61738348
upgrade microprofile to junit5 (#18669)
* upgrade microprofile to junit5

* re-generate samples

* fix junit(DOT)version

* update tests for java microprofile server

* update samples

* update

* update

* update

* update

---------

Co-authored-by: Thorsten Hirsch <t.hirsch@web.de>
2024-05-14 18:21:19 +08:00
William Cheng
926a07fe4d
Add tests for @Valid (enum) (#18664)
* add tests for #18430

* add new filies
2024-05-14 12:57:41 +08:00
CREKD
d5559d5e65
Remove @Valid even for enum types defined in components (#18451)
* Update beanValidation.mustache

* step 3

* Revert "step 3"

This reverts commit 73ba918d36e55a440da6435392729c1997266863.

* update mustache

* #

* isContainer

* step3

* ^

* fix
2024-05-14 11:56:53 +08:00
William Cheng
51ef8683fb
[java] implement #18032 add builder pattern to java client and spring generator (#18650)
* add builder pattern to java client and spring generator

* regenerate samples

* update doc

---------

Co-authored-by: jpfinne <jeanpaul@finne.be>
2024-05-14 11:38:30 +08:00
Tim Quinn
0e05cf26d9
Add support for Helidon 4 MP client and server generation (#18627)
* Add support for Helidon 4 MP client and server generation

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Rerun samples generation trying to fix spring jobs

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Update copyright

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Correct the copyright notice

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

---------

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
2024-05-12 16:49:28 +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
William Cheng
29cfa3335d
update python fastapi dependencies (#18624) 2024-05-09 13:23:16 +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
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
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
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
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
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
William Cheng
d573f00e84 update go samples 2024-05-01 22:52:26 +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
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
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
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
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
Daniel Schreiber
2217a7b0f2
feat: simple/experimental generator for flight-php server framework (#18406)
* feat: simple/experimental generator for flight-php server framework

* fix: update php-flight samples and add php-flight to integration tests

* feat: adding path to method doc
2024-04-21 23:56:59 +08:00
William Cheng
c8e835cac7
update x/net to newer version in go generators (#18447) 2024-04-21 22:01:20 +08:00
Aaron Pritzlaff
93f4323364
Taught Scala-cask to publish JS model files (#18413)
* Taught Scala-cask to publish JS model files

* cask fix for generated FILES
2024-04-20 18:23:09 +08:00
William Cheng
807250a430
Prepare 7.6.0 (#18412)
* Revert "v7.5.0 release"

This reverts commit 1eafe2aebf33b13bee0ead66d62a6436e7db059d.

* update master to v7.6.0 snapshot

* update readme

* update samples
2024-04-17 19:05:37 +08:00
William Cheng
dd97def5fa
update undertow to newer version (#18409) 2024-04-17 11:29:06 +08:00
lizzyTheLizard
213564a5aa
#18388: Add Mutiny support to JaxRS (#18389)
* #18388: Add Mutiny support to JaxRS

* Updated samples

* Updated doccs

* Updated example to 3_0

* Updated sample
2024-04-17 11:20:39 +08:00