diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index b52ce072c0d5..c09be51c16be 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -1,6 +1,7 @@ name: Docker tests on: + workflow_dispatch: push: paths: - Dockerfile @@ -27,7 +28,7 @@ jobs: shell: bash run: | sed -i 's/ -it / /g' run-in-docker.sh - ./run-in-docker.sh mvn clean install + ./run-in-docker.sh mvn -B clean install - name: Build Dockerfile shell: bash diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml index 8ee577de2c86..ac957abd3555 100644 --- a/.github/workflows/samples-dotnet.yaml +++ b/.github/workflows/samples-dotnet.yaml @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: Build working-directory: ${{ matrix.sample }} run: dotnet build Org.OpenAPITools.sln diff --git a/.github/workflows/samples-java-client-echo-api-jdk11.yaml b/.github/workflows/samples-java-client-echo-api-jdk11.yaml index d32c404a1a71..81ad9aa97bfa 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk11.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk11.yaml @@ -19,6 +19,7 @@ jobs: - samples/client/echo_api/java/apache-httpclient - samples/client/echo_api/java/native - samples/client/echo_api/java/feign-gson + - samples/client/echo_api/java/resttemplate steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v3 diff --git a/.github/workflows/samples-java-client-echo-api-jdk8.yaml b/.github/workflows/samples-java-client-echo-api-jdk8.yaml index 5f91e7c8db88..7578af1baa6d 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk8.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk8.yaml @@ -6,11 +6,13 @@ on: - samples/client/echo_api/java/apache-httpclient/** - samples/client/echo_api/java/feign-gson/** - samples/client/echo_api/java/okhttp-gson/** + - samples/client/echo_api/java/resttemplate/** pull_request: paths: - samples/client/echo_api/java/apache-httpclient/** - samples/client/echo_api/java/feign-gson/** - samples/client/echo_api/java/okhttp-gson/** + - samples/client/echo_api/java/resttemplate/** jobs: build: name: Build Java Client JDK8 @@ -23,6 +25,7 @@ jobs: - samples/client/echo_api/java/apache-httpclient - samples/client/echo_api/java/feign-gson - samples/client/echo_api/java/okhttp-gson + - samples/client/echo_api/java/resttemplate steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v3 diff --git a/.hub.cli.dockerfile b/.hub.cli.dockerfile index fe18ad8dd3f8..5a3041dc1084 100644 --- a/.hub.cli.dockerfile +++ b/.hub.cli.dockerfile @@ -3,19 +3,19 @@ ## ## You can build _just_ this part with: ## docker --target builder -t container-name:builder -f .hub.cli.dockerfile . -FROM maven:3.6.3-jdk-11-openj9 as builder +FROM maven:3-eclipse-temurin-17 as builder ENV GEN_DIR /opt/openapi-generator WORKDIR ${GEN_DIR} COPY . ${GEN_DIR} # Pre-compile openapi-generator-cli -RUN mvn -am -pl "modules/openapi-generator-cli" package +RUN mvn -B -am -pl "modules/openapi-generator-cli" package ## The final (release) image ## The resulting container here only needs the target jar ## and ca-certificates (to be able to query HTTPS hosted specs) -FROM openjdk:11.0.8-jre-slim-buster +FROM eclipse-temurin:17-jre ENV GEN_DIR /opt/openapi-generator diff --git a/.hub.online.dockerfile b/.hub.online.dockerfile index 4c7e01e3a24a..1d0b3a4aeed6 100644 --- a/.hub.online.dockerfile +++ b/.hub.online.dockerfile @@ -3,18 +3,18 @@ ## ## You can build _just_ this part with: ## docker --target builder -t container-name:builder -f .hub.online.dockerfile . -FROM maven:3.6.3-jdk-11-openj9 as builder +FROM maven:3-eclipse-temurin-17 as builder ENV GEN_DIR /opt/openapi-generator WORKDIR ${GEN_DIR} COPY . ${GEN_DIR} # Pre-compile openapi-generator-online -RUN mvn -am -pl "modules/openapi-generator-online" package +RUN mvn -B -am -pl "modules/openapi-generator-online" package ## The final (release) image ## The resulting container here only needs the target jar -FROM openjdk:11.0.8-jre-slim-buster +FROM eclipse-temurin:17-jre ENV GEN_DIR /opt/openapi-generator ENV TARGET_DIR /generator diff --git a/Dockerfile b/Dockerfile index b1ca47344ed0..163f62d45d4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM maven:3.6.3-jdk-11-openj9 +FROM maven:3-eclipse-temurin-17 ENV GEN_DIR /opt/openapi-generator WORKDIR ${GEN_DIR} @@ -20,7 +20,7 @@ COPY ./modules/openapi-generator ${GEN_DIR}/modules/openapi-generator COPY ./pom.xml ${GEN_DIR} # Pre-compile openapi-generator-cli -RUN mvn -am -pl "modules/openapi-generator-cli" package +RUN mvn -B -am -pl "modules/openapi-generator-cli" package # This exists at the end of the file to benefit from cached layers when modifying docker-entrypoint.sh. COPY docker-entrypoint.sh /usr/local/bin/ diff --git a/bin/configs/csharp-generichost-latest-allOf.yaml b/bin/configs/csharp-generichost-latest-allOf.yaml index e2b84e08d307..90a4f177ce36 100644 --- a/bin/configs/csharp-generichost-latest-allOf.yaml +++ b/bin/configs/csharp-generichost-latest-allOf.yaml @@ -9,3 +9,4 @@ additionalProperties: useCompareNetObjects: true disallowAdditionalPropertiesIfNotPresent: false nullableReferenceTypes: true + equatable: true diff --git a/bin/configs/csharp-generichost-latest-anyOf.yaml b/bin/configs/csharp-generichost-latest-anyOf.yaml index fc6e4bd4298c..e4b2f31aed28 100644 --- a/bin/configs/csharp-generichost-latest-anyOf.yaml +++ b/bin/configs/csharp-generichost-latest-anyOf.yaml @@ -9,3 +9,4 @@ additionalProperties: useCompareNetObjects: true disallowAdditionalPropertiesIfNotPresent: false nullableReferenceTypes: true + equatable: true diff --git a/bin/configs/csharp-generichost-latest-nrt-useSourceGeneration.yaml b/bin/configs/csharp-generichost-latest-nrt-useSourceGeneration.yaml index 392e76b045f1..30c8ad9fcb25 100644 --- a/bin/configs/csharp-generichost-latest-nrt-useSourceGeneration.yaml +++ b/bin/configs/csharp-generichost-latest-nrt-useSourceGeneration.yaml @@ -10,3 +10,4 @@ additionalProperties: disallowAdditionalPropertiesIfNotPresent: false useSourceGeneration: true packageName: UseSourceGeneration + equatable: true diff --git a/bin/configs/csharp-generichost-latest-nrt.yaml b/bin/configs/csharp-generichost-latest-nrt.yaml index d5b834cf314e..699fd70d3f95 100644 --- a/bin/configs/csharp-generichost-latest-nrt.yaml +++ b/bin/configs/csharp-generichost-latest-nrt.yaml @@ -9,3 +9,4 @@ additionalProperties: useCompareNetObjects: true disallowAdditionalPropertiesIfNotPresent: false nullableReferenceTypes: true + equatable: true diff --git a/bin/configs/csharp-generichost-latest-oneOf.yaml b/bin/configs/csharp-generichost-latest-oneOf.yaml index 01b2b4d7fcaa..5b38dc3e7fb2 100644 --- a/bin/configs/csharp-generichost-latest-oneOf.yaml +++ b/bin/configs/csharp-generichost-latest-oneOf.yaml @@ -9,3 +9,4 @@ additionalProperties: useCompareNetObjects: true disallowAdditionalPropertiesIfNotPresent: false nullableReferenceTypes: true + equatable: true diff --git a/bin/configs/csharp-generichost-latest.yaml b/bin/configs/csharp-generichost-latest.yaml index e850d31280c3..82360fcae46f 100644 --- a/bin/configs/csharp-generichost-latest.yaml +++ b/bin/configs/csharp-generichost-latest.yaml @@ -9,3 +9,4 @@ additionalProperties: useCompareNetObjects: true disallowAdditionalPropertiesIfNotPresent: false nullableReferenceTypes: false + equatable: true diff --git a/bin/configs/csharp-generichost-netstandard2.0.yaml b/bin/configs/csharp-generichost-netstandard2.0.yaml index fbe662deba01..4c9c8828291e 100644 --- a/bin/configs/csharp-generichost-netstandard2.0.yaml +++ b/bin/configs/csharp-generichost-netstandard2.0.yaml @@ -9,3 +9,4 @@ additionalProperties: useCompareNetObjects: true disallowAdditionalPropertiesIfNotPresent: false targetFramework: netstandard2.0 + equatable: true diff --git a/bin/configs/csharp-httpclient-netstandard2.0.yaml b/bin/configs/csharp-httpclient-netstandard2.0.yaml index e431b385e39b..326f8df942b7 100644 --- a/bin/configs/csharp-httpclient-netstandard2.0.yaml +++ b/bin/configs/csharp-httpclient-netstandard2.0.yaml @@ -10,3 +10,4 @@ additionalProperties: disallowAdditionalPropertiesIfNotPresent: false useOneOfDiscriminatorLookup: true targetFramework: netstandard2.0 + equatable: true diff --git a/bin/configs/csharp-restsharp-echo-api.yaml b/bin/configs/csharp-restsharp-echo-api.yaml index 3380ae3c3d2c..4d93a0d3562d 100644 --- a/bin/configs/csharp-restsharp-echo-api.yaml +++ b/bin/configs/csharp-restsharp-echo-api.yaml @@ -7,3 +7,4 @@ additionalProperties: targetFramework: net6.0 setCompareNetObjects: "true" hideGenerationTimestamp: "true" + equatable: true diff --git a/bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml b/bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml index 5176032c265d..9a44c9236166 100644 --- a/bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml +++ b/bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml @@ -6,3 +6,4 @@ additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' targetFramework: netstandard2.1;net47 useCompareNetObjects: "true" + equatable: true diff --git a/bin/configs/csharp-restsharp-net4.7.yaml b/bin/configs/csharp-restsharp-net4.7.yaml index 91985cd8faa0..7222a6bbcee5 100644 --- a/bin/configs/csharp-restsharp-net4.7.yaml +++ b/bin/configs/csharp-restsharp-net4.7.yaml @@ -10,3 +10,4 @@ additionalProperties: useOneOfDiscriminatorLookup: true targetFramework: net47 skipOneOfAnyOfGetter: true + equatable: true diff --git a/bin/configs/csharp-restsharp-net4.8.yaml b/bin/configs/csharp-restsharp-net4.8.yaml index 29c4ac2b8f80..25b55bc3b820 100644 --- a/bin/configs/csharp-restsharp-net4.8.yaml +++ b/bin/configs/csharp-restsharp-net4.8.yaml @@ -9,3 +9,4 @@ additionalProperties: disallowAdditionalPropertiesIfNotPresent: false useOneOfDiscriminatorLookup: true targetFramework: net48 + equatable: true diff --git a/bin/configs/csharp-restsharp-net6.0-name-mappings.yaml b/bin/configs/csharp-restsharp-net6.0-name-mappings.yaml index 56af6a800cb7..e58d9e57686a 100644 --- a/bin/configs/csharp-restsharp-net6.0-name-mappings.yaml +++ b/bin/configs/csharp-restsharp-net6.0-name-mappings.yaml @@ -16,3 +16,4 @@ additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' hideGenerationTimestamp: "true" targetFramework: net6.0 + equatable: true diff --git a/bin/configs/csharp-restsharp-net7.0-compareNetObjects.yaml b/bin/configs/csharp-restsharp-net7.0-compareNetObjects.yaml index 597c7c328c75..7015e00a2779 100644 --- a/bin/configs/csharp-restsharp-net7.0-compareNetObjects.yaml +++ b/bin/configs/csharp-restsharp-net7.0-compareNetObjects.yaml @@ -6,3 +6,4 @@ additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' targetFramework: net7.0 useCompareNetObjects: "true" + equatable: true diff --git a/bin/configs/csharp-restsharp-net7.0.yaml b/bin/configs/csharp-restsharp-net7.0.yaml index 347ac99a2b35..402113ed6e2f 100644 --- a/bin/configs/csharp-restsharp-net7.0.yaml +++ b/bin/configs/csharp-restsharp-net7.0.yaml @@ -9,3 +9,4 @@ additionalProperties: disallowAdditionalPropertiesIfNotPresent: false useOneOfDiscriminatorLookup: true targetFramework: net7.0 + equatable: true diff --git a/bin/configs/csharp-restsharp-netstandard2.0-complexfiles.yaml b/bin/configs/csharp-restsharp-netstandard2.0-complexfiles.yaml index efd6022c6e89..a6782e9387b9 100644 --- a/bin/configs/csharp-restsharp-netstandard2.0-complexfiles.yaml +++ b/bin/configs/csharp-restsharp-netstandard2.0-complexfiles.yaml @@ -6,5 +6,6 @@ additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' targetFramework: netstandard2.0 useCompareNetObjects: "true" + equatable: true globalProperties: skipFormModel: "false" diff --git a/bin/configs/csharp-restsharp-netstandard2.0-conditionalSerialization.yaml b/bin/configs/csharp-restsharp-netstandard2.0-conditionalSerialization.yaml index b92f3bac2243..100203b43a69 100644 --- a/bin/configs/csharp-restsharp-netstandard2.0-conditionalSerialization.yaml +++ b/bin/configs/csharp-restsharp-netstandard2.0-conditionalSerialization.yaml @@ -10,3 +10,4 @@ additionalProperties: useOneOfDiscriminatorLookup: true targetFramework: netstandard2.0 conditionalSerialization: true + equatable: true diff --git a/bin/configs/csharp-restsharp-netstandard2.0.yaml b/bin/configs/csharp-restsharp-netstandard2.0.yaml index 994fd0d40647..d4b6d3289833 100644 --- a/bin/configs/csharp-restsharp-netstandard2.0.yaml +++ b/bin/configs/csharp-restsharp-netstandard2.0.yaml @@ -9,3 +9,4 @@ additionalProperties: disallowAdditionalPropertiesIfNotPresent: false useOneOfDiscriminatorLookup: true targetFramework: netstandard2.0 + equatable: true diff --git a/bin/configs/csharp-unityWebRequest-netstandard2.0.yaml b/bin/configs/csharp-unityWebRequest-netstandard2.0.yaml index 8005d2ce78a5..0f91232f8e1e 100644 --- a/bin/configs/csharp-unityWebRequest-netstandard2.0.yaml +++ b/bin/configs/csharp-unityWebRequest-netstandard2.0.yaml @@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/csharp library: unityWebRequest additionalProperties: targetFramework: netstandard2.0 + equatable: true diff --git a/bin/configs/java-resttemplate-echo-api.yaml b/bin/configs/java-resttemplate-echo-api.yaml new file mode 100644 index 000000000000..27e9a63cfa69 --- /dev/null +++ b/bin/configs/java-resttemplate-echo-api.yaml @@ -0,0 +1,10 @@ +generatorName: java +outputDir: samples/client/echo_api/java/resttemplate +library: resttemplate +inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: echo-api-resttemplate + hideGenerationTimestamp: "true" + java8: true + containerDefaultToNull: true diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5091cf3996d6..4590b56ce65d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -4,7 +4,7 @@ set -euo pipefail # GEN_DIR allows to share the entrypoint between Dockerfile and run-in-docker.sh (backward compatible) GEN_DIR=${GEN_DIR:-/opt/openapi-generator} -JAVA_OPTS=${JAVA_OPTS:-"-Xmx1024M -DloggerPath=conf/log4j.properties"} +JAVA_OPTS=${JAVA_OPTS:-"-DloggerPath=conf/log4j.properties"} cli="${GEN_DIR}/modules/openapi-generator-cli" codegen="${cli}/target/openapi-generator-cli.jar" diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index 09d2bc30c489..a20d461a484b 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateFormat|The default Date format (only `generichost` library supports this option).| |yyyy'-'MM'-'dd| |dateTimeFormat|The default DateTime format (only `generichost` library supports this option).| |yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|