Skip to content

Commit

Permalink
Add support for Helidon 4 MP client and server generation (#18627)
Browse files Browse the repository at this point in the history
* Add support for Helidon 4 MP client and server generation

Signed-off-by: Tim Quinn <[email protected]>

* Rerun samples generation trying to fix spring jobs

Signed-off-by: Tim Quinn <[email protected]>

* Update copyright

Signed-off-by: Tim Quinn <[email protected]>

* Correct the copyright notice

Signed-off-by: Tim Quinn <[email protected]>

---------

Signed-off-by: Tim Quinn <[email protected]>
  • Loading branch information
tjquinno authored May 12, 2024
1 parent 4b56fd2 commit 0e05cf2
Show file tree
Hide file tree
Showing 953 changed files with 27,164 additions and 287 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Samples Java Helidon
name: Samples Java Helidon v3

on:
push:
paths:
- samples/client/petstore/java-helidon-client/**
- samples/server/petstore/java-helidon-server/**
- samples/client/petstore/java-helidon-client/v3/**
- samples/server/petstore/java-helidon-server/v3/**
pull_request:
paths:
- samples/client/petstore/java-helidon-client/**
- samples/server/petstore/java-helidon-server/**
- samples/client/petstore/java-helidon-client/v3/**
- samples/server/petstore/java-helidon-server/v3/**
jobs:
build:
name: Build Java Helidon
Expand All @@ -17,10 +17,10 @@ jobs:
fail-fast: false
matrix:
sample:
- samples/client/petstore/java-helidon-client/mp
- samples/client/petstore/java-helidon-client/se
- samples/server/petstore/java-helidon-server/mp
- samples/server/petstore/java-helidon-server/se
- samples/client/petstore/java-helidon-client/v3/mp
- samples/client/petstore/java-helidon-client/v3/se
- samples/server/petstore/java-helidon-server/v3/mp
- samples/server/petstore/java-helidon-server/v3/se
version: [17]
steps:
- uses: actions/checkout@v4
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/samples-java-helidon-v4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Samples Java Helidon v4

on:
push:
paths:
- samples/client/petstore/java-helidon-client/v4/**
- samples/server/petstore/java-helidon-server/v4/**
pull_request:
paths:
- samples/client/petstore/java-helidon-client/v4/**
- samples/server/petstore/java-helidon-server/v4/**
jobs:
build:
name: Build Java Helidon
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/java-helidon-client/v4/mp
- samples/server/petstore/java-helidon-server/v4/mp
version: [21]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.version }}
- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: maven-repository
with:
path: |
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Build
working-directory: ${{ matrix.sample }}
run: mvn clean package
24 changes: 12 additions & 12 deletions .github/workflows/samples-jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ on:
paths:
# clients
- samples/openapi3/client/petstore/spring-cloud-3/**
- samples/client/petstore/java-helidon-client/mp/**
- samples/client/petstore/java-helidon-client/se/**
- samples/client/petstore/java-helidon-client/v3/mp/**
- samples/client/petstore/java-helidon-client/v3/se/**
- samples/client/petstore/spring-http-interface-reactive/**
- samples/client/petstore/spring-http-interface/**
- samples/client/petstore/java/webclient-jakarta/**
# servers
- samples/openapi3/server/petstore/springboot-3/**
- samples/server/petstore/java-helidon-server/mp/**
- samples/server/petstore/java-helidon-server/se/**
- samples/server/petstore/java-helidon-server/v3/mp/**
- samples/server/petstore/java-helidon-server/v3/se/**
pull_request:
paths:
# clients
- samples/openapi3/client/petstore/spring-cloud-3/**
- samples/client/petstore/java-helidon-client/mp/**
- samples/client/petstore/java-helidon-client/se/**
- samples/client/petstore/java-helidon-client/v3/mp/**
- samples/client/petstore/java-helidon-client/v3/se/**
- samples/client/petstore/spring-http-interface-reactive/**
- samples/client/petstore/spring-http-interface/**
- samples/client/petstore/java/webclient-jakarta/**
# servers
- samples/openapi3/server/petstore/springboot-3/**
- samples/server/petstore/java-helidon-server/mp/**
- samples/server/petstore/java-helidon-server/se/**
- samples/server/petstore/java-helidon-server/v3/mp/**
- samples/server/petstore/java-helidon-server/v3/se/**
jobs:
build:
name: Build with JDK17
Expand All @@ -36,15 +36,15 @@ jobs:
sample:
# clients
- samples/openapi3/client/petstore/spring-cloud-3
- samples/client/petstore/java-helidon-client/mp
- samples/client/petstore/java-helidon-client/se
- samples/client/petstore/java-helidon-client/v3/mp/
- samples/client/petstore/java-helidon-client/v3/se
- samples/client/petstore/spring-http-interface-reactive
- samples/client/petstore/spring-http-interface
- samples/client/petstore/java/webclient-jakarta
# servers
- samples/openapi3/server/petstore/springboot-3
- samples/server/petstore/java-helidon-server/mp
- samples/server/petstore/java-helidon-server/se
- samples/server/petstore/java-helidon-server/v3/mp/
- samples/server/petstore/java-helidon-server/v3/se
- samples/client/petstore/spring-http-interface-reactive
- samples/client/petstore/spring-http-interface
steps:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/samples-jdk21.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Samples JDK21
on:
push:
paths:
# clients
- samples/client/petstore/java-helidon-client/v4/mp/**
# servers
- samples/server/petstore/java-helidon-server/v4/mp/**
pull_request:
paths:
# clients
- samples/client/petstore/java-helidon-client/v4/mp/**
# servers
- samples/server/petstore/java-helidon-server/v4/mp/**
jobs:
build:
name: Build with JDK21
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# clients
- samples/client/petstore/java-helidon-client/v4/mp/
# servers
- samples/server/petstore/java-helidon-server/v4/mp/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: maven-repository
with:
path: |
~/.m2
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Build
working-directory: ${{ matrix.sample }}
run: mvn clean package
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
generatorName: java-helidon-client
library: mp
outputDir: samples/client/petstore/java-helidon-client/mp
outputDir: samples/client/petstore/java-helidon-client/v3/mp
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
additionalProperties:
helidonVersion: 3.2.7
artifactId: petstore-helidon-client-mp
hideGenerationTimestamp: "true"
configureAuth: "false"
Expand Down
14 changes: 14 additions & 0 deletions bin/configs/java-helidon-client-mp_4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
generatorName: java-helidon-client
library: mp
outputDir: samples/client/petstore/java-helidon-client/v4/mp
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
additionalProperties:
helidonVersion: 4.0.8
artifactId: petstore-helidon-client-mp
hideGenerationTimestamp: "true"
configureAuth: "false"
build: "all"
test: "spock"
requiredPropertiesInConstructor: "false"
visitable: "true"
fullProject: "true"
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
generatorName: java-helidon-client
library: se
outputDir: samples/client/petstore/java-helidon-client/se
outputDir: samples/client/petstore/java-helidon-client/v3/se
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
additionalProperties:
helidonVersion: 3.2.7
artifactId: petstore-helidon-client-se
hideGenerationTimestamp: "true"
configureAuth: "false"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
generatorName: java-helidon-server
library: mp
outputDir: samples/server/petstore/java-helidon-server/mp
outputDir: samples/server/petstore/java-helidon-server/v3/mp
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/java-helidon/server
additionalProperties:
helidonVersion: 3.2.7
artifactId: petstore-helidon-server-mp
hideGenerationTimestamp: "true"
build: "all"
Expand Down
13 changes: 13 additions & 0 deletions bin/configs/java-helidon-server-mp_4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
generatorName: java-helidon-server
library: mp
outputDir: samples/server/petstore/java-helidon-server/v4/mp
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/java-helidon/server
additionalProperties:
helidonVersion: 4.0.8
artifactId: petstore-helidon-server-mp
hideGenerationTimestamp: "true"
build: "all"
test: "spock"
useAuth: "false"
fullProject: "true"
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
generatorName: java-helidon-server
library: se
outputDir: samples/server/petstore/java-helidon-server/se
outputDir: samples/server/petstore/java-helidon-server/v3/se
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/java-helidon/server
additionalProperties:
helidonVersion: 3.2.7
artifactId: petstore-helidon-server-se
hideGenerationTimestamp: "true"
fullProject: "true"
2 changes: 1 addition & 1 deletion docs/generators/java-helidon-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| ||
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|helidonVersion|Helidon version for generated code| |3.0.1|
|helidonVersion|Helidon complete version identifier or major version number. The specified exact Helidon release or, if specified as a major version the latest release of that major version, is used in the generated code.| |Highest released version.|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
Expand Down
4 changes: 2 additions & 2 deletions docs/generators/java-helidon-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|gradleProject|Whether to generate gradle project instead of maven.| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|helidonVersion|Helidon version for generated code| |3.0.1|
|helidonVersion|Helidon complete version identifier or major version number. The specified exact Helidon release or, if specified as a major version the latest release of that major version, is used in the generated code.| |Highest released version.|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|
|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false|
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
|invokerPackage|root package for generated code| |org.openapitools.server|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|library|library template (sub-template) to use|<dl><dt>**mp**</dt><dd>Helidon MP Server</dd><dt>**se**</dt><dd>Helidon SE Server</dd><dt>**nima**</dt><dd>Helidon NIMA Server</dd><dt>**nima-annotations**</dt><dd>Helidon NIMA Annotations Server</dd></dl>|se|
|library|library template (sub-template) to use|<dl><dt>**mp**</dt><dd>Helidon MP Server</dd><dt>**se**</dt><dd>Helidon SE Server</dd></dl>|se|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.server.model|
Expand Down
5 changes: 5 additions & 0 deletions modules/openapi-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@
<artifactId>commons-text</artifactId>
<version>${commons-text.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
<version>${resolver-util-version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
Expand Down
Loading

0 comments on commit 0e05cf2

Please sign in to comment.