Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allArgConstructor for java #18405

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 16 additions & 1 deletion .github/workflows/openapi-generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,23 @@ jobs:
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
- name: Delete samples that are entirely generated
run: |
rm -rf samples/client/petstore/csharp/generichost/net8/AllOf
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOf
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
rm -rf samples/client/petstore/csharp/generichost/net8/FormModels
rm -rf samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
rm -rf samples/client/petstore/csharp/generichost/net8/OneOf
rm -rf samples/client/petstore/csharp/generichost/net8/Petstore
rm -rf samples/client/petstore/csharp/generichost/net8/SourceGeneration
rm -rf samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
rm -rf samples/client/petstore/csharp/generichost/standard2.0/Petstore
- name: Generate samples
run: bash bin/generate-samples.sh
run: |
bash bin/generate-samples.sh
# when a sample is deleted, you have to generate it twice for all files to get created
bash bin/generate-samples.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR includes lots of changes not belonging to your original PR

can you please submit a new one with just the change for just "allArgConstruct for java"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry. I screwed up the merges.

Is it better now?

- name: Verify git status
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/samples-scala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- samples/server/petstore/scalatra
- samples/server/petstore/scala-finch # cannot be tested with jdk11
- samples/server/petstore/scala-http4s-server
- samples/server/petstore/scala-cask
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
| | Languages/Frameworks |
| -------------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient, pekko), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (9.x - 17.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) |
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) |
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** |
Expand Down Expand Up @@ -1102,6 +1102,7 @@ Here is a list of template creators:
* Ruby on Rails 5: @zlx
* Rust (rust-server): @metaswitch
* Scala Akka: @Bouillie
* Scala Cask: @aaronp
* Scala Finch: @jimschubert [:heart:](https://www.patreon.com/jimschubert)
* Scala Lagom: @gmkumar2005
* Scala Play: @adigerber
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ additionalProperties:
serializationLibrary: jackson
artifactId: microprofile-rest-client-3-jackson-with-xml
configKey: petstore
microprofileRestClientVersion: "3.0"
microprofileRestClientVersion: "3.0"
hideGenerationTimestamp: true
3 changes: 2 additions & 1 deletion bin/configs/java-microprofile-rest-client-3.0-jackson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ additionalProperties:
serializationLibrary: jackson
artifactId: microprofile-rest-client-3-jackson
configKey: petstore
microprofileRestClientVersion: "3.0"
microprofileRestClientVersion: "3.0"
hideGenerationTimestamp: true
3 changes: 2 additions & 1 deletion bin/configs/java-okhttp-gson-swagger1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ additionalProperties:
useOneOfDiscriminatorLookup: "true"
disallowAdditionalPropertiesIfNotPresent: false
annotationLibrary: "swagger1"

openapiNormalizer:
SET_TAGS_FOR_ALL_OPERATIONS: common
1 change: 1 addition & 0 deletions bin/configs/java-resttemplate-jakarta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
useJakartaEe: true
generatedConstructorWithAllArgs: true
1 change: 1 addition & 0 deletions bin/configs/java-resttemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
containerDefaultToNull: true
generatedConstructorWithAllArgs: true
2 changes: 1 addition & 1 deletion bin/configs/kotlin-model-prefix-type-mapping-echo-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ additionalProperties:
enumPropertyNaming: UPPERCASE
serializationLibrary: gson
openapiNormalizer:
SIMPLIFY_ONEOF_ANYOF=false
SIMPLIFY_ONEOF_ANYOF: false
2 changes: 1 addition & 1 deletion bin/configs/kotlin-model-prefix-type-mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ additionalProperties:
enumPropertyNaming: UPPERCASE
serializationLibrary: gson
openapiNormalizer:
SIMPLIFY_ONEOF_ANYOF=false
SIMPLIFY_ONEOF_ANYOF: false
13 changes: 13 additions & 0 deletions bin/configs/scala-cask-petstore-new.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
generatorName: scala-cask
outputDir: samples/server/petstore/scala-cask
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/scala-cask
additionalProperties:
hideGenerationTimestamp: "true"
artifactId: scala-cask-petstore
groupId: "cask.groupId"
package: "sample.cask"
modelPackage: "sample.cask.model"
apiPackage: "sample.cask.api"
gitRepoId: "sample-cask-repo"
gitUserId: "sample-cask-user"
1 change: 1 addition & 0 deletions bin/configs/spring-boot-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ additionalProperties:
useBeanValidation: true
withXml: true
hideGenerationTimestamp: "true"
generatedConstructorWithAllArgs: true
1 change: 1 addition & 0 deletions bin/configs/spring-boot-delegate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
delegatePattern: "true"
generatedConstructorWithAllArgs: true
1 change: 1 addition & 0 deletions bin/configs/spring-boot-lombok-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ additionalProperties:
artifactId: springboot-lombok-data
hideGenerationTimestamp: "true"
additionalModelTypeAnnotations: "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor"
generatedConstructorWithAllArgs: true
2 changes: 2 additions & 0 deletions docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ You can use also `config.yml` with following equivalent example:
apiPackage: "petstore"
```

Another example of config file can be found in [modules/openapi-generator/src/test/resources/sampleConfig.json](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/sampleConfig.json)

Supported config options can be different per language. Running `config-help -g {lang}` will show available options.
**These options are applied via configuration file (e.g. config.json or config.yml) or by passing them with `-p {optionName}={optionValue}`**. (If `-p {optionName}` does not work, please open a [ticket](https://github.com/openapitools/openapi-generator/issues/new) and we'll look into it)

Expand Down
1 change: 1 addition & 0 deletions docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ The following generators are available:
* [rust-axum (beta)](generators/rust-axum.md)
* [rust-server](generators/rust-server.md)
* [scala-akka-http-server (beta)](generators/scala-akka-http-server.md)
* [scala-cask](generators/scala-cask.md)
* [scala-finch](generators/scala-finch.md)
* [scala-http4s-server](generators/scala-http4s-server.md)
* [scala-lagom-server](generators/scala-lagom-server.md)
Expand Down
Loading