diff --git a/.github/workflows/samples-go.yaml b/.github/workflows/samples-go.yaml index 13b030c06aa5..6acbef8d8486 100644 --- a/.github/workflows/samples-go.yaml +++ b/.github/workflows/samples-go.yaml @@ -47,7 +47,7 @@ jobs: sample: - samples/server/petstore/go-api-server/ go-version: - - "1.18" + - "1.25" steps: - uses: actions/checkout@v7 - name: Set up Go diff --git a/.github/workflows/samples-typescript-typecheck.yaml b/.github/workflows/samples-typescript-typecheck.yaml index 4d5ceac33530..e91ba3515c1f 100644 --- a/.github/workflows/samples-typescript-typecheck.yaml +++ b/.github/workflows/samples-typescript-typecheck.yaml @@ -1,9 +1,24 @@ name: TypeScript clients type checks on: + push: + branches: + - master + paths: + - samples/client/petstore/typescript*/** + - samples/client/others/typescript*/** + - samples/client/echo_api/typescript*/** + - samples/openapi3/client/petstore*/typescript/** + - samples/server/petstore/typescript-nestjs-server/** + - bin/ts-typecheck-all.sh + - .github/workflows/samples-typescript-typecheck.yaml pull_request: paths: - - samples/** + - samples/client/petstore/typescript*/** + - samples/client/others/typescript*/** + - samples/client/echo_api/typescript*/** + - samples/openapi3/client/petstore*/typescript/** + - samples/server/petstore/typescript-nestjs-server/** - bin/ts-typecheck-all.sh - .github/workflows/samples-typescript-typecheck.yaml jobs: diff --git a/bin/configs/kotlin-spring-boot-3-no-response-entity.yaml b/bin/configs/kotlin-spring-boot-3-no-response-entity.yaml index b0b7c3fe3825..fb88b7e5c053 100644 --- a/bin/configs/kotlin-spring-boot-3-no-response-entity.yaml +++ b/bin/configs/kotlin-spring-boot-3-no-response-entity.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-3.yaml b/bin/configs/kotlin-spring-boot-3.yaml index 5c0572cf1cb4..a102ecb2e695 100644 --- a/bin/configs/kotlin-spring-boot-3.yaml +++ b/bin/configs/kotlin-spring-boot-3.yaml @@ -4,6 +4,9 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NONE" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-4.yaml b/bin/configs/kotlin-spring-boot-4.yaml index 6779d1910974..c544279bd050 100644 --- a/bin/configs/kotlin-spring-boot-4.yaml +++ b/bin/configs/kotlin-spring-boot-4.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-additionalproperties.yaml b/bin/configs/kotlin-spring-boot-additionalproperties.yaml index e9c962afffd6..59588abd4d20 100644 --- a/bin/configs/kotlin-spring-boot-additionalproperties.yaml +++ b/bin/configs/kotlin-spring-boot-additionalproperties.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: samples/server/petstore/kotlin-springboot-additionalproperties/src/main/resources/openapi.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-bigdecimal-default.yaml b/bin/configs/kotlin-spring-boot-bigdecimal-default.yaml index 6fa5b9556499..67ad5f0518b3 100644 --- a/bin/configs/kotlin-spring-boot-bigdecimal-default.yaml +++ b/bin/configs/kotlin-spring-boot-bigdecimal-default.yaml @@ -3,3 +3,6 @@ outputDir: samples/server/petstore/kotlin-springboot-bigdecimal-default library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_14584_bigdecimal_default.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" diff --git a/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml b/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml index 3596dbcf6383..778495dcd07b 100644 --- a/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml +++ b/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-delegate.yaml b/bin/configs/kotlin-spring-boot-delegate.yaml index 2eb2f2e43e89..c09fcf345fdb 100644 --- a/bin/configs/kotlin-spring-boot-delegate.yaml +++ b/bin/configs/kotlin-spring-boot-delegate.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml b/bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml index 44b82e9702fc..51990ca79a95 100644 --- a/bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml +++ b/bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: swagger1 useSwaggerUI: false diff --git a/bin/configs/kotlin-spring-boot-integer-enum.yaml b/bin/configs/kotlin-spring-boot-integer-enum.yaml index 0b23e72b5bf6..3b470aed9488 100644 --- a/bin/configs/kotlin-spring-boot-integer-enum.yaml +++ b/bin/configs/kotlin-spring-boot-integer-enum.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/issue19244_integer_enum.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" interfaceOnly: "true" skipDefaultInterface: "true" useTags: "true" diff --git a/bin/configs/kotlin-spring-boot-modelMutable.yaml b/bin/configs/kotlin-spring-boot-modelMutable.yaml index ba49fcc91f90..2fb63e2cc4fc 100644 --- a/bin/configs/kotlin-spring-boot-modelMutable.yaml +++ b/bin/configs/kotlin-spring-boot-modelMutable.yaml @@ -4,6 +4,9 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_DEFAULT" documentationProvider: springdoc annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-multipart-request-model.yaml b/bin/configs/kotlin-spring-boot-multipart-request-model.yaml index 63d0b59fd5bb..184f3722f01f 100644 --- a/bin/configs/kotlin-spring-boot-multipart-request-model.yaml +++ b/bin/configs/kotlin-spring-boot-multipart-request-model.yaml @@ -3,3 +3,6 @@ outputDir: samples/server/petstore/kotlin-springboot-multipart-request-model library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" diff --git a/bin/configs/kotlin-spring-boot-no-response-entity-delegate.yaml b/bin/configs/kotlin-spring-boot-no-response-entity-delegate.yaml index d5ad5a5a4b41..eb41fe7444b9 100644 --- a/bin/configs/kotlin-spring-boot-no-response-entity-delegate.yaml +++ b/bin/configs/kotlin-spring-boot-no-response-entity-delegate.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-no-response-entity.yaml b/bin/configs/kotlin-spring-boot-no-response-entity.yaml index 007fadf41864..ad4bac02f91b 100644 --- a/bin/configs/kotlin-spring-boot-no-response-entity.yaml +++ b/bin/configs/kotlin-spring-boot-no-response-entity.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-oneof-discriminator-const.yaml b/bin/configs/kotlin-spring-boot-oneof-discriminator-const.yaml index 1ecd7a2b660e..7198eb9926af 100644 --- a/bin/configs/kotlin-spring-boot-oneof-discriminator-const.yaml +++ b/bin/configs/kotlin-spring-boot-oneof-discriminator-const.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_1/polymorphism-and-discriminator.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-oneof-discriminator.yaml b/bin/configs/kotlin-spring-boot-oneof-discriminator.yaml index 2d2edd95bfd1..228d0dcf5026 100644 --- a/bin/configs/kotlin-spring-boot-oneof-discriminator.yaml +++ b/bin/configs/kotlin-spring-boot-oneof-discriminator.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/polymorphism-oneof-discriminator.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml b/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml index 235978710b26..53b322f29f00 100644 --- a/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml +++ b/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/polymorphism-oneof-enum-discriminator.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-paged-model.yaml b/bin/configs/kotlin-spring-boot-paged-model.yaml index 02776a3a1c5b..079e3a49b83a 100644 --- a/bin/configs/kotlin-spring-boot-paged-model.yaml +++ b/bin/configs/kotlin-spring-boot-paged-model.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-paged-model.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-reactive-without-flow.yaml b/bin/configs/kotlin-spring-boot-reactive-without-flow.yaml index 8f29401890a4..8428cfbede8e 100644 --- a/bin/configs/kotlin-spring-boot-reactive-without-flow.yaml +++ b/bin/configs/kotlin-spring-boot-reactive-without-flow.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-reactive.yaml b/bin/configs/kotlin-spring-boot-reactive.yaml index c05cc232fcf4..a8272859ce07 100644 --- a/bin/configs/kotlin-spring-boot-reactive.yaml +++ b/bin/configs/kotlin-spring-boot-reactive.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-request-cookie.yaml b/bin/configs/kotlin-spring-boot-request-cookie.yaml index fdf613630ae9..7aeb82984780 100644 --- a/bin/configs/kotlin-spring-boot-request-cookie.yaml +++ b/bin/configs/kotlin-spring-boot-request-cookie.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" appendRequestToHandler: true interfaceOnly: true useSpringBoot3: true \ No newline at end of file diff --git a/bin/configs/kotlin-spring-boot-sort-validation.yaml b/bin/configs/kotlin-spring-boot-sort-validation.yaml index 485233c40fad..827eaeedf8b3 100644 --- a/bin/configs/kotlin-spring-boot-sort-validation.yaml +++ b/bin/configs/kotlin-spring-boot-sort-validation.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-sort-validation.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-boot-source-swagger1.yaml b/bin/configs/kotlin-spring-boot-source-swagger1.yaml index 5a304d628e03..1a470a150fed 100644 --- a/bin/configs/kotlin-spring-boot-source-swagger1.yaml +++ b/bin/configs/kotlin-spring-boot-source-swagger1.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: source annotationLibrary: swagger1 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-source-swagger2.yaml b/bin/configs/kotlin-spring-boot-source-swagger2.yaml index 287d71be535c..94dfa2a58657 100644 --- a/bin/configs/kotlin-spring-boot-source-swagger2.yaml +++ b/bin/configs/kotlin-spring-boot-source-swagger2.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: source annotationLibrary: swagger2 useSwaggerUI: "true" diff --git a/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml b/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml index 685c64a31c4d..1ee6f5030598 100644 --- a/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml +++ b/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: swagger1 useSwaggerUI: false diff --git a/bin/configs/kotlin-spring-boot.yaml b/bin/configs/kotlin-spring-boot.yaml index 0595d4243c28..0f930bf63998 100644 --- a/bin/configs/kotlin-spring-boot.yaml +++ b/bin/configs/kotlin-spring-boot.yaml @@ -4,6 +4,9 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_EMPTY" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-cloud.yaml b/bin/configs/kotlin-spring-cloud.yaml index b4185c2a38d7..9a2def41fa0f 100644 --- a/bin/configs/kotlin-spring-cloud.yaml +++ b/bin/configs/kotlin-spring-cloud.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface-bean-validation.yaml b/bin/configs/kotlin-spring-declarative-interface-bean-validation.yaml index 7c7ab0f17b21..227e9b360e95 100644 --- a/bin/configs/kotlin-spring-declarative-interface-bean-validation.yaml +++ b/bin/configs/kotlin-spring-declarative-interface-bean-validation.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface-reactive-coroutines.yaml b/bin/configs/kotlin-spring-declarative-interface-reactive-coroutines.yaml index e8df0fd8855c..ac35f26cb4bf 100644 --- a/bin/configs/kotlin-spring-declarative-interface-reactive-coroutines.yaml +++ b/bin/configs/kotlin-spring-declarative-interface-reactive-coroutines.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface-reactive-reactor-wrapped.yaml b/bin/configs/kotlin-spring-declarative-interface-reactive-reactor-wrapped.yaml index 1f16d8ec5dbc..431d1a9dc5f5 100644 --- a/bin/configs/kotlin-spring-declarative-interface-reactive-reactor-wrapped.yaml +++ b/bin/configs/kotlin-spring-declarative-interface-reactive-reactor-wrapped.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface-wrapped.yaml b/bin/configs/kotlin-spring-declarative-interface-wrapped.yaml index 01911f6a4b66..f8f5ec693cba 100644 --- a/bin/configs/kotlin-spring-declarative-interface-wrapped.yaml +++ b/bin/configs/kotlin-spring-declarative-interface-wrapped.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-declarative-interface.yaml b/bin/configs/kotlin-spring-declarative-interface.yaml index 5770ddafd8c8..1380afa9e362 100644 --- a/bin/configs/kotlin-spring-declarative-interface.yaml +++ b/bin/configs/kotlin-spring-declarative-interface.yaml @@ -4,6 +4,8 @@ library: spring-declarative-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springDoc annotationLibrary: swagger2 useSwaggerUI: "false" diff --git a/bin/configs/kotlin-spring-default.yaml b/bin/configs/kotlin-spring-default.yaml index 7cfefdc631cc..cb730f2d0f56 100644 --- a/bin/configs/kotlin-spring-default.yaml +++ b/bin/configs/kotlin-spring-default.yaml @@ -12,3 +12,7 @@ templateDir: modules/openapi-generator/src/main/resources/kotlin-spring # serializableModel: "true" # useBeanValidation: "true" # useSpringBoot3: "true" +additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_NULL" diff --git a/bin/configs/kotlin-spring-sealed-interfaces.yaml b/bin/configs/kotlin-spring-sealed-interfaces.yaml index c8d7123f65fb..f05100172f78 100644 --- a/bin/configs/kotlin-spring-sealed-interfaces.yaml +++ b/bin/configs/kotlin-spring-sealed-interfaces.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/kotlin-spring-sealed-interfaces inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" useSealedResponseInterfaces: true interfaceOnly: true dateLibrary: java8 diff --git a/bin/configs/spring-boot-3-include-http-request-context.yaml b/bin/configs/spring-boot-3-include-http-request-context.yaml index 23cfdcd9214b..de8f771cc8ca 100644 --- a/bin/configs/spring-boot-3-include-http-request-context.yaml +++ b/bin/configs/spring-boot-3-include-http-request-context.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-3-include-http-request-co inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot-3.yaml b/bin/configs/spring-boot-3.yaml index 472f660ac7ab..37b8d2738f7d 100644 --- a/bin/configs/spring-boot-3.yaml +++ b/bin/configs/spring-boot-3.yaml @@ -3,6 +3,9 @@ outputDir: samples/openapi3/server/petstore/springboot-3 inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_NULL" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot-4-jspecify.yaml b/bin/configs/spring-boot-4-jspecify.yaml index ea3415840a3d..bfe35efb2909 100644 --- a/bin/configs/spring-boot-4-jspecify.yaml +++ b/bin/configs/spring-boot-4-jspecify.yaml @@ -5,6 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/java/jspecify.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring validateSpec: false additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc interfaceOnly: true diff --git a/bin/configs/spring-boot-4.yaml b/bin/configs/spring-boot-4.yaml index fee5258d9ceb..7506d17c8d26 100644 --- a/bin/configs/spring-boot-4.yaml +++ b/bin/configs/spring-boot-4.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-4 inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot-api-response-examples.yaml b/bin/configs/spring-boot-api-response-examples.yaml index e0b4196cc44d..b4acf09a2bdf 100644 --- a/bin/configs/spring-boot-api-response-examples.yaml +++ b/bin/configs/spring-boot-api-response-examples.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/api-response-examples_issue17610.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-api-response-examples documentationProvider: springdoc useSpringBoot3: true diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml index 408849f7eec6..837ec15f1acd 100644 --- a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml +++ b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 #documentationProvider: springdoc java8: "false" diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml index 4a8904341cbd..0a49cca8f76c 100644 --- a/bin/configs/spring-boot-beanvalidation.yaml +++ b/bin/configs/spring-boot-beanvalidation.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc useSwaggerUI: false java8: true diff --git a/bin/configs/spring-boot-builtin-validation.yaml b/bin/configs/spring-boot-builtin-validation.yaml index 8a070a7f278e..e2e1bd25fb45 100644 --- a/bin/configs/spring-boot-builtin-validation.yaml +++ b/bin/configs/spring-boot-builtin-validation.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc useSwaggerUI: false java8: true diff --git a/bin/configs/spring-boot-defaultInterface-unhandledExcp.yaml b/bin/configs/spring-boot-defaultInterface-unhandledExcp.yaml index 18608bd41adf..a0feedc6f8f6 100644 --- a/bin/configs/spring-boot-defaultInterface-unhandledExcp.yaml +++ b/bin/configs/spring-boot-defaultInterface-unhandledExcp.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/spring-boot-defaultInterface-unhandledExcp inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-boot-defaultInterface-unhandledException hideGenerationTimestamp: true java8: true diff --git a/bin/configs/spring-boot-delegate-j8.yaml b/bin/configs/spring-boot-delegate-j8.yaml index 1561840073a0..f0efd05a3117 100644 --- a/bin/configs/spring-boot-delegate-j8.yaml +++ b/bin/configs/spring-boot-delegate-j8.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-delegate-j8 inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc artifactId: springboot-delegate-j8 hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-delegate-no-response-entity.yaml b/bin/configs/spring-boot-delegate-no-response-entity.yaml index 13d062eb01c9..560d4db7aeaa 100644 --- a/bin/configs/spring-boot-delegate-no-response-entity.yaml +++ b/bin/configs/spring-boot-delegate-no-response-entity.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-delegate-no-response-entity inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc artifactId: springboot-delegate-no-response-entity hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-delegate-oas3.yaml b/bin/configs/spring-boot-delegate-oas3.yaml index 28ba653ad086..d0dc5546af85 100644 --- a/bin/configs/spring-boot-delegate-oas3.yaml +++ b/bin/configs/spring-boot-delegate-oas3.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-delegate inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot-delegate diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml index 5edcca222c49..a05ba9a72e20 100644 --- a/bin/configs/spring-boot-delegate.yaml +++ b/bin/configs/spring-boot-delegate.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-delegate inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-delegate hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-file-delegate-optional.yaml b/bin/configs/spring-boot-file-delegate-optional.yaml index 68c15c540431..9ac105b03460 100644 --- a/bin/configs/spring-boot-file-delegate-optional.yaml +++ b/bin/configs/spring-boot-file-delegate-optional.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-file-delegate-optional inputSpec: modules/openapi-generator/src/test/resources/3_0/issue18345.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" delegatePattern: true useOptional: true useSpringBoot3: true diff --git a/bin/configs/spring-boot-implicitHeaders-annotationLibrary.yaml b/bin/configs/spring-boot-implicitHeaders-annotationLibrary.yaml index 11dbb339bd95..68f75e49d4b4 100644 --- a/bin/configs/spring-boot-implicitHeaders-annotationLibrary.yaml +++ b/bin/configs/spring-boot-implicitHeaders-annotationLibrary.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-implicitHeaders-annotationLibrary inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-implicitHeaders-annotationLibrary documentationProvider: none annotationLibrary: none diff --git a/bin/configs/spring-boot-implicitHeaders-oas3.yaml b/bin/configs/spring-boot-implicitHeaders-oas3.yaml index 6d204b53c55e..9db0d986422a 100644 --- a/bin/configs/spring-boot-implicitHeaders-oas3.yaml +++ b/bin/configs/spring-boot-implicitHeaders-oas3.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-implicitHeaders inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc oas3: "true" diff --git a/bin/configs/spring-boot-implicitHeaders.yaml b/bin/configs/spring-boot-implicitHeaders.yaml index 7fae7e85daf0..d5b7187f3b5c 100644 --- a/bin/configs/spring-boot-implicitHeaders.yaml +++ b/bin/configs/spring-boot-implicitHeaders.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-implicitHeaders inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-implicitHeaders documentationProvider: springdoc hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-include-http-request-context.yaml b/bin/configs/spring-boot-include-http-request-context.yaml index a52eeaf879a7..4eedfe7957cb 100644 --- a/bin/configs/spring-boot-include-http-request-context.yaml +++ b/bin/configs/spring-boot-include-http-request-context.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-include-http-request-context inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot snapshotVersion: "true" diff --git a/bin/configs/spring-boot-lombok-data.yaml b/bin/configs/spring-boot-lombok-data.yaml index 57f54d71d3db..5125bfae5b12 100644 --- a/bin/configs/spring-boot-lombok-data.yaml +++ b/bin/configs/spring-boot-lombok-data.yaml @@ -3,6 +3,9 @@ outputDir: samples/server/petstore/springboot-lombok-data inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_EMPTY" groupId: org.openapitools.openapi3 artifactId: springboot-lombok-data hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-lombok-tostring.yaml b/bin/configs/spring-boot-lombok-tostring.yaml index 35d4e934eb82..666a16eb2f16 100644 --- a/bin/configs/spring-boot-lombok-tostring.yaml +++ b/bin/configs/spring-boot-lombok-tostring.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-lombok-tostring inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 artifactId: springboot-lombok-tostring hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-oas3.yaml b/bin/configs/spring-boot-oas3.yaml index 1c4c87f19402..4e4e8abff336 100644 --- a/bin/configs/spring-boot-oas3.yaml +++ b/bin/configs/spring-boot-oas3.yaml @@ -3,6 +3,9 @@ outputDir: samples/openapi3/server/petstore/springboot inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NONE" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot-oneof-interface.yaml b/bin/configs/spring-boot-oneof-interface.yaml index a66a2c4bfc97..34d04736d56b 100644 --- a/bin/configs/spring-boot-oneof-interface.yaml +++ b/bin/configs/spring-boot-oneof-interface.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/spring-boot-oneof-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot-oneof diff --git a/bin/configs/spring-boot-oneof-sealed.yaml b/bin/configs/spring-boot-oneof-sealed.yaml index 83da74dc7c01..fbb14bf90b1b 100644 --- a/bin/configs/spring-boot-oneof-sealed.yaml +++ b/bin/configs/spring-boot-oneof-sealed.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/spring-boot-oneof-sealed inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot-oneof-sealed diff --git a/bin/configs/spring-boot-oneof.yaml b/bin/configs/spring-boot-oneof.yaml index f4a7ca7a99cc..98a8e2dd4dfc 100644 --- a/bin/configs/spring-boot-oneof.yaml +++ b/bin/configs/spring-boot-oneof.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/spring-boot-oneof inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: springboot-oneof diff --git a/bin/configs/spring-boot-paged-model.yaml b/bin/configs/spring-boot-paged-model.yaml index 5e0922688513..a9e3b91156e3 100644 --- a/bin/configs/spring-boot-paged-model.yaml +++ b/bin/configs/spring-boot-paged-model.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-paged-model.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/spring-boot-petstore-with-api-response-examples.yaml b/bin/configs/spring-boot-petstore-with-api-response-examples.yaml index 6a4604492b98..cc77cca4ddf7 100644 --- a/bin/configs/spring-boot-petstore-with-api-response-examples.yaml +++ b/bin/configs/spring-boot-petstore-with-api-response-examples.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore_with_api_response_examples.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-petstore-with-api-response-examples documentationProvider: springdoc useSpringBoot3: true diff --git a/bin/configs/spring-boot-reactive-noResponseEntity.yaml b/bin/configs/spring-boot-reactive-noResponseEntity.yaml index f69ad9806c5c..debb048ef2e5 100644 --- a/bin/configs/spring-boot-reactive-noResponseEntity.yaml +++ b/bin/configs/spring-boot-reactive-noResponseEntity.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-reactive-noResponseEntity inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 artifactId: springboot-reactive-noResponseEntity documentationProvider: springdoc diff --git a/bin/configs/spring-boot-reactive.yaml b/bin/configs/spring-boot-reactive.yaml index 5bc52f55edda..338a4ebaeedf 100644 --- a/bin/configs/spring-boot-reactive.yaml +++ b/bin/configs/spring-boot-reactive.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-reactive inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 artifactId: springboot-reactive documentationProvider: springdoc diff --git a/bin/configs/spring-boot-sort-validation.yaml b/bin/configs/spring-boot-sort-validation.yaml index c3c0cb1096e7..e2640306375b 100644 --- a/bin/configs/spring-boot-sort-validation.yaml +++ b/bin/configs/spring-boot-sort-validation.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-sort-validation.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none annotationLibrary: none useSwaggerUI: "false" diff --git a/bin/configs/spring-boot-source.yaml b/bin/configs/spring-boot-source.yaml index a1572c0e19c4..89d895c1960b 100644 --- a/bin/configs/spring-boot-source.yaml +++ b/bin/configs/spring-boot-source.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/springboot-source inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: source artifactId: springboot diff --git a/bin/configs/spring-boot-springdoc.yaml b/bin/configs/spring-boot-springdoc.yaml index fe479cd21e7f..cd15712ec7ca 100644 --- a/bin/configs/spring-boot-springdoc.yaml +++ b/bin/configs/spring-boot-springdoc.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/server/petstore/spring-boot-springdoc inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc useSwaggerUI: false diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml index daf57fe87351..428935c9bdd7 100644 --- a/bin/configs/spring-boot-useoptional.yaml +++ b/bin/configs/spring-boot-useoptional.yaml @@ -3,6 +3,9 @@ outputDir: samples/server/petstore/springboot-useoptional inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" + optionalNonNullPropertyJsonInclude: "NON_DEFAULT" groupId: org.openapitools.openapi3 #documentationProvider: springdoc useOptional: true diff --git a/bin/configs/spring-boot-virtualan.yaml b/bin/configs/spring-boot-virtualan.yaml index 87a2e30fb91a..526888c6ecef 100644 --- a/bin/configs/spring-boot-virtualan.yaml +++ b/bin/configs/spring-boot-virtualan.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc apiPackage: org.openapitools.virtualan.api modelPackage: org.openapitools.virtualan.model diff --git a/bin/configs/spring-boot-x-implements-skip.yaml b/bin/configs/spring-boot-x-implements-skip.yaml index a56794db3de8..66a2340a9cf3 100644 --- a/bin/configs/spring-boot-x-implements-skip.yaml +++ b/bin/configs/spring-boot-x-implements-skip.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot-x-implements-skip inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" additionalNotNullAnnotations: true documentationProvider: springdoc artifactId: springboot diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml index 9464c18594ec..aafaea71da4f 100644 --- a/bin/configs/spring-boot.yaml +++ b/bin/configs/spring-boot.yaml @@ -3,6 +3,8 @@ outputDir: samples/server/petstore/springboot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot snapshotVersion: "true" diff --git a/bin/configs/spring-cloud-3-with-optional.yaml b/bin/configs/spring-cloud-3-with-optional.yaml index 7efd4ce223e0..de47cf1cf270 100644 --- a/bin/configs/spring-cloud-3-with-optional.yaml +++ b/bin/configs/spring-cloud-3-with-optional.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-3-with-optional inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 artifactId: spring-cloud-oas3 useSpringBoot3: "true" diff --git a/bin/configs/spring-cloud-3.yaml b/bin/configs/spring-cloud-3.yaml index 18e3797f0ca3..ce03369d6208 100644 --- a/bin/configs/spring-cloud-3.yaml +++ b/bin/configs/spring-cloud-3.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-3 inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 diff --git a/bin/configs/spring-cloud-4-with-optional.yaml b/bin/configs/spring-cloud-4-with-optional.yaml index 1e474a40a122..10649fe8604f 100644 --- a/bin/configs/spring-cloud-4-with-optional.yaml +++ b/bin/configs/spring-cloud-4-with-optional.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-4-with-optional inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas4 diff --git a/bin/configs/spring-cloud-async-oas3.yaml b/bin/configs/spring-cloud-async-oas3.yaml index 01e4dc6ce4db..ecd0cdf03481 100644 --- a/bin/configs/spring-cloud-async-oas3.yaml +++ b/bin/configs/spring-cloud-async-oas3.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc async: "true" diff --git a/bin/configs/spring-cloud-auth.yaml b/bin/configs/spring-cloud-auth.yaml index 88c2e399b892..0d559d7dcd57 100644 --- a/bin/configs/spring-cloud-auth.yaml +++ b/bin/configs/spring-cloud-auth.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-auth.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: none artifactId: petstore-spring-cloud-auth hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-cloud-date-time-oas3.yaml b/bin/configs/spring-cloud-date-time-oas3.yaml index 8574b519edfb..1bdffc887298 100644 --- a/bin/configs/spring-cloud-date-time-oas3.yaml +++ b/bin/configs/spring-cloud-date-time-oas3.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-date-time inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-date-time-oas3 diff --git a/bin/configs/spring-cloud-date-time.yaml b/bin/configs/spring-cloud-date-time.yaml index 14c7e3361f31..58f80a88c883 100644 --- a/bin/configs/spring-cloud-date-time.yaml +++ b/bin/configs/spring-cloud-date-time.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-cloud-date-time inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: spring-cloud-date-time interfaceOnly: "true" diff --git a/bin/configs/spring-cloud-deprecated-oas3.yaml b/bin/configs/spring-cloud-deprecated-oas3.yaml index b6d1943ce7ab..921d2a38a336 100644 --- a/bin/configs/spring-cloud-deprecated-oas3.yaml +++ b/bin/configs/spring-cloud-deprecated-oas3.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-cloud-deprecated inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-deprecated diff --git a/bin/configs/spring-cloud-http-basic-only.yaml b/bin/configs/spring-cloud-http-basic-only.yaml index b6ff990b7963..13354e58cdfd 100644 --- a/bin/configs/spring-cloud-http-basic-only.yaml +++ b/bin/configs/spring-cloud-http-basic-only.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-http-basic inputSpec: modules/openapi-generator/src/test/resources/3_0/http-basic-test.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-http-basic diff --git a/bin/configs/spring-cloud-oas3-fakeapi.yaml b/bin/configs/spring-cloud-oas3-fakeapi.yaml index b4582cbe1c06..7be9c1fbc701 100644 --- a/bin/configs/spring-cloud-oas3-fakeapi.yaml +++ b/bin/configs/spring-cloud-oas3-fakeapi.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 diff --git a/bin/configs/spring-cloud-oas3.yaml b/bin/configs/spring-cloud-oas3.yaml index 4e07871206f1..1c4679fdaa1a 100644 --- a/bin/configs/spring-cloud-oas3.yaml +++ b/bin/configs/spring-cloud-oas3.yaml @@ -4,6 +4,8 @@ outputDir: samples/openapi3/client/petstore/spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-oas3 diff --git a/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml b/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml index b130111f0e0d..afa0848f4ba1 100644 --- a/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml +++ b/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-cloud-spring-pageable diff --git a/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml b/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml index dc342f51ad8e..0300fa35258a 100644 --- a/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml +++ b/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: petstore-spring-cloud hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-cloud-tags.yaml b/bin/configs/spring-cloud-tags.yaml index 8fad04c73760..524c25f253d2 100644 --- a/bin/configs/spring-cloud-tags.yaml +++ b/bin/configs/spring-cloud-tags.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-cloud-tags inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-tags.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc artifactId: spring-cloud-date-time interfaceOnly: "true" diff --git a/bin/configs/spring-cloud.yaml b/bin/configs/spring-cloud.yaml index b4a75a6391f5..a93b0924aa76 100644 --- a/bin/configs/spring-cloud.yaml +++ b/bin/configs/spring-cloud.yaml @@ -4,6 +4,8 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" #documentationProvider: springdoc artifactId: petstore-spring-cloud hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-bean-validation.yaml b/bin/configs/spring-http-interface-bean-validation.yaml index 9d3aca960b59..4da1d4cb1769 100644 --- a/bin/configs/spring-http-interface-bean-validation.yaml +++ b/bin/configs/spring-http-interface-bean-validation.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-bean-validation inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-noResponseEntity.yaml b/bin/configs/spring-http-interface-noResponseEntity.yaml index 098c5ebf7598..b9614043cd45 100644 --- a/bin/configs/spring-http-interface-noResponseEntity.yaml +++ b/bin/configs/spring-http-interface-noResponseEntity.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-noResponseEntity inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-noResponseEntity snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-oauth.yaml b/bin/configs/spring-http-interface-oauth.yaml index ef6e29eade40..36d44dfaae8b 100644 --- a/bin/configs/spring-http-interface-oauth.yaml +++ b/bin/configs/spring-http-interface-oauth.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-oauth inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-oauth-petstore snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-reactive-bean-validation.yaml b/bin/configs/spring-http-interface-reactive-bean-validation.yaml index 6040068f931b..1929a918c2e8 100644 --- a/bin/configs/spring-http-interface-reactive-bean-validation.yaml +++ b/bin/configs/spring-http-interface-reactive-bean-validation.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-reactive-bean-validatio inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-reactive snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml b/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml index e572fc5188e8..961fbeb5cdc2 100644 --- a/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml +++ b/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-reactive-noResponseEnti inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-reactive-noResponseEntity snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-reactive.yaml b/bin/configs/spring-http-interface-reactive.yaml index 1a289063f6bd..f7397c1788c8 100644 --- a/bin/configs/spring-http-interface-reactive.yaml +++ b/bin/configs/spring-http-interface-reactive.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-reactive inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-reactive snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-springboot-4.yaml b/bin/configs/spring-http-interface-springboot-4.yaml index e9cee278abc9..60d458548d0e 100644 --- a/bin/configs/spring-http-interface-springboot-4.yaml +++ b/bin/configs/spring-http-interface-springboot-4.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-springboot-4 inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfiguration.yaml b/bin/configs/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfiguration.yaml index 1d50b034c7ae..cd6c66e38bea 100644 --- a/bin/configs/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfiguration.yaml +++ b/bin/configs/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfiguration.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface-useHttpServiceProxyFact inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-http-interface.yaml b/bin/configs/spring-http-interface.yaml index bc6bf36e5123..4051bb3afeb4 100644 --- a/bin/configs/spring-http-interface.yaml +++ b/bin/configs/spring-http-interface.yaml @@ -4,6 +4,8 @@ outputDir: samples/client/petstore/spring-http-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-http-interface snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-nullable-set.yaml b/bin/configs/spring-nullable-set.yaml index 64122c7cf3c8..d186d5f6f382 100644 --- a/bin/configs/spring-nullable-set.yaml +++ b/bin/configs/spring-nullable-set.yaml @@ -4,6 +4,8 @@ outputDir: samples/server/petstore/spring-boot-nullable-set inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/10167-nullable-set.yml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: spring-boot-nullable-set interfaceOnly: "true" singleContentTypes: "true" diff --git a/bin/configs/spring-stubs-oas3.yaml b/bin/configs/spring-stubs-oas3.yaml index c37ba7e3c3c2..b2f927457512 100644 --- a/bin/configs/spring-stubs-oas3.yaml +++ b/bin/configs/spring-stubs-oas3.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/client/petstore/spring-stubs inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-stubs diff --git a/bin/configs/spring-stubs-skip-default-interface.yaml b/bin/configs/spring-stubs-skip-default-interface.yaml index 43d4dd080898..e18dd66ed804 100644 --- a/bin/configs/spring-stubs-skip-default-interface.yaml +++ b/bin/configs/spring-stubs-skip-default-interface.yaml @@ -3,6 +3,8 @@ outputDir: samples/openapi3/client/petstore/spring-stubs-skip-default-interface inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" groupId: org.openapitools.openapi3 documentationProvider: springdoc artifactId: spring-stubs diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml index 056714c4f230..b52b6da47336 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml @@ -6,6 +6,8 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring delegatePattern: true java8: false additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-spring-pageable-delegatePattern-without-j8 hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml index 980dab683b8f..c41cb5a1eb12 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml @@ -5,6 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with templateDir: modules/openapi-generator/src/main/resources/JavaSpring delegatePattern: true additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-spring-pageable-delegatePattern hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml index 4d7feb4fadc3..4ac75381902b 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml @@ -5,6 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with templateDir: modules/openapi-generator/src/main/resources/JavaSpring java8: false additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-spring-pageable-withoutj8 hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable.yaml b/bin/configs/springboot-petstore-server-spring-pageable.yaml index 85dadcac577c..3f48b041c094 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable.yaml @@ -4,6 +4,8 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" documentationProvider: springdoc artifactId: springboot-spring-pageable hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-provide-args.yaml b/bin/configs/springboot-petstore-server-spring-provide-args.yaml index 09ed7ec421be..b1afd47a7095 100644 --- a/bin/configs/springboot-petstore-server-spring-provide-args.yaml +++ b/bin/configs/springboot-petstore-server-spring-provide-args.yaml @@ -4,5 +4,7 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-provide-args.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + generateJsonIncludeAnnotations: "true" + generateJsonSetterNullsAnnotations: "true" artifactId: springboot-spring-provide-args hideGenerationTimestamp: 'true' diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 2e2d5191f02f..705a12974c0d 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -64,6 +64,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateGenericResponseEntity|Use a generic type for the `ResponseEntity` wrapping return values of generated API methods. If enabled, method are generated with return type ResponseEntity<?>| |false| +|generateJsonIncludeAnnotations|Whether to generate policy @JsonInclude annotations on model properties. When true, emits spec-honest annotations (required-field protection and the optional non-nullable policy from optionalNonNullPropertyJsonInclude). When false, none are generated and the global ObjectMapper owns inclusion. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning. A per-property override set via the `x-jackson-json-include-policy` vendor extension is always honored regardless of this flag.| |false| +|generateJsonSetterNullsAnnotations|Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. When true, emits @JsonSetter so an explicit null in the payload does not overwrite the field. When false, none are generated and deserialization null-handling defers to the global ObjectMapper. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning.| |false| |generatePageableConstraintValidation|Generate a @ValidPageable annotation and PageableConstraintValidator class, and apply @ValidPageable to the injected Pageable parameter of operations whose 'page' or 'size' parameter specifies a maximum constraint. The annotation enforces those constraints on the Pageable object that replaces the individual page/size query parameters. Requires useBeanValidation=true and library=spring-boot.| |false| |generateSortValidation|Generate a @ValidSort annotation and SortValidator class, and apply @ValidSort to the injected Pageable parameter of operations whose 'sort' parameter has enum values. The annotation validates that sort values in the Pageable object match the allowed enum values from the spec. Requires useBeanValidation=true and library=spring-boot.| |false| |generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true| @@ -83,6 +85,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelPackage|package for generated models| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |optionalAcceptNullable|Use `ofNullable` instead of just `of` to accept null values when using Optional.| |true| +|optionalNonNullPropertyJsonInclude|The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when generateJsonIncludeAnnotations is true. NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy.|
**NON_NULL**
Omit the property when its value is null (default, spec-safe for non-nullable fields).
**NON_EMPTY**
Omit the property when its value is null or considered empty.
**NON_DEFAULT**
Omit the property when its value equals the default.
**NONE**
Emit no @JsonInclude annotation; defer to the global ObjectMapper.
|NON_NULL| +|optionalNonNullPropertyJsonSetterNulls|The Jackson @JsonSetter(nulls = ...) mode emitted for optional, non-nullable model properties when generateJsonSetterNullsAnnotations is true. SKIP ignores an explicit JSON null (keeping the field's default), FAIL rejects it. When left unset the mode is derived from openApiNullable (true -> FAIL where supported, false -> SKIP), preserving 7.24.x behavior. A per-property override set via the `x-jackson-json-setter-nulls` vendor extension always wins.|
**SKIP**
Emit @JsonSetter(nulls = Nulls.SKIP): silently ignore an explicit JSON null, keeping the field's default.
**FAIL**
Emit @JsonSetter(nulls = Nulls.FAIL): reject an explicit JSON null.
|null| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| @@ -153,6 +157,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null |x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null |x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null +|x-jackson-json-include-policy|Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.|FIELD|resolved automatically per the required/nullable matrix +|x-jackson-json-setter-nulls|Manually override the resolved Jackson `@JsonSetter(nulls = ...)` deserialization null-handling for this property. Must be one of `SKIP` (ignore an explicit JSON null, keeping the default), `FAIL` (reject an explicit JSON null), or `NONE` to emit no annotation. Always wins over the automatic `openApiNullable` default and the `optionalNonNullPropertyJsonSetterNulls` option, and is honored regardless of `generateJsonSetterNullsAnnotations` or whether the property is required/nullable.|FIELD|resolved automatically per the openApiNullable default ## IMPORT MAPPING diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 1d98298707cd..31e78d3a8e73 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -33,6 +33,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
**springdoc**
Generate an OpenAPI 3 specification using SpringDoc.
|springdoc| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', 'original', and 'bestEffortBacktick' (like 'original' but tries to wrap values in backticks before falling back to sanitizing, e.g. `name,asc` stays `name,asc` rather than becoming nameCommaAsc; useful for sort/order enums)| |original| |exceptionHandler|generate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )| |true| +|generateJsonIncludeAnnotations|Whether to generate policy @JsonInclude annotations on model properties. When true, emits spec-honest annotations (required-field protection and the optional non-nullable policy from optionalNonNullPropertyJsonInclude). When false, none are generated and the global ObjectMapper owns inclusion. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning. A per-property override set via the `x-jackson-json-include-policy` vendor extension is always honored regardless of this flag.| |false| +|generateJsonSetterNullsAnnotations|Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. When true, emits @JsonSetter (Nulls.FAIL when openApiNullable is true, otherwise Nulls.SKIP) so an explicit null in the payload is handled explicitly. When false, none are generated and deserialization null-handling defers to the global ObjectMapper. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning.| |false| |generatePageableConstraintValidation|Generate a @ValidPageable annotation and PageableConstraintValidator class, and apply @ValidPageable to the injected Pageable parameter of operations whose 'page' or 'size' parameter specifies a maximum constraint. The annotation enforces those constraints on the Pageable object that replaces the individual page/size query parameters. Requires useBeanValidation=true and library=spring-boot.| |false| |generateSortValidation|Generate a @ValidSort annotation and SortValidator class, and apply @ValidSort to the injected Pageable parameter of operations whose 'sort' parameter has enum values. The annotation validates that sort values in the Pageable object match the allowed enum values from the spec. Requires useBeanValidation=true and library=spring-boot.| |false| |gradleBuildFile|generate a gradle build file using the Kotlin DSL| |true| @@ -44,6 +46,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelMutable|Create mutable models| |false| |modelPackage|model package for generated code| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library (jackson-databind-nullable) for strict null handling. Controls how optional + non-nullable properties (required: false, nullable: false) handle explicit JSON null: when false (default), @JsonSetter(nulls = Nulls.SKIP) is used — explicit null is silently ignored (lenient, protects any default value from being overridden); when true, @JsonSetter(nulls = Nulls.FAIL) is used — explicit null causes deserialization to fail (strict, enforces the non-nullable contract, useful for PATCH semantics). Additionally, when true, optional + nullable properties (required: false, nullable: true) use JsonNullable<T> = JsonNullable.undefined() to distinguish between a missing key and an explicit null. Requires jackson-databind-nullable >= 0.2.10 when used with useJackson3.| |false| +|optionalNonNullPropertyJsonInclude|The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when generateJsonIncludeAnnotations is true. NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy.|
**NON_NULL**
Omit the property when its value is null (default, spec-safe for non-nullable fields).
**NON_EMPTY**
Omit the property when its value is null or considered empty.
**NON_DEFAULT**
Omit the property when its value equals the default.
**NONE**
Emit no @JsonInclude annotation; defer to the global ObjectMapper.
|NON_NULL| +|optionalNonNullPropertyJsonSetterNulls|The Jackson @JsonSetter(nulls = ...) mode emitted for optional, non-nullable model properties when generateJsonSetterNullsAnnotations is true. SKIP ignores an explicit JSON null (keeping the field's default), FAIL rejects it. When left unset the mode is derived from openApiNullable (true -> FAIL where supported, false -> SKIP), preserving 7.24.x behavior. A per-property override set via the `x-jackson-json-setter-nulls` vendor extension always wins.|
**SKIP**
Emit @JsonSetter(nulls = Nulls.SKIP): silently ignore an explicit JSON null, keeping the field's default.
**FAIL**
Emit @JsonSetter(nulls = Nulls.FAIL): reject an explicit JSON null.
|null| |packageName|Generated artifact package name.| |org.openapitools| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |reactive|use coroutines for reactive behavior| |false| @@ -95,6 +99,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |x-kotlin-implements|Ability to specify interfaces that model must implement|MODEL|empty array |x-kotlin-implements-fields|Specify attributes that are implemented by the interface(s) added via `x-kotlin-implements`|MODEL|empty array |x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object. Only applies when `library=spring-boot`; ignored for client libraries (spring-cloud, spring-declarative-http-interface).|OPERATION|false +|x-jackson-json-include-policy|Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.|FIELD|resolved automatically per the required/nullable matrix +|x-jackson-json-setter-nulls|Manually override the resolved Jackson `@JsonSetter(nulls = ...)` deserialization null-handling for this property. Must be one of `SKIP` (ignore an explicit JSON null, keeping the default), `FAIL` (reject an explicit JSON null), or `NONE` to emit no annotation. Always wins over the automatic `openApiNullable` default and the `optionalNonNullPropertyJsonSetterNulls` option, and is honored regardless of `generateJsonSetterNullsAnnotations` or whether the property is required/nullable.|FIELD|resolved automatically per the openApiNullable default ## IMPORT MAPPING diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 31f5f55ff4a5..be1bfa2ba717 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -57,6 +57,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateBuilders|Whether to generate builders for models| |false| |generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateGenericResponseEntity|Use a generic type for the `ResponseEntity` wrapping return values of generated API methods. If enabled, method are generated with return type ResponseEntity<?>| |false| +|generateJsonIncludeAnnotations|Whether to generate policy @JsonInclude annotations on model properties. When true, emits spec-honest annotations (required-field protection and the optional non-nullable policy from optionalNonNullPropertyJsonInclude). When false, none are generated and the global ObjectMapper owns inclusion. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning. A per-property override set via the `x-jackson-json-include-policy` vendor extension is always honored regardless of this flag.| |false| +|generateJsonSetterNullsAnnotations|Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. When true, emits @JsonSetter so an explicit null in the payload does not overwrite the field. When false, none are generated and deserialization null-handling defers to the global ObjectMapper. When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning.| |false| |generatePageableConstraintValidation|Generate a @ValidPageable annotation and PageableConstraintValidator class, and apply @ValidPageable to the injected Pageable parameter of operations whose 'page' or 'size' parameter specifies a maximum constraint. The annotation enforces those constraints on the Pageable object that replaces the individual page/size query parameters. Requires useBeanValidation=true and library=spring-boot.| |false| |generateSortValidation|Generate a @ValidSort annotation and SortValidator class, and apply @ValidSort to the injected Pageable parameter of operations whose 'sort' parameter has enum values. The annotation validates that sort values in the Pageable object match the allowed enum values from the spec. Requires useBeanValidation=true and library=spring-boot.| |false| |generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true| @@ -76,6 +78,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelPackage|package for generated models| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| |optionalAcceptNullable|Use `ofNullable` instead of just `of` to accept null values when using Optional.| |true| +|optionalNonNullPropertyJsonInclude|The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when generateJsonIncludeAnnotations is true. NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy.|
**NON_NULL**
Omit the property when its value is null (default, spec-safe for non-nullable fields).
**NON_EMPTY**
Omit the property when its value is null or considered empty.
**NON_DEFAULT**
Omit the property when its value equals the default.
**NONE**
Emit no @JsonInclude annotation; defer to the global ObjectMapper.
|NON_NULL| +|optionalNonNullPropertyJsonSetterNulls|The Jackson @JsonSetter(nulls = ...) mode emitted for optional, non-nullable model properties when generateJsonSetterNullsAnnotations is true. SKIP ignores an explicit JSON null (keeping the field's default), FAIL rejects it. When left unset the mode is derived from openApiNullable (true -> FAIL where supported, false -> SKIP), preserving 7.24.x behavior. A per-property override set via the `x-jackson-json-setter-nulls` vendor extension always wins.|
**SKIP**
Emit @JsonSetter(nulls = Nulls.SKIP): silently ignore an explicit JSON null, keeping the field's default.
**FAIL**
Emit @JsonSetter(nulls = Nulls.FAIL): reject an explicit JSON null.
|null| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| @@ -146,6 +150,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null |x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null |x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null +|x-jackson-json-include-policy|Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.|FIELD|resolved automatically per the required/nullable matrix +|x-jackson-json-setter-nulls|Manually override the resolved Jackson `@JsonSetter(nulls = ...)` deserialization null-handling for this property. Must be one of `SKIP` (ignore an explicit JSON null, keeping the default), `FAIL` (reject an explicit JSON null), or `NONE` to emit no annotation. Always wins over the automatic `openApiNullable` default and the `optionalNonNullPropertyJsonSetterNulls` option, and is honored regardless of `generateJsonSetterNullsAnnotations` or whether the property is required/nullable.|FIELD|resolved automatically per the openApiNullable default ## IMPORT MAPPING diff --git a/docs/migration-guide.adoc b/docs/migration-guide.adoc index 591aebe82c91..7eb53fb8adb0 100644 --- a/docs/migration-guide.adoc +++ b/docs/migration-guide.adoc @@ -11,6 +11,51 @@ Another approach to find breaking changes is to look at issue and pull requests * link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28with%20fallback%29[Breaking change (with fallback)] * link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28without%20fallback%29[Breaking change (without fallback)] +=== From 7.24.x to 7.25.0 (java-spring / kotlin-spring) + +Version `7.24.0` (link:https://github.com/OpenAPITools/openapi-generator/pull/23993[#23993]) started emitting field-level Jackson annotations on model properties for the `spring` and `kotlin-spring` generators: + +* `@JsonInclude(...)` on properties (serialization), and +* `@JsonSetter(nulls = ...)` on optional non-nullable properties (deserialization). + +Field-level `@JsonInclude` overrides the project-wide `ObjectMapper` inclusion policy (for example `spring.jackson.default-property-inclusion=non_empty`), which silently changed the wire contract for projects that upgraded. See link:https://github.com/OpenAPITools/openapi-generator/issues/24401[#24401]. + +Starting with `7.25.0`, emission of these annotations is controlled by two independent, opt-in options. When an option is left **unset**, the generator defaults to the pre-`7.24.0` (`7.23.0`) behavior — *no* annotations are emitted — and logs a warning so the choice is visible even on transitive upgrades. Set the option explicitly to silence the warning. + +==== Serialization: `@JsonInclude` + +* `generateJsonIncludeAnnotations` (boolean) +** unset (default) → no `@JsonInclude` annotations; inclusion is governed entirely by the global `ObjectMapper` (a warning is logged). +** `false` → same weak behavior, warning silenced. +** `true` → emit spec-honest `@JsonInclude` annotations (required-field contract protection plus the optional non-nullable policy below). +* `optionalNonNullPropertyJsonInclude` (enum, default `NON_NULL`) → the policy emitted for optional non-nullable properties when `generateJsonIncludeAnnotations=true`. One of `NON_NULL` / `NON_EMPTY` / `NON_DEFAULT` / `NONE` (`NONE` emits nothing). + +A per-property override set via the `x-jackson-json-include-policy` vendor extension always wins, regardless of these flags. + +==== Deserialization: `@JsonSetter(nulls = ...)` + +* `generateJsonSetterNullsAnnotations` (boolean) +** unset (default) → no `@JsonSetter(nulls = ...)` annotations; null-handling is governed by the global `ObjectMapper` (a warning is logged). +** `false` → same weak behavior, warning silenced. +** `true` → emit `@JsonSetter(nulls = ...)` on optional non-nullable properties. +* `optionalNonNullPropertyJsonSetterNulls` (enum, `SKIP` / `FAIL`, unset by default) → explicitly controls the mode emitted for optional non-nullable properties when `generateJsonSetterNullsAnnotations=true`, decoupling it from `openApiNullable`. When unset, the mode is derived from `openApiNullable` exactly as in `7.24.x` (`true` → `FAIL` where supported, `false` → `SKIP`), so this is fully backward compatible. Setting it makes the previously-unreachable combinations possible — e.g. `openApiNullable=true` with `SKIP` (tolerate an incoming `null` on a non-nullable field while genuinely nullable optionals still use `JsonNullable`). On the `spring` (Java) generator this is the only generator-wide option that can emit `Nulls.FAIL` (the per-property `x-jackson-json-setter-nulls extension below can also emit it per field). + +A per-property override set via the `x-jackson-json-setter-nulls` vendor extension (`SKIP` / `FAIL` / `NONE`) always wins, regardless of these options, and is honored even when `generateJsonSetterNullsAnnotations` is unset. + +[NOTE] +==== +`@JsonSetter(nulls = Nulls.SKIP)` and emitting *no* `@JsonSetter` are not equivalent: with no annotation Jackson falls back to its global default (`Nulls.SET`), so an explicit JSON `null` overwrites the field's default value, whereas `Nulls.SKIP` ignores the incoming `null` and preserves the default. On the `spring` generator with `openApiNullable=true`, the unset default still emits no annotation (`7.24.x`-compatible) but now logs a warning; set `optionalNonNullPropertyJsonSetterNulls=SKIP` (preserve defaults) or `FAIL` (reject nulls) to control it explicitly. +==== + +[NOTE] +==== +This also affects the `kotlin-spring` strict-null (PATCH) behavior. In `7.24.x`, an optional non-nullable property generated with `openApiNullable=true` emitted `@JsonSetter(nulls = Nulls.FAIL)`, so an explicit `null` in the payload was rejected. From `7.25.0`, that annotation is only emitted when `generateJsonSetterNullsAnnotations=true`. Leaving the option unset (or `false`) means an explicit `null` is handled by the global `ObjectMapper` instead of failing. Set `generateJsonSetterNullsAnnotations=true` to restore the strict `Nulls.FAIL` behavior. +==== + +==== Note + +`@JsonInclude(NON_ABSENT)` is no longer emitted on `JsonNullable` fields: the `JsonNullable` module already governs their inclusion, so the annotation was redundant. + === From 3.x to 4.0.0 Version `4.0.0` is a major release, which contains some breaking changes without fallback. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index ee5cea2c78c1..be6224ff862b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -436,6 +436,14 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String USE_VERTX_5 = "useVertx5"; public static final String USE_VERTX_5_DESC = "Setting this property to true will generate Vert.x 5 specific callbacks using Callables."; + public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE = "optionalNonNullPropertyJsonInclude"; + + public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS = "optionalNonNullPropertyJsonSetterNulls"; + + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS = "generateJsonIncludeAnnotations"; + + public static final String GENERATE_JSON_SETTER_NULLS_ANNOTATIONS = "generateJsonSetterNullsAnnotations"; + public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT = "disallowAdditionalPropertiesIfNotPresent"; public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC = "If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " + @@ -488,19 +496,6 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String DEFAULT_TO_EMPTY_CONTAINER = "defaultToEmptyContainer"; public static final String DEFAULT_TO_EMPTY_CONTAINER_DESC = "Initialize containers (array/set/map) to empty containers instead of null by default. Usage: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#default-values"; - // The raw enum values from the OpenAPI specification - public static final String ENUM_VALUES = "values"; - // The map that stores all enum values and their metadata (name, value, enumDescription...) - public static final String ENUM_VARS = "enumVars"; - // The name of the enum, for example NAME("value") in Java - public static final String ENUM_NAME = "name"; - // The on-the-line value, i.e., the one present in the "values" - public static final String ENUM_VALUE = "value"; - // If the enum is typed as a string - public static final String ENUM_IS_STRING = "isString"; - // The description that should be attached to an entry in "enumVars" - public static final String ENUM_DESCRIPTION = "enumDescription"; - // Vendor extensions public static final String X_EXAMPLE = "x-example"; public static final String X_INTERNAL = "x-internal"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 1e8d2c7b181e..6d6c631aec1e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -63,6 +63,7 @@ import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.model.WebhooksMap; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.serializer.SerializerUtils; import org.openapitools.codegen.templating.MustacheEngineAdapter; import org.openapitools.codegen.templating.mustache.*; @@ -92,6 +93,7 @@ import java.util.stream.Stream; import static org.openapitools.codegen.CodegenConstants.*; +import static org.openapitools.codegen.model.EnumVarMap.*; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.DiscriminatorUtils.*; import static org.openapitools.codegen.utils.EnumUtils.*; @@ -901,7 +903,7 @@ public ModelsMap postProcessModelsEnum(ModelsMap objs) { // for enum model if (cm.isEnum && cm.allowableValues != null) { List values = getEnumValues(cm.allowableValues); - List> enumVars = buildEnumVars(values, cm.dataType); + List enumVars = buildEnumVars(values, cm.dataType); postProcessEnumVars(enumVars); // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames updateEnumVarsWithExtensions(enumVars, cm.getVendorExtensions(), cm.dataType); @@ -7008,7 +7010,7 @@ public void setParameterBooleanFlagWithCodegenProperty(CodegenParameter paramete } /** - * Update codegen property's enum by adding {@value CodegenConstants#ENUM_VARS} (with name and value) + * Update codegen property's enum by adding {@value EnumVarMap#ENUM_VARS} (with name and value) * * @param var list of CodegenProperty */ @@ -7035,7 +7037,7 @@ public void updateCodegenPropertyEnum(CodegenProperty var) { .map(Map.Entry::getValue) .findFirst(); String dataType = (referencedSchema.isPresent()) ? getTypeDeclaration(referencedSchema.get()) : varDataType; - List> enumVars = buildEnumVars(values, dataType); + List enumVars = buildEnumVars(values, dataType); postProcessEnumVars(enumVars); // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames @@ -7051,9 +7053,9 @@ public void updateCodegenPropertyEnum(CodegenProperty var) { final String enumDefaultValue = getEnumDefaultValue(var.defaultValue, dataType); String enumName = null; - for (Map enumVar : enumVars) { - if (enumDefaultValue.equals(enumVar.get(ENUM_VALUE))) { - enumName = (String) enumVar.get(ENUM_NAME); + for (EnumVarMap enumVar : enumVars) { + if (enumDefaultValue.equals(enumVar.getEnumValue())) { + enumName = (String) enumVar.getEnumName(); break; } } @@ -7073,8 +7075,8 @@ protected String getEnumDefaultValue(String defaultValue, String dataType) { return enumDefaultValue; } - protected List> buildEnumVars(List values, String dataType) { - List> enumVars = new ArrayList<>(); + protected List buildEnumVars(List values, String dataType) { + List enumVars = new ArrayList<>(); int truncateIdx = isRemoveEnumValuePrefix() ? findCommonPrefixOfVars(values).length() : 0; @@ -7085,7 +7087,7 @@ protected List> buildEnumVars(List values, String da // attributes, not actual enum values, so we remove them here continue; } - Map enumVar = new HashMap<>(); + EnumVarMap enumVar = new EnumVarMap(); String enumName = truncateIdx == 0 ? String.valueOf(value) : value.toString().substring(truncateIdx); @@ -7096,9 +7098,7 @@ protected List> buildEnumVars(List values, String da final String finalEnumName = toEnumVarName(enumName, dataType); - enumVar.put(ENUM_NAME, finalEnumName); - enumVar.put(ENUM_VALUE, toEnumValue(String.valueOf(value), dataType)); - enumVar.put(ENUM_IS_STRING, isDataTypeString(dataType)); + enumVar.enumVar(finalEnumName, toEnumValue(String.valueOf(value), dataType), isDataTypeString(dataType)); // TODO: add isNumeric enumVars.add(enumVar); } @@ -7117,8 +7117,8 @@ protected List> buildEnumVars(List values, String da * @param enumVars the enumVars * @param dataType the data type of the enum parameter */ - private void injectEnumUnknownDefaultCase(List> enumVars, String dataType) { - Map enumVar = new HashMap<>(); + private void injectEnumUnknownDefaultCase(List enumVars, String dataType) { + EnumVarMap enumVar = new EnumVarMap(); String enumName = enumUnknownDefaultCaseName; String enumValue = isDataTypeString(dataType) @@ -7131,9 +7131,7 @@ private void injectEnumUnknownDefaultCase(List> enumVars, St // https://github.com/OpenAPITools/openapi-generator/pull/11013 String.valueOf(11184809); - enumVar.put(ENUM_NAME, toEnumVarName(enumName, dataType)); - enumVar.put(ENUM_VALUE, toEnumValue(enumValue, dataType)); - enumVar.put(ENUM_IS_STRING, isDataTypeString(dataType)); + enumVar.enumVar(toEnumVarName(enumName, dataType), toEnumValue(enumValue, dataType), isDataTypeString(dataType)); // TODO: add isNumeric enumVars.add(enumVar); } @@ -7148,31 +7146,31 @@ private void injectEnumUnknownDefaultCase(List> enumVars, St protected void removeEnumUnknownDefaultCase(CodegenOperation operation) { for (CodegenParameter param : operation.allParams) { if (!param.isBodyParam && param.isEnum && hasEnumVars(param.allowableValues)) { - List> enumVars = getEnumVars(param.allowableValues); + List enumVars = getEnumVars(param.allowableValues); if (enumVars != null) { String unknownName = toEnumVarName(enumUnknownDefaultCaseName, param.dataType); - enumVars.removeIf(ev -> unknownName.equals(ev.get(ENUM_NAME))); + enumVars.removeIf(ev -> unknownName.equals(ev.getEnumName())); } } } } - protected void postProcessEnumVars(List> enumVars) { + protected void postProcessEnumVars(List enumVars) { Collections.reverse(enumVars); enumVars.forEach(v -> { - String name = (String) v.get(ENUM_NAME); - long count = enumVars.stream().filter(v1 -> v1.get(ENUM_NAME).equals(name)).count(); + String name = (String) v.getEnumName(); + long count = enumVars.stream().filter(v1 -> v1.getEnumName().equals(name)).count(); if (count > 1) { String uniqueEnumName = getUniqueEnumName(name, enumVars); - LOGGER.debug("Changing duplicate enumeration name from {} to {}", v.get(ENUM_NAME), uniqueEnumName); - v.put(ENUM_NAME, uniqueEnumName); + LOGGER.debug("Changing duplicate enumeration name from {} to {}", v.getEnumName(), uniqueEnumName); + v.setEnumName(uniqueEnumName); } }); Collections.reverse(enumVars); } - private String getUniqueEnumName(String name, List> enumVars) { - long count = enumVars.stream().filter(v -> v.get(ENUM_NAME).equals(name)).count(); + private String getUniqueEnumName(String name, List enumVars) { + long count = enumVars.stream().filter(v -> v.getEnumName().equals(name)).count(); return count > 1 ? getUniqueEnumName(name + count, enumVars) : name; @@ -7185,7 +7183,7 @@ private String getUniqueEnumName(String name, List> enumVars * @param vendorExtensions vendor extensions * @param dataType data type */ - protected void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions, String dataType) { + protected void updateEnumVarsWithExtensions(List enumVars, Map vendorExtensions, String dataType) { if (vendorExtensions != null) { updateEnumVarsWithExtensions(enumVars, vendorExtensions, X_ENUM_VARNAMES, ENUM_NAME, dataType); updateEnumVarsWithExtensions(enumVars, vendorExtensions, X_ENUM_DESCRIPTIONS, ENUM_DESCRIPTION, dataType); @@ -7201,7 +7199,7 @@ protected void updateEnumVarsWithExtensions(List> enumVars, * @param key key * @param dataType data type */ - protected void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions, String extensionKey, String key, String dataType) { + protected void updateEnumVarsWithExtensions(List enumVars, Map vendorExtensions, String extensionKey, String key, String dataType) { updateEnumVarsWithExtensions(enumVars, vendorExtensions, extensionKey, key, dataType, (a, b) -> a); } @@ -7214,7 +7212,7 @@ protected void updateEnumVarsWithExtensions(List> enumVars, * @param dataType data type * @param enumDataTypeMapping functions that accepts 2 arguments */ - protected void updateEnumVarsWithExtensions(List> enumVars, + protected void updateEnumVarsWithExtensions(List enumVars, Map vendorExtensions, String extensionKey, String key, @@ -7230,8 +7228,8 @@ protected void updateEnumVarsWithExtensions(List> enumVars, } } else if (extensionValue instanceof Map) { Map valueMap = (Map) extensionValue; - for (Map enumVar : enumVars) { - String enumValue = (String) enumVar.get(ENUM_VALUE); + for (EnumVarMap enumVar : enumVars) { + String enumValue = (String) enumVar.getEnumValue(); for (Map.Entry entry : valueMap.entrySet()) { if (toEnumValue(entry.getKey(), dataType).equals(enumValue)) { enumVar.put(key, enumDataTypeMapping.apply(entry.getValue(), dataType)); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java index 97d3a11a2785..a684bf326683 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java @@ -43,6 +43,7 @@ import static org.openapitools.codegen.CodegenConstants.*; import static org.openapitools.codegen.utils.EnumUtils.ANY_OF; import static org.openapitools.codegen.utils.EnumUtils.ONE_OF; +import static org.openapitools.codegen.utils.ModelUtils.isOneOfOfConsts; import static org.openapitools.codegen.utils.ModelUtils.simplifyOneOfAnyOfWithOnlyOneNonNullSubSchema; import static org.openapitools.codegen.utils.StringUtils.getUniqueString; @@ -1742,18 +1743,24 @@ protected Schema processSimplifyOneOf(Schema schema) { } schema = simplifyOneOfAnyOfWithOnlyOneNonNullSubSchema(openAPI, schema, oneOfSchemas); - if (ModelUtils.isIntegerSchema(schema) || ModelUtils.isNumberSchema(schema) || ModelUtils.isStringSchema(schema)) { - if (schema.getSpecVersion().equals(SpecVersion.V30)) { - schema.setOneOf(null); - } //else { - // TODO convert oneOf const/deprecated to enum - // } - } + clearOneOf(schema); } return schema; } + /** + * Removes the {@code oneOf} from the schema if it is considered to not contain information that the generator can + * currently act upon. The schema is left untouched if all the {@code oneOf} branches contain an OAS 3.1 {@code const}. + * This since that structure can potentially be used for enum interpretation. + */ + private void clearOneOf(Schema schema) { + if (ModelUtils.isIntegerSchema(schema) || ModelUtils.isNumberSchema(schema) || ModelUtils.isStringSchema(schema)) { + if (!isOneOfOfConsts(schema)) { + schema.setOneOf(null); + } + } + } /** * Ensure inheritance is correctly defined for OneOf and Discriminators. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java index 92e34e47997e..5aa24940cb6a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java @@ -32,7 +32,9 @@ public enum VendorExtension { X_SIZE_MESSAGE("x-size-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the size or length of a variable", null), X_MINIMUM_MESSAGE("x-minimum-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the minimum value of a variable", null), X_MAXIMUM_MESSAGE("x-maximum-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the maximum value of a variable", null), - X_ZERO_BASED_ENUM("x-zero-based-enum", ExtensionLevel.MODEL, "When used on an enum, the index will not be generated and the default numbering will be used, zero-based", "false"); + X_ZERO_BASED_ENUM("x-zero-based-enum", ExtensionLevel.MODEL, "When used on an enum, the index will not be generated and the default numbering will be used, zero-based", "false"), + X_JACKSON_JSON_INCLUDE_POLICY("x-jackson-json-include-policy", ExtensionLevel.FIELD, "Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.", "resolved automatically per the required/nullable matrix"), + X_JACKSON_JSON_SETTER_NULLS("x-jackson-json-setter-nulls", ExtensionLevel.FIELD, "Manually override the resolved Jackson `@JsonSetter(nulls = ...)` deserialization null-handling for this property. Must be one of `SKIP` (ignore an explicit JSON null, keeping the default), `FAIL` (reject an explicit JSON null), or `NONE` to emit no annotation. Always wins over the automatic `openApiNullable` default and the `optionalNonNullPropertyJsonSetterNulls` option, and is honored regardless of `generateJsonSetterNullsAnnotations` or whether the property is required/nullable.", "resolved automatically per the openApiNullable default"); private final String name; private final List levels; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index 269afedcd981..f56f47491953 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -32,6 +32,7 @@ import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.model.WebhooksMap; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.templating.mustache.*; import org.openapitools.codegen.templating.mustache.CopyLambda.CopyContent; import org.openapitools.codegen.templating.mustache.CopyLambda.WhiteSpaceStrategy; @@ -899,15 +900,15 @@ protected void patchProperty(Map enumRefs, CodegenModel mo } @Override - protected List> buildEnumVars(List values, String dataType) { - List> enumVars = super.buildEnumVars(values, dataType); + protected List buildEnumVars(List values, String dataType) { + List enumVars = super.buildEnumVars(values, dataType); // this is needed for enumRefs like OuterEnum marked as nullable and also have string values // keep isString true so that the index will be used as the enum value instead of a string // this is inline with C# enums with string values if ("string?".equals(dataType)) { enumVars.forEach((enumVar) -> { - enumVar.put(ENUM_IS_STRING, true); + enumVar.isString(true); }); } @@ -920,7 +921,7 @@ protected List> buildEnumVars(List values, String da } /** - * Update codegen property's enum by adding {@value CodegenConstants#ENUM_VARS} (with name and value) + * Update codegen property's enum by adding {@value EnumVarMap#ENUM_VARS} (with name and value) * * @param var list of CodegenProperty */ diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index 835b21ad840e..14df27726545 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -28,7 +29,7 @@ import java.util.*; import java.util.stream.Stream; -import static org.openapitools.codegen.CodegenConstants.*; +import static org.openapitools.codegen.model.EnumVarMap.*; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.EnumUtils.BUNGIE_X_ENUM_VALUES; import static org.openapitools.codegen.utils.EnumUtils.getBungieEnumValues; @@ -860,7 +861,7 @@ private List> prioritizeContentTypes(List> enumVars, Map vendorExtensions, String dataType) { + protected void updateEnumVarsWithExtensions(List enumVars, Map vendorExtensions, String dataType) { if (vendorExtensions != null && useEnumExtension && vendorExtensions.containsKey(BUNGIE_X_ENUM_VALUES)) { // Use the x-enum-values extension for this enum // Existing enumVars added by the default handling need to be removed first @@ -870,10 +871,8 @@ protected void updateEnumVarsWithExtensions(List> enumVars, boolean isString = isDataTypeString(dataType); for (Map value : bungieEnumValues) { - Map enumVar = new HashMap<>(value); - enumVar.put(ENUM_NAME, toEnumVarName(value.get(ENUM_NAME), dataType)); - enumVar.put(ENUM_VALUE, toEnumValue(value.get(ENUM_VALUE), dataType)); - enumVar.put(ENUM_IS_STRING, isString); + EnumVarMap enumVar = new EnumVarMap(value); + enumVar.enumVar(toEnumVarName(value.get(ENUM_NAME), dataType), toEnumValue(value.get(ENUM_VALUE), dataType), isString); enumVars.add(enumVar); } } else { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java index 303ddc01dee1..68c16233508e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java @@ -25,6 +25,7 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -37,11 +38,11 @@ import java.io.File; import java.util.*; -import static org.openapitools.codegen.CodegenConstants.ENUM_VARS; import static org.openapitools.codegen.CodegenConstants.X_ENUM_BYTE; import static org.openapitools.codegen.CodegenConstants.X_EXAMPLE; +import static org.openapitools.codegen.model.EnumVarMap.ENUM_VARS; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; -import static org.openapitools.codegen.utils.EnumUtils.getEnumVarsAsString; +import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -451,12 +452,12 @@ private void postProcessEnumRefs(final Map models) { // Since we iterate enumVars for modelInnerEnum and enumClass templates, and CodegenModel is missing some of CodegenProperty's properties, // we can take advantage of Mustache's contextual lookup to add the same "properties" to the model's enumVars scope rather than CodegenProperty's scope. - List> enumVars = getEnumVarsAsString(model.allowableValues); - List> newEnumVars = new ArrayList<>(); - for (Map enumVar : enumVars) { - Map mixedVars = new HashMap<>(enumVar); + List enumVars = getEnumVars(model.allowableValues); + List newEnumVars = new ArrayList<>(); + for (EnumVarMap enumVar : enumVars) { + EnumVarMap mixedVars = new EnumVarMap(enumVar); - mixedVars.put("isString", isString); + mixedVars.isString(isString); mixedVars.put("isLong", isLong); mixedVars.put("isInteger", isInteger); mixedVars.put("isByte", isByte); @@ -475,7 +476,7 @@ private void postProcessEnumRefs(final Map models) { } /** - * Update codegen property's enum by adding {@value CodegenConstants#ENUM_VARS} (with name and value) + * Update codegen property's enum by adding {@value EnumVarMap#ENUM_VARS} (with name and value) * * @param var list of CodegenProperty */ diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index 0dce98a4fb5c..7051fcea4f87 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -24,6 +24,7 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -39,6 +40,8 @@ import java.util.regex.Pattern; import static org.openapitools.codegen.CodegenConstants.*; +import static org.openapitools.codegen.model.EnumVarMap.ENUM_DESCRIPTION; +import static org.openapitools.codegen.model.EnumVarMap.ENUM_NAME; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.CamelizeOption.UPPERCASE_FIRST_CHAR; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -822,7 +825,7 @@ public void setParameterExampleValue(CodegenParameter p) { } @Override - protected void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions, String dataType) { + protected void updateEnumVarsWithExtensions(List enumVars, Map vendorExtensions, String dataType) { if (vendorExtensions != null) { updateEnumVarsWithExtensions(enumVars, vendorExtensions, X_ENUM_VARNAMES, ENUM_NAME, dataType, this::toEnumVarName); updateEnumVarsWithExtensions(enumVars, vendorExtensions, X_ENUM_DESCRIPTIONS, ENUM_DESCRIPTION, dataType); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index b02f4f141ce8..f2ab264952cd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -29,6 +29,7 @@ import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.SecurityFeature; import org.openapitools.codegen.meta.features.DataTypeFeature; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -1138,18 +1139,18 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { // set enum type in extensions and update `name` in enumVars if (model.isEnum) { - for (Map enumVars : getEnumVars(model.getAllowableValues())) { - if ((Boolean) enumVars.get(ENUM_IS_STRING)) { + for (EnumVarMap enumVars : getEnumVars(model.getAllowableValues())) { + if (enumVars.isString()) { model.vendorExtensions.putIfAbsent(X_PY_ENUM_TYPE, "str"); // Do not overwrite the variable name if already set through x-enum-varnames if (model.vendorExtensions.get(X_ENUM_VARNAMES) == null) { - enumVars.put(ENUM_NAME, toEnumVariableName((String) enumVars.get(ENUM_VALUE), "str")); + enumVars.setEnumName(toEnumVariableName((String) enumVars.getEnumValue(), "str")); } } else { model.vendorExtensions.putIfAbsent(X_PY_ENUM_TYPE, "int"); // Do not overwrite the variable name if already set through x-enum-varnames if (model.vendorExtensions.get(X_ENUM_VARNAMES) == null) { - enumVars.put(ENUM_NAME, toEnumVariableName((String) enumVars.get(ENUM_VALUE), "int")); + enumVars.setEnumName(toEnumVariableName((String) enumVars.getEnumValue(), "int")); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java index f69f811a1b1a..796e99e1eab4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java @@ -27,10 +27,12 @@ import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.SecurityFeature; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.utils.EnumUtils; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -978,14 +980,14 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { // set enum type in extensions and update `name` in enumVars if (model.isEnum) { - for (Map enumVars : (List>) model.getAllowableValues().get(ENUM_VARS)) { - if ((Boolean) enumVars.get(ENUM_IS_STRING)) { + for (EnumVarMap enumVars : EnumUtils.getEnumVars(model.getAllowableValues())) { + if (enumVars.isString()) { model.vendorExtensions.putIfAbsent(X_PY_ENUM_TYPE, "str"); // update `name`, e.g. - enumVars.put(ENUM_NAME, toEnumVariableName((String) enumVars.get(ENUM_VALUE), "str")); + enumVars.setEnumName(toEnumVariableName((String) enumVars.getEnumValue(), "str")); } else { model.vendorExtensions.putIfAbsent(X_PY_ENUM_TYPE, "int"); - enumVars.put(ENUM_NAME, toEnumVariableName((String) enumVars.get(ENUM_VALUE), "int")); + enumVars.setEnumName(toEnumVariableName((String) enumVars.getEnumValue(), "int")); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java index 2fe4d50812b4..617a6d55b4fa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java @@ -26,6 +26,7 @@ import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; @@ -251,7 +252,7 @@ public String escapeQuotationMark(String input) { } @Override - protected List> buildEnumVars(List values, String dataType) { + protected List buildEnumVars(List values, String dataType) { List sanitizedValues = values.stream() .filter(x -> x != null) .map(Object::toString) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppHttplibServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppHttplibServerCodegen.java index 7f4a2e09d6eb..207eb2872e9b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppHttplibServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppHttplibServerCodegen.java @@ -59,7 +59,7 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.responses.ApiResponse; -import static org.openapitools.codegen.CodegenConstants.*; +import static org.openapitools.codegen.model.EnumVarMap.*; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; import static org.openapitools.codegen.utils.EnumUtils.hasEnumValues; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java index 41a01bffd569..06f227a0a416 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java @@ -24,6 +24,7 @@ import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -39,9 +40,8 @@ import java.time.ZoneId; import java.util.*; -import static org.openapitools.codegen.CodegenConstants.*; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; -import static org.openapitools.codegen.utils.EnumUtils.getEnumVarsAsString; +import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -825,9 +825,9 @@ public org.openapitools.codegen.model.WebhooksMap postProcessWebhooksWithModels( * Shared post-processing for one generated api class, whether its operations come from * {@code paths} or from {@code webhooks}. * - * @param objs the template bundle for the api file (also carries specHelperPath) - * @param operations the operations to process, or null when the group is empty - * @param allModels every generated model, used to qualify model types and build examples + * @param objs the template bundle for the api file (also carries specHelperPath) + * @param operations0 the operations to process, or null when the group is empty + * @param allModels every generated model, used to qualify model types and build examples */ private void processApiGroup(Map objs, OperationMap operations0, List allModels) { String classname = (operations0 != null) ? operations0.getClassname() : ""; @@ -1100,8 +1100,8 @@ private String constructExampleCode(CodegenModel codegenModel, HashMap> enumVars = getEnumVarsAsString(codegenModel.allowableValues); - return moduleName + "::" + codegenModel.classname + "::" + enumVars.get(0).get(ENUM_NAME); + List enumVars = getEnumVars(codegenModel.allowableValues); + return moduleName + "::" + codegenModel.classname + "::" + enumVars.get(0).getEnumName(); } else if (codegenModel.oneOf != null && !codegenModel.oneOf.isEmpty()) { String subModel = (String) codegenModel.oneOf.toArray()[0]; if (modelMaps.get(subModel) == null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 72232b875d8f..d9625e9f5656 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -28,6 +28,7 @@ import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -40,10 +41,9 @@ import java.io.File; import java.util.*; -import static org.openapitools.codegen.CodegenConstants.*; +import static org.openapitools.codegen.model.EnumVarMap.ENUM_VARS; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; -import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; import static org.openapitools.codegen.utils.ModelUtils.hasAnyOf; import static org.openapitools.codegen.utils.ModelUtils.hasOneOf; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -610,10 +610,10 @@ private void prefixEnumUnknownDefaultCase(CodegenModel model) { } // Prefix only the fallback name so user-defined enum values keep their existing generated names. - Map fallbackEnumVar = (Map) enumVars.get(enumVars.size() - 1); - Object fallbackName = fallbackEnumVar.get(ENUM_NAME); + EnumVarMap fallbackEnumVar = (EnumVarMap) enumVars.get(enumVars.size() - 1); + Object fallbackName = fallbackEnumVar.getEnumName(); if (fallbackName instanceof String) { - fallbackEnumVar.put(ENUM_NAME, model.classname.toUpperCase(Locale.ROOT) + "_" + fallbackName); + fallbackEnumVar.setEnumName(model.classname.toUpperCase(Locale.ROOT) + "_" + fallbackName); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 192cc62e31f3..acb40b97d0fb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -27,6 +27,7 @@ import org.apache.commons.text.StringEscapeUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -41,11 +42,9 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import static org.openapitools.codegen.CodegenConstants.ENUM_NAME; -import static org.openapitools.codegen.CodegenConstants.ENUM_VARS; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.CamelizeOption.UPPERCASE_FIRST_CHAR; -import static org.openapitools.codegen.utils.EnumUtils.getEnumVarsAsString; +import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -1413,8 +1412,8 @@ private void updateAllowableValuesNames(String paramNameType, Map enumVar : getEnumVarsAsString(allowableValues)) { - enumVar.put(ENUM_NAME, paramNameType + enumVar.get(ENUM_NAME)); + for (EnumVarMap enumVar : getEnumVars(allowableValues)) { + enumVar.setEnumName(paramNameType + enumVar.getEnumName()); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java index 75c38bd4a1a9..ffa2a934b4f0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java @@ -26,6 +26,7 @@ import org.apache.commons.text.StringEscapeUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.CXFExtServerFeatures; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -47,7 +48,6 @@ import java.text.SimpleDateFormat; import java.util.*; -import static org.openapitools.codegen.CodegenConstants.*; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; @@ -666,13 +666,13 @@ private boolean appendRandomEnum(StringBuilder buffer, CodegenOperation op, Code boolean usingEnumLiteral = false; String definingClass = (String) var.varVendorExtensions.get("x-defining-class"); if (definingClass != null) { - List> enumVars = getEnumVars(var.allowableValues); + List enumVars = getEnumVars(var.allowableValues); if (enumVars != null) { if (!loadTestDataFromFile) { - Map randomEnumVar = enumVars.get(i); + EnumVarMap randomEnumVar = enumVars.get(i); // NOTE: to disambiguate identically named inner enums, qualify enum name with defining class. buffer.append(definingClass).append('.').append(var.enumName).append('.') - .append(randomEnumVar.get(ENUM_NAME)); + .append(randomEnumVar.getEnumName()); op.imports.add(definingClass); } usingEnumLiteral = true; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 35ffe6710be7..4a252d8f796a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -31,11 +31,13 @@ import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.GlobalFeature; import org.openapitools.codegen.meta.features.SecurityFeature; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.templating.mustache.CaseFormatLambda; +import org.openapitools.codegen.utils.EnumUtils; import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -1235,10 +1237,10 @@ public ModelsMap postProcessModels(ModelsMap objs) { if (StringUtils.isNotEmpty(var.defaultValue)) { // has default value String defaultValue = var.defaultValue.substring(var.defaultValue.lastIndexOf('.') + 1); - for (Map enumVars : (List>) var.getAllowableValues().get(ENUM_VARS)) { - if (defaultValue.equals(enumVars.get(ENUM_NAME))) { + for (EnumVarMap enumVars : EnumUtils.getEnumVars(var.allowableValues)) { + if (defaultValue.equals(enumVars.getEnumName())) { // update default to use the string directly instead of enum string - var.defaultValue = (String) enumVars.get(ENUM_VALUE); + var.defaultValue = (String) enumVars.getEnumValue(); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java index 2a628d7f6c25..cf286b79ed12 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java @@ -29,9 +29,11 @@ import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.GlobalFeature; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.utils.EnumUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -412,10 +414,10 @@ public ModelsMap postProcessModels(ModelsMap objs) { if (StringUtils.isNotEmpty(var.defaultValue)) { // has default value String defaultValue = var.defaultValue.substring(var.defaultValue.lastIndexOf('.') + 1); - for (Map enumVars : (List>) var.getAllowableValues().get(ENUM_VARS)) { - if (defaultValue.equals(enumVars.get(ENUM_NAME))) { + for (EnumVarMap enumVars : EnumUtils.getEnumVars(var.getAllowableValues())) { + if (defaultValue.equals(enumVars.getEnumName())) { // update default to use the string directly instead of enum string - var.defaultValue = (String) enumVars.get(ENUM_VALUE); + var.defaultValue = (String) enumVars.getEnumValue(); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 3344db943a5b..2133145a608b 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -58,9 +58,6 @@ import org.openapitools.codegen.templating.mustache.ReplaceAllLambda; import static java.util.Collections.sort; -import static org.openapitools.codegen.CodegenConstants.ENUM_NAME; -import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; -import static org.openapitools.codegen.utils.EnumUtils.hasEnumVars; /** *

Mustache templates are located in diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index b05fc5df0432..d2c9e61a130b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -34,7 +34,10 @@ import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda; +import org.openapitools.codegen.utils.JsonAnnotationPolicyUtils; +import org.openapitools.codegen.utils.JsonIncludePolicy; import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.TriStateBoolean; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -182,6 +185,10 @@ public enum RequestMappingMode { @Setter private boolean useEnumValueInterface = false; private String valuedEnumClassName = "ValuedEnum"; @Setter private boolean suspendFunctions = false; + @Getter @Setter private JsonIncludePolicy optionalNonNullPropertyJsonInclude = JsonIncludePolicy.NON_NULL; + @Getter @Setter private JsonAnnotationPolicyUtils.JsonSetterNullsMode optionalNonNullPropertyJsonSetterNulls = null; + @Getter @Setter private TriStateBoolean generateJsonIncludeAnnotations = TriStateBoolean.UNSET; + @Getter @Setter private TriStateBoolean generateJsonSetterNullsAnnotations = TriStateBoolean.UNSET; @Getter @Setter private boolean openApiNullable = false; @Getter @Setter protected boolean useDeductionForOneOfInterfaces = false; @@ -315,6 +322,30 @@ public KotlinSpringServerCodegen() { substituteGenericPagedModel); addSwitch(COMPANION_OBJECT, "Whether to generate companion objects in data classes, enabling companion extensions.", companionObject); addSwitch(SUSPEND_FUNCTIONS, "Whether to generate suspend functions for API operations. Useful for Spring MVC with Kotlin coroutines without requiring the full reactive stack.", suspendFunctions); + + CliOption optionalNonNullPropertyJsonIncludeOpt = CliOption.newString(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, + JsonAnnotationPolicyUtils.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE_DESC); + for (JsonIncludePolicy policy : JsonIncludePolicy.OPTIONAL_NON_NULL_POLICIES) { + optionalNonNullPropertyJsonIncludeOpt.addEnum(policy.name(), policy.getDescription()); + } + optionalNonNullPropertyJsonIncludeOpt.setDefault(optionalNonNullPropertyJsonInclude.name()); + cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); + + CliOption optionalNonNullPropertyJsonSetterNullsOpt = CliOption.newString(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, + JsonAnnotationPolicyUtils.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS_DESC); + optionalNonNullPropertyJsonSetterNullsOpt.addEnum(JsonAnnotationPolicyUtils.JsonSetterNullsMode.SKIP.name(), + "Emit @JsonSetter(nulls = Nulls.SKIP): silently ignore an explicit JSON null, keeping the field's default."); + optionalNonNullPropertyJsonSetterNullsOpt.addEnum(JsonAnnotationPolicyUtils.JsonSetterNullsMode.FAIL.name(), + "Emit @JsonSetter(nulls = Nulls.FAIL): reject an explicit JSON null."); + cliOptions.add(optionalNonNullPropertyJsonSetterNullsOpt); + addSwitch(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + JsonAnnotationPolicyUtils.GENERATE_JSON_INCLUDE_ANNOTATIONS_DESC, false); + addSwitch(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + "Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. " + + "When true, emits @JsonSetter (Nulls.FAIL when openApiNullable is true, otherwise Nulls.SKIP) so " + + "an explicit null in the payload is handled explicitly. When false, none are generated and " + + "deserialization null-handling defers to the global ObjectMapper. When left unset it defaults to " + + "false (7.23.0-equivalent output) and logs a warning; set it explicitly to silence the warning.", false); cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_DEDUCTION_FOR_ONE_OF_INTERFACES, CodegenConstants.USE_DEDUCTION_FOR_ONE_OF_INTERFACES_DESC, useDeductionForOneOfInterfaces)); addSwitch(CodegenConstants.USE_ENUM_VALUE_INTERFACE, CodegenConstants.USE_ENUM_VALUE_INTERFACE_DESC, useEnumValueInterface); addSwitch(CodegenConstants.OPENAPI_NULLABLE, @@ -735,6 +766,26 @@ public void processOpts() { } writePropertyBack(SUSPEND_FUNCTIONS, suspendFunctions); + if (additionalProperties.containsKey(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS)) { + this.generateJsonIncludeAnnotations = TriStateBoolean.fromNullableBoolean(convertPropertyToBoolean(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS)); + } + writePropertyBack(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, generateJsonIncludeAnnotations.isTrue()); + if (additionalProperties.containsKey(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)) { + this.generateJsonSetterNullsAnnotations = TriStateBoolean.fromNullableBoolean(convertPropertyToBoolean(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS)); + } + writePropertyBack(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, generateJsonSetterNullsAnnotations.isTrue()); + this.optionalNonNullPropertyJsonInclude = JsonAnnotationPolicyUtils.resolveOptionalNonNullPropertyJsonInclude( + additionalProperties, optionalNonNullPropertyJsonInclude); + writePropertyBack(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude.name()); + this.optionalNonNullPropertyJsonSetterNulls = JsonAnnotationPolicyUtils.resolveOptionalNonNullPropertyJsonSetterNulls( + additionalProperties, optionalNonNullPropertyJsonSetterNulls); + if (optionalNonNullPropertyJsonSetterNulls != null) { + writePropertyBack(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, optionalNonNullPropertyJsonSetterNulls.name()); + } + JsonAnnotationPolicyUtils.warnIfUnset(LOGGER, generateJsonIncludeAnnotations, generateJsonSetterNullsAnnotations); + JsonAnnotationPolicyUtils.warnIfJsonSetterNullsDefaultRisky(LOGGER, generateJsonSetterNullsAnnotations, + optionalNonNullPropertyJsonSetterNulls, openApiNullable, true); + if (additionalProperties.containsKey(BEAN_QUALIFIERS) && library.equals(SPRING_BOOT)) { this.setBeanQualifiers(convertPropertyToBoolean(BEAN_QUALIFIERS)); } @@ -1281,21 +1332,12 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert property.example = null; } - // Scenario 3: optional + non-nullable → always emit @JsonSetter to handle explicit JSON nulls. - // When openApiNullable=true: Nulls.FAIL → reject explicit null (strict PATCH semantics). - // When openApiNullable=false: Nulls.SKIP → silently ignore explicit null (lenient, protects defaults). - // Always emit @JsonInclude(NON_NULL) so null fields are omitted from serialized output regardless - // of who is deserializing on the other end — closer to spec, avoids round-trip failures. - if (!property.required && !property.isNullable) { - if (openApiNullable) { - property.vendorExtensions.put("x-has-json-setter-nulls-fail", true); - } else { - property.vendorExtensions.put("x-has-json-setter-nulls-skip", true); - } - model.imports.add("JsonSetter"); - model.imports.add("Nulls"); - model.imports.add("JsonInclude"); - } + // Emit @JsonSetter(nulls = ...) for optional, non-nullable properties (and honor a per-property + // x-jackson-json-setter-nulls override) when enabled; see JsonAnnotationPolicyUtils#resolveJsonSetterNulls + // for the full precedence/SKIP/FAIL rules. kotlin-spring's default path supports both SKIP and FAIL + // (failModeSupported=true), unlike spring. + JsonAnnotationPolicyUtils.resolveJsonSetterNulls(model, property, generateJsonSetterNullsAnnotations, + optionalNonNullPropertyJsonSetterNulls, openApiNullable, true); // Scenario 4: optional + nullable with openApiNullable → use JsonNullable = JsonNullable.undefined() // so callers can distinguish between a missing key and an explicitly provided null. @@ -1304,6 +1346,8 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert model.imports.add("JsonNullable"); } + resolveJsonIncludePolicy(model, property); + //Add imports for Jackson if (!model.isEnum) { model.imports.add("JsonProperty"); @@ -1323,6 +1367,18 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } } + /** + * Resolve the {@code @JsonInclude} policy into the single universal + * {@code x-jackson-json-include-policy} vendor extension the template emits. See + * {@link JsonAnnotationPolicyUtils#resolveJsonIncludePolicy} for the full precedence rules; here, required + * properties (nullable or not) always resolve to {@code ALWAYS} since Kotlin's non-nullable types can + * never hold null. + */ + private void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty property) { + JsonAnnotationPolicyUtils.resolveJsonIncludePolicy(model, property, generateJsonIncludeAnnotations, + optionalNonNullPropertyJsonInclude, JsonIncludePolicy.ALWAYS, JsonIncludePolicy.ALWAYS); + } + @Override public void addImportsToOneOfInterface(List> imports) { if (additionalProperties.containsKey("jackson")) { @@ -1540,19 +1596,22 @@ public ModelsMap postProcessModelsEnum(ModelsMap objs) { for (ModelMap mo : objs.getModels()) { CodegenModel cm = mo.getModel(); for (CodegenProperty var : cm.optionalVars) { - // Scenario 3: optional + non-nullable → always emit @JsonSetter and @JsonInclude(NON_NULL). - // openApiNullable=true: Nulls.FAIL (strict). openApiNullable=false: Nulls.SKIP (lenient). - if (!var.required && !var.isNullable) { - if (openApiNullable) { - var.vendorExtensions.put("x-has-json-setter-nulls-fail", true); - } else { - var.vendorExtensions.put("x-has-json-setter-nulls-skip", true); - } - } + // Scenario 3: optional + non-nullable → emit @JsonSetter when generateJsonSetterNullsAnnotations is enabled, + // honoring any per-property x-jackson-json-setter-nulls override and the optionalNonNullPropertyJsonSetterNulls option. + JsonAnnotationPolicyUtils.resolveJsonSetterNulls(cm, var, generateJsonSetterNullsAnnotations, + optionalNonNullPropertyJsonSetterNulls, openApiNullable, true); // Scenario 4: optional + nullable with openApiNullable → use JsonNullable if (openApiNullable && !var.required && var.isNullable) { var.vendorExtensions.put("x-is-jackson-optional-nullable", true); } + resolveJsonIncludePolicy(cm, var); + } + for (CodegenProperty var : cm.requiredVars) { + // Honor a per-property x-jackson-json-setter-nulls override even on required properties + // (the automatic path emits nothing for required vars). + JsonAnnotationPolicyUtils.resolveJsonSetterNulls(cm, var, generateJsonSetterNullsAnnotations, + optionalNonNullPropertyJsonSetterNulls, openApiNullable, true); + resolveJsonIncludePolicy(cm, var); } } @@ -1886,6 +1945,8 @@ public List getSupportedVendorExtensions() { extensions.add(VendorExtension.X_KOTLIN_IMPLEMENTS); extensions.add(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS); extensions.add(VendorExtension.X_SPRING_PAGINATED); + extensions.add(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY); + extensions.add(VendorExtension.X_JACKSON_JSON_SETTER_NULLS); return extensions; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java index 8b8445f5fb84..624eee109469 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java @@ -31,7 +31,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.openapitools.codegen.CodegenConstants.ENUM_VALUES; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; import static org.openapitools.codegen.utils.StringUtils.underscore; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java index 366f1e04be50..a27c1edca6cc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java @@ -23,6 +23,7 @@ import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -37,8 +38,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.openapitools.codegen.CodegenConstants.ENUM_VALUE; -import static org.openapitools.codegen.CodegenConstants.ENUM_VARS; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; import static org.openapitools.codegen.utils.EnumUtils.hasEnumVars; @@ -259,14 +258,14 @@ private void stripQuotesFromIntegerEnumValues(Map allowableValue return; } - List> enumVars = getEnumVars(allowableValues); - for (Map enumVar : enumVars) { - Object value = enumVar.get(ENUM_VALUE); + List enumVars = getEnumVars(allowableValues); + for (EnumVarMap enumVar : enumVars) { + Object value = enumVar.getEnumValue(); if (value instanceof String) { String strValue = (String) value; // Remove surrounding quotes if present if (strValue.startsWith("\"") && strValue.endsWith("\"")) { - enumVar.put(ENUM_VALUE, strValue.substring(1, strValue.length() - 1)); + enumVar.setEnumValue(strValue.substring(1, strValue.length() - 1)); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index a6500d64398a..c3b8cf8afc94 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -28,6 +28,7 @@ import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -41,8 +42,7 @@ import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.capitalize; -import static org.openapitools.codegen.CodegenConstants.ENUM_NAME; -import static org.openapitools.codegen.CodegenConstants.ENUM_VALUES; +import static org.openapitools.codegen.model.EnumVarMap.ENUM_VALUES; import static org.openapitools.codegen.utils.ModelUtils.hasAnyOf; import static org.openapitools.codegen.utils.ModelUtils.hasOneOf; import static org.openapitools.codegen.utils.StringUtils.escape; @@ -812,13 +812,13 @@ private Map allowableValues(String valueString) { return result; } - private List> buildEnumValues(String valueString) { - List> result = new ArrayList<>(); + private List buildEnumValues(String valueString) { + List result = new ArrayList<>(); for (String v : valueString.split(",")) { - Map m = new HashMap<>(); + EnumVarMap m = new EnumVarMap(); String value = v.isEmpty() ? "empty" : v; - m.put(ENUM_NAME, value); + m.setEnumName(value); m.put("camlEnumValueName", ocamlizeEnumValue(value)); result.add(m); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PostgresqlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PostgresqlSchemaCodegen.java index 20f2d480ec58..4bbaa58f8911 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PostgresqlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PostgresqlSchemaCodegen.java @@ -33,7 +33,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.openapitools.codegen.CodegenConstants.ENUM_VALUES; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; import static org.openapitools.codegen.utils.StringUtils.underscore; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 42cb762e732f..f108f515d648 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -32,6 +32,7 @@ import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.SecurityFeature; import org.openapitools.codegen.meta.features.WireFormatFeature; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; @@ -48,7 +49,7 @@ import com.google.common.base.CaseFormat; -import static org.openapitools.codegen.CodegenConstants.*; +import static org.openapitools.codegen.model.EnumVarMap.*; import static org.openapitools.codegen.utils.EnumUtils.*; import static org.openapitools.codegen.utils.ModelUtils.*; import static org.openapitools.codegen.utils.StringUtils.*; @@ -570,12 +571,12 @@ public void preprocessOpenAPI(OpenAPI openAPI) { */ public void addEnumValuesPrefix(Map allowableValues, String prefix) { if (hasEnumVars(allowableValues)) { - List> enumVars = getEnumVars(allowableValues); + List enumVars = getEnumVars(allowableValues); prefix = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, prefix); - for (Map value : enumVars) { - String name = (String) value.get(ENUM_NAME); - value.put(ENUM_NAME, useSimplifiedEnumNames ? name : prefix + "_" + name); - value.put(ENUM_VALUE, useSimplifiedEnumNames ? name : "\"" + prefix + "_" + name + "\""); + for (EnumVarMap value : enumVars) { + String name = (String) value.getEnumName(); + value.setEnumName(useSimplifiedEnumNames ? name : prefix + "_" + name); + value.setEnumValue(useSimplifiedEnumNames ? name : "\"" + prefix + "_" + name + "\""); } } @@ -598,16 +599,12 @@ public void addUnspecifiedToAllowableValues(Map allowableValues) if (startEnumsWithUnspecified) { if (hasEnumVars(allowableValues)) { - List> enumVars = getEnumVars(allowableValues); + List enumVars = getEnumVars(allowableValues); boolean unspecifiedPresent = enumVars.stream() - .anyMatch(e -> { - return UNSPECIFIED.equals(e.get(ENUM_NAME)); - }); + .anyMatch(e -> UNSPECIFIED.equals(e.getEnumName())); if (!unspecifiedPresent) { - HashMap unspecifiedEnum = new HashMap(); - unspecifiedEnum.put(ENUM_NAME, UNSPECIFIED); - unspecifiedEnum.put(ENUM_IS_STRING, "false"); - unspecifiedEnum.put(ENUM_VALUE, "\"" + UNSPECIFIED + "\""); + EnumVarMap unspecifiedEnum = new EnumVarMap(); + unspecifiedEnum.enumVar(UNSPECIFIED, "\"" + UNSPECIFIED + "\"", false); enumVars.add(0, unspecifiedEnum); } } @@ -628,9 +625,9 @@ public void addUnspecifiedToAllowableValues(Map allowableValues) * * @param enumVars list of enum vars */ - public void addEnumIndexes(List> enumVars) { + public void addEnumIndexes(List enumVars) { int enumIndex = 0; - for (Map enumVar : enumVars) { + for (EnumVarMap enumVar : enumVars) { enumVar.put("protobuf-enum-index", enumIndex); enumIndex++; } @@ -736,7 +733,7 @@ public ModelsMap postProcessModels(ModelsMap objs) { addUnspecifiedToAllowableValues(allowableValues); addEnumValuesPrefix(allowableValues, cm.getClassname()); if (hasEnumVars(allowableValues)) { - List> enumVars = getEnumVars(allowableValues); + List enumVars = getEnumVars(allowableValues); addEnumIndexes(enumVars); } } @@ -792,7 +789,7 @@ public ModelsMap postProcessModels(ModelsMap objs) { addEnumValuesPrefix(enumProperty.allowableValues, enumProperty.getEnumName()); if (hasEnumVars(enumProperty.allowableValues)) { - List> enumVars = getEnumVars(enumProperty.allowableValues); + List enumVars = getEnumVars(enumProperty.allowableValues); addEnumIndexes(enumVars); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java index 0a15106d15ee..980baf7a6a65 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java @@ -40,7 +40,6 @@ import java.util.*; import java.util.regex.Pattern; -import static org.openapitools.codegen.CodegenConstants.ENUM_VALUES; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; import static org.openapitools.codegen.utils.StringUtils.camelize; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 47c841c88e3c..6a3481fad6f4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -28,6 +28,7 @@ import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.model.EnumVarMap; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,9 +38,8 @@ import java.io.Writer; import java.util.*; -import static org.openapitools.codegen.CodegenConstants.*; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; -import static org.openapitools.codegen.utils.EnumUtils.getEnumVarsAsString; +import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -784,8 +784,8 @@ private String constructExampleCode(CodegenModel codegenModel, HashMap> enumVars = getEnumVarsAsString(codegenModel.allowableValues); - return moduleName + "::" + codegenModel.classname + "::" + enumVars.get(0).get(ENUM_NAME); + List enumVars = getEnumVars(codegenModel.allowableValues); + return moduleName + "::" + codegenModel.classname + "::" + enumVars.get(0).getEnumName(); } else if (codegenModel.oneOf != null && !codegenModel.oneOf.isEmpty()) { String subModel = (String) codegenModel.oneOf.toArray()[0]; if (modelMaps.containsKey(subModel)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 161400d9b83b..29dd89d8c148 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -1383,9 +1383,84 @@ public Map postProcessSupportingFileData(Map bun } bundle.put("hasAuthScopes", hasAuthScopes); + addAuthSchemeTestsToBundle(authMethods, bundle); + return super.postProcessSupportingFileData(bundle); } + /** + * Derive the facts the generated auth-scheme precedence tests need. + * + * Each generated block in `context.rs` returns early once it matches, so a block that fails to + * check which `AuthData` variant it received will claim credentials belonging to another scheme + * and make every later block unreachable (see issue #24095). + * + * Whether that is observable depends on block order, so the only thing the template cannot work + * out for itself is whether a block handling a given HTTP scheme precedes the apiKey block it + * could shadow. Everything else - which requests to send, which credentials to use - lives in + * the template. + */ + private void addAuthSchemeTestsToBundle(List authMethods, Map bundle) { + boolean hasBasic = false; + boolean hasBearer = false; + boolean basicPrecedesHeaderApiKey = false; + boolean bearerPrecedesHeaderApiKey = false; + boolean basicPrecedesQueryApiKey = false; + boolean bearerPrecedesQueryApiKey = false; + String apiKeyHeaderName = null; + String apiKeyQueryName = null; + + if (authMethods != null) { + for (CodegenSecurity authMethod : authMethods) { + boolean isBasic = Boolean.TRUE.equals(authMethod.isBasicBasic); + boolean isBearer = Boolean.TRUE.equals(authMethod.isBasicBearer) + || Boolean.TRUE.equals(authMethod.isOAuth); + boolean isApiKeyHeader = Boolean.TRUE.equals(authMethod.isApiKey) + && Boolean.TRUE.equals(authMethod.isKeyInHeader); + boolean isApiKeyQuery = Boolean.TRUE.equals(authMethod.isApiKey) + && Boolean.TRUE.equals(authMethod.isKeyInQuery); + + hasBasic |= isBasic; + hasBearer |= isBearer; + // Only blocks generated before an apiKey block can shadow it, and the header and + // query blocks are shadowed independently: each matches a different part of the + // request, so a block that fails to match one may still precede and claim the other. + if (apiKeyHeaderName == null) { + basicPrecedesHeaderApiKey |= isBasic; + bearerPrecedesHeaderApiKey |= isBearer; + } + if (apiKeyQueryName == null) { + basicPrecedesQueryApiKey |= isBasic; + bearerPrecedesQueryApiKey |= isBearer; + } + if (isApiKeyHeader && apiKeyHeaderName == null) { + apiKeyHeaderName = authMethod.keyParamName.toLowerCase(Locale.ROOT); + } + if (isApiKeyQuery && apiKeyQueryName == null) { + apiKeyQueryName = authMethod.keyParamName; + } + } + } + + bundle.put("authTestHasBasic", hasBasic); + bundle.put("authTestHasBearer", hasBearer); + bundle.put("authTestBasicPrecedesHeaderApiKey", basicPrecedesHeaderApiKey); + bundle.put("authTestBearerPrecedesHeaderApiKey", bearerPrecedesHeaderApiKey); + bundle.put("authTestBasicPrecedesQueryApiKey", basicPrecedesQueryApiKey); + bundle.put("authTestBearerPrecedesQueryApiKey", bearerPrecedesQueryApiKey); + bundle.put("authTestApiKeyHeader", apiKeyHeaderName); + bundle.put("authTestApiKeyQuery", apiKeyQueryName); + bundle.put("authTestHasApiKey", apiKeyHeaderName != null || apiKeyQueryName != null); + + SupportingFile authTestFile = + new SupportingFile("tests-auth-scheme-precedence.mustache", "tests", "auth_scheme_precedence.rs"); + if (hasBasic || hasBearer || apiKeyHeaderName != null || apiKeyQueryName != null) { + supportingFiles.add(authTestFile); + } else { + supportingFiles.remove(authTestFile); + } + } + /** * Add a built path set map to the provided bundle * @@ -1652,10 +1727,10 @@ public ModelsMap postProcessModels(ModelsMap objs) { additionalProperties.put("apiUsesIntegerEnums", true); // Add numeric discriminant values for enum variants - List> enumVars = getEnumVars(model.allowableValues); + List enumVars = getEnumVars(model.allowableValues); if (enumVars != null) { - for (Map enumVar : enumVars) { + for (EnumVarMap enumVar : enumVars) { String value = (String) enumVar.get("value"); if (value != null) { // Strip quotes to get raw numeric value diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java index c576549b78c5..da8396404481 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java @@ -31,7 +31,6 @@ import java.util.*; -import static org.openapitools.codegen.CodegenConstants.ENUM_VALUES; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.EnumUtils.getEnumValues; import static org.openapitools.codegen.utils.StringUtils.camelize; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttp4ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttp4ClientCodegen.java index 1e0285c66d0b..818b724d3535 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttp4ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttp4ClientCodegen.java @@ -350,7 +350,10 @@ public Map postProcessAllModels(Map objs) // Add discriminator mapping value if present if (cModel.discriminator != null) { - String discriminatorName = cModel.discriminator.getPropertyName(); + // baseName, not propertyName: the latter is the escaped Scala + // identifier and never matches a property's baseName + String discriminatorName = cModel.discriminator.getPropertyBaseName(); + childModel.getVendorExtensions().put("x-discriminator-property", discriminatorName); // Find the mapping value for this child model String discriminatorValue = null; @@ -368,7 +371,7 @@ public Map postProcessAllModels(Map objs) } // Remove discriminator field from child - // (circe-generic-extras adds it automatically) + // (the sealed trait's encoder writes it) childModel.vars.removeIf(prop -> prop.baseName.equals(discriminatorName)); childModel.allVars.removeIf(prop -> prop.baseName.equals(discriminatorName)); childModel.requiredVars.removeIf(prop -> prop.baseName.equals(discriminatorName)); @@ -423,7 +426,7 @@ public Map postProcessAllModels(Map objs) // Remove discriminator property from models that extend a oneOf parent // (circe-generic-extras adds it automatically) if (cModel.parent != null && cModel.parentModel != null && cModel.parentModel.discriminator != null) { - String discriminatorName = cModel.parentModel.discriminator.getPropertyName(); + String discriminatorName = cModel.parentModel.discriminator.getPropertyBaseName(); cModel.vars.removeIf(prop -> prop.baseName.equals(discriminatorName)); cModel.allVars.removeIf(prop -> prop.baseName.equals(discriminatorName)); cModel.requiredVars.removeIf(prop -> prop.baseName.equals(discriminatorName)); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 83e1fb20a863..7b5805f79c5f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -40,8 +40,11 @@ import org.openapitools.codegen.templating.mustache.SplitStringLambda; import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda; import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda; +import org.openapitools.codegen.utils.JsonAnnotationPolicyUtils; +import org.openapitools.codegen.utils.JsonIncludePolicy; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; +import org.openapitools.codegen.utils.TriStateBoolean; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -159,6 +162,10 @@ public enum RequestMappingMode { @Setter protected boolean apiFirst = false; protected boolean useOptional = false; @Setter protected boolean useSealed = false; + @Getter @Setter protected JsonIncludePolicy optionalNonNullPropertyJsonInclude = JsonIncludePolicy.NON_NULL; + @Getter @Setter protected JsonAnnotationPolicyUtils.JsonSetterNullsMode optionalNonNullPropertyJsonSetterNulls = null; + @Getter @Setter protected TriStateBoolean generateJsonIncludeAnnotations = TriStateBoolean.UNSET; + @Getter @Setter protected TriStateBoolean generateJsonSetterNullsAnnotations = TriStateBoolean.UNSET; @Setter protected boolean virtualService = false; @Setter protected boolean hateoas = false; @Setter protected boolean returnSuccessCode = false; @@ -281,6 +288,31 @@ public SpringCodegen() { "Use Bean Validation Impl. to perform BeanValidation", performBeanValidation)); cliOptions.add(CliOption.newBoolean(USE_SEALED, "Whether to generate sealed model interfaces and classes")); + + CliOption optionalNonNullPropertyJsonIncludeOpt = CliOption.newString(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, + JsonAnnotationPolicyUtils.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE_DESC); + for (JsonIncludePolicy policy : JsonIncludePolicy.OPTIONAL_NON_NULL_POLICIES) { + optionalNonNullPropertyJsonIncludeOpt.addEnum(policy.name(), policy.getDescription()); + } + optionalNonNullPropertyJsonIncludeOpt.setDefault(optionalNonNullPropertyJsonInclude.name()); + cliOptions.add(optionalNonNullPropertyJsonIncludeOpt); + + CliOption optionalNonNullPropertyJsonSetterNullsOpt = CliOption.newString(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, + JsonAnnotationPolicyUtils.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS_DESC); + optionalNonNullPropertyJsonSetterNullsOpt.addEnum(JsonAnnotationPolicyUtils.JsonSetterNullsMode.SKIP.name(), + "Emit @JsonSetter(nulls = Nulls.SKIP): silently ignore an explicit JSON null, keeping the field's default."); + optionalNonNullPropertyJsonSetterNullsOpt.addEnum(JsonAnnotationPolicyUtils.JsonSetterNullsMode.FAIL.name(), + "Emit @JsonSetter(nulls = Nulls.FAIL): reject an explicit JSON null."); + cliOptions.add(optionalNonNullPropertyJsonSetterNullsOpt); + + cliOptions.add(CliOption.newBoolean(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + JsonAnnotationPolicyUtils.GENERATE_JSON_INCLUDE_ANNOTATIONS_DESC, false)); + cliOptions.add(CliOption.newBoolean(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + "Whether to generate @JsonSetter(nulls = ...) annotations on optional non-nullable model properties. " + + "When true, emits @JsonSetter so an explicit null in the payload does not overwrite the field. " + + "When false, none are generated and deserialization null-handling defers to the global ObjectMapper. " + + "When left unset it defaults to false (7.23.0-equivalent output) and logs a warning; set it " + + "explicitly to silence the warning.", false)); cliOptions.add(CliOption.newBoolean(API_FIRST, "Generate the API from the OAI spec at server compile time (API first approach)", apiFirst)); cliOptions @@ -555,6 +587,23 @@ public void processOpts() { convertPropertyToBooleanAndWriteBack(RETURN_SUCCESS_CODE, this::setReturnSuccessCode); convertPropertyToBooleanAndWriteBack(USE_SWAGGER_UI, this::setUseSwaggerUI); convertPropertyToBooleanAndWriteBack(USE_SEALED, this::setUseSealed); + convertPropertyToBooleanAndWriteBack(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + value -> this.generateJsonIncludeAnnotations = TriStateBoolean.fromNullableBoolean(value)); + convertPropertyToBooleanAndWriteBack(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + value -> this.generateJsonSetterNullsAnnotations = TriStateBoolean.fromNullableBoolean(value)); + this.optionalNonNullPropertyJsonInclude = JsonAnnotationPolicyUtils.resolveOptionalNonNullPropertyJsonInclude( + additionalProperties, optionalNonNullPropertyJsonInclude); + additionalProperties.put(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, optionalNonNullPropertyJsonInclude.name()); + this.optionalNonNullPropertyJsonSetterNulls = JsonAnnotationPolicyUtils.resolveOptionalNonNullPropertyJsonSetterNulls( + additionalProperties, optionalNonNullPropertyJsonSetterNulls); + if (optionalNonNullPropertyJsonSetterNulls != null) { + additionalProperties.put(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, optionalNonNullPropertyJsonSetterNulls.name()); + } + if (jackson) { + JsonAnnotationPolicyUtils.warnIfUnset(LOGGER, generateJsonIncludeAnnotations, generateJsonSetterNullsAnnotations); + JsonAnnotationPolicyUtils.warnIfJsonSetterNullsDefaultRisky(LOGGER, generateJsonSetterNullsAnnotations, + optionalNonNullPropertyJsonSetterNulls, openApiNullable, false); + } if (DocumentationProvider.NONE.equals(getDocumentationProvider())) { this.setUseSwaggerUI(false); } @@ -1208,24 +1257,22 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert model.imports.add("Arrays"); } - // Optional + non-nullable: always emit @JsonInclude(NON_NULL) so null fields are omitted from - // serialized output regardless of who deserializes on the other end — closer to spec. - // When openApiNullable=false, also add @JsonSetter(nulls = Nulls.SKIP) on the setter. - if (!property.required && !property.isNullable) { - model.imports.add("JsonInclude"); - if (!openApiNullable) { - property.vendorExtensions.put("x-has-json-setter-nulls-skip", true); - model.imports.add("JsonSetter"); - model.imports.add("Nulls"); - } - } - // Optional + nullable with openApiNullable: emit @JsonInclude(NON_ABSENT) so that - // JsonNullable.undefined() is excluded from serialized output. - if (openApiNullable && !property.required && property.isNullable) { - model.imports.add("JsonInclude"); - } + // Optional + non-nullable: emit @JsonSetter(nulls = ...) so an explicit null in the payload does not + // silently overwrite the field's default. Also honors a per-property x-jackson-json-setter-nulls override + // and the optionalNonNullPropertyJsonSetterNulls option; see JsonAnnotationPolicyUtils#resolveJsonSetterNulls. + // spring's default path never emits Nulls.FAIL (failModeSupported=false), but the option/extension can. + JsonAnnotationPolicyUtils.resolveJsonSetterNulls(model, property, generateJsonSetterNullsAnnotations, + optionalNonNullPropertyJsonSetterNulls, openApiNullable, false); + + // Resolve the @JsonInclude policy into the x-jackson-json-include-policy vendor extension; see + // JsonAnnotationPolicyUtils#resolveJsonIncludePolicy for the full precedence/matrix rules. For spring, + // required properties resolve to NON_NULL when non-nullable (contract protection) and ALWAYS when + // nullable (explicit null is valid and must be serialized). + JsonAnnotationPolicyUtils.resolveJsonIncludePolicy(model, property, generateJsonIncludeAnnotations, + optionalNonNullPropertyJsonInclude, JsonIncludePolicy.NON_NULL, JsonIncludePolicy.ALWAYS); } + @Override public CodegenModel fromModel(String name, Schema model) { CodegenModel codegenModel = super.fromModel(name, model); @@ -1559,6 +1606,8 @@ public List getSupportedVendorExtensions() { extensions.add(VendorExtension.X_MINIMUM_MESSAGE); extensions.add(VendorExtension.X_MAXIMUM_MESSAGE); extensions.add(VendorExtension.X_SPRING_API_VERSION); + extensions.add(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY); + extensions.add(VendorExtension.X_JACKSON_JSON_SETTER_NULLS); return extensions; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index f713a7e677d7..bc7473f9f861 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -46,10 +46,9 @@ import java.util.stream.Collectors; import static java.util.Objects.nonNull; -import static org.openapitools.codegen.CodegenConstants.ENUM_NAME; -import static org.openapitools.codegen.CodegenConstants.ENUM_VARS; +import static org.openapitools.codegen.model.EnumVarMap.ENUM_VARS; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; -import static org.openapitools.codegen.utils.EnumUtils.getEnumVarsAsString; +import static org.openapitools.codegen.utils.EnumUtils.getEnumVars; import static org.openapitools.codegen.utils.OnceLogger.once; import static org.openapitools.codegen.utils.StringUtils.*; @@ -606,7 +605,7 @@ private void autoSetDefaultValueForProperty(ExtendedCodegenProperty var) { var.defaultValue = "false"; } else { if (var.allowableValues != null && var.allowableValues.get(ENUM_VARS) instanceof ArrayList && ((ArrayList) var.allowableValues.get(ENUM_VARS)).get(0) instanceof HashMap) { - var.defaultValue = var.dataTypeAlternate + "." + getEnumVarsAsString(var.allowableValues).get(0).get(ENUM_NAME); + var.defaultValue = var.dataTypeAlternate + "." + getEnumVars(var.allowableValues).get(0).getEnumName(); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/model/EnumVarMap.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/model/EnumVarMap.java new file mode 100644 index 000000000000..40726a647aec --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/model/EnumVarMap.java @@ -0,0 +1,68 @@ +package org.openapitools.codegen.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class EnumVarMap extends HashMap { + + // The raw enum values from the OpenAPI specification + public static final String ENUM_VALUES = "values"; + // The map that stores all enum values and their metadata (name, value, enumDescription...) + public static final String ENUM_VARS = "enumVars"; + // The name of the enum, for example NAME("value") in Java + public static final String ENUM_NAME = "name"; + // The on-the-line value, i.e., the one present in the "values" + public static final String ENUM_VALUE = "value"; + // If the enum is typed as a string + public static final String ENUM_IS_STRING = "isString"; + // The description that should be attached to an entry in "enumVars" + public static final String ENUM_DESCRIPTION = "enumDescription"; + + public EnumVarMap() { + + } + + public EnumVarMap(EnumVarMap init) { + putAll(init); + } + + public EnumVarMap(Map init) { + putAll(init); + } + + public void enumVar(String enumName, String enumValue, boolean isString) { + put(ENUM_NAME, enumName); + put(ENUM_VALUE, enumValue); + put(ENUM_IS_STRING, isString); + } + + public void setEnumName(String name) { + put(ENUM_NAME, name); + } + + public Object getEnumName() { + return get(ENUM_NAME); + } + + public void setEnumValue(String value) { + put(ENUM_VALUE, value); + } + + public Object getEnumValue() { + return get(ENUM_VALUE); + } + + public void isString(boolean isString) { + put(ENUM_IS_STRING, isString); + } + + public boolean isString() { + Object value = get(ENUM_IS_STRING); + if (!(value instanceof Boolean)) { + throw new IllegalStateException(ENUM_IS_STRING + " is not a boolean: " + value); + } + return (Boolean) value; + } + +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/EnumUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/EnumUtils.java index 0cd4d5e8b536..314660c6a01f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/EnumUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/EnumUtils.java @@ -2,12 +2,14 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; -import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.model.EnumVarMap; import java.util.*; import java.util.stream.Collectors; -import static org.openapitools.codegen.CodegenConstants.*; +import static org.openapitools.codegen.CodegenConstants.X_ENUM_DEPRECATED; +import static org.openapitools.codegen.CodegenConstants.X_ENUM_DESCRIPTIONS; +import static org.openapitools.codegen.model.EnumVarMap.*; public class EnumUtils { @@ -22,7 +24,7 @@ public class EnumUtils { /** * * @param allowableValues The allowableValues map - * @return whether the allowableValues map contains {@value CodegenConstants#ENUM_VARS} + * @return whether the allowableValues map contains {@value EnumVarMap#ENUM_VARS} */ public static boolean hasEnumVars(Map allowableValues) { return allowableValues != null && allowableValues.containsKey(ENUM_VARS); @@ -31,25 +33,26 @@ public static boolean hasEnumVars(Map allowableValues) { /** * * @param allowableValues The allowableValues map - * @return whether the allowableValues map contains {@value CodegenConstants#ENUM_VALUES} + * @return whether the allowableValues map contains {@value EnumVarMap#ENUM_VALUES} */ public static boolean hasEnumValues(Map allowableValues) { return allowableValues != null && allowableValues.containsKey(ENUM_VALUES); } /** - * Get the {@value CodegenConstants#ENUM_VARS} from the allowableValues map. + * Get the {@value EnumVarMap#ENUM_VARS} from the allowableValues map. + * * @param allowableValues The allowableValues map * @return the list of enumVars */ - public static List> getEnumVars(Map allowableValues) { + public static List getEnumVars(Map allowableValues) { @SuppressWarnings("unchecked") - List> enumVars = (List>) allowableValues.get(ENUM_VARS); + List enumVars = (List) allowableValues.get(ENUM_VARS); return enumVars; } /** - * Get the {@value CodegenConstants#ENUM_VALUES} from the allowableValues map. + * Get the {@value EnumVarMap#ENUM_VALUES} from the allowableValues map. * @param allowableValues The allowableValues map * @return the list of enumValues */ @@ -60,18 +63,7 @@ public static List getEnumValues(Map allowableValues) { } /** - * Get the {@value CodegenConstants#ENUM_VARS} from the allowableValues map. - * @param allowableValues The allowableValues map - * @return the list of enumVars - */ - public static List> getEnumVarsAsString(Map allowableValues) { - @SuppressWarnings("unchecked") - List> enumVars = (List>) allowableValues.get(ENUM_VARS); - return enumVars; - } - - /** - * Get the {@value CodegenConstants#ENUM_VALUES} from the allowableValues map. + * Get the {@value EnumVarMap#ENUM_VALUES} from the allowableValues map. * @param allowableValues The allowableValues map * @return the list of enumValues */ diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonAnnotationPolicyUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonAnnotationPolicyUtils.java new file mode 100644 index 000000000000..5818e65cdbf3 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonAnnotationPolicyUtils.java @@ -0,0 +1,420 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.utils; + +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.VendorExtension; +import org.slf4j.Logger; + +import java.util.Map; + +/** + * Shared resolution/validation logic for the Jackson {@code @JsonInclude}/{@code @JsonSetter(nulls = ...)} + * config options and the {@code x-jackson-json-include-policy} vendor extension, used by both the + * {@code spring} and {@code kotlin-spring} generators (issue #24401). + */ +public final class JsonAnnotationPolicyUtils { + + /** Shared {@code CliOption} description for {@code optionalNonNullPropertyJsonInclude}. */ + public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE_DESC = + "The Jackson @JsonInclude policy emitted for optional, non-nullable model properties when " + + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS + " is true. " + + "NONE emits no annotation, deferring fully to the global ObjectMapper inclusion policy."; + + /** Shared {@code CliOption} description for {@code optionalNonNullPropertyJsonSetterNulls}. */ + public static final String OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS_DESC = + "The Jackson @JsonSetter(nulls = ...) mode emitted for optional, non-nullable model properties when " + + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS + " is true. SKIP ignores an explicit " + + "JSON null (keeping the field's default), FAIL rejects it. When left unset the mode is derived " + + "from openApiNullable (true -> FAIL where supported, false -> SKIP), preserving 7.24.x behavior. " + + "A per-property override set via the `x-jackson-json-setter-nulls` vendor extension always wins."; + + /** Shared {@code CliOption} description for {@code generateJsonIncludeAnnotations}. */ + public static final String GENERATE_JSON_INCLUDE_ANNOTATIONS_DESC = + "Whether to generate policy @JsonInclude annotations on model properties. When true, emits " + + "spec-honest annotations (required-field protection and the optional non-nullable policy from " + + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE + "). When false, none are generated and the global " + + "ObjectMapper owns inclusion. When left unset it defaults to false (7.23.0-equivalent output) and " + + "logs a warning; set it explicitly to silence the warning. A per-property override set via the " + + "`x-jackson-json-include-policy` vendor extension is always honored regardless of this flag."; + + /** Resolved {@code @JsonSetter(nulls = ...)} annotation to emit for a property, if any. */ + public enum JsonSetterNullsMode { + /** No {@code @JsonSetter(nulls = ...)} annotation should be emitted. */ + NONE, + /** Emit {@code @JsonSetter(nulls = Nulls.SKIP)}: silently ignore an explicit JSON null. */ + SKIP, + /** Emit {@code @JsonSetter(nulls = Nulls.FAIL)}: reject an explicit JSON null. */ + FAIL + } + + private JsonAnnotationPolicyUtils() { + } + + /** + * Validate and normalize a manual per-property {@code x-jackson-json-include-policy} override. + * + * @param rawPolicy the raw vendor extension value set directly on the property in the spec + * @param extensionName the vendor extension key, used in the error message (kept generator-agnostic) + * @return the normalized (upper-case) policy name to emit, or {@code null} when the override means + * "emit no annotation" ({@code NONE}/blank), in which case the caller must drop the extension. + * @throws IllegalArgumentException when the override is not a valid {@code JsonInclude.Include} value. + */ + public static String resolveManualJsonIncludePolicy(Object rawPolicy, String extensionName) { + JsonIncludePolicy parsed; + try { + parsed = JsonIncludePolicy.parse(rawPolicy); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException(extensionName + + " must be a valid com.fasterxml.jackson.annotation.JsonInclude.Include value " + + "(ALWAYS, NON_NULL, NON_ABSENT, NON_EMPTY, NON_DEFAULT, USE_DEFAULTS, CUSTOM), or NONE to emit " + + "no annotation, but was: " + rawPolicy); + } + if (parsed == null || !parsed.isEmitted()) { + return null; + } + return parsed.name(); + } + + /** + * Validate and normalize the {@code optionalNonNullPropertyJsonInclude} config option value. + * + * @param policy the raw config option value (may be {@code null}, in which case the default + * {@code NON_NULL} is returned) + * @param optionName the config option name, used in the error message (kept generator-agnostic) + * @return the normalized (upper-case) policy name: one of {@code NON_NULL}, {@code NON_EMPTY}, + * {@code NON_DEFAULT}, {@code NONE}. + * @throws IllegalArgumentException when the value is not one of the supported policies. + */ + public static String normalizeJsonIncludePolicy(String policy, String optionName) { + if (policy == null) { + return JsonIncludePolicy.NON_NULL.name(); + } + JsonIncludePolicy parsed; + try { + parsed = JsonIncludePolicy.valueOf(policy.trim().toUpperCase(java.util.Locale.ROOT)); + } catch (IllegalArgumentException e) { + parsed = null; + } + if (parsed == null || !parsed.isValidOptionalNonNullPolicy()) { + throw new IllegalArgumentException(optionName + + " must be one of " + JsonIncludePolicy.OPTIONAL_NON_NULL_POLICIES + " but was: " + policy); + } + return parsed.name(); + } + + /** + * Read back the {@code optionalNonNullPropertyJsonInclude} config option from {@code additionalProperties}, + * validating/normalizing it via {@link #normalizeJsonIncludePolicy}. Returns {@code current} unchanged when + * the option was not present in {@code additionalProperties} (i.e. the generator's existing/default value is + * kept). Callers are responsible for writing the resolved value back via their own + * {@code writePropertyBack}/{@code additionalProperties.put} convention. + * + * @param additionalProperties the generator's additional properties map + * @param current the generator's current {@code optionalNonNullPropertyJsonInclude} value + * @return the resolved {@link JsonIncludePolicy} to assign to the generator's field + */ + public static JsonIncludePolicy resolveOptionalNonNullPropertyJsonInclude(Map additionalProperties, JsonIncludePolicy current) { + if (!additionalProperties.containsKey(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)) { + return current; + } + return JsonIncludePolicy.valueOf(normalizeJsonIncludePolicy( + additionalProperties.get(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE).toString(), + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE)); + } + + /** + * Log the shared "option left unset, defaulting to false" warnings for + * {@code generateJsonIncludeAnnotations}/{@code generateJsonSetterNullsAnnotations} on the caller's own + * {@link Logger}. No-op for each option that is not {@link TriStateBoolean#UNSET}. + * + * @param logger the calling generator's own {@code LOGGER} + * @param generateJsonIncludeAnnotations the resolved {@code generateJsonIncludeAnnotations} state + * @param generateJsonSetterNullsAnnotations the resolved {@code generateJsonSetterNullsAnnotations} state + */ + public static void warnIfUnset(Logger logger, TriStateBoolean generateJsonIncludeAnnotations, TriStateBoolean generateJsonSetterNullsAnnotations) { + if (generateJsonIncludeAnnotations.isUnset()) { + logger.warn("'{}' is not set. Defaulting to false: no @JsonInclude annotations are generated and property " + + "inclusion is governed entirely by the global ObjectMapper (7.23.0-equivalent output). " + + "Set '{}=false' to keep this behavior and silence this warning, or '{}=true' to emit spec-honest " + + "@JsonInclude annotations (see '{}'). Note: before 7.24.0 released output had no field-level " + + "@JsonInclude, so leaving this unset preserves that behavior.", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE); + } + if (generateJsonSetterNullsAnnotations.isUnset()) { + logger.warn("'{}' is not set. Defaulting to false: no @JsonSetter(nulls = ...) annotations are generated and " + + "deserialization null-handling is governed entirely by the global ObjectMapper (7.23.0-equivalent " + + "output). Set '{}=false' to keep this behavior and silence this warning, or '{}=true' to emit " + + "@JsonSetter(nulls = ...) on optional non-nullable fields.", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS); + } + } + + /** + * Resolve the {@code @JsonInclude} policy into the single universal + * {@code x-jackson-json-include-policy} vendor extension the template emits, mutating {@code model.imports} + * and {@code property.vendorExtensions} in place. Precedence: + *
    + *
  1. A value set directly on the property (manual override in the spec) always wins.
  2. + *
  3. Otherwise, when {@code generateJsonIncludeAnnotations=true}, apply the automatic matrix: + *
      + *
    • required & non-nullable → {@code requiredNonNullablePolicy}
    • + *
    • required & nullable → {@code requiredNullablePolicy}
    • + *
    • optional & non-nullable → {@code optionalNonNullPropertyJsonInclude} + * (default {@code NON_NULL}, {@code NONE} = omit)
    • + *
    • optional & nullable → none (JsonNullable module already governs inclusion)
    • + *
    + *
  4. + *
+ * + *

The two "required" policies are supplied by the caller since the spring and kotlin-spring generators + * apply slightly different matrices there: kotlin-spring's non-nullable Kotlin types can never hold null, + * so it always uses {@code ALWAYS} for required properties, whereas spring uses {@code NON_NULL} for + * required-non-nullable (contract protection) and {@code ALWAYS} for required-nullable. + * + * @param model the model owning {@code property}, whose imports may be extended + * @param property the property to resolve the policy for + * @param generateJsonIncludeAnnotations the resolved {@code generateJsonIncludeAnnotations} state + * @param optionalNonNullPropertyJsonInclude the resolved {@code optionalNonNullPropertyJsonInclude} policy + * @param requiredNonNullablePolicy the policy to apply to required, non-nullable properties + * @param requiredNullablePolicy the policy to apply to required, nullable properties + */ + public static void resolveJsonIncludePolicy(CodegenModel model, CodegenProperty property, + TriStateBoolean generateJsonIncludeAnnotations, JsonIncludePolicy optionalNonNullPropertyJsonInclude, + JsonIncludePolicy requiredNonNullablePolicy, JsonIncludePolicy requiredNullablePolicy) { + if (property.vendorExtensions.containsKey(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName())) { + String manualPolicy = resolveManualJsonIncludePolicy( + property.vendorExtensions.get(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()), VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()); + if (manualPolicy != null) { + property.vendorExtensions.put(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(), manualPolicy); + model.imports.add("JsonInclude"); + } else { + // NONE / empty means "emit nothing"; drop the extension so the template renders no annotation. + property.vendorExtensions.remove(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName()); + } + return; + } + if (!generateJsonIncludeAnnotations.isTrue()) { + return; + } + JsonIncludePolicy policy = null; + if (property.required) { + policy = property.isNullable ? requiredNullablePolicy : requiredNonNullablePolicy; + } else if (!property.isNullable) { + policy = optionalNonNullPropertyJsonInclude; + } + if (policy != null && policy.isEmitted()) { + property.vendorExtensions.put(VendorExtension.X_JACKSON_JSON_INCLUDE_POLICY.getName(), policy.name()); + model.imports.add("JsonInclude"); + } + } + + /** + * Resolve which {@code @JsonSetter(nulls = ...)} annotation, if any, should be emitted for an optional, + * non-nullable property. + * + * @param generateJsonSetterNullsAnnotations the resolved {@code generateJsonSetterNullsAnnotations} state + * @param required whether the property is required + * @param nullable whether the property is nullable + * @param openApiNullable whether the generator's {@code openApiNullable} option is enabled + * @param failModeSupported whether this generator supports {@link JsonSetterNullsMode#FAIL} (kotlin-spring + * does; spring currently only ever emits {@link JsonSetterNullsMode#SKIP}) + * @return {@link JsonSetterNullsMode#NONE} unless the property is optional and non-nullable and + * {@code generateJsonSetterNullsAnnotations} is explicitly enabled; otherwise {@link JsonSetterNullsMode#FAIL} + * when {@code openApiNullable && failModeSupported}, {@link JsonSetterNullsMode#SKIP} when + * {@code !openApiNullable}, or {@link JsonSetterNullsMode#NONE} when {@code openApiNullable && !failModeSupported}. + */ + public static JsonSetterNullsMode resolveJsonSetterNullsMode(TriStateBoolean generateJsonSetterNullsAnnotations, + boolean required, boolean nullable, boolean openApiNullable, boolean failModeSupported) { + return resolveJsonSetterNullsMode(generateJsonSetterNullsAnnotations, required, nullable, openApiNullable, + failModeSupported, null); + } + + /** + * Resolve which {@code @JsonSetter(nulls = ...)} annotation, if any, should be emitted for an optional, + * non-nullable property, honoring the {@code optionalNonNullPropertyJsonSetterNulls} global override. + * + * @param generateJsonSetterNullsAnnotations the resolved {@code generateJsonSetterNullsAnnotations} state + * @param required whether the property is required + * @param nullable whether the property is nullable + * @param openApiNullable whether the generator's {@code openApiNullable} option is enabled + * @param failModeSupported whether this generator's default path emits {@link JsonSetterNullsMode#FAIL} + * (kotlin-spring does; spring's default path never does) + * @param optionalNonNullOverride the resolved {@code optionalNonNullPropertyJsonSetterNulls} option + * ({@code null} when unset); when set it wins over the {@code openApiNullable} + * default and is emitted regardless of {@code failModeSupported} + * @return the mode to emit for an optional non-nullable property, or {@link JsonSetterNullsMode#NONE} + */ + public static JsonSetterNullsMode resolveJsonSetterNullsMode(TriStateBoolean generateJsonSetterNullsAnnotations, + boolean required, boolean nullable, boolean openApiNullable, boolean failModeSupported, + JsonSetterNullsMode optionalNonNullOverride) { + if (!generateJsonSetterNullsAnnotations.isTrue() || required || nullable) { + return JsonSetterNullsMode.NONE; + } + if (optionalNonNullOverride != null) { + return optionalNonNullOverride; + } + if (openApiNullable) { + return failModeSupported ? JsonSetterNullsMode.FAIL : JsonSetterNullsMode.NONE; + } + return JsonSetterNullsMode.SKIP; + } + + /** + * Validate and normalize the {@code optionalNonNullPropertyJsonSetterNulls} config option value. + * + * @param value the raw config option value + * @param optionName the config option name, used in the error message + * @return the normalized {@link JsonSetterNullsMode} ({@code SKIP} or {@code FAIL}) + * @throws IllegalArgumentException when the value is not {@code SKIP} or {@code FAIL} + */ + public static JsonSetterNullsMode normalizeJsonSetterNulls(String value, String optionName) { + JsonSetterNullsMode parsed = null; + if (value != null) { + try { + parsed = JsonSetterNullsMode.valueOf(value.trim().toUpperCase(java.util.Locale.ROOT)); + } catch (IllegalArgumentException e) { + parsed = null; + } + } + if (parsed != JsonSetterNullsMode.SKIP && parsed != JsonSetterNullsMode.FAIL) { + throw new IllegalArgumentException(optionName + " must be one of [SKIP, FAIL] but was: " + value); + } + return parsed; + } + + /** + * Read back the {@code optionalNonNullPropertyJsonSetterNulls} config option from + * {@code additionalProperties}, validating/normalizing it via {@link #normalizeJsonSetterNulls}. Returns + * {@code current} unchanged when the option was not present (i.e. the generator's existing/default value, + * typically {@code null} = unset, is kept). + * + * @param additionalProperties the generator's additional properties map + * @param current the generator's current {@code optionalNonNullPropertyJsonSetterNulls} value + * @return the resolved {@link JsonSetterNullsMode} ({@code null} when left unset) + */ + public static JsonSetterNullsMode resolveOptionalNonNullPropertyJsonSetterNulls(Map additionalProperties, JsonSetterNullsMode current) { + if (!additionalProperties.containsKey(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS)) { + return current; + } + return normalizeJsonSetterNulls( + java.util.Objects.toString(additionalProperties.get(CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS), null), + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS); + } + + /** + * Validate and normalize a manual per-property {@code x-jackson-json-setter-nulls} override. + * + * @param rawValue the raw vendor extension value set directly on the property in the spec + * @param extensionName the vendor extension key, used in the error message + * @return the normalized {@link JsonSetterNullsMode}: {@code SKIP}/{@code FAIL} to emit that annotation, or + * {@link JsonSetterNullsMode#NONE} when the override means "emit no annotation" ({@code NONE}/blank) + * @throws IllegalArgumentException when the override is not {@code SKIP}, {@code FAIL}, or {@code NONE} + */ + public static JsonSetterNullsMode resolveManualJsonSetterNulls(Object rawValue, String extensionName) { + if (rawValue == null) { + return JsonSetterNullsMode.NONE; + } + String trimmed = rawValue.toString().trim(); + if (trimmed.isEmpty()) { + return JsonSetterNullsMode.NONE; + } + try { + return JsonSetterNullsMode.valueOf(trimmed.toUpperCase(java.util.Locale.ROOT)); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException(extensionName + + " must be one of SKIP, FAIL, or NONE (to emit no annotation), but was: " + rawValue); + } + } + + /** + * Resolve the {@code @JsonSetter(nulls = ...)} annotation for a property into the + * {@code x-has-json-setter-nulls-skip}/{@code -fail} vendor extension the templates emit, mutating + * {@code property.vendorExtensions} and {@code model.imports} in place. Precedence (mirrors + * {@link #resolveJsonIncludePolicy}): + *

    + *
  1. A per-property {@code x-jackson-json-setter-nulls} override in the spec always wins and is honored + * unconditionally (regardless of {@code generateJsonSetterNullsAnnotations}, required/nullable, + * {@code openApiNullable}, or {@code failModeSupported}).
  2. + *
  3. Otherwise the automatic optional-non-nullable mode from + * {@link #resolveJsonSetterNullsMode(TriStateBoolean, boolean, boolean, boolean, boolean, JsonSetterNullsMode)}.
  4. + *
+ * + * @param model the model owning {@code property}, whose imports may be extended + * @param property the property to resolve the mode for + * @param generateJsonSetterNullsAnnotations the resolved {@code generateJsonSetterNullsAnnotations} state + * @param optionalNonNullOverride the resolved {@code optionalNonNullPropertyJsonSetterNulls} option + * ({@code null} when unset) + * @param openApiNullable whether the generator's {@code openApiNullable} option is enabled + * @param failModeSupported whether this generator's default path emits {@code FAIL} + */ + public static void resolveJsonSetterNulls(CodegenModel model, CodegenProperty property, + TriStateBoolean generateJsonSetterNullsAnnotations, JsonSetterNullsMode optionalNonNullOverride, + boolean openApiNullable, boolean failModeSupported) { + JsonSetterNullsMode mode; + if (property.vendorExtensions.containsKey(VendorExtension.X_JACKSON_JSON_SETTER_NULLS.getName())) { + mode = resolveManualJsonSetterNulls( + property.vendorExtensions.get(VendorExtension.X_JACKSON_JSON_SETTER_NULLS.getName()), + VendorExtension.X_JACKSON_JSON_SETTER_NULLS.getName()); + } else { + mode = resolveJsonSetterNullsMode(generateJsonSetterNullsAnnotations, property.required, + property.isNullable, openApiNullable, failModeSupported, optionalNonNullOverride); + } + applyJsonSetterNullsMode(model, property, mode); + } + + /** + * Apply a resolved {@link JsonSetterNullsMode} to a property: sets the + * {@code x-has-json-setter-nulls-skip}/{@code -fail} vendor extension and adds the required imports. + * No-op for {@link JsonSetterNullsMode#NONE}/{@code null}. + */ + public static void applyJsonSetterNullsMode(CodegenModel model, CodegenProperty property, JsonSetterNullsMode mode) { + if (mode == null || mode == JsonSetterNullsMode.NONE) { + return; + } + property.vendorExtensions.put(mode == JsonSetterNullsMode.FAIL + ? "x-has-json-setter-nulls-fail" : "x-has-json-setter-nulls-skip", true); + model.imports.add("JsonSetter"); + model.imports.add("Nulls"); + } + + /** + * Log a one-time warning when the generator falls back to the (technically risky) "no {@code @JsonSetter}" + * default for optional non-nullable properties: {@code generateJsonSetterNullsAnnotations=true}, + * no {@code optionalNonNullPropertyJsonSetterNulls} override, {@code openApiNullable=true}, and the + * generator's default path does not emit {@code FAIL} ({@code failModeSupported=false}, i.e. spring/java). + * In that case an explicit JSON null falls back to the global mapper default ({@code Nulls.SET}) and + * overwrites field defaults. kotlin-spring passes {@code failModeSupported=true} and stays silent. + */ + public static void warnIfJsonSetterNullsDefaultRisky(Logger logger, TriStateBoolean generateJsonSetterNullsAnnotations, + JsonSetterNullsMode optionalNonNullOverride, boolean openApiNullable, boolean failModeSupported) { + if (generateJsonSetterNullsAnnotations.isTrue() && optionalNonNullOverride == null && openApiNullable && !failModeSupported) { + logger.warn("'{}=true' with 'openApiNullable=true' emits no @JsonSetter(nulls = ...) on optional " + + "non-nullable properties, so deserialization defers to the global ObjectMapper default " + + "(Nulls.SET): an explicit JSON null overwrites the field's default value. Set '{}=SKIP' to " + + "ignore incoming nulls (preserve defaults) or '{}=FAIL' to reject them, or use the " + + "`x-jackson-json-setter-nulls` vendor extension per property, to control this explicitly.", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS); + } + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicy.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicy.java new file mode 100644 index 000000000000..6c10f3f92b10 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/JsonIncludePolicy.java @@ -0,0 +1,80 @@ +package org.openapitools.codegen.utils; + +import lombok.Getter; + +import java.util.EnumSet; +import java.util.Locale; +import java.util.Set; + +/** + * Mirrors {@code com.fasterxml.jackson.annotation.JsonInclude.Include} (the set of policies a + * generated {@code @JsonInclude} annotation can be given), plus a {@link #NONE} sentinel meaning + * "emit no {@code @JsonInclude} annotation at all", used by the {@code spring} and + * {@code kotlin-spring} generators (issue #24401) for: + * + *
    + *
  • the {@code optionalNonNullPropertyJsonInclude} config option (restricted to + * {@link #NON_NULL}, {@link #NON_EMPTY}, {@link #NON_DEFAULT}, {@link #NONE} — see + * {@link #OPTIONAL_NON_NULL_POLICIES})
  • + *
  • the resolved {@code x-jackson-json-include-policy} vendor extension value, whether set + * manually on a property in the spec or computed by the automatic required/nullable matrix + * (any value is allowed there)
  • + *
+ */ +@Getter +public enum JsonIncludePolicy { + ALWAYS, + NON_NULL("Omit the property when its value is null (default, spec-safe for non-nullable fields)."), + NON_ABSENT, + NON_EMPTY("Omit the property when its value is null or considered empty."), + NON_DEFAULT("Omit the property when its value equals the default."), + USE_DEFAULTS, + CUSTOM, + /** Sentinel meaning "emit no {@code @JsonInclude} annotation". */ + NONE("Emit no @JsonInclude annotation; defer to the global ObjectMapper."); + + /** + * CLI-facing description, only populated for the values in {@link #OPTIONAL_NON_NULL_POLICIES} + * (the only ones ever offered as a {@code CliOption} enum choice); {@code null} otherwise. + */ + private final String description; + + JsonIncludePolicy() { + this(null); + } + + JsonIncludePolicy(String description) { + this.description = description; + } + + /** The subset of policies accepted for the {@code optionalNonNullPropertyJsonInclude} config option. */ + public static final Set OPTIONAL_NON_NULL_POLICIES = + EnumSet.of(NON_NULL, NON_EMPTY, NON_DEFAULT, NONE); + + /** Whether this policy should result in an emitted {@code @JsonInclude} annotation. */ + public boolean isEmitted() { + return this != NONE; + } + + /** Whether this policy is a valid value for the {@code optionalNonNullPropertyJsonInclude} config option. */ + public boolean isValidOptionalNonNullPolicy() { + return OPTIONAL_NON_NULL_POLICIES.contains(this); + } + + /** + * Parse a raw string (trimmed, case-insensitive) into a {@link JsonIncludePolicy}, or return + * {@code null} if blank/whitespace-only (callers treat that the same as {@link #NONE}). + * + * @throws IllegalArgumentException if non-blank but not a valid {@link JsonIncludePolicy} name + */ + public static JsonIncludePolicy parse(Object rawPolicy) { + if (rawPolicy == null) { + return null; + } + String trimmed = rawPolicy.toString().trim(); + if (trimmed.isEmpty()) { + return null; + } + return JsonIncludePolicy.valueOf(trimmed.toUpperCase(Locale.ROOT)); + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 17ce0a391b46..0be9f0d7f758 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -2847,6 +2847,19 @@ public static boolean containsEnums(OpenAPI openAPI) { return schemaMap.values().stream().anyMatch(ModelUtils::isEnumSchema); } + /** + * Whether all branches in the oneOf contains a {@code const}. Returns false for OAS 3.0 since that does not support + * {@code const}. + * @param schema The Schema + * @return true if all {@code oneOf} branches contains a {@code const}. + */ + public static boolean isOneOfOfConsts(Schema schema) { + if (hasOneOf(schema) && !schema.getSpecVersion().equals(SpecVersion.V30)) { + return schema.getOneOf().stream().allMatch(oneOf -> oneOf.getConst() != null); + } + return false; + } + @FunctionalInterface private interface OpenAPISchemaVisitor { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/TriStateBoolean.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/TriStateBoolean.java new file mode 100644 index 000000000000..c8a07567c0dd --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/TriStateBoolean.java @@ -0,0 +1,44 @@ +package org.openapitools.codegen.utils; + +/** + * A tri-state toggle for boolean-like config options that need to distinguish "the user never set + * this" from an explicit {@code true}/{@code false}, e.g. so a weak default can be applied along + * with a one-time warning when the option was left unset, while an explicit {@code false} silently + * keeps the same default behavior. + * + *

This replaces the previous convention of using a boxed {@code Boolean} field where + * {@code null} meant "unset", which requires a code comment at every declaration site to be + * understandable. + */ +public enum TriStateBoolean { + /** The option was never explicitly set by the user (neither {@code true} nor {@code false}). */ + UNSET, + /** The option was explicitly set to {@code false}. */ + FALSE, + /** The option was explicitly set to {@code true}. */ + TRUE; + + /** Whether this state represents an explicit, affirmative opt-in ({@link #TRUE}). */ + public boolean isTrue() { + return this == TRUE; + } + + /** Whether the option was never explicitly set ({@link #UNSET}). */ + public boolean isUnset() { + return this == UNSET; + } + + /** + * Convert a nullable {@link Boolean} (the CLI/config-option convention where {@code null} means + * "not present in additionalProperties") into a {@link TriStateBoolean}. + * + * @param value {@code null} for unset, {@code Boolean.TRUE}/{@code Boolean.FALSE} for an explicit value + * @return {@link #UNSET}, {@link #TRUE}, or {@link #FALSE} + */ + public static TriStateBoolean fromNullableBoolean(Boolean value) { + if (value == null) { + return UNSET; + } + return value ? TRUE : FALSE; + } +} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 964db40884ac..47b1fd30dae0 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -62,14 +62,15 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{{.}}} {{/vendorExtensions.x-field-extra-annotation}} {{#jackson}} - {{^required}} - {{^isNullable}} - @JsonInclude(JsonInclude.Include.NON_NULL) - {{/isNullable}} - {{/required}} - {{#vendorExtensions.x-is-jackson-optional-nullable}} - @JsonInclude(JsonInclude.Include.NON_ABSENT) - {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{#vendorExtensions.x-jackson-json-include-policy}} + @JsonInclude(JsonInclude.Include.{{{vendorExtensions.x-jackson-json-include-policy}}}) + {{/vendorExtensions.x-jackson-json-include-policy}} + {{#vendorExtensions.x-has-json-setter-nulls-skip}} + @JsonSetter(nulls = Nulls.SKIP) + {{/vendorExtensions.x-has-json-setter-nulls-skip}} + {{#vendorExtensions.x-has-json-setter-nulls-fail}} + @JsonSetter(nulls = Nulls.FAIL) + {{/vendorExtensions.x-has-json-setter-nulls-fail}} {{/jackson}} {{#deprecated}} @Deprecated @@ -252,11 +253,6 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} {{/vendorExtensions.x-setter-extra-annotation}} - {{#jackson}} - {{#vendorExtensions.x-has-json-setter-nulls-skip}} - @JsonSetter(nulls = Nulls.SKIP) - {{/vendorExtensions.x-has-json-setter-nulls-skip}} - {{/jackson}} {{#deprecated}} @Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/_common/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/_common/git_push.sh.mustache index 0e3776ae6dd4..7782eddb9a30 100755 --- a/modules/openapi-generator/src/main/resources/_common/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/_common/git_push.sh.mustache @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/modules/openapi-generator/src/main/resources/go-server/go.mod.mustache b/modules/openapi-generator/src/main/resources/go-server/go.mod.mustache index f1ee8194c831..ad342668fb8f 100644 --- a/modules/openapi-generator/src/main/resources/go-server/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/go.mod.mustache @@ -1,6 +1,6 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}} -go 1.18 +go 1.25 {{#hasPathParams}} {{#routers}} @@ -11,7 +11,7 @@ require github.com/gorilla/handlers v1.5.1 {{/featureCORS}} {{/mux}} {{#chi}} -require github.com/go-chi/chi/v5 v5.2.2 +require github.com/go-chi/chi/v5 v5.2.4 {{#featureCORS}} require github.com/go-chi/cors v1.2.1 {{/featureCORS}} diff --git a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache index 5021dd1df0f2..daaf9360b19b 100644 --- a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache @@ -80,16 +80,11 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - {{#oneOf}} - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf({{classname}}): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf({{classname}})") - } - {{/oneOf}} - {{^oneOf}} - return fmt.Errorf("data failed to match schemas in oneOf({{classname}})") - {{/oneOf}} + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf({{classname}}): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf({{classname}})") } {{/discriminator}} {{/useOneOfDiscriminatorLookup}} @@ -124,16 +119,11 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - {{#oneOf}} - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf({{classname}}): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf({{classname}})") - } - {{/oneOf}} - {{^oneOf}} - return fmt.Errorf("data failed to match schemas in oneOf({{classname}})") - {{/oneOf}} + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf({{classname}}): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf({{classname}})") } {{/useOneOfDiscriminatorLookup}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache index 900c2e3f4662..78380ea41ac9 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -2,9 +2,8 @@ @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#deprecated}} @Deprecated(message = ""){{/deprecated}}{{#vendorExtensions.x-field-extra-annotation}} - {{{.}}}{{/vendorExtensions.x-field-extra-annotation}}{{^isNullable}} - @field:JsonInclude(JsonInclude.Include.NON_NULL){{/isNullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} - @field:JsonInclude(JsonInclude.Include.NON_ABSENT){{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-has-json-setter-nulls-skip}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}}{{#vendorExtensions.x-jackson-json-include-policy}} + @field:JsonInclude(JsonInclude.Include.{{{vendorExtensions.x-jackson-json-include-policy}}}){{/vendorExtensions.x-jackson-json-include-policy}}{{#vendorExtensions.x-has-json-setter-nulls-skip}} @field:JsonSetter(nulls = Nulls.SKIP){{/vendorExtensions.x-has-json-setter-nulls-skip}}{{#vendorExtensions.x-has-json-setter-nulls-fail}} @field:JsonSetter(nulls = Nulls.FAIL){{/vendorExtensions.x-has-json-setter-nulls-fail}} @param:JsonProperty("{{{baseName}}}") diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 2f07705c6dd0..0fe6660a8159 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,6 +1,9 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} - {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}}{{#vendorExtensions.x-jackson-json-include-policy}} + @field:JsonInclude(JsonInclude.Include.{{{vendorExtensions.x-jackson-json-include-policy}}}){{/vendorExtensions.x-jackson-json-include-policy}}{{#vendorExtensions.x-has-json-setter-nulls-skip}} + @field:JsonSetter(nulls = Nulls.SKIP){{/vendorExtensions.x-has-json-setter-nulls-skip}}{{#vendorExtensions.x-has-json-setter-nulls-fail}} + @field:JsonSetter(nulls = Nulls.FAIL){{/vendorExtensions.x-has-json-setter-nulls-fail}} @param:JsonProperty("{{{baseName}}}") @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/rust-server/tests-auth-scheme-precedence.mustache b/modules/openapi-generator/src/main/resources/rust-server/tests-auth-scheme-precedence.mustache new file mode 100644 index 000000000000..c3f666173c94 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust-server/tests-auth-scheme-precedence.mustache @@ -0,0 +1,151 @@ +//! Runtime checks for auth-scheme precedence in the generated `AddContext` middleware. +//! +//! This file is generated. `swagger::auth::from_headers` returns an *untyped* `AuthData`, +//! matching an `Authorization` header that carries either `Basic` or `Bearer` credentials. +//! Every generated auth block returns early once it matches, so a block that does not check +//! which variant it received will claim credentials belonging to a different scheme and +//! prevent every later block - including API-key blocks - from ever running. +//! +//! The expectations below are derived from the security schemes this API declares, in the +//! order their blocks are generated. + +#![cfg(feature = "server")] + +use std::sync::{Arc, Mutex}; + +use hyper::service::Service; +use hyper::{Request, Response}; +use swagger::auth::AuthData; +use swagger::{EmptyContext, Has}; +use {{{externCrateName}}}::context::AddContext; + +/// Innermost service: records the `Option` that `AddContext` pushed onto the context. +#[derive(Clone, Default)] +struct CaptureAuthData(Arc>>); + +impl Service<(Request, C)> for CaptureAuthData +where + C: Has>, +{ + type Response = Response; + type Error = std::convert::Infallible; + type Future = std::future::Ready>; + + fn call(&self, (_request, context): (Request, C)) -> Self::Future { + let auth_data: &Option = context.get(); + *self.0.lock().expect("lock poisoned") = auth_data.clone(); + std::future::ready(Ok(Response::new(String::new()))) + } +} + +/// Drives a request through `AddContext` and returns the `AuthData` it resolved. +fn resolve_auth_data(uri: &str, headers: &[(&str, &str)]) -> Option { + let capture = CaptureAuthData::default(); + let service = AddContext::<_, EmptyContext>::new(capture.clone()); + + let mut builder = Request::get(uri); + for (name, value) in headers { + builder = builder.header(*name, *value); + } + let request = builder.body(()).expect("request should build"); + + futures::executor::block_on(service.call(request)).expect("service call should succeed"); + + let resolved = capture.0.lock().expect("lock poisoned").clone(); + resolved +} + +/// `dXNlcjpwYXNzd29yZA==` is `user:password`. +const BASIC_HEADER: &str = "Basic dXNlcjpwYXNzd29yZA=="; +const BEARER_HEADER: &str = "Bearer some-token"; +{{#authTestHasApiKey}} +const API_KEY: &str = "test-api-key"; +{{/authTestHasApiKey}} + +#[test] +fn no_credentials_resolve_to_no_auth_data() { + assert_eq!(resolve_auth_data("/", &[]), None); +} + +#[test] +{{#authTestHasBasic}} +fn basic_credentials_resolve_to_the_declared_basic_scheme() { +{{/authTestHasBasic}} +{{^authTestHasBasic}} +fn basic_credentials_resolve_to_none_when_no_basic_scheme_is_declared() { +{{/authTestHasBasic}} + assert_eq!( + resolve_auth_data("/", &[("authorization", BASIC_HEADER)]), + {{#authTestHasBasic}}Some(AuthData::Basic("user".to_owned(), "password".to_owned())){{/authTestHasBasic}}{{^authTestHasBasic}}None{{/authTestHasBasic}}, + ); +} + +#[test] +{{#authTestHasBearer}} +fn bearer_credentials_resolve_to_the_declared_bearer_scheme() { +{{/authTestHasBearer}} +{{^authTestHasBearer}} +fn bearer_credentials_resolve_to_none_when_no_bearer_scheme_is_declared() { +{{/authTestHasBearer}} + assert_eq!( + resolve_auth_data("/", &[("authorization", BEARER_HEADER)]), + {{#authTestHasBearer}}Some(AuthData::Bearer("some-token".to_owned())){{/authTestHasBearer}}{{^authTestHasBearer}}None{{/authTestHasBearer}}, + ); +} +{{#authTestApiKeyHeader}} + +#[test] +fn header_api_key_resolves_when_it_is_the_only_credential() { + assert_eq!( + resolve_auth_data("/", &[("{{{.}}}", API_KEY)]), + Some(AuthData::ApiKey(API_KEY.to_owned())), + ); +} + +/// An `Authorization` header must not shadow the apiKey block unless a block that actually +/// handles that scheme is generated before it. +#[test] +fn header_api_key_is_reachable_alongside_bearer_credentials() { + assert_eq!( + resolve_auth_data("/", &[("authorization", BEARER_HEADER), ("{{{.}}}", API_KEY)]), + {{#authTestBearerPrecedesHeaderApiKey}}Some(AuthData::Bearer("some-token".to_owned())){{/authTestBearerPrecedesHeaderApiKey}}{{^authTestBearerPrecedesHeaderApiKey}}Some(AuthData::ApiKey(API_KEY.to_owned())){{/authTestBearerPrecedesHeaderApiKey}}, + ); +} + +#[test] +fn header_api_key_is_reachable_alongside_basic_credentials() { + assert_eq!( + resolve_auth_data("/", &[("authorization", BASIC_HEADER), ("{{{.}}}", API_KEY)]), + {{#authTestBasicPrecedesHeaderApiKey}}Some(AuthData::Basic("user".to_owned(), "password".to_owned())){{/authTestBasicPrecedesHeaderApiKey}}{{^authTestBasicPrecedesHeaderApiKey}}Some(AuthData::ApiKey(API_KEY.to_owned())){{/authTestBasicPrecedesHeaderApiKey}}, + ); +} +{{/authTestApiKeyHeader}} +{{#authTestApiKeyQuery}} + +#[test] +fn query_api_key_resolves_when_it_is_the_only_credential() { + assert_eq!( + resolve_auth_data("/?{{{.}}}=test-api-key", &[]), + Some(AuthData::ApiKey(API_KEY.to_owned())), + ); +} + +/// The query apiKey block is shadowed independently of the header one: an `Authorization` +/// header must not claim a request whose credentials are in the query string unless a block +/// that actually handles that scheme is generated before the query block. +#[test] +fn query_api_key_is_reachable_alongside_bearer_credentials() { + assert_eq!( + resolve_auth_data("/?{{{.}}}=test-api-key", &[("authorization", BEARER_HEADER)]), + {{#authTestBearerPrecedesQueryApiKey}}Some(AuthData::Bearer("some-token".to_owned())){{/authTestBearerPrecedesQueryApiKey}}{{^authTestBearerPrecedesQueryApiKey}}Some(AuthData::ApiKey(API_KEY.to_owned())){{/authTestBearerPrecedesQueryApiKey}}, + ); +} + +#[test] +fn query_api_key_is_reachable_alongside_basic_credentials() { + assert_eq!( + resolve_auth_data("/?{{{.}}}=test-api-key", &[("authorization", BASIC_HEADER)]), + {{#authTestBasicPrecedesQueryApiKey}}Some(AuthData::Basic("user".to_owned(), "password".to_owned())){{/authTestBasicPrecedesQueryApiKey}}{{^authTestBasicPrecedesQueryApiKey}}Some(AuthData::ApiKey(API_KEY.to_owned())){{/authTestBasicPrecedesQueryApiKey}}, + ); +} +{{/authTestApiKeyQuery}} diff --git a/modules/openapi-generator/src/main/resources/scala-sttp4/api.mustache b/modules/openapi-generator/src/main/resources/scala-sttp4/api.mustache index 1afd073d825e..dc8e59028dfd 100644 --- a/modules/openapi-generator/src/main/resources/scala-sttp4/api.mustache +++ b/modules/openapi-generator/src/main/resources/scala-sttp4/api.mustache @@ -20,7 +20,7 @@ class {{classname}}(baseUrl: String) { {{>javadoc}} {{/javadocRenderer}} - def {{operationId}}({{>methodParameters}}): Request[{{#separateErrorChannel}}Either[ResponseException[String], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}] = + def {{operationId}}({{>methodParameters}}): sttp.client4.Request[{{#separateErrorChannel}}Either[ResponseException[String], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}] = basicRequest .method(Method.{{httpMethod.toUpperCase}}, uri"$baseUrl{{{path}}}{{#queryParams.0}}?{{/queryParams.0}}{{#queryParams}}{{baseName}}=${ {{paramName}} }{{^-last}}&{{/-last}}{{/queryParams}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}}{{#queryParams.0}}&{{/queryParams.0}}{{^queryParams.0}}?{{/queryParams.0}}{{keyParamName}}=${apiKeyQuery}{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}") .contentType({{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}){{#headerParams}} diff --git a/modules/openapi-generator/src/main/resources/scala-sttp4/model.mustache b/modules/openapi-generator/src/main/resources/scala-sttp4/model.mustache index 7c710728f583..67d131fe9d35 100644 --- a/modules/openapi-generator/src/main/resources/scala-sttp4/model.mustache +++ b/modules/openapi-generator/src/main/resources/scala-sttp4/model.mustache @@ -49,10 +49,41 @@ case class {{classname}}( object {{classname}} { import io.circe._ import io.circe.syntax._ - import io.circe.generic.semiauto._ - implicit val encoder: Encoder[{{classname}}] = deriveEncoder[{{classname}}].mapJson(_.dropNullValues) - implicit val decoder: Decoder[{{classname}}] = deriveDecoder +{{^allVars}} + implicit val encoder: Encoder[{{classname}}] = Encoder.instance(_ => Json.obj()) + implicit val decoder: Decoder[{{classname}}] = Decoder.const({{classname}}()) +{{/allVars}} +{{#allVars}} +{{#-first}} + implicit val encoder: Encoder[{{classname}}] = Encoder.instance { t => + Json.fromFields( + Seq( +{{/-first}} + {{#required}}Some("{{baseName}}" -> t.{{{name}}}.asJson){{/required}}{{^required}}t.{{{name}}}.map(v => "{{baseName}}" -> v.asJson){{/required}}{{^-last}},{{/-last}} +{{#-last}} + ).flatten + ) + } +{{/-last}} +{{/allVars}} +{{#allVars}} +{{#-first}} + implicit val decoder: Decoder[{{classname}}] = Decoder.instance { c => + for { +{{/-first}} + {{{name}}} <- c.downField("{{baseName}}").as[{{^required}}Option[{{/required}}{{dataType}}{{^required}}]{{/required}}] +{{#-last}} + } yield {{classname}}( +{{/-last}} +{{/allVars}} +{{#allVars}} + {{{name}}} = {{{name}}}{{^-last}},{{/-last}} +{{#-last}} + ) + } +{{/-last}} +{{/allVars}} } {{/circe}} @@ -176,30 +207,39 @@ object {{classname}} { {{#circe}} {{^vendorExtensions.x-hasWrappedOneOfMembers}} {{^vendorExtensions.x-use-discr}} - // oneOf without discriminator - using semiauto derivation + // oneOf without discriminator - try each member in turn import io.circe.{Encoder, Decoder} - import io.circe.generic.semiauto._ + import io.circe.syntax._ - implicit val encoder: Encoder[{{classname}}] = deriveEncoder[{{classname}}].mapJson(_.dropNullValues) - implicit val decoder: Decoder[{{classname}}] = deriveDecoder + implicit val encoder: Encoder[{{classname}}] = Encoder.instance { +{{#vendorExtensions.x-oneOfMembers}} + case obj: {{classname}} => obj.asJson +{{/vendorExtensions.x-oneOfMembers}} + } + implicit val decoder: Decoder[{{classname}}] = List[Decoder[{{classname}}]]( +{{#vendorExtensions.x-oneOfMembers}} + Decoder[{{classname}}].map(x => x: {{vendorExtensions.x-oneOfParent}}), +{{/vendorExtensions.x-oneOfMembers}} + ).reduceLeft(_ or _) {{/vendorExtensions.x-use-discr}} {{#vendorExtensions.x-use-discr}} - // oneOf with discriminator - using semiauto derivation with Configuration - import io.circe.{Encoder, Decoder} - import io.circe.generic.extras._ - import io.circe.generic.extras.semiauto._ + // oneOf with discriminator + import io.circe.{Encoder, Decoder, DecodingFailure} + import io.circe.syntax._ - private implicit val config: Configuration = Configuration.default.withDiscriminator("{{discriminator.propertyBaseName}}") - .copy( - transformConstructorNames = { + implicit val encoder: Encoder[{{classname}}] = Encoder.instance { {{#vendorExtensions.x-oneOfMembers}} - case "{{classname}}" => "{{vendorExtensions.x-discriminator-value}}" + case obj: {{classname}} => obj.asJson.mapObject(("{{vendorExtensions.x-discriminator-property}}" -> "{{vendorExtensions.x-discriminator-value}}".asJson) +: _) {{/vendorExtensions.x-oneOfMembers}} - case other => sys.error(s"Invalid {{classname}} discriminant: ${other}") - } - ) - implicit val encoder: Encoder[{{classname}}] = deriveConfiguredEncoder[{{classname}}].mapJson(_.dropNullValues) - implicit val decoder: Decoder[{{classname}}] = deriveConfiguredDecoder + } + implicit val decoder: Decoder[{{classname}}] = Decoder.instance { c => + c.downField("{{discriminator.propertyBaseName}}").as[String].flatMap { +{{#vendorExtensions.x-oneOfMembers}} + case "{{vendorExtensions.x-discriminator-value}}" => c.as[{{classname}}].map(x => x: {{vendorExtensions.x-oneOfParent}}) +{{/vendorExtensions.x-oneOfMembers}} + case other => Left(DecodingFailure(s"Unknown {{discriminator.propertyBaseName}}: $other", c.history)) + } + } {{/vendorExtensions.x-use-discr}} {{/vendorExtensions.x-hasWrappedOneOfMembers}} {{#vendorExtensions.x-hasWrappedOneOfMembers}} @@ -239,7 +279,7 @@ object {{classname}} { implicit val decoder: Decoder[{{classname}}] = Decoder.instance { c => c.get[String]("{{discriminator.propertyBaseName}}").flatMap { {{#vendorExtensions.x-oneOfMembers}} - case "{{vendorExtensions.x-discriminator-value}}" => c.as[{{classname}}]({{classname}}.decoder).map(x => x: {{parentClassname}}) + case "{{vendorExtensions.x-discriminator-value}}" => c.as[{{classname}}]({{classname}}.decoder).map(x => x: {{vendorExtensions.x-oneOfParent}}) {{/vendorExtensions.x-oneOfMembers}} {{#vendorExtensions.x-wrappedOneOfMembers}} case "{{discriminatorValue}}" => c.as[{{classname}}]({{classname}}.decoder).map({{wrapperClassname}}.apply) @@ -324,10 +364,41 @@ case class {{classname}}( object {{classname}} { import io.circe._ import io.circe.syntax._ - import io.circe.generic.semiauto._ - implicit val encoder: Encoder[{{classname}}] = deriveEncoder[{{classname}}].mapJson(_.dropNullValues) - implicit val decoder: Decoder[{{classname}}] = deriveDecoder +{{^vars}} + implicit val encoder: Encoder[{{classname}}] = Encoder.instance(_ => Json.obj()) + implicit val decoder: Decoder[{{classname}}] = Decoder.const({{classname}}()) +{{/vars}} +{{#vars}} +{{#-first}} + implicit val encoder: Encoder[{{classname}}] = Encoder.instance { t => + Json.fromFields( + Seq( +{{/-first}} + {{#required}}Some("{{baseName}}" -> t.{{{name}}}.asJson){{/required}}{{^required}}t.{{{name}}}.map(v => "{{baseName}}" -> v.asJson){{/required}}{{^-last}},{{/-last}} +{{#-last}} + ).flatten + ) + } +{{/-last}} +{{/vars}} +{{#vars}} +{{#-first}} + implicit val decoder: Decoder[{{classname}}] = Decoder.instance { c => + for { +{{/-first}} + {{{name}}} <- c.downField("{{baseName}}").as[{{^required}}Option[{{/required}}{{^isEnum}}{{dataType}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}Enums.{{datatypeWithEnum}}{{/isArray}}{{#isArray}}Seq[{{classname}}Enums.{{datatypeWithEnum}}]{{/isArray}}{{/isEnum}}{{^required}}]{{/required}}] +{{#-last}} + } yield {{classname}}( +{{/-last}} +{{/vars}} +{{#vars}} + {{{name}}} = {{{name}}}{{^-last}},{{/-last}} +{{#-last}} + ) + } +{{/-last}} +{{/vars}} } {{/circe}} {{#hasEnums}} diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/modelEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/modelEnum.mustache index 8fdf09b4697d..74fdc47c183d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/modelEnum.mustache @@ -22,7 +22,7 @@ export const {{classname}} = { * {{.}} */ {{/enumDescription}} - {{name}}: {{{value}}}{{^-last}},{{/-last}} + {{name}}: {{{value}}}, {{/enumVars}} {{/allowableValues}} } as const; diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericEnums.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericEnums.mustache index 8e636697b67f..4da64fee7731 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericEnums.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericEnums.mustache @@ -18,7 +18,7 @@ export enum {{classname}}{{enumName}} { export const {{enumName}} = { {{#allowableValues}} {{#enumVars}} - {{name}}: {{{value}}}{{^-last}},{{/-last}} + {{name}}: {{{value}}}, {{/enumVars}} {{/allowableValues}} } as const; diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apisOperationEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apisOperationEnum.mustache index e1641254e521..b8c09fe1479d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apisOperationEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apisOperationEnum.mustache @@ -8,7 +8,7 @@ export enum {{operationIdCamelCase}}{{enumName}} { {{#allowableValues}} {{#enumVars}} - {{{name}}} = {{{value}}}{{^-last}},{{/-last}} + {{{name}}} = {{{value}}}, {{/enumVars}} {{/allowableValues}} } @@ -20,7 +20,7 @@ export enum {{operationIdCamelCase}}{{enumName}} { export const {{operationIdCamelCase}}{{enumName}} = { {{#allowableValues}} {{#enumVars}} - {{{name}}}: {{{value}}}{{^-last}},{{/-last}} + {{{name}}}: {{{value}}}, {{/enumVars}} {{/allowableValues}} } as const; diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnumInterfaces.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnumInterfaces.mustache index 8d44b927affc..e6395c6fb972 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnumInterfaces.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnumInterfaces.mustache @@ -29,7 +29,7 @@ export const {{classname}} = { * {{enumDescription}} */ {{/enumDescription}} - {{{name}}}: {{{value}}}{{^-last}},{{/-last}} + {{{name}}}: {{{value}}}, {{/enumVars}} {{/allowableValues}} } as const; diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache index 7d6aceec7a5e..e1ce9eac0d2c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache @@ -45,7 +45,7 @@ export enum {{classname}}{{enumName}} { export const {{classname}}{{enumName}} = { {{#allowableValues}} {{#enumVars}} - {{{name}}}: {{{value}}}{{^-last}},{{/-last}} + {{{name}}}: {{{value}}}, {{/enumVars}} {{/allowableValues}} } as const; diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs-server/modelEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs-server/modelEnum.mustache index 8fdf09b4697d..74fdc47c183d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs-server/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs-server/modelEnum.mustache @@ -22,7 +22,7 @@ export const {{classname}} = { * {{.}} */ {{/enumDescription}} - {{name}}: {{{value}}}{{^-last}},{{/-last}} + {{name}}: {{{value}}}, {{/enumVars}} {{/allowableValues}} } as const; diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs-server/modelGenericEnums.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs-server/modelGenericEnums.mustache index 7c3eb9ec2645..044c154a6481 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs-server/modelGenericEnums.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs-server/modelGenericEnums.mustache @@ -18,7 +18,7 @@ export namespace {{classname}} { export const {{enumName}} = { {{#allowableValues}} {{#enumVars}} - {{name}}: {{{value}}}{{^-last}},{{/-last}} + {{name}}: {{{value}}}, {{/enumVars}} {{/allowableValues}} } as const; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java index 1b75a51b7100..9bb321618003 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java @@ -43,6 +43,8 @@ public class OpenAPINormalizerTest { + private static final String SIMPLIFY_ONE_OF_ANY_OF = "SIMPLIFY_ONEOF_ANYOF"; + private static final String SIMPLIFY_ONEOF_ANYOF_ENUM = "SIMPLIFY_ONEOF_ANYOF_ENUM"; private static final String REF_AS_PARENT_IN_ALLOF = "REF_AS_PARENT_IN_ALLOF"; private static final String X_PARENT = "x-parent"; private static final String X_INTERNAL = "x-internal"; @@ -210,7 +212,7 @@ public void testSimplifyOneOfAnyOfEnum() throws Exception { // Test with rule enabled (default) Map options = new HashMap<>(); - options.put("SIMPLIFY_ONEOF_ANYOF_ENUM", "true"); + options.put(SIMPLIFY_ONEOF_ANYOF_ENUM, "true"); OpenAPINormalizer normalizer = new OpenAPINormalizer(openAPI, options); normalizer.normalize(); @@ -248,7 +250,7 @@ public void testSimplifyOneOfAnyOfEnum() throws Exception { // Test with rule disabled OpenAPI openAPI2 = TestUtils.parseSpec("src/test/resources/3_0/simplifyOneOfWithEnums_test.yaml"); Map options2 = new HashMap<>(); - options2.put("SIMPLIFY_ONEOF_ANYOF_ENUM", "false"); + options2.put(SIMPLIFY_ONEOF_ANYOF_ENUM, "false"); OpenAPINormalizer normalizer2 = new OpenAPINormalizer(openAPI2, options2); normalizer2.normalize(); @@ -312,7 +314,7 @@ public void testOpenAPINormalizerSimplifyOneOfAnyOf() { assertEquals(schema19.getAnyOf().size(), 1); Map options = new HashMap<>(); - options.put("SIMPLIFY_ONEOF_ANYOF", "true"); + options.put(SIMPLIFY_ONE_OF_ANY_OF, "true"); OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); openAPINormalizer.normalize(); @@ -370,7 +372,7 @@ public void testOpenAPINormalizerSimplifyOneOfWithSingleRef() { assertEquals(((Schema) oneOfWithSingleRef.getProperties().get("number")).getOneOf().size(), 1); Map options = new HashMap<>(); - options.put("SIMPLIFY_ONEOF_ANYOF", "true"); + options.put(SIMPLIFY_ONE_OF_ANY_OF, "true"); OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); openAPINormalizer.normalize(); @@ -511,7 +513,7 @@ public void testOpenAPINormalizerConvertEnumNullToNullable() { assertNull(schema.getNullable()); Map options = new HashMap<>(); - options.put("SIMPLIFY_ONEOF_ANYOF", "true"); + options.put(SIMPLIFY_ONE_OF_ANY_OF, "true"); OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); openAPINormalizer.normalize(); @@ -1539,7 +1541,7 @@ public void testOpenAPINormalizerSimplifyOneOfAnyOf31Spec() { // start the normalization Map options = new HashMap<>(); - options.put("SIMPLIFY_ONEOF_ANYOF", "true"); + options.put(SIMPLIFY_ONE_OF_ANY_OF, "true"); OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); openAPINormalizer.normalize(); @@ -1613,6 +1615,40 @@ public void testOpenAPINormalizerSimplifyOneOfAnyOf31Spec() { assertEquals(((Schema) schema24.getProperties().get("anyof_nullable_number")).getTypes().size(), 1); } + @Test + public void testOneOfWithStringsWithDifferentPatternsAreCollapsedWithSimplifyOneOfAnyOf() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_1/simplifyOneOfAnyOf_test.yaml"); + + Schema stringPatternsWithOneOf = openAPI.getComponents().getSchemas().get("StringPatternsWithOneOf"); + assertEquals(stringPatternsWithOneOf.getOneOf().size(), 2); + + // start the normalization + Map options = new HashMap<>(); + options.put(SIMPLIFY_ONE_OF_ANY_OF, "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema normalizedStringPatternsWithOneOf = openAPI.getComponents().getSchemas().get("StringPatternsWithOneOf"); + assertNull(normalizedStringPatternsWithOneOf.getOneOf()); + } + + @Test + public void testOneOfWithConstsIsUntouchedBySimplifyOneOfAnyOf() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_1/simplifyOneOfAnyOf_test.yaml"); + + Schema integerWithOneOfConsts = openAPI.getComponents().getSchemas().get("TypeIntegerWithOneOf"); + assertEquals(integerWithOneOfConsts.getOneOf().size(), 3); + + // start the normalization + Map options = new HashMap<>(); + options.put(SIMPLIFY_ONEOF_ANYOF_ENUM, "false"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema normalizedIntegerWithOneOfConsts = openAPI.getComponents().getSchemas().get("TypeIntegerWithOneOf"); + assertEquals(normalizedIntegerWithOneOfConsts.getOneOf().size(), 3); + } + @Test public void testOpenAPINormalizerSimplifyOneOfWithSingleRef31Spec() { OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_1/simplifyOneOfAnyOf_test.yaml"); @@ -1621,7 +1657,7 @@ public void testOpenAPINormalizerSimplifyOneOfWithSingleRef31Spec() { assertEquals(((Schema) oneOfWithSingleRef.getProperties().get("number")).getOneOf().size(), 1); Map options = new HashMap<>(); - options.put("SIMPLIFY_ONEOF_ANYOF", "true"); + options.put(SIMPLIFY_ONE_OF_ANY_OF, "true"); OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); openAPINormalizer.normalize(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index c77a0ac16cf2..516336cb7904 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -8455,57 +8455,433 @@ void issue24003() throws IOException { } /** - * Scenario 4 (openApiNullable=true): optional+nullable field must carry - * {@code @JsonInclude(JsonInclude.Include.NON_ABSENT)} so that Jackson - * excludes {@code JsonNullable.undefined()} from serialized output. + * Issue #24401: the {@code @JsonInclude(NON_ABSENT)} annotation must no longer be emitted for + * {@code JsonNullable} fields, as the JsonNullable module already governs their inclusion. */ @Test - void optionalNullableField_withOpenApiNullable_hasNonAbsentAnnotation() throws IOException { + void optionalNullableField_withOpenApiNullable_hasNoJsonIncludeAnnotation() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); Path modelFile = files.get("TestModel.java").toPath(); - // NON_ABSENT must be present — only optionalNullable (JsonNullable) gets this annotation - assertFileContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_ABSENT)"); - // JsonNullable field must be present - assertFileContains(modelFile, "private JsonNullable optionalNullable"); - // NON_NULL must also be present (for optionalNonNullable fields) - assertFileContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_NULL)"); - assertFileContains(modelFile, "import com.fasterxml.jackson.annotation.JsonInclude"); + assertFileNotContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_ABSENT)"); + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("optionalNullable").withType("JsonNullable") + .assertPropertyAnnotations().doesNotContainWithName("JsonInclude"); } /** - * Without openApiNullable the optional+nullable field is a plain nullable type — - * no {@code @JsonInclude(NON_ABSENT)} should be emitted. + * Issue #24401 (safe-but-noisy): with no flags set, the generator defaults to weak/7.23.0 behavior — + * NO policy {@code @JsonInclude} or {@code @JsonSetter(nulls)} annotations are emitted, deferring + * entirely to the global ObjectMapper. */ @Test - void optionalNullableField_withoutOpenApiNullable_hasNoNonAbsentAnnotation() throws IOException { + void jsonInclude_unset_emitsNoPolicyAnnotations() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, - Map.of(CodegenConstants.OPENAPI_NULLABLE, "false")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); Path modelFile = files.get("TestModel.java").toPath(); - // Without openApiNullable the field is String optionalNullable, not JsonNullable - assertFileNotContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_ABSENT)"); + assertFileNotContains(modelFile, "@JsonInclude("); + assertFileNotContains(modelFile, "@JsonSetter("); } /** - * Optional+non-nullable fields must still have {@code @JsonInclude(NON_NULL)} regardless - * of the openApiNullable setting. + * Issue #24401: default matrix for JAVA-SPRING when {@code generateJsonIncludeAnnotations=true} + * (openApiNullable=true). required non-nullable -> NON_NULL, required nullable -> ALWAYS, + * optional non-nullable -> NON_NULL (default policy), optional nullable -> no annotation. */ @Test - void optionalNonNullableField_alwaysHasNonNullAnnotation() throws IOException { + void jsonInclude_defaultMatrix() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", SPRING_BOOT, - Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("requiredNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")).toProperty().toType() + .assertProperty("requiredNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.ALWAYS")).toProperty().toType() + .assertProperty("optionalNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")).toProperty().toType() + .assertProperty("optionalNullable").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude"); + } + + /** + * Issue #24401 (safe-but-noisy): {@code generateJsonSetterNullsAnnotations=true} emits + * {@code @JsonSetter(nulls = Nulls.SKIP)} on optional non-nullable fields (openApiNullable=false); + * leaving it unset emits none. + */ + @Test + void jsonSetterNulls_generateFlag_controlsEmission() throws IOException { + Map withFlag = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "false", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + assertFileContains(withFlag.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.SKIP)"); + + Map unset = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "false")); + assertFileNotContains(unset.get("OptionalNonNullable.java").toPath(), "@JsonSetter("); + } + + /** + * Issue #24401 regression: when Lombok generates the setter ({@code lombok.Setter}), the manual + * setter method (and the {@code @JsonSetter} annotation that used to live only on it) is skipped + * entirely. {@code @JsonSetter(nulls = Nulls.SKIP)} must be emitted on the field itself so it is + * still honored by Jackson even though no explicit setter method is generated. + */ + @Test + void jsonSetterNulls_generateFlag_appliesWithLombokSetter() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put(CodegenConstants.OPENAPI_NULLABLE, "false"); + additionalProperties.put(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); + additionalProperties.put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@lombok.Getter;@lombok.Setter"); + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + additionalProperties); + + JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")) + .hasNoMethod("setOptionalNonNullable"); + assertFileContains(files.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.SKIP)"); + } + + /** + * Issue #24491: {@code optionalNonNullPropertyJsonSetterNulls} decouples the SKIP/FAIL choice from + * {@code openApiNullable} on spring. With {@code openApiNullable=true} the default emits no + * {@code @JsonSetter}; SKIP and FAIL are now both reachable (FAIL via the new template branch). + */ + @Test + void jsonSetterNulls_option_decouplesFromOpenApiNullable() throws IOException { + // openApiNullable=true + SKIP (previously unreachable): tolerate an explicit null + Map skip = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "SKIP")); + assertFileContains(skip.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.SKIP)"); + assertFileNotContains(skip.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.FAIL)"); + // @JsonInclude is still emitted independently + assertFileContains(skip.get("OptionalNonNullable.java").toPath(), "@JsonInclude(JsonInclude.Include.NON_NULL)"); + + // openApiNullable=true + FAIL: reject an explicit null (uses the new -fail template branch) + Map fail = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "FAIL")); + assertFileContains(fail.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.FAIL)"); + + // openApiNullable=false + FAIL: overrides the SKIP default + Map failNoNullable = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "false", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "FAIL")); + assertFileContains(failNoNullable.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.FAIL)"); + assertFileNotContains(failNoNullable.get("OptionalNonNullable.java").toPath(), "@JsonSetter(nulls = Nulls.SKIP)"); + } + + /** + * Issue #24491: an invalid {@code optionalNonNullPropertyJsonSetterNulls} value fails fast with an + * actionable error naming the option and allowed values. + */ + @Test + void jsonSetterNulls_option_invalidValueFailsFast() { + try { + generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "BOGUS")); + org.assertj.core.api.Assertions.fail("expected an IllegalArgumentException for an invalid optionalNonNullPropertyJsonSetterNulls value"); + } catch (Exception e) { + Throwable root = e; + while (root.getCause() != null) { + root = root.getCause(); + } + assertThat(root).isInstanceOf(IllegalArgumentException.class); + assertThat(root.getMessage()).contains("optionalNonNullPropertyJsonSetterNulls").contains("[SKIP, FAIL]"); + } + } + + /** + * Issue #24491: the per-property {@code x-jackson-json-setter-nulls} vendor extension overrides the + * mode precisely per field (SKIP/FAIL/NONE), winning over the option and unconditionally applying + * even to a required property. + */ + @Test + void jsonSetterNulls_perPropertyExtension() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + // openApiNullable=true + option SKIP: the extension must still win per property + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "SKIP")); + + assertFileContains(files.get("SetterNullsManualSkip.java").toPath(), "@JsonSetter(nulls = Nulls.SKIP)"); + assertFileContains(files.get("SetterNullsManualFail.java").toPath(), "@JsonSetter(nulls = Nulls.FAIL)"); + assertFileNotContains(files.get("SetterNullsManualNone.java").toPath(), "@JsonSetter("); + // forced FAIL on a required property is honored unconditionally + assertFileContains(files.get("SetterNullsForcedOnRequired.java").toPath(), "@JsonSetter(nulls = Nulls.FAIL)"); + } + + /** + * Issue #24491: the per-property {@code x-jackson-json-setter-nulls} override is honored even when + * {@code generateJsonSetterNullsAnnotations} is not enabled (mirrors the JsonInclude manual override). + */ + @Test + void jsonSetterNulls_perPropertyExtension_honoredWhenFlagDisabled() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of()); + assertFileContains(files.get("SetterNullsManualFail.java").toPath(), "@JsonSetter(nulls = Nulls.FAIL)"); + assertFileContains(files.get("SetterNullsManualFail.java").toPath(), + "com.fasterxml.jackson.annotation.JsonSetter", "com.fasterxml.jackson.annotation.Nulls"); + } + + /** + * Issue #24401: {@code optionalNonNullPropertyJsonInclude} changes the policy emitted for + * optional non-nullable properties (when {@code generateJsonIncludeAnnotations=true}). + */ + @Test + void jsonInclude_optionalNonNullPolicy_nonEmpty() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NON_EMPTY")); + + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("optionalNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_EMPTY")).toProperty().toType() + // required-field protection is unaffected by the optional policy + .assertProperty("requiredNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")); + } + + /** + * Issue #24401: {@code optionalNonNullPropertyJsonInclude=NONE} emits no annotation on optional + * non-nullable properties, deferring to the global ObjectMapper. Required-field protection stays. + */ + @Test + void jsonInclude_optionalNonNullPolicy_none() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); + + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("optionalNonNullable").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude").toProperty().toType() + .assertProperty("requiredNonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")); + } + + /** + * Issue #24401: {@code generateJsonIncludeAnnotations=false} removes ALL policy @JsonInclude + * annotations, including the required-field protection, letting the global ObjectMapper win. + */ + @Test + void jsonInclude_generateJsonIncludeAnnotations_false() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); Path modelFile = files.get("TestModel.java").toPath(); - assertFileContains(modelFile, "@JsonInclude(JsonInclude.Include.NON_NULL)"); - assertFileContains(modelFile, "private String optionalNonNullable"); + assertFileNotContains(modelFile, "@JsonInclude("); + } + + /** + * Issue #24401: a manual per-property {@code x-jackson-json-include-policy} vendor extension + * always overrides the automatic behavior, even when {@code generateJsonIncludeAnnotations=false}. + */ + @Test + void jsonInclude_manualOverride_winsOverGenerateFlag() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_override.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + JavaFileAssert.assertThat(files.get("TestModel.java")) + .assertProperty("overridden").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_EMPTY")).toProperty().toType() + // no automatic annotation on the non-overridden optional field + .assertProperty("plain").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude"); + } + + /** + * Issue #24401: with one property per schema, each generated model must import exactly the + * Jackson annotations its single property needs — no more, no less. + */ + @Test + void jsonInclude_perSchemaImports() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + final String jsonSetter = "com.fasterxml.jackson.annotation.JsonSetter"; + final String nulls = "com.fasterxml.jackson.annotation.Nulls"; + final String jsonNullable = "org.openapitools.jackson.nullable.JsonNullable"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + // required non-nullable -> @JsonInclude(NON_NULL); no setter machinery + JavaFileAssert.assertThat(files.get("RequiredNonNullable.java")) + .hasImports(jsonInclude).hasNoImports(jsonSetter, nulls); + // required nullable -> @JsonInclude(ALWAYS) + JavaFileAssert.assertThat(files.get("RequiredNullable.java")) + .hasImports(jsonInclude).hasNoImports(jsonSetter, nulls); + // optional non-nullable with openApiNullable=true -> @JsonInclude(NON_NULL), no @JsonSetter + JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")) + .hasImports(jsonInclude).hasNoImports(jsonSetter, nulls); + // optional nullable with openApiNullable=true -> JsonNullable, NO @JsonInclude + JavaFileAssert.assertThat(files.get("OptionalNullable.java")) + .hasImports(jsonNullable).hasNoImports(jsonInclude, jsonSetter, nulls); + } + + /** + * Issue #24401: with openApiNullable=false, optional non-nullable adds @JsonSetter(Nulls.SKIP); + * optional nullable is a plain type needing none of the Jackson import machinery. + */ + @Test + void jsonInclude_perSchemaImports_withoutOpenApiNullable() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + final String jsonSetter = "com.fasterxml.jackson.annotation.JsonSetter"; + final String nulls = "com.fasterxml.jackson.annotation.Nulls"; + final String jsonNullable = "org.openapitools.jackson.nullable.JsonNullable"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "false", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + + // optional non-nullable -> @JsonInclude(NON_NULL) + @JsonSetter(Nulls.SKIP) + JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")) + .hasImports(jsonInclude, jsonSetter, nulls).hasNoImports(jsonNullable); + // optional nullable (plain String) -> no policy annotation, no import machinery + JavaFileAssert.assertThat(files.get("OptionalNullable.java")) + .hasNoImports(jsonInclude, jsonSetter, nulls, jsonNullable); + } + + /** + * Issue #24401: even with {@code generateJsonIncludeAnnotations=false}, a manual per-property + * vendor extension must still emit its annotation AND the JsonInclude import must be present. + */ + @Test + void jsonInclude_manualOverride_emitsImport_whenAnnotationsDisabled() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + JavaFileAssert.assertThat(files.get("ManualOverride.java")) + .hasImports(jsonInclude) + .assertProperty("value").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_EMPTY")); + // A schema without the override must not import JsonInclude when annotations are disabled + JavaFileAssert.assertThat(files.get("OptionalNonNullable.java")).hasNoImports(jsonInclude); + } + + /** + * Issue #24401: a forced override on an optional+nullable ({@code JsonNullable}) property must be + * respected — the annotation is emitted and the JsonInclude import is added, even though the + * automatic path emits nothing for JsonNullable fields. + */ + @Test + void jsonInclude_forcedOverride_onJsonNullable_emitsAnnotationAndImport() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + + JavaFileAssert.assertThat(files.get("ForcedOnJsonNullable.java")) + .hasImports(jsonInclude) + .assertProperty("value").withType("JsonNullable").assertPropertyAnnotations() + .containsWithNameAndAttributes("JsonInclude", Map.of("value", "JsonInclude.Include.NON_NULL")); + } + + /** + * Issue #24401: a manual per-property override of {@code NONE} means "emit no annotation". Neither the + * {@code @JsonInclude} annotation nor its import may be generated, otherwise the output fails to compile. + */ + @Test + void jsonInclude_manualOverride_none_emitsNoAnnotationOrImport() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + JavaFileAssert.assertThat(files.get("ManualNone.java")) + .hasNoImports(jsonInclude) + .assertProperty("value").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude"); + } + + /** + * Issue #24401: a whitespace-padded {@code NONE} override must be treated identically to a bare + * {@code NONE} — the sentinel comparison must trim before checking, otherwise it falls through to + * validation and generation fails for a value that should simply suppress the annotation. + */ + @Test + void jsonInclude_manualOverride_paddedNone_emitsNoAnnotationOrImport() throws IOException { + final String jsonInclude = "com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + JavaFileAssert.assertThat(files.get("ManualNonePadded.java")) + .hasNoImports(jsonInclude) + .assertProperty("value").assertPropertyAnnotations() + .doesNotContainWithName("JsonInclude"); + } + + /** + * Issue #24401: an invalid manual per-property override must fail fast with an actionable error + * during generation rather than emitting uncompilable Java. + */ + @Test + void jsonInclude_manualOverride_invalid_failsWithActionableError() { + org.assertj.core.api.Assertions.assertThatThrownBy(() -> generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml", + SPRING_BOOT, + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))) + .hasStackTraceContaining("x-jackson-json-include-policy") + .hasStackTraceContaining("NOT_A_REAL_POLICY"); } @Test diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index a38495cef8b8..edad12367b27 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -6724,7 +6724,8 @@ public void requiredNullable_scenario2_requiredNullable() throws IOException { public void requiredNullable_scenario3_optionalNonNullable() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - new HashMap<>()); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6754,7 +6755,9 @@ public void requiredNullable_scenario3_optionalNonNullable() throws IOException public void requiredNullable_scenario3_optionalNonNullable_withOpenApiNullable() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6782,7 +6785,8 @@ public void requiredNullable_scenario3_optionalNonNullable_withOpenApiNullable() public void requiredNullable_scenario3_optionalNonNullable_withDefault() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", - new HashMap<>()); + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); Path modelFile = files.get("TestModel.kt").toPath(); String content = Files.readString(modelFile); @@ -6802,9 +6806,163 @@ public void requiredNullable_scenario3_optionalNonNullable_withDefault() throws } /** - * Scenario 4 (openApiNullable=false, default): required=false, nullable=true - * Without openApiNullable, falls back to nullable type with null default (same as before this feature). + * Issue #24491: the {@code optionalNonNullPropertyJsonSetterNulls=SKIP} option decouples the + * SKIP/FAIL choice from {@code openApiNullable}. With {@code openApiNullable=true} the default would + * be FAIL, but the option forces the (previously unreachable) SKIP so an explicit null is tolerated. + */ + @Test(description = "optionalNonNullPropertyJsonSetterNulls=SKIP overrides the openApiNullable=true FAIL default") + public void jsonSetterNulls_option_skipOverridesOpenApiNullableTrue() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "SKIP")); + + Path modelFile = files.get("TestModel.kt").toPath(); + String content = Files.readString(modelFile); + int idx = content.indexOf("val optionalNonNullable:"); + Assert.assertTrue(idx >= 0, "optionalNonNullable property must exist"); + String context = content.substring(Math.max(0, idx - 200), idx); + Assert.assertTrue(context.contains("@field:JsonSetter(nulls = Nulls.SKIP)"), + "optionalNonNullPropertyJsonSetterNulls=SKIP must win over the openApiNullable=true FAIL default"); + Assert.assertFalse(context.contains("@field:JsonSetter(nulls = Nulls.FAIL)"), + "FAIL must not be emitted when the option forces SKIP"); + // @JsonInclude is still emitted independently + Assert.assertTrue(context.contains("@field:JsonInclude(JsonInclude.Include.NON_NULL)"), + "@JsonInclude(NON_NULL) must still be emitted independently of the setter-nulls option"); + } + + /** + * Issue #24491: {@code optionalNonNullPropertyJsonSetterNulls=FAIL} keeps FAIL under + * {@code openApiNullable=true} (matches the default, but now explicit). + */ + @Test(description = "optionalNonNullPropertyJsonSetterNulls=FAIL with openApiNullable=true") + public void jsonSetterNulls_option_failWithOpenApiNullableTrue() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "FAIL")); + + Path modelFile = files.get("TestModel.kt").toPath(); + String content = Files.readString(modelFile); + int idx = content.indexOf("val optionalNonNullable:"); + Assert.assertTrue(idx >= 0, "optionalNonNullable property must exist"); + String context = content.substring(Math.max(0, idx - 200), idx); + Assert.assertTrue(context.contains("@field:JsonSetter(nulls = Nulls.FAIL)"), + "optionalNonNullPropertyJsonSetterNulls=FAIL must emit FAIL"); + } + + /** + * Issue #24491: {@code optionalNonNullPropertyJsonSetterNulls=FAIL} forces FAIL even with + * {@code openApiNullable=false}, where the default would be SKIP. + */ + @Test(description = "optionalNonNullPropertyJsonSetterNulls=FAIL overrides the openApiNullable=false SKIP default") + public void jsonSetterNulls_option_failOverridesOpenApiNullableFalse() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "FAIL")); + + Path modelFile = files.get("TestModel.kt").toPath(); + String content = Files.readString(modelFile); + int idx = content.indexOf("val optionalNonNullable:"); + Assert.assertTrue(idx >= 0, "optionalNonNullable property must exist"); + String context = content.substring(Math.max(0, idx - 200), idx); + Assert.assertTrue(context.contains("@field:JsonSetter(nulls = Nulls.FAIL)"), + "optionalNonNullPropertyJsonSetterNulls=FAIL must win over the openApiNullable=false SKIP default"); + Assert.assertFalse(context.contains("@field:JsonSetter(nulls = Nulls.SKIP)"), + "SKIP must not be emitted when the option forces FAIL"); + } + + /** + * Issue #24491: an invalid {@code optionalNonNullPropertyJsonSetterNulls} value must fail fast with + * an actionable error message. + */ + @Test(description = "invalid optionalNonNullPropertyJsonSetterNulls value fails fast") + public void jsonSetterNulls_option_invalidValueFailsFast() { + try { + generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "BOGUS")); + Assert.fail("expected an IllegalArgumentException for an invalid optionalNonNullPropertyJsonSetterNulls value"); + } catch (Exception e) { + Throwable root = e; + while (root.getCause() != null) { + root = root.getCause(); + } + Assert.assertTrue(root instanceof IllegalArgumentException, + "expected IllegalArgumentException but was " + root.getClass()); + Assert.assertTrue(root.getMessage().contains("optionalNonNullPropertyJsonSetterNulls") + && root.getMessage().contains("[SKIP, FAIL]"), + "error message must name the option and allowed values, but was: " + root.getMessage()); + } + } + + /** + * Issue #24491: the per-property {@code x-jackson-json-setter-nulls} vendor extension precisely + * overrides the mode per field, winning over the option/openApiNullable default — including a NONE + * that emits no annotation, and a forced value on a required property. + */ + @Test(description = "x-jackson-json-setter-nulls vendor extension overrides precisely per property") + public void jsonSetterNulls_perPropertyExtension() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/json-setter-nulls-override.yaml", + // openApiNullable=true (default FAIL) + option SKIP: per-property extension must still win + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_SETTER_NULLS, "SKIP")); + + Path modelFile = files.get("TestModel.kt").toPath(); + String content = Files.readString(modelFile); + + assertPropertyHasSetterNulls(content, "manualSkip", "SKIP"); + assertPropertyHasSetterNulls(content, "manualFail", "FAIL"); + assertPropertyHasNoSetterNulls(content, "manualNone"); + assertPropertyHasSetterNulls(content, "requiredForcedFail", "FAIL"); + // plainOptional has no extension: follows the option (SKIP) + assertPropertyHasSetterNulls(content, "plainOptional", "SKIP"); + } + + /** + * Issue #24491: an invalid {@code x-jackson-json-setter-nulls} vendor extension value must fail fast. */ + @Test(description = "invalid x-jackson-json-setter-nulls extension value fails fast") + public void jsonSetterNulls_perPropertyExtension_invalidValueFailsFast() { + try { + generateFromContract( + "src/test/resources/3_0/kotlin/json-setter-nulls-override-invalid.yaml", + Map.of(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + Assert.fail("expected an IllegalArgumentException for an invalid x-jackson-json-setter-nulls value"); + } catch (Exception e) { + Throwable root = e; + while (root.getCause() != null) { + root = root.getCause(); + } + Assert.assertTrue(root instanceof IllegalArgumentException, + "expected IllegalArgumentException but was " + root.getClass()); + Assert.assertTrue(root.getMessage().contains("x-jackson-json-setter-nulls"), + "error message must name the extension, but was: " + root.getMessage()); + } + } + + private static void assertPropertyHasSetterNulls(String content, String property, String mode) { + int idx = content.indexOf("val " + property + ":"); + Assert.assertTrue(idx >= 0, property + " property must exist"); + String context = content.substring(Math.max(0, idx - 250), idx); + Assert.assertTrue(context.contains("@field:JsonSetter(nulls = Nulls." + mode + ")"), + property + " must have @field:JsonSetter(nulls = Nulls." + mode + "), context was: " + context); + } + + private static void assertPropertyHasNoSetterNulls(String content, String property) { + int idx = content.indexOf("val " + property + ":"); + Assert.assertTrue(idx >= 0, property + " property must exist"); + String context = content.substring(Math.max(0, idx - 250), idx); + Assert.assertFalse(context.contains("@field:JsonSetter(nulls"), + property + " must not have any @field:JsonSetter(nulls), context was: " + context); + } @Test(description = "Scenario 4 – optional+nullable without openApiNullable: nullable type with null default (legacy fallback)") public void requiredNullable_scenario4_optionalNullable_withoutOpenApiNullable() throws IOException { Map files = generateFromContract( @@ -6858,6 +7016,7 @@ public void requiredNullable_scenario3_optionalNonNullable_withJackson3() throws Map props = new HashMap<>(); props.put(KotlinSpringServerCodegen.USE_SPRING_BOOT4, "true"); props.put(CodegenConstants.OPENAPI_NULLABLE, "true"); + props.put(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", props); @@ -6874,28 +7033,245 @@ public void requiredNullable_scenario3_optionalNonNullable_withJackson3() throws } /** - * Scenario 4 (openApiNullable=true): optional+nullable field must carry - * {@code @field:JsonInclude(JsonInclude.Include.NON_ABSENT)} so that Jackson - * excludes {@code JsonNullable.undefined()} from serialized output. + * Issue #24401: optional+nullable ({@code JsonNullable}) fields must no longer carry + * {@code @field:JsonInclude(NON_ABSENT)} — the JsonNullable module already governs their inclusion. */ - @Test(description = "Scenario 4 – optional+nullable with openApiNullable=true: @JsonInclude(NON_ABSENT) guards undefined from serialization") - public void requiredNullable_scenario4_optionalNullable_hasNonAbsentAnnotation() throws IOException { + @Test(description = "Issue #24401 – optional+nullable with openApiNullable=true: no @JsonInclude annotation") + public void requiredNullable_scenario4_optionalNullable_hasNoJsonIncludeAnnotation() throws IOException { Map files = generateFromContract( "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); Path modelFile = files.get("TestModel.kt").toPath(); - String content = Files.readString(modelFile); - int idx = content.indexOf("val optionalNullable:"); - Assert.assertTrue(idx >= 0, "optionalNullable property must exist"); - // Annotations appear before the val declaration - String context = content.substring(Math.max(0, idx - 300), idx); - Assert.assertTrue(context.contains("@field:JsonInclude(JsonInclude.Include.NON_ABSENT)"), - "optionalNullable must have @field:JsonInclude(NON_ABSENT) to suppress JsonNullable.undefined() from output"); - // Must NOT have NON_NULL — that annotation is only for non-nullable optional fields - Assert.assertFalse(context.contains("@field:JsonInclude(JsonInclude.Include.NON_NULL)"), - "optionalNullable must NOT have @field:JsonInclude(NON_NULL); only non-nullable optionals use NON_NULL"); - assertFileContains(modelFile, "import com.fasterxml.jackson.annotation.JsonInclude"); + // NON_ABSENT must no longer be emitted anywhere + assertFileNotContains(modelFile, "@field:JsonInclude(JsonInclude.Include.NON_ABSENT)"); + // optionalNullable must still be a JsonNullable wrapper + assertFileContains(modelFile, "JsonNullable"); + } + + /** + * Issue #24401 (safe-but-noisy): with no flags set, kotlin-spring defaults to weak/7.23.0 behavior — + * NO policy {@code @field:JsonInclude} or {@code @field:JsonSetter(nulls)} annotations are emitted. + */ + @Test(description = "Issue #24401 – unset flags emit no policy annotations (kotlin-spring)") + public void jsonInclude_unset_emitsNoPolicyAnnotations() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + + Path modelFile = files.get("TestModel.kt").toPath(); + assertFileNotContains(modelFile, "@field:JsonInclude("); + assertFileNotContains(modelFile, "@field:JsonSetter("); + } + + /** + * Issue #24401: default matrix for kotlin-spring. required fields -> ALWAYS, + * optional non-nullable -> NON_NULL (default policy), optional nullable -> no annotation. + */ + @Test(description = "Issue #24401 – default @JsonInclude matrix (kotlin-spring)") + public void jsonInclude_kotlinMatrix_default() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + String content = Files.readString(files.get("TestModel.kt").toPath()); + Assert.assertTrue(jsonIncludeBlockFor(content, "requiredNonNullable").contains("@field:JsonInclude(JsonInclude.Include.ALWAYS)"), + "required non-nullable must be ALWAYS"); + Assert.assertTrue(jsonIncludeBlockFor(content, "requiredNullable").contains("@field:JsonInclude(JsonInclude.Include.ALWAYS)"), + "required nullable must be ALWAYS"); + Assert.assertTrue(jsonIncludeBlockFor(content, "optionalNonNullable").contains("@field:JsonInclude(JsonInclude.Include.NON_NULL)"), + "optional non-nullable must be NON_NULL by default"); + Assert.assertFalse(jsonIncludeBlockFor(content, "optionalNullable").contains("@field:JsonInclude"), + "optional nullable must have no @JsonInclude annotation"); + } + + /** + * Issue #24401: {@code optionalNonNullPropertyJsonInclude=NONE} omits the annotation on optional + * non-nullable properties while keeping the required-field protection. + */ + @Test(description = "Issue #24401 – optionalNonNullPropertyJsonInclude=NONE (kotlin-spring)") + public void jsonInclude_optionalNonNullPolicy_none() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.OPTIONAL_NON_NULL_PROPERTY_JSON_INCLUDE, "NONE")); + + String content = Files.readString(files.get("TestModel.kt").toPath()); + Assert.assertFalse(jsonIncludeBlockFor(content, "optionalNonNullable").contains("@field:JsonInclude"), + "optional non-nullable must have no annotation when policy is NONE"); + Assert.assertTrue(jsonIncludeBlockFor(content, "requiredNonNullable").contains("@field:JsonInclude(JsonInclude.Include.ALWAYS)"), + "required-field protection must still be present"); + } + + /** + * Issue #24401: {@code generateJsonIncludeAnnotations=false} removes ALL policy @JsonInclude + * annotations, including required-field protection. + */ + @Test(description = "Issue #24401 – generateJsonIncludeAnnotations=false removes all policy annotations (kotlin-spring)") + public void jsonInclude_generateJsonIncludeAnnotations_false() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/kotlin/required-nullable-4-states.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + assertFileNotContains(files.get("TestModel.kt").toPath(), "@field:JsonInclude("); + } + + /** + * Issue #24401: a manual per-property {@code x-jackson-json-include-policy} vendor extension always + * overrides the automatic behavior, even when {@code generateJsonIncludeAnnotations=false}. + */ + @Test(description = "Issue #24401 – manual vendor-extension override wins (kotlin-spring)") + public void jsonInclude_manualOverride_winsOverGenerateFlag() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_override.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + String content = Files.readString(files.get("TestModel.kt").toPath()); + Assert.assertTrue(jsonIncludeBlockFor(content, "overridden").contains("@field:JsonInclude(JsonInclude.Include.NON_EMPTY)"), + "manual override must be honored even with generateJsonIncludeAnnotations=false"); + Assert.assertFalse(jsonIncludeBlockFor(content, "plain").contains("@field:JsonInclude"), + "non-overridden field must have no annotation when generateJsonIncludeAnnotations=false"); + } + + /** + * Returns the source region isolating a single property's annotations, bounded by the previous + * property's {@code @get:JsonProperty} marker, so @field:JsonInclude checks are property-specific. + */ + private static String jsonIncludeBlockFor(String content, String propName) { + int end = content.indexOf("@get:JsonProperty(\"" + propName + "\""); + Assert.assertTrue(end >= 0, propName + " property must exist"); + int prev = content.lastIndexOf("@get:JsonProperty(", end - 1); + return content.substring(Math.max(0, prev), end); + } + + /** + * Issue #24401: with one property per schema, each generated model must import exactly the Jackson + * annotations its single property needs. openApiNullable=true so optional nullable uses JsonNullable. + */ + @Test(description = "Issue #24401 – per-schema import isolation (kotlin-spring)") + public void jsonInclude_perSchemaImports() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + final String jsonSetter = "import com.fasterxml.jackson.annotation.JsonSetter"; + final String nulls = "import com.fasterxml.jackson.annotation.Nulls"; + final String jsonNullable = "import org.openapitools.jackson.nullable.JsonNullable"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true", + CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true", + CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true")); + + // required non-nullable -> @field:JsonInclude(ALWAYS); no setter/nullable machinery + Path requiredNonNullable = files.get("RequiredNonNullable.kt").toPath(); + assertFileContains(requiredNonNullable, jsonInclude); + assertFileNotContains(requiredNonNullable, jsonSetter, nulls, jsonNullable); + // required nullable -> @field:JsonInclude(ALWAYS) + Path requiredNullable = files.get("RequiredNullable.kt").toPath(); + assertFileContains(requiredNullable, jsonInclude); + assertFileNotContains(requiredNullable, jsonSetter, nulls, jsonNullable); + // optional non-nullable -> @field:JsonInclude(NON_NULL) + @field:JsonSetter(Nulls.FAIL) + Path optionalNonNullable = files.get("OptionalNonNullable.kt").toPath(); + assertFileContains(optionalNonNullable, jsonInclude, jsonSetter, nulls); + assertFileNotContains(optionalNonNullable, jsonNullable); + // optional nullable with openApiNullable=true -> JsonNullable, NO @field:JsonInclude + Path optionalNullable = files.get("OptionalNullable.kt").toPath(); + assertFileContains(optionalNullable, jsonNullable); + assertFileNotContains(optionalNullable, jsonInclude, jsonSetter, nulls); + } + + /** + * Issue #24401: even with {@code generateJsonIncludeAnnotations=false}, a manual per-property vendor + * extension must still emit its annotation AND the JsonInclude import must be present. + */ + @Test(description = "Issue #24401 – manual override emits import even when annotations disabled (kotlin-spring)") + public void jsonInclude_manualOverride_emitsImport_whenAnnotationsDisabled() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "false")); + + Path manualOverride = files.get("ManualOverride.kt").toPath(); + assertFileContains(manualOverride, jsonInclude); + Assert.assertTrue(jsonIncludeBlockFor(Files.readString(manualOverride), "value") + .contains("@field:JsonInclude(JsonInclude.Include.NON_EMPTY)"), + "manual override must be emitted even when generateJsonIncludeAnnotations=false"); + // A schema without the override must not import JsonInclude when annotations are disabled + assertFileNotContains(files.get("OptionalNonNullable.kt").toPath(), jsonInclude); + } + + /** + * Issue #24401: a forced override on an optional+nullable ({@code JsonNullable}) property must be + * respected — the annotation is emitted and the JsonInclude import is added. + */ + @Test(description = "Issue #24401 – forced override on JsonNullable emits annotation and import (kotlin-spring)") + public void jsonInclude_forcedOverride_onJsonNullable_emitsAnnotationAndImport() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + final String jsonNullable = "import org.openapitools.jackson.nullable.JsonNullable"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.OPENAPI_NULLABLE, "true")); + + Path forced = files.get("ForcedOnJsonNullable.kt").toPath(); + assertFileContains(forced, jsonInclude, jsonNullable, "JsonNullable"); + Assert.assertTrue(jsonIncludeBlockFor(Files.readString(forced), "value") + .contains("@field:JsonInclude(JsonInclude.Include.NON_NULL)"), + "forced override on JsonNullable field must be emitted"); + } + + /** + * Issue #24401: a manual per-property override of {@code NONE} means "emit no annotation". Neither the + * {@code @field:JsonInclude} annotation nor its import may be generated, otherwise the output fails to compile. + */ + @Test(description = "Issue #24401 – manual NONE override emits no annotation or import (kotlin-spring)") + public void jsonInclude_manualOverride_none_emitsNoAnnotationOrImport() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + Path manualNone = files.get("ManualNone.kt").toPath(); + assertFileNotContains(manualNone, jsonInclude); + Assert.assertFalse(Files.readString(manualNone).contains("@field:JsonInclude"), + "manual NONE override must emit no @field:JsonInclude annotation"); + } + + /** + * Issue #24401: a whitespace-padded {@code NONE} override must be treated identically to a bare + * {@code NONE} — the sentinel comparison must trim before checking, otherwise it falls through to + * validation and generation fails for a value that should simply suppress the annotation. + */ + @Test(description = "Issue #24401 – padded NONE override emits no annotation or import (kotlin-spring)") + public void jsonInclude_manualOverride_paddedNone_emitsNoAnnotationOrImport() throws IOException { + final String jsonInclude = "import com.fasterxml.jackson.annotation.JsonInclude"; + + Map files = generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true")); + + Path manualNonePadded = files.get("ManualNonePadded.kt").toPath(); + assertFileNotContains(manualNonePadded, jsonInclude); + Assert.assertFalse(Files.readString(manualNonePadded).contains("@field:JsonInclude"), + "padded NONE override must emit no @field:JsonInclude annotation"); + } + + /** + * Issue #24401: an invalid manual per-property override must fail fast with an actionable error + * during generation rather than emitting uncompilable Kotlin. + */ + @Test(description = "Issue #24401 – invalid manual override fails fast (kotlin-spring)") + public void jsonInclude_manualOverride_invalid_failsWithActionableError() { + Throwable thrown = Assert.expectThrows(Throwable.class, () -> generateFromContract( + "src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml", + Map.of(CodegenConstants.GENERATE_JSON_INCLUDE_ANNOTATIONS, "true"))); + + java.io.StringWriter sw = new java.io.StringWriter(); + thrown.printStackTrace(new java.io.PrintWriter(sw)); + String trace = sw.toString(); + Assert.assertTrue(trace.contains("x-jackson-json-include-policy") && trace.contains("NOT_A_REAL_POLICY"), + "expected an actionable error naming the invalid policy, but got: " + trace); } /** @@ -7182,6 +7558,7 @@ public void testIssue24139NullableRefNoJsonSetterNullsFail() throws IOException Map additionalProperties = new HashMap<>(); additionalProperties.put("useBeanValidation", true); additionalProperties.put("openApiNullable", "true"); + additionalProperties.put(CodegenConstants.GENERATE_JSON_SETTER_NULLS_ANNOTATIONS, "true"); Map files = generateFromContract( "src/test/resources/3_1/issue_24139.yaml", diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java index e6c3d9721e03..7e9c4f786101 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/protobuf/ProtobufSchemaCodegenTest.java @@ -312,7 +312,7 @@ public void unspecifiedEnumValuesAreAdded() { Assert.assertEquals(enumVars1.get(0).get("name"), "UNSPECIFIED"); Assert.assertEquals(enumVars1.get(0).get("value"), "UNSPECIFIED"); - Assert.assertEquals(Boolean.valueOf((String) enumVars1.get(0).get("isString")), false); + Assert.assertEquals(enumVars1.get(0).get("isString"), false); Assert.assertEquals(enumVars1.get(1).get("name"), "FOO"); Assert.assertEquals(enumVars1.get(1).get("value"), "FOO"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scala/Sttp4CodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scala/Sttp4CodegenTest.java index 393965263778..958d9a66aedd 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scala/Sttp4CodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scala/Sttp4CodegenTest.java @@ -151,20 +151,22 @@ public void verifyOneOfSupportWithCirce() throws IOException { Path vehiclePath = Paths.get(outputPath + "/src/main/scala/org/openapitools/client/model/Vehicle.scala"); assertFileContains(vehiclePath, "sealed trait Vehicle"); assertFileContains(vehiclePath, "object Vehicle {"); - assertFileContains(vehiclePath, "// oneOf with discriminator - using semiauto derivation with Configuration"); + assertFileContains(vehiclePath, "// oneOf with discriminator"); assertFileContains(vehiclePath, - "private implicit val config: Configuration = Configuration.default.withDiscriminator(\"vehicleType\")"); - assertFileContains(vehiclePath, "\"Car\" => \"car\""); - assertFileContains(vehiclePath, "\"Truck\" => \"truck\""); + "case obj: Car => obj.asJson.mapObject((\"vehicleType\" -> \"car\".asJson) +: _)"); + assertFileContains(vehiclePath, + "case obj: Truck => obj.asJson.mapObject((\"vehicleType\" -> \"truck\".asJson) +: _)"); + assertFileContains(vehiclePath, "c.downField(\"vehicleType\").as[String].flatMap {"); + assertFileContains(vehiclePath, "case \"car\" => c.as[Car].map(x => x: Vehicle)"); + assertFileContains(vehiclePath, "case \"truck\" => c.as[Truck].map(x => x: Vehicle)"); // Test oneOf with discriminator that is a Scala keyword ("type") // The discriminator should use the original wire name, not the backtick-escaped Scala name Path shapePath = Paths.get(outputPath + "/src/main/scala/org/openapitools/client/model/Shape.scala"); assertFileContains(shapePath, "sealed trait Shape"); - assertFileContains(shapePath, - "private implicit val config: Configuration = Configuration.default.withDiscriminator(\"type\")"); + assertFileContains(shapePath, "c.downField(\"type\").as[String].flatMap {"); // Discriminator in serialization must not be backtick-escaped - assertFileNotContains(shapePath, "withDiscriminator(\"`type`\")"); + assertFileNotContains(shapePath, "`type`"); // Verify regular models are still case classes Path dogPath = Paths.get(outputPath + "/src/main/scala/org/openapitools/client/model/Dog.scala"); @@ -263,8 +265,8 @@ public void verifyOneOfWithEmptyMembers() throws IOException { assertFileContains(eventPath, "case class PurchaseEvent("); assertFileContains(eventPath, "amount: Double"); - // Verify discriminator is configured - assertFileContains(eventPath, "Configuration.default.withDiscriminator(\"eventType\")"); + // Verify the discriminator is written by the sealed trait's encoder + assertFileContains(eventPath, "c.downField(\"eventType\").as[String].flatMap {"); // Verify the discriminator property was removed from inline members // ClickEvent and ViewEvent should have NO properties at all @@ -408,6 +410,103 @@ public void verifyOptionalFieldsOmittedWhenNone() throws IOException { // not serialized as null: strict servers reject explicit null for // non-nullable optional properties. Path petPath = Paths.get(outputPath + "/src/main/scala/org/openapitools/client/model/Pet.scala"); - assertFileContains(petPath, "implicit val encoder: Encoder[Pet] = deriveEncoder[Pet].mapJson(_.dropNullValues)"); + assertFileContains(petPath, "t.tag.map(v => \"tag\" -> v.asJson)"); + assertFileNotContains(petPath, "deriveEncoder"); + } + + @Test + public void verifyCirceCodecsUseOriginalJsonPropertyNames() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/scala/sttp4-mixed-case-fields.yaml", null, new ParseOptions()) + .getOpenAPI(); + + ScalaSttp4ClientCodegen codegen = new ScalaSttp4ClientCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put("jsonLibrary", "circe"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.opts(input).generate(); + + // Scala identifiers stay camelCase; JSON keys are the original spec property names + Path modelPath = Paths.get(outputPath + "/src/main/scala/org/openapitools/client/model/MixedCaseModel.scala"); + assertFileContains(modelPath, "assignmentKey: String"); + assertFileContains(modelPath, "addressLine2: Option[String] = None"); + assertFileContains(modelPath, "Some(\"assignment_key\" -> t.assignmentKey.asJson)"); + assertFileContains(modelPath, "t.firstName.map(v => \"first-name\" -> v.asJson)"); + assertFileContains(modelPath, "t.zipCode.map(v => \"ZipCode\" -> v.asJson)"); + // an already-camelCase property must keep its name, so this stays byte-identical + assertFileContains(modelPath, "t.lastName.map(v => \"lastName\" -> v.asJson)"); + assertFileContains(modelPath, "lastName <- c.downField(\"lastName\").as[Option[String]]"); + assertFileContains(modelPath, "t.addressLine2.map(v => \"address_line_2\" -> v.asJson)"); + assertFileContains(modelPath, "assignmentKey <- c.downField(\"assignment_key\").as[String]"); + assertFileContains(modelPath, "addressLine2 <- c.downField(\"address_line_2\").as[Option[String]]"); + assertFileContains(modelPath, + "bookingStatus <- c.downField(\"booking_status\").as[Option[MixedCaseModelEnums.BookingStatus]]"); + assertFileNotContains(modelPath, "deriveEncoder"); + assertFileNotContains(modelPath, "deriveDecoder"); + + // Inline oneOf members: original names too, and the discriminator property is + // written by the sealed trait rather than carried as a member field + Path paymentPath = Paths.get(outputPath + "/src/main/scala/org/openapitools/client/model/PaymentMethod.scala"); + assertFileContains(paymentPath, "Some(\"card_holder_name\" -> t.cardHolderName.asJson)"); + assertFileContains(paymentPath, "t.lastFourDigits.map(v => \"last-four-digits\" -> v.asJson)"); + assertFileContains(paymentPath, + "case obj: CreditCardPayment => obj.asJson.mapObject((\"payment_type\" -> \"credit_card\".asJson) +: _)"); + assertFileContains(paymentPath, "c.downField(\"payment_type\").as[String].flatMap {"); + assertFileNotContains(paymentPath, "paymentType"); + + // oneOf without a discriminator encodes the bare member. Deriving it produced a + // constructor-name wrapper ({"Circle":{..}}), which is not what oneOf means. + Path shapePath = Paths.get(outputPath + "/src/main/scala/org/openapitools/client/model/Shape.scala"); + assertFileContains(shapePath, "case obj: Circle => obj.asJson"); + assertFileContains(shapePath, "Decoder[Circle].map(x => x: Shape)"); + assertFileNotContains(shapePath, "deriveEncoder"); + } + + @Test + public void verifyModelNamedRequestDoesNotShadowSttpRequest() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/scala/sttp4-request-model-name.yaml", null, new ParseOptions()) + .getOpenAPI(); + + ScalaSttp4ClientCodegen codegen = new ScalaSttp4ClientCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.opts(input).generate(); + + // A model named Request is imported explicitly, which outranks the + // `import sttp.client4._` wildcard, so the return type must be qualified. + Path apiPath = Paths.get(outputPath + "/src/main/scala/org/openapitools/client/api/DefaultApi.scala"); + assertFileContains(apiPath, "import org.openapitools.client.model.Request"); + assertFileContains(apiPath, "): sttp.client4.Request[Either[ResponseException[String], Response]] ="); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/SharedTypeScriptTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/SharedTypeScriptTest.java index 283b3932b5bc..32ce811ebe4d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/SharedTypeScriptTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/SharedTypeScriptTest.java @@ -4,6 +4,7 @@ import java.io.File; import java.io.IOException; +import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -274,6 +275,32 @@ public void givenMapWithArrayOfEnumsThenCorrectEnumNameIsUsed() throws Exception } } + @Test(description = "Issue #23275 - as const enum objects should include trailing commas") + public void generatesTrailingCommasInAsConstEnumObjectsAcrossTypeScriptGenerators() throws Exception { + final String specPath = "src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"; + List generators = Arrays.asList( + "typescript-angular", + "typescript-axios", + "typescript-fetch", + "typescript-nestjs-server" + ); + + for (String generatorName : generators) { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName(generatorName) + .setInputSpec(specPath) + .setOutputDir(output.getAbsolutePath()); + + Generator generator = new DefaultGenerator(); + generator.opts(configurator.toClientOptInput()).generate(); + + assertAsConstObjectsUseTrailingCommas(output.toPath(), generatorName); + } + } + @Test(description = "Issue #22748 - Inner enums should not be double-prefixed when model has parent") public void givenChildModelWithInheritedInnerEnumThenEnumNameIsNotDoublePrefixed() throws Exception { // This tests that when a child model inherits from a parent that has an inner enum property, @@ -310,4 +337,41 @@ public void givenChildModelWithInheritedInnerEnumThenEnumNameIsNotDoublePrefixed "typescript-angular: Should contain 'Employee.ProjectRolesEnum' in " + modelFile); } + private void assertAsConstObjectsUseTrailingCommas(Path root, String generatorName) throws IOException { + final int[] asConstObjectCount = {0}; + + try (Stream paths = Files.walk(root)) { + paths.filter(Files::isRegularFile) + .filter(path -> path.toString().endsWith(".ts")) + .forEach(path -> { + try { + List lines = Files.readAllLines(path); + for (int i = 0; i < lines.size(); i++) { + if (!lines.get(i).strip().equals("} as const;")) { + continue; + } + + asConstObjectCount[0]++; + + int previousLineIndex = i - 1; + while (previousLineIndex >= 0 && lines.get(previousLineIndex).isBlank()) { + previousLineIndex--; + } + + Assert.assertTrue( + previousLineIndex >= 0 && lines.get(previousLineIndex).stripTrailing().endsWith(","), + generatorName + ": Expected trailing comma before '} as const;' in " + path); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + } catch (UncheckedIOException e) { + throw e.getCause(); + } + + Assert.assertTrue(asConstObjectCount[0] > 0, + generatorName + ": Expected generated as const enum objects"); + } + } diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/json-setter-nulls-override-invalid.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/json-setter-nulls-override-invalid.yaml new file mode 100644 index 000000000000..6da3bc472298 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/json-setter-nulls-override-invalid.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + title: Invalid x-jackson-json-setter-nulls value test + version: 1.0.0 +paths: + /test: + post: + operationId: testPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TestModel' + responses: + '200': + description: OK +components: + schemas: + TestModel: + type: object + properties: + bad: + type: string + nullable: false + x-jackson-json-setter-nulls: BOGUS diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/json-setter-nulls-override.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/json-setter-nulls-override.yaml new file mode 100644 index 000000000000..4a09bac4f083 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/json-setter-nulls-override.yaml @@ -0,0 +1,47 @@ +openapi: 3.0.0 +info: + title: Per-property x-jackson-json-setter-nulls override test + version: 1.0.0 +paths: + /test: + post: + operationId: testPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TestModel' + responses: + '200': + description: OK +components: + schemas: + TestModel: + type: object + required: + - requiredForcedFail + properties: + # optional non-nullable with an explicit per-property SKIP override + manualSkip: + type: string + nullable: false + x-jackson-json-setter-nulls: SKIP + # optional non-nullable with an explicit per-property FAIL override + manualFail: + type: string + nullable: false + x-jackson-json-setter-nulls: FAIL + # optional non-nullable with a NONE override: no @JsonSetter must be emitted + manualNone: + type: string + nullable: false + x-jackson-json-setter-nulls: NONE + # required non-nullable forced to FAIL: the override is honored unconditionally + requiredForcedFail: + type: string + nullable: false + x-jackson-json-setter-nulls: FAIL + # a plain optional non-nullable property with no override for contrast + plainOptional: + type: string + nullable: false diff --git a/modules/openapi-generator/src/test/resources/3_0/scala/sttp4-mixed-case-fields.yaml b/modules/openapi-generator/src/test/resources/3_0/scala/sttp4-mixed-case-fields.yaml new file mode 100644 index 000000000000..8bb63223a5ab --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/scala/sttp4-mixed-case-fields.yaml @@ -0,0 +1,94 @@ +openapi: 3.0.0 +info: + title: sttp4 mixed case fields + version: 1.0.0 +paths: + /bookings: + post: + operationId: createBooking + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MixedCaseModel' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethod' +components: + schemas: + MixedCaseModel: + type: object + required: + - assignment_key + properties: + assignment_key: + type: string + first-name: + type: string + phone_number: + type: string + lastName: + type: string + ZipCode: + type: string + address_line_2: + type: string + trip_summary: + $ref: '#/components/schemas/TripSummary' + booking_status: + type: string + enum: + - pending + - confirmed + TripSummary: + type: object + properties: + departure_airport_code: + type: string + PaymentMethod: + oneOf: + - $ref: '#/components/schemas/CreditCardPayment' + - $ref: '#/components/schemas/BankTransferPayment' + discriminator: + propertyName: payment_type + mapping: + credit_card: '#/components/schemas/CreditCardPayment' + bank_transfer: '#/components/schemas/BankTransferPayment' + CreditCardPayment: + type: object + required: + - card_holder_name + properties: + payment_type: + type: string + card_holder_name: + type: string + last-four-digits: + type: string + BankTransferPayment: + type: object + properties: + payment_type: + type: string + account_holder_name: + type: string + Shape: + oneOf: + - $ref: '#/components/schemas/Circle' + - $ref: '#/components/schemas/Square' + Circle: + type: object + required: + - radius_cm + properties: + radius_cm: + type: number + Square: + type: object + properties: + side_length: + type: number diff --git a/modules/openapi-generator/src/test/resources/3_0/scala/sttp4-request-model-name.yaml b/modules/openapi-generator/src/test/resources/3_0/scala/sttp4-request-model-name.yaml new file mode 100644 index 000000000000..831244fbbc12 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/scala/sttp4-request-model-name.yaml @@ -0,0 +1,34 @@ +openapi: 3.0.0 +info: + title: sttp4 model named Request + version: 1.0.0 +paths: + /predict: + post: + operationId: predict + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Request' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Response' +components: + schemas: + Request: + type: object + required: + - userId + properties: + userId: + type: string + Response: + type: object + properties: + score: + type: number diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml new file mode 100644 index 000000000000..39d6b3ed12eb --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_invalid_override.yaml @@ -0,0 +1,28 @@ +openapi: 3.0.0 +info: + title: JsonInclude invalid manual override test + version: 1.0.0 + description: > + A single schema whose property carries an invalid x-jackson-json-include-policy value. + Generation must fail fast with an actionable error rather than emitting uncompilable output. +paths: + /test: + post: + operationId: testPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvalidOverride' + responses: + '200': + description: OK +components: + schemas: + InvalidOverride: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-include-policy: NOT_A_REAL_POLICY diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_override.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_override.yaml new file mode 100644 index 000000000000..c39028982365 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_override.yaml @@ -0,0 +1,30 @@ +openapi: 3.0.0 +info: + title: JsonInclude manual override test + version: 1.0.0 +paths: + /test: + post: + operationId: testPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TestModel' + responses: + '200': + description: OK +components: + schemas: + TestModel: + type: object + properties: + # Manual per-property override via the universal vendor extension. + overridden: + type: string + nullable: false + x-jackson-json-include-policy: NON_EMPTY + # No override: with generateJsonIncludeAnnotations=false this must get no annotation. + plain: + type: string + nullable: false diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml new file mode 100644 index 000000000000..60c7ddac8262 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24401_json_include_per_schema.yaml @@ -0,0 +1,133 @@ +openapi: 3.0.0 +info: + title: JsonInclude per-schema import isolation test + version: 1.0.0 + description: > + Each schema holds exactly one property covering one required/optional x + nullable/non-nullable combination. Isolating a single case per model ensures the + generated imports (JsonInclude, JsonSetter, Nulls, JsonNullable) are correct for + every case on their own, without another property masking a missing import. +paths: + /test: + post: + operationId: testPost + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequiredNonNullable' + responses: + '200': + description: OK +components: + schemas: + # required + non-nullable + RequiredNonNullable: + type: object + required: + - value + properties: + value: + type: string + nullable: false + # required + nullable + RequiredNullable: + type: object + required: + - value + properties: + value: + type: string + nullable: true + # optional + non-nullable + OptionalNonNullable: + type: object + properties: + value: + type: string + nullable: false + # optional + non-nullable with a default value + OptionalNonNullableWithDefault: + type: object + properties: + value: + type: string + nullable: false + default: "defaultValue" + # optional + nullable + OptionalNullable: + type: object + properties: + value: + type: string + nullable: true + # manual per-property override: even with generateJsonIncludeAnnotations=false the + # annotation (and its import) must still be emitted from the vendor extension. + ManualOverride: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-include-policy: NON_EMPTY + # forced override on an optional + nullable (JsonNullable) property: the automatic path emits + # nothing here, but an explicit vendor extension must be respected and its import added. + ForcedOnJsonNullable: + type: object + properties: + value: + type: string + nullable: true + x-jackson-json-include-policy: NON_NULL + # manual per-property override of NONE: the sentinel means "emit no annotation", so neither the + # @JsonInclude annotation nor its import must be generated (otherwise the output fails to compile). + ManualNone: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-include-policy: NONE + # manual per-property override of NONE padded with whitespace: must be treated identically to a + # bare NONE (normalization must trim before comparing), i.e. emit no annotation, no validation error. + ManualNonePadded: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-include-policy: " NONE " + # per-property @JsonSetter(nulls) override: SKIP on an optional non-nullable property. + SetterNullsManualSkip: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-setter-nulls: SKIP + # per-property @JsonSetter(nulls) override: FAIL on an optional non-nullable property. + SetterNullsManualFail: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-setter-nulls: FAIL + # per-property @JsonSetter(nulls) override: NONE means emit no annotation (and no import). + SetterNullsManualNone: + type: object + properties: + value: + type: string + nullable: false + x-jackson-json-setter-nulls: NONE + # per-property @JsonSetter(nulls) override forced on a required property: honored unconditionally. + SetterNullsForcedOnRequired: + type: object + required: + - value + properties: + value: + type: string + nullable: false + x-jackson-json-setter-nulls: FAIL diff --git a/modules/openapi-generator/src/test/resources/3_1/simplifyOneOfAnyOf_test.yaml b/modules/openapi-generator/src/test/resources/3_1/simplifyOneOfAnyOf_test.yaml index bf8dc407b9ef..6e6c028f8d91 100644 --- a/modules/openapi-generator/src/test/resources/3_1/simplifyOneOfAnyOf_test.yaml +++ b/modules/openapi-generator/src/test/resources/3_1/simplifyOneOfAnyOf_test.yaml @@ -150,4 +150,13 @@ components: OneOfNullAndRef3: oneOf: - $ref: '#/components/schemas/Parent' - - type: "null" \ No newline at end of file + - type: "null" + StringPatternsWithOneOf: + type: string + oneOf: + - type: string + description: Numeric identifier + pattern: '^\d{1,35}$' + - type: string + description: UUID identifier + pattern: '^[0-9a-f-]{36}$' \ No newline at end of file diff --git a/samples/client/echo_api/csharp/restsharp/net8/EchoApi/git_push.sh b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/csharp/restsharp/net8/EchoApi/git_push.sh +++ b/samples/client/echo_api/csharp/restsharp/net8/EchoApi/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/go-external-refs/git_push.sh b/samples/client/echo_api/go-external-refs/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/go-external-refs/git_push.sh +++ b/samples/client/echo_api/go-external-refs/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/go/git_push.sh b/samples/client/echo_api/go/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/go/git_push.sh +++ b/samples/client/echo_api/go/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/java/apache-httpclient/git_push.sh b/samples/client/echo_api/java/apache-httpclient/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/java/apache-httpclient/git_push.sh +++ b/samples/client/echo_api/java/apache-httpclient/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/java/feign-gson/git_push.sh b/samples/client/echo_api/java/feign-gson/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/java/feign-gson/git_push.sh +++ b/samples/client/echo_api/java/feign-gson/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/java/native/git_push.sh b/samples/client/echo_api/java/native/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/java/native/git_push.sh +++ b/samples/client/echo_api/java/native/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/git_push.sh b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/git_push.sh +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/java/okhttp-gson/git_push.sh b/samples/client/echo_api/java/okhttp-gson/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/java/okhttp-gson/git_push.sh +++ b/samples/client/echo_api/java/okhttp-gson/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/java/restclient/git_push.sh b/samples/client/echo_api/java/restclient/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/java/restclient/git_push.sh +++ b/samples/client/echo_api/java/restclient/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/java/resteasy/git_push.sh b/samples/client/echo_api/java/resteasy/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/java/resteasy/git_push.sh +++ b/samples/client/echo_api/java/resteasy/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/java/resttemplate/git_push.sh b/samples/client/echo_api/java/resttemplate/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/java/resttemplate/git_push.sh +++ b/samples/client/echo_api/java/resttemplate/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/php-nextgen-streaming/git_push.sh b/samples/client/echo_api/php-nextgen-streaming/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/php-nextgen-streaming/git_push.sh +++ b/samples/client/echo_api/php-nextgen-streaming/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/php-nextgen/git_push.sh b/samples/client/echo_api/php-nextgen/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/php-nextgen/git_push.sh +++ b/samples/client/echo_api/php-nextgen/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/git_push.sh b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/git_push.sh +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/python-pydantic-v1/git_push.sh b/samples/client/echo_api/python-pydantic-v1/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/python-pydantic-v1/git_push.sh +++ b/samples/client/echo_api/python-pydantic-v1/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/python/git_push.sh b/samples/client/echo_api/python/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/python/git_push.sh +++ b/samples/client/echo_api/python/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/r/git_push.sh b/samples/client/echo_api/r/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/r/git_push.sh +++ b/samples/client/echo_api/r/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/ruby-faraday/git_push.sh b/samples/client/echo_api/ruby-faraday/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/ruby-faraday/git_push.sh +++ b/samples/client/echo_api/ruby-faraday/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/ruby-httpx/git_push.sh b/samples/client/echo_api/ruby-httpx/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/ruby-httpx/git_push.sh +++ b/samples/client/echo_api/ruby-httpx/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/ruby-typhoeus/git_push.sh b/samples/client/echo_api/ruby-typhoeus/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/ruby-typhoeus/git_push.sh +++ b/samples/client/echo_api/ruby-typhoeus/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/echo_api/typescript-axios/build/git_push.sh b/samples/client/echo_api/typescript-axios/build/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/echo_api/typescript-axios/build/git_push.sh +++ b/samples/client/echo_api/typescript-axios/build/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/crystal-qdrant/git_push.sh b/samples/client/others/crystal-qdrant/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/crystal-qdrant/git_push.sh +++ b/samples/client/others/crystal-qdrant/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/csharp-complex-files/git_push.sh b/samples/client/others/csharp-complex-files/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/csharp-complex-files/git_push.sh +++ b/samples/client/others/csharp-complex-files/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/git_push.sh b/samples/client/others/go/allof_multiple_ref_and_discriminator/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/go/allof_multiple_ref_and_discriminator/git_push.sh +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/go/issue_20079_go_regex_wrongly_translated/git_push.sh b/samples/client/others/go/issue_20079_go_regex_wrongly_translated/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/go/issue_20079_go_regex_wrongly_translated/git_push.sh +++ b/samples/client/others/go/issue_20079_go_regex_wrongly_translated/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/go/oneof-anyof-required/git_push.sh b/samples/client/others/go/oneof-anyof-required/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/go/oneof-anyof-required/git_push.sh +++ b/samples/client/others/go/oneof-anyof-required/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/go/oneof-anyof-required/model_object.go b/samples/client/others/go/oneof-anyof-required/model_object.go index 946783e59f0f..5c71521f1702 100644 --- a/samples/client/others/go/oneof-anyof-required/model_object.go +++ b/samples/client/others/go/oneof-anyof-required/model_object.go @@ -84,16 +84,11 @@ func (dst *Object) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(Object): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(Object)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(Object): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(Object)") - } + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf(Object): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf(Object)") } } diff --git a/samples/client/others/go/oneof-discriminator-lookup/git_push.sh b/samples/client/others/go/oneof-discriminator-lookup/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/go/oneof-discriminator-lookup/git_push.sh +++ b/samples/client/others/go/oneof-discriminator-lookup/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/git_push.sh b/samples/client/others/java/jersey2-oneOf-Mixed/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/git_push.sh +++ b/samples/client/others/java/jersey2-oneOf-Mixed/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/git_push.sh b/samples/client/others/java/jersey2-oneOf-duplicates/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/git_push.sh +++ b/samples/client/others/java/jersey2-oneOf-duplicates/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/okhttp-gson-oneOf-array/git_push.sh b/samples/client/others/java/okhttp-gson-oneOf-array/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/okhttp-gson-oneOf-array/git_push.sh +++ b/samples/client/others/java/okhttp-gson-oneOf-array/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/okhttp-gson-oneOf/git_push.sh b/samples/client/others/java/okhttp-gson-oneOf/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/git_push.sh +++ b/samples/client/others/java/okhttp-gson-oneOf/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/okhttp-gson-streaming/git_push.sh b/samples/client/others/java/okhttp-gson-streaming/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/okhttp-gson-streaming/git_push.sh +++ b/samples/client/others/java/okhttp-gson-streaming/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/restclient-enum-in-multipart/git_push.sh b/samples/client/others/java/restclient-enum-in-multipart/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/restclient-enum-in-multipart/git_push.sh +++ b/samples/client/others/java/restclient-enum-in-multipart/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/restclient-jackson-default-impl/src/main/java/org/openapitools/client/ExceptionProvider.java b/samples/client/others/java/restclient-jackson-default-impl/src/main/java/org/openapitools/client/ExceptionProvider.java new file mode 100644 index 000000000000..d6147533b9f6 --- /dev/null +++ b/samples/client/others/java/restclient-jackson-default-impl/src/main/java/org/openapitools/client/ExceptionProvider.java @@ -0,0 +1,80 @@ +/* + * Jackson defaultImpl oneOf sample + * Sample spec exercising Jackson @JsonTypeInfo(defaultImpl = ...) on oneOf interfaces, driven by the x-jackson-default-impl vendor extension (spec-based) and the typeInfoDefaultImpls generator option (config-based). + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import org.springframework.web.client.RestClientException; +import java.text.ParseException; + +/** + * Extension point for customizing exceptions thrown by the generated API client. + *

+ * The default implementation throws {@link RuntimeException}. To use custom exception + * types, implement this interface and pass the instance to + * {@link ApiClient#setExceptionProvider(ExceptionProvider)}. + *

+ *
{@code
+ * apiClient.setExceptionProvider(new ExceptionProvider() {
+ *     public RuntimeException bearerAuthException() {
+ *         return new MyAuthException("No Bearer authentication configured!");
+ *     }
+ * });
+ * }
+ */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") +public interface ExceptionProvider { + + /** Returns an exception indicating that no Bearer authentication is configured. */ + default RuntimeException bearerAuthException() { + return new RuntimeException("No Bearer authentication configured!"); + } + + /** Returns an exception indicating that no HTTP basic authentication is configured. */ + default RuntimeException httpBasicAuthException() { + return new RuntimeException("No HTTP basic authentication configured!"); + } + + /** Returns an exception indicating that no API key authentication is configured. */ + default RuntimeException apiKeyAuthException() { + return new RuntimeException("No API key authentication configured!"); + } + + /** Returns an exception indicating that no OAuth2 authentication is configured. */ + default RuntimeException oAuth2Exception() { + return new RuntimeException("No OAuth2 authentication configured!"); + } + + /** Wraps a date/time parse exception. */ + default RuntimeException dateTimeException(ParseException e) { + return new RuntimeException(e); + } + + /** Wraps a Jackson serialization/deserialization exception. */ + default RuntimeException jacksonException(Exception e) { + return new RuntimeException(e); + } + + /** + * Returns an exception indicating that the requested authentication scheme is not configured. + * + * @param authName the name of the authentication scheme that could not be found + * @return a {@link RestClientException} describing the missing authentication + */ + default RestClientException undefinedAuthenticationException(String authName) { + return new RestClientException("Authentication undefined: " + authName); + } + + /** The default {@link ExceptionProvider} instance. */ + ExceptionProvider DEFAULT = new ExceptionProvider() {}; + +} \ No newline at end of file diff --git a/samples/client/others/java/restclient-sealedInterface/git_push.sh b/samples/client/others/java/restclient-sealedInterface/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/restclient-sealedInterface/git_push.sh +++ b/samples/client/others/java/restclient-sealedInterface/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/git_push.sh b/samples/client/others/java/restclient-useAbstractionForFiles/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/restclient-useAbstractionForFiles/git_push.sh +++ b/samples/client/others/java/restclient-useAbstractionForFiles/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/resttemplate-list-schema-validation/git_push.sh b/samples/client/others/java/resttemplate-list-schema-validation/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/resttemplate-list-schema-validation/git_push.sh +++ b/samples/client/others/java/resttemplate-list-schema-validation/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/git_push.sh b/samples/client/others/java/resttemplate-useAbstractionForFiles/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/resttemplate-useAbstractionForFiles/git_push.sh +++ b/samples/client/others/java/resttemplate-useAbstractionForFiles/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/webclient-sealedInterface/git_push.sh b/samples/client/others/java/webclient-sealedInterface/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/webclient-sealedInterface/git_push.sh +++ b/samples/client/others/java/webclient-sealedInterface/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/webclient-sealedInterface_3_1/git_push.sh b/samples/client/others/java/webclient-sealedInterface_3_1/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/webclient-sealedInterface_3_1/git_push.sh +++ b/samples/client/others/java/webclient-sealedInterface_3_1/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/git_push.sh b/samples/client/others/java/webclient-useAbstractionForFiles/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/git_push.sh +++ b/samples/client/others/java/webclient-useAbstractionForFiles/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/python-legacy-model-dictionaries/git_push.sh b/samples/client/others/python-legacy-model-dictionaries/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/python-legacy-model-dictionaries/git_push.sh +++ b/samples/client/others/python-legacy-model-dictionaries/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/hyper/api-with-ref-param/git_push.sh b/samples/client/others/rust/hyper/api-with-ref-param/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/git_push.sh +++ b/samples/client/others/rust/hyper/api-with-ref-param/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/hyper/composed-oneof/git_push.sh b/samples/client/others/rust/hyper/composed-oneof/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/hyper/composed-oneof/git_push.sh +++ b/samples/client/others/rust/hyper/composed-oneof/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/hyper/emptyObject/git_push.sh b/samples/client/others/rust/hyper/emptyObject/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/hyper/emptyObject/git_push.sh +++ b/samples/client/others/rust/hyper/emptyObject/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/hyper/oneOf-array-map/git_push.sh b/samples/client/others/rust/hyper/oneOf-array-map/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/git_push.sh +++ b/samples/client/others/rust/hyper/oneOf-array-map/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/git_push.sh b/samples/client/others/rust/hyper/oneOf-reuseRef/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/git_push.sh +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/hyper/oneOf/git_push.sh b/samples/client/others/rust/hyper/oneOf/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/hyper/oneOf/git_push.sh +++ b/samples/client/others/rust/hyper/oneOf/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest-regression-16119/git_push.sh b/samples/client/others/rust/reqwest-regression-16119/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest-regression-16119/git_push.sh +++ b/samples/client/others/rust/reqwest-regression-16119/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/api-with-ref-param/git_push.sh b/samples/client/others/rust/reqwest/api-with-ref-param/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/api-with-ref-param/git_push.sh +++ b/samples/client/others/rust/reqwest/api-with-ref-param/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/composed-oneof/git_push.sh b/samples/client/others/rust/reqwest/composed-oneof/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/git_push.sh +++ b/samples/client/others/rust/reqwest/composed-oneof/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/emptyObject/git_push.sh b/samples/client/others/rust/reqwest/emptyObject/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/emptyObject/git_push.sh +++ b/samples/client/others/rust/reqwest/emptyObject/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/enum-query-params/git_push.sh b/samples/client/others/rust/reqwest/enum-query-params/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/enum-query-params/git_push.sh +++ b/samples/client/others/rust/reqwest/enum-query-params/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/multipart-async/git_push.sh b/samples/client/others/rust/reqwest/multipart-async/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/multipart-async/git_push.sh +++ b/samples/client/others/rust/reqwest/multipart-async/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/nullable-enum-query-params/git_push.sh b/samples/client/others/rust/reqwest/nullable-enum-query-params/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/nullable-enum-query-params/git_push.sh +++ b/samples/client/others/rust/reqwest/nullable-enum-query-params/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/git_push.sh b/samples/client/others/rust/reqwest/oneOf-array-map/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/git_push.sh +++ b/samples/client/others/rust/reqwest/oneOf-array-map/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/git_push.sh b/samples/client/others/rust/reqwest/oneOf-reuseRef/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/git_push.sh +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/rust/reqwest/oneOf/git_push.sh b/samples/client/others/rust/reqwest/oneOf/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/rust/reqwest/oneOf/git_push.sh +++ b/samples/client/others/rust/reqwest/oneOf/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/typescript-angular-v20/builds/query-param-deep-object/git_push.sh b/samples/client/others/typescript-angular-v20/builds/query-param-deep-object/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/typescript-angular-v20/builds/query-param-deep-object/git_push.sh +++ b/samples/client/others/typescript-angular-v20/builds/query-param-deep-object/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/typescript-angular-v20/builds/query-param-form/git_push.sh b/samples/client/others/typescript-angular-v20/builds/query-param-form/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/typescript-angular-v20/builds/query-param-form/git_push.sh +++ b/samples/client/others/typescript-angular-v20/builds/query-param-form/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/typescript-angular-v20/builds/query-param-json/git_push.sh b/samples/client/others/typescript-angular-v20/builds/query-param-json/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/typescript-angular-v20/builds/query-param-json/git_push.sh +++ b/samples/client/others/typescript-angular-v20/builds/query-param-json/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/typescript-angular-v20/builds/query-param-json/model/pageable.ts b/samples/client/others/typescript-angular-v20/builds/query-param-json/model/pageable.ts index 4fe243b677ca..da238a5befeb 100644 --- a/samples/client/others/typescript-angular-v20/builds/query-param-json/model/pageable.ts +++ b/samples/client/others/typescript-angular-v20/builds/query-param-json/model/pageable.ts @@ -33,7 +33,7 @@ export interface Pageable { export namespace Pageable { export const SortDirectionEnum = { Asc: 'ASC', - Desc: 'DESC' + Desc: 'DESC', } as const; export type SortDirectionEnum = typeof SortDirectionEnum[keyof typeof SortDirectionEnum]; } diff --git a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/git_push.sh b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/git_push.sh +++ b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/typescript-angular/builds/composed-schemas/git_push.sh b/samples/client/others/typescript-angular/builds/composed-schemas/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas/git_push.sh +++ b/samples/client/others/typescript-angular/builds/composed-schemas/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/git_push.sh b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/git_push.sh +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestObjectType.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestObjectType.ts index f3fc7cdfe944..320554c3f71d 100644 --- a/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestObjectType.ts +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestObjectType.ts @@ -20,7 +20,7 @@ export const TestObjectType = { TEST1: 'TEST1', TEST2: 'TEST2', - unknown_default_open_api: '11184809' + unknown_default_open_api: '11184809', } as const; export type TestObjectType = typeof TestObjectType[keyof typeof TestObjectType]; diff --git a/samples/client/others/typescript-node/encode-decode/build/git_push.sh b/samples/client/others/typescript-node/encode-decode/build/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/others/typescript-node/encode-decode/build/git_push.sh +++ b/samples/client/others/typescript-node/encode-decode/build/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/R-httr2-wrapper/git_push.sh b/samples/client/petstore/R-httr2-wrapper/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/R-httr2-wrapper/git_push.sh +++ b/samples/client/petstore/R-httr2-wrapper/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/R-httr2/git_push.sh b/samples/client/petstore/R-httr2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/R-httr2/git_push.sh +++ b/samples/client/petstore/R-httr2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/R/git_push.sh b/samples/client/petstore/R/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/R/git_push.sh +++ b/samples/client/petstore/R/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/cpp-restsdk/client/git_push.sh b/samples/client/petstore/cpp-restsdk/client/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/cpp-restsdk/client/git_push.sh +++ b/samples/client/petstore/cpp-restsdk/client/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/crystal/git_push.sh b/samples/client/petstore/crystal/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/crystal/git_push.sh +++ b/samples/client/petstore/crystal/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/api/openapi.yaml b/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/api/openapi.yaml index da6dae64572d..b657d7bc953c 100644 --- a/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/latest/AnnotatedEnum/api/openapi.yaml @@ -131,6 +131,8 @@ components: allOf: - $ref: "#/components/schemas/Parent" nullable: true + StringPatternsWithOneOf: + type: string ParentWithPluralOneOfProperty_number: oneOf: - $ref: "#/components/schemas/Number" diff --git a/samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi/git_push.sh b/samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi/git_push.sh +++ b/samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/httpclient/net10/Petstore/git_push.sh b/samples/client/petstore/csharp/httpclient/net10/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/httpclient/net10/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/httpclient/net10/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi/git_push.sh b/samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi/git_push.sh +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/httpclient/net9/Petstore/git_push.sh b/samples/client/petstore/csharp/httpclient/net9/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/git_push.sh b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/git_push.sh b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/git_push.sh b/samples/client/petstore/csharp/restsharp/net10/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net10/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/git_push.sh b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/git_push.sh b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/git_push.sh b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net8/EnumMappings/git_push.sh b/samples/client/petstore/csharp/restsharp/net8/EnumMappings/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net8/EnumMappings/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net8/EnumMappings/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net8/ParameterMappings/git_push.sh b/samples/client/petstore/csharp/restsharp/net8/ParameterMappings/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net8/ParameterMappings/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net8/ParameterMappings/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net8/Petstore/git_push.sh b/samples/client/petstore/csharp/restsharp/net8/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net8/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net8/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/git_push.sh b/samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net8/useVirtualForHooks/git_push.sh b/samples/client/petstore/csharp/restsharp/net8/useVirtualForHooks/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net8/useVirtualForHooks/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net8/useVirtualForHooks/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/net9/EnumMappings/git_push.sh b/samples/client/petstore/csharp/restsharp/net9/EnumMappings/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/net9/EnumMappings/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/net9/EnumMappings/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/git_push.sh b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/git_push.sh b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/unityWebRequest/net10/Petstore/git_push.sh b/samples/client/petstore/csharp/unityWebRequest/net10/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net10/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/unityWebRequest/net10/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/git_push.sh b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/git_push.sh b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/git_push.sh +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/go/go-petstore/git_push.sh b/samples/client/petstore/go/go-petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/go/go-petstore/git_push.sh +++ b/samples/client/petstore/go/go-petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/haskell-http-client/git_push.sh b/samples/client/petstore/haskell-http-client/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/haskell-http-client/git_push.sh +++ b/samples/client/petstore/haskell-http-client/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/apache-httpclient-jackson3/git_push.sh b/samples/client/petstore/java/apache-httpclient-jackson3/git_push.sh index f53a75d4fabe..a35991cd51a1 100755 --- a/samples/client/petstore/java/apache-httpclient-jackson3/git_push.sh +++ b/samples/client/petstore/java/apache-httpclient-jackson3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/apache-httpclient/git_push.sh b/samples/client/petstore/java/apache-httpclient/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/apache-httpclient/git_push.sh +++ b/samples/client/petstore/java/apache-httpclient/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/feign-hc5/git_push.sh b/samples/client/petstore/java/feign-hc5/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/feign-hc5/git_push.sh +++ b/samples/client/petstore/java/feign-hc5/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/feign-no-nullable/git_push.sh b/samples/client/petstore/java/feign-no-nullable/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/feign-no-nullable/git_push.sh +++ b/samples/client/petstore/java/feign-no-nullable/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/feign/git_push.sh b/samples/client/petstore/java/feign/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/feign/git_push.sh +++ b/samples/client/petstore/java/feign/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/google-api-client/git_push.sh b/samples/client/petstore/java/google-api-client/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/google-api-client/git_push.sh +++ b/samples/client/petstore/java/google-api-client/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/git_push.sh b/samples/client/petstore/java/jersey2-java8-localdatetime/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/git_push.sh +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/jersey2-java8/git_push.sh b/samples/client/petstore/java/jersey2-java8/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/jersey2-java8/git_push.sh +++ b/samples/client/petstore/java/jersey2-java8/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/jersey3-jackson3/git_push.sh b/samples/client/petstore/java/jersey3-jackson3/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/jersey3-jackson3/git_push.sh +++ b/samples/client/petstore/java/jersey3-jackson3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/jersey3-oneOf/git_push.sh b/samples/client/petstore/java/jersey3-oneOf/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/jersey3-oneOf/git_push.sh +++ b/samples/client/petstore/java/jersey3-oneOf/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/jersey3/git_push.sh b/samples/client/petstore/java/jersey3/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/jersey3/git_push.sh +++ b/samples/client/petstore/java/jersey3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/native-async/git_push.sh b/samples/client/petstore/java/native-async/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/native-async/git_push.sh +++ b/samples/client/petstore/java/native-async/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/native-jackson3-jspecify/git_push.sh b/samples/client/petstore/java/native-jackson3-jspecify/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/git_push.sh +++ b/samples/client/petstore/java/native-jackson3-jspecify/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/native-jackson3/git_push.sh b/samples/client/petstore/java/native-jackson3/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/native-jackson3/git_push.sh +++ b/samples/client/petstore/java/native-jackson3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/native-jakarta/git_push.sh b/samples/client/petstore/java/native-jakarta/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/native-jakarta/git_push.sh +++ b/samples/client/petstore/java/native-jakarta/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/native-useGzipFeature/git_push.sh b/samples/client/petstore/java/native-useGzipFeature/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/native-useGzipFeature/git_push.sh +++ b/samples/client/petstore/java/native-useGzipFeature/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/native/git_push.sh b/samples/client/petstore/java/native/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/native/git_push.sh +++ b/samples/client/petstore/java/native/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/git_push.sh b/samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-3.1/git_push.sh b/samples/client/petstore/java/okhttp-gson-3.1/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-3.1/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/git_push.sh b/samples/client/petstore/java/okhttp-gson-awsv4signature/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/git_push.sh b/samples/client/petstore/java/okhttp-gson-dynamicOperations/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/git_push.sh b/samples/client/petstore/java/okhttp-gson-group-parameter/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/git_push.sh b/samples/client/petstore/java/okhttp-gson-nullable-required/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh b/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/git_push.sh b/samples/client/petstore/java/okhttp-gson-swagger1/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-swagger1/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/git_push.sh b/samples/client/petstore/java/okhttp-gson-swagger2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-swagger2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/okhttp-gson/git_push.sh b/samples/client/petstore/java/okhttp-gson/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/okhttp-gson/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/rest-assured-jackson/git_push.sh b/samples/client/petstore/java/rest-assured-jackson/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/git_push.sh +++ b/samples/client/petstore/java/rest-assured-jackson/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/rest-assured/git_push.sh b/samples/client/petstore/java/rest-assured/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/rest-assured/git_push.sh +++ b/samples/client/petstore/java/rest-assured/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient-nullable-arrays/git_push.sh b/samples/client/petstore/java/restclient-nullable-arrays/git_push.sh index f53a75d4fabe..a35991cd51a1 100755 --- a/samples/client/petstore/java/restclient-nullable-arrays/git_push.sh +++ b/samples/client/petstore/java/restclient-nullable-arrays/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson2/git_push.sh b/samples/client/petstore/java/restclient-springBoot4-jackson2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson2/git_push.sh +++ b/samples/client/petstore/java/restclient-springBoot4-jackson2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/git_push.sh b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/git_push.sh +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/git_push.sh b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/git_push.sh +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3/git_push.sh b/samples/client/petstore/java/restclient-springBoot4-jackson3/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3/git_push.sh +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient-swagger2/git_push.sh b/samples/client/petstore/java/restclient-swagger2/git_push.sh index f53a75d4fabe..a35991cd51a1 100755 --- a/samples/client/petstore/java/restclient-swagger2/git_push.sh +++ b/samples/client/petstore/java/restclient-swagger2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/git_push.sh b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/git_push.sh +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter/git_push.sh b/samples/client/petstore/java/restclient-useSingleRequestParameter/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/restclient-useSingleRequestParameter/git_push.sh +++ b/samples/client/petstore/java/restclient-useSingleRequestParameter/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/restclient/git_push.sh b/samples/client/petstore/java/restclient/git_push.sh index f53a75d4fabe..a35991cd51a1 100755 --- a/samples/client/petstore/java/restclient/git_push.sh +++ b/samples/client/petstore/java/restclient/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resteasy/git_push.sh b/samples/client/petstore/java/resteasy/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resteasy/git_push.sh +++ b/samples/client/petstore/java/resteasy/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resttemplate-jakarta/git_push.sh b/samples/client/petstore/java/resttemplate-jakarta/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/git_push.sh +++ b/samples/client/petstore/java/resttemplate-jakarta/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson2/git_push.sh b/samples/client/petstore/java/resttemplate-springBoot4-jackson2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson2/git_push.sh +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/git_push.sh b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/git_push.sh +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3/git_push.sh b/samples/client/petstore/java/resttemplate-springBoot4-jackson3/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3/git_push.sh +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resttemplate-swagger1/git_push.sh b/samples/client/petstore/java/resttemplate-swagger1/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/git_push.sh +++ b/samples/client/petstore/java/resttemplate-swagger1/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resttemplate-swagger2/git_push.sh b/samples/client/petstore/java/resttemplate-swagger2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/git_push.sh +++ b/samples/client/petstore/java/resttemplate-swagger2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resttemplate-withXml/git_push.sh b/samples/client/petstore/java/resttemplate-withXml/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/git_push.sh +++ b/samples/client/petstore/java/resttemplate-withXml/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/resttemplate/git_push.sh b/samples/client/petstore/java/resttemplate/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/resttemplate/git_push.sh +++ b/samples/client/petstore/java/resttemplate/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/retrofit2-play26/git_push.sh b/samples/client/petstore/java/retrofit2-play26/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/retrofit2-play26/git_push.sh +++ b/samples/client/petstore/java/retrofit2-play26/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/retrofit2/git_push.sh b/samples/client/petstore/java/retrofit2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/retrofit2/git_push.sh +++ b/samples/client/petstore/java/retrofit2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/retrofit2rx2/git_push.sh b/samples/client/petstore/java/retrofit2rx2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/retrofit2rx2/git_push.sh +++ b/samples/client/petstore/java/retrofit2rx2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/retrofit2rx3/git_push.sh b/samples/client/petstore/java/retrofit2rx3/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/retrofit2rx3/git_push.sh +++ b/samples/client/petstore/java/retrofit2rx3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/vertx-no-nullable/git_push.sh b/samples/client/petstore/java/vertx-no-nullable/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/git_push.sh +++ b/samples/client/petstore/java/vertx-no-nullable/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/vertx-supportVertxFuture/git_push.sh b/samples/client/petstore/java/vertx-supportVertxFuture/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/vertx-supportVertxFuture/git_push.sh +++ b/samples/client/petstore/java/vertx-supportVertxFuture/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/vertx/git_push.sh b/samples/client/petstore/java/vertx/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/vertx/git_push.sh +++ b/samples/client/petstore/java/vertx/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/vertx5-supportVertxFuture/git_push.sh b/samples/client/petstore/java/vertx5-supportVertxFuture/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/vertx5-supportVertxFuture/git_push.sh +++ b/samples/client/petstore/java/vertx5-supportVertxFuture/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/vertx5/git_push.sh b/samples/client/petstore/java/vertx5/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/vertx5/git_push.sh +++ b/samples/client/petstore/java/vertx5/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/webclient-jakarta/git_push.sh b/samples/client/petstore/java/webclient-jakarta/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/webclient-jakarta/git_push.sh +++ b/samples/client/petstore/java/webclient-jakarta/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/webclient-nullable-arrays/git_push.sh b/samples/client/petstore/java/webclient-nullable-arrays/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/git_push.sh +++ b/samples/client/petstore/java/webclient-nullable-arrays/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/git_push.sh b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/git_push.sh +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3/git_push.sh b/samples/client/petstore/java/webclient-springBoot4-jackson3/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3/git_push.sh +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/webclient-swagger2/git_push.sh b/samples/client/petstore/java/webclient-swagger2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/webclient-swagger2/git_push.sh +++ b/samples/client/petstore/java/webclient-swagger2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/git_push.sh b/samples/client/petstore/java/webclient-useSingleRequestParameter/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/git_push.sh +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/java/webclient/git_push.sh b/samples/client/petstore/java/webclient/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/java/webclient/git_push.sh +++ b/samples/client/petstore/java/webclient/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/javascript-apollo/git_push.sh b/samples/client/petstore/javascript-apollo/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/javascript-apollo/git_push.sh +++ b/samples/client/petstore/javascript-apollo/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/javascript-es6/git_push.sh b/samples/client/petstore/javascript-es6/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/javascript-es6/git_push.sh +++ b/samples/client/petstore/javascript-es6/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/javascript-promise-es6/git_push.sh b/samples/client/petstore/javascript-promise-es6/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/javascript-promise-es6/git_push.sh +++ b/samples/client/petstore/javascript-promise-es6/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/lua/git_push.sh b/samples/client/petstore/lua/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/lua/git_push.sh +++ b/samples/client/petstore/lua/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/objc/core-data/git_push.sh b/samples/client/petstore/objc/core-data/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/objc/core-data/git_push.sh +++ b/samples/client/petstore/objc/core-data/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/objc/default/git_push.sh b/samples/client/petstore/objc/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/objc/default/git_push.sh +++ b/samples/client/petstore/objc/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/perl/git_push.sh b/samples/client/petstore/perl/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/perl/git_push.sh +++ b/samples/client/petstore/perl/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/git_push.sh b/samples/client/petstore/php-nextgen/OpenAPIClient-php/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/git_push.sh +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/php/OpenAPIClient-php/git_push.sh b/samples/client/petstore/php/OpenAPIClient-php/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/git_push.sh +++ b/samples/client/petstore/php/OpenAPIClient-php/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/php/psr-18/git_push.sh b/samples/client/petstore/php/psr-18/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/php/psr-18/git_push.sh +++ b/samples/client/petstore/php/psr-18/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/ruby-autoload/git_push.sh b/samples/client/petstore/ruby-autoload/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/ruby-autoload/git_push.sh +++ b/samples/client/petstore/ruby-autoload/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/ruby-faraday/git_push.sh b/samples/client/petstore/ruby-faraday/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/ruby-faraday/git_push.sh +++ b/samples/client/petstore/ruby-faraday/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/ruby-httpx/git_push.sh b/samples/client/petstore/ruby-httpx/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/ruby-httpx/git_push.sh +++ b/samples/client/petstore/ruby-httpx/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/ruby/git_push.sh b/samples/client/petstore/ruby/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/ruby/git_push.sh +++ b/samples/client/petstore/ruby/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/hyper/petstore/git_push.sh b/samples/client/petstore/rust/hyper/petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/hyper/petstore/git_push.sh +++ b/samples/client/petstore/rust/hyper/petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/hyper/test-duplicates/git_push.sh b/samples/client/petstore/rust/hyper/test-duplicates/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/hyper/test-duplicates/git_push.sh +++ b/samples/client/petstore/rust/hyper/test-duplicates/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/hyper0x/petstore/git_push.sh b/samples/client/petstore/rust/hyper0x/petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/git_push.sh +++ b/samples/client/petstore/rust/hyper0x/petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/git_push.sh b/samples/client/petstore/rust/reqwest-trait/petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/git_push.sh +++ b/samples/client/petstore/rust/reqwest-trait/petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/name-mapping/git_push.sh b/samples/client/petstore/rust/reqwest/name-mapping/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/git_push.sh +++ b/samples/client/petstore/rust/reqwest/name-mapping/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/git_push.sh b/samples/client/petstore/rust/reqwest/petstore-async-middleware/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/git_push.sh b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore-async/git_push.sh b/samples/client/petstore/rust/reqwest/petstore-async/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore-async/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/git_push.sh b/samples/client/petstore/rust/reqwest/petstore-avoid-box/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/git_push.sh b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/git_push.sh b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore-no-chrono/git_push.sh b/samples/client/petstore/rust/reqwest/petstore-no-chrono/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-no-chrono/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore-no-chrono/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/git_push.sh b/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/petstore/git_push.sh b/samples/client/petstore/rust/reqwest/petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/petstore/git_push.sh +++ b/samples/client/petstore/rust/reqwest/petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/git_push.sh b/samples/client/petstore/rust/reqwest/test-duplicates/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/rust/reqwest/test-duplicates/git_push.sh +++ b/samples/client/petstore/rust/reqwest/test-duplicates/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/PetApi.scala index 23d94e4e0143..3d424db5e9ad 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -33,7 +33,7 @@ class PetApi(baseUrl: String) { * * @param pet Pet object that needs to be added to the store */ - def addPet(pet: Pet): Request[Either[ResponseException[String], Pet]] = + def addPet(pet: Pet): sttp.client4.Request[Either[ResponseException[String], Pet]] = basicRequest .method(Method.POST, uri"$baseUrl/pet") .contentType("application/json") @@ -49,7 +49,7 @@ class PetApi(baseUrl: String) { * @param petId Pet id to delete * @param apiKey */ - def deletePet(petId: Long, apiKey: Option[String] = None): Request[Either[ResponseException[String], Unit]] = + def deletePet(petId: Long, apiKey: Option[String] = None): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.DELETE, uri"$baseUrl/pet/${petId}") .contentType("application/json") @@ -65,7 +65,7 @@ class PetApi(baseUrl: String) { * * @param status Status values that need to be considered for filter */ - def findPetsByStatus(status: Seq[String] = Seq.empty): Request[Either[ResponseException[String], Seq[Pet]]] = + def findPetsByStatus(status: Seq[String] = Seq.empty): sttp.client4.Request[Either[ResponseException[String], Seq[Pet]]] = basicRequest .method(Method.GET, uri"$baseUrl/pet/findByStatus?status=${ status }") .contentType("application/json") @@ -80,7 +80,7 @@ class PetApi(baseUrl: String) { * * @param tags Tags to filter by */ - def findPetsByTags(tags: Seq[String] = Seq.empty): Request[Either[ResponseException[String], Seq[Pet]]] = + def findPetsByTags(tags: Seq[String] = Seq.empty): sttp.client4.Request[Either[ResponseException[String], Seq[Pet]]] = basicRequest .method(Method.GET, uri"$baseUrl/pet/findByTags?tags=${ tags }") .contentType("application/json") @@ -99,7 +99,7 @@ class PetApi(baseUrl: String) { * * @param petId ID of pet to return */ - def getPetById(apiKeyHeader: String)(petId: Long): Request[Either[ResponseException[String], Pet]] = + def getPetById(apiKeyHeader: String)(petId: Long): sttp.client4.Request[Either[ResponseException[String], Pet]] = basicRequest .method(Method.GET, uri"$baseUrl/pet/${petId}") .contentType("application/json") @@ -117,7 +117,7 @@ class PetApi(baseUrl: String) { * * @param pet Pet object that needs to be added to the store */ - def updatePet(pet: Pet): Request[Either[ResponseException[String], Pet]] = + def updatePet(pet: Pet): sttp.client4.Request[Either[ResponseException[String], Pet]] = basicRequest .method(Method.PUT, uri"$baseUrl/pet") .contentType("application/json") @@ -134,7 +134,7 @@ class PetApi(baseUrl: String) { * @param name Updated name of the pet * @param status Updated status of the pet */ - def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None): Request[Either[ResponseException[String], Unit]] = + def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/pet/${petId}") .contentType("application/x-www-form-urlencoded") @@ -154,7 +154,7 @@ class PetApi(baseUrl: String) { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): Request[Either[ResponseException[String], ApiResponse]] = + def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): sttp.client4.Request[Either[ResponseException[String], ApiResponse]] = basicRequest .method(Method.POST, uri"$baseUrl/pet/${petId}/uploadImage") .contentType("multipart/form-data") diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/StoreApi.scala index 27efb05281b1..133314fa142b 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -31,7 +31,7 @@ class StoreApi(baseUrl: String) { * * @param orderId ID of the order that needs to be deleted */ - def deleteOrder(orderId: String): Request[Either[ResponseException[String], Unit]] = + def deleteOrder(orderId: String): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.DELETE, uri"$baseUrl/store/order/${orderId}") .contentType("application/json") @@ -46,7 +46,7 @@ class StoreApi(baseUrl: String) { * Available security schemes: * api_key (apiKey) */ - def getInventory(apiKeyHeader: String)(): Request[Either[ResponseException[String], Map[String, Int]]] = + def getInventory(apiKeyHeader: String)(): sttp.client4.Request[Either[ResponseException[String], Map[String, Int]]] = basicRequest .method(Method.GET, uri"$baseUrl/store/inventory") .contentType("application/json") @@ -63,7 +63,7 @@ class StoreApi(baseUrl: String) { * * @param orderId ID of pet that needs to be fetched */ - def getOrderById(orderId: Long): Request[Either[ResponseException[String], Order]] = + def getOrderById(orderId: Long): sttp.client4.Request[Either[ResponseException[String], Order]] = basicRequest .method(Method.GET, uri"$baseUrl/store/order/${orderId}") .contentType("application/json") @@ -78,7 +78,7 @@ class StoreApi(baseUrl: String) { * * @param order order placed for purchasing the pet */ - def placeOrder(order: Order): Request[Either[ResponseException[String], Order]] = + def placeOrder(order: Order): sttp.client4.Request[Either[ResponseException[String], Order]] = basicRequest .method(Method.POST, uri"$baseUrl/store/order") .contentType("application/json") diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/UserApi.scala index 176c21e2b316..a601a14f45c6 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -34,7 +34,7 @@ class UserApi(baseUrl: String) { * * @param user Created user object */ - def createUser(apiKeyHeader: String)(user: User): Request[Either[ResponseException[String], Unit]] = + def createUser(apiKeyHeader: String)(user: User): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user") .contentType("application/json") @@ -53,7 +53,7 @@ class UserApi(baseUrl: String) { * * @param user List of user object */ - def createUsersWithArrayInput(apiKeyHeader: String)(user: Seq[User]): Request[Either[ResponseException[String], Unit]] = + def createUsersWithArrayInput(apiKeyHeader: String)(user: Seq[User]): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithArray") .contentType("application/json") @@ -72,7 +72,7 @@ class UserApi(baseUrl: String) { * * @param user List of user object */ - def createUsersWithListInput(apiKeyHeader: String)(user: Seq[User]): Request[Either[ResponseException[String], Unit]] = + def createUsersWithListInput(apiKeyHeader: String)(user: Seq[User]): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithList") .contentType("application/json") @@ -92,7 +92,7 @@ class UserApi(baseUrl: String) { * * @param username The name that needs to be deleted */ - def deleteUser(apiKeyHeader: String)(username: String): Request[Either[ResponseException[String], Unit]] = + def deleteUser(apiKeyHeader: String)(username: String): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.DELETE, uri"$baseUrl/user/${username}") .contentType("application/json") @@ -109,7 +109,7 @@ class UserApi(baseUrl: String) { * * @param username The name that needs to be fetched. Use user1 for testing. */ - def getUserByName(username: String): Request[Either[ResponseException[String], User]] = + def getUserByName(username: String): sttp.client4.Request[Either[ResponseException[String], User]] = basicRequest .method(Method.GET, uri"$baseUrl/user/${username}") .contentType("application/json") @@ -129,7 +129,7 @@ class UserApi(baseUrl: String) { * @param username The user name for login * @param password The password for login in clear text */ - def loginUser(username: String, password: String): Request[Either[ResponseException[String], String]] = + def loginUser(username: String, password: String): sttp.client4.Request[Either[ResponseException[String], String]] = basicRequest .method(Method.GET, uri"$baseUrl/user/login?username=${ username }&password=${ password }") .contentType("application/json") @@ -144,7 +144,7 @@ class UserApi(baseUrl: String) { * Available security schemes: * api_key (apiKey) */ - def logoutUser(apiKeyHeader: String)(): Request[Either[ResponseException[String], Unit]] = + def logoutUser(apiKeyHeader: String)(): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.GET, uri"$baseUrl/user/logout") .contentType("application/json") @@ -164,7 +164,7 @@ class UserApi(baseUrl: String) { * @param username name that need to be deleted * @param user Updated user object */ - def updateUser(apiKeyHeader: String)(username: String, user: User): Request[Either[ResponseException[String], Unit]] = + def updateUser(apiKeyHeader: String)(username: String, user: User): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.PUT, uri"$baseUrl/user/${username}") .contentType("application/json") diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/ApiResponse.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/ApiResponse.scala index d1a0a16f99f4..c71137577e18 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/ApiResponse.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/ApiResponse.scala @@ -24,8 +24,25 @@ case class ApiResponse( object ApiResponse { import io.circe._ import io.circe.syntax._ - import io.circe.generic.semiauto._ - implicit val encoder: Encoder[ApiResponse] = deriveEncoder[ApiResponse].mapJson(_.dropNullValues) - implicit val decoder: Decoder[ApiResponse] = deriveDecoder + implicit val encoder: Encoder[ApiResponse] = Encoder.instance { t => + Json.fromFields( + Seq( + t.code.map(v => "code" -> v.asJson), + t.`type`.map(v => "type" -> v.asJson), + t.message.map(v => "message" -> v.asJson) + ).flatten + ) + } + implicit val decoder: Decoder[ApiResponse] = Decoder.instance { c => + for { + code <- c.downField("code").as[Option[Int]] + `type` <- c.downField("type").as[Option[String]] + message <- c.downField("message").as[Option[String]] + } yield ApiResponse( + code = code, + `type` = `type`, + message = message + ) + } } diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Category.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Category.scala index 546dacdbb753..8faea9354819 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Category.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Category.scala @@ -23,8 +23,22 @@ case class Category( object Category { import io.circe._ import io.circe.syntax._ - import io.circe.generic.semiauto._ - implicit val encoder: Encoder[Category] = deriveEncoder[Category].mapJson(_.dropNullValues) - implicit val decoder: Decoder[Category] = deriveDecoder + implicit val encoder: Encoder[Category] = Encoder.instance { t => + Json.fromFields( + Seq( + t.id.map(v => "id" -> v.asJson), + t.name.map(v => "name" -> v.asJson) + ).flatten + ) + } + implicit val decoder: Decoder[Category] = Decoder.instance { c => + for { + id <- c.downField("id").as[Option[Long]] + name <- c.downField("name").as[Option[String]] + } yield Category( + id = id, + name = name + ) + } } diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Order.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Order.scala index b942df6e0ca3..20302bb72268 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Order.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Order.scala @@ -29,10 +29,36 @@ case class Order( object Order { import io.circe._ import io.circe.syntax._ - import io.circe.generic.semiauto._ - implicit val encoder: Encoder[Order] = deriveEncoder[Order].mapJson(_.dropNullValues) - implicit val decoder: Decoder[Order] = deriveDecoder + implicit val encoder: Encoder[Order] = Encoder.instance { t => + Json.fromFields( + Seq( + t.id.map(v => "id" -> v.asJson), + t.petId.map(v => "petId" -> v.asJson), + t.quantity.map(v => "quantity" -> v.asJson), + t.shipDate.map(v => "shipDate" -> v.asJson), + t.status.map(v => "status" -> v.asJson), + t.complete.map(v => "complete" -> v.asJson) + ).flatten + ) + } + implicit val decoder: Decoder[Order] = Decoder.instance { c => + for { + id <- c.downField("id").as[Option[Long]] + petId <- c.downField("petId").as[Option[Long]] + quantity <- c.downField("quantity").as[Option[Int]] + shipDate <- c.downField("shipDate").as[Option[OffsetDateTime]] + status <- c.downField("status").as[Option[OrderEnums.Status]] + complete <- c.downField("complete").as[Option[Boolean]] + } yield Order( + id = id, + petId = petId, + quantity = quantity, + shipDate = shipDate, + status = status, + complete = complete + ) + } } object OrderEnums { diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Pet.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Pet.scala index d52f5cf86b6c..e76299ae97a0 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Pet.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Pet.scala @@ -28,10 +28,36 @@ case class Pet( object Pet { import io.circe._ import io.circe.syntax._ - import io.circe.generic.semiauto._ - implicit val encoder: Encoder[Pet] = deriveEncoder[Pet].mapJson(_.dropNullValues) - implicit val decoder: Decoder[Pet] = deriveDecoder + implicit val encoder: Encoder[Pet] = Encoder.instance { t => + Json.fromFields( + Seq( + t.id.map(v => "id" -> v.asJson), + t.category.map(v => "category" -> v.asJson), + Some("name" -> t.name.asJson), + Some("photoUrls" -> t.photoUrls.asJson), + t.tags.map(v => "tags" -> v.asJson), + t.status.map(v => "status" -> v.asJson) + ).flatten + ) + } + implicit val decoder: Decoder[Pet] = Decoder.instance { c => + for { + id <- c.downField("id").as[Option[Long]] + category <- c.downField("category").as[Option[Category]] + name <- c.downField("name").as[String] + photoUrls <- c.downField("photoUrls").as[Seq[String]] + tags <- c.downField("tags").as[Option[Seq[Tag]]] + status <- c.downField("status").as[Option[PetEnums.Status]] + } yield Pet( + id = id, + category = category, + name = name, + photoUrls = photoUrls, + tags = tags, + status = status + ) + } } object PetEnums { diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Tag.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Tag.scala index 6840fc050e20..25145aebee85 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Tag.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/Tag.scala @@ -23,8 +23,22 @@ case class Tag( object Tag { import io.circe._ import io.circe.syntax._ - import io.circe.generic.semiauto._ - implicit val encoder: Encoder[Tag] = deriveEncoder[Tag].mapJson(_.dropNullValues) - implicit val decoder: Decoder[Tag] = deriveDecoder + implicit val encoder: Encoder[Tag] = Encoder.instance { t => + Json.fromFields( + Seq( + t.id.map(v => "id" -> v.asJson), + t.name.map(v => "name" -> v.asJson) + ).flatten + ) + } + implicit val decoder: Decoder[Tag] = Decoder.instance { c => + for { + id <- c.downField("id").as[Option[Long]] + name <- c.downField("name").as[Option[String]] + } yield Tag( + id = id, + name = name + ) + } } diff --git a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/User.scala b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/User.scala index 1f42e16a497a..d4eed01035bc 100644 --- a/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/User.scala +++ b/samples/client/petstore/scala-sttp4-circe/src/main/scala/org/openapitools/client/model/User.scala @@ -30,8 +30,40 @@ case class User( object User { import io.circe._ import io.circe.syntax._ - import io.circe.generic.semiauto._ - implicit val encoder: Encoder[User] = deriveEncoder[User].mapJson(_.dropNullValues) - implicit val decoder: Decoder[User] = deriveDecoder + implicit val encoder: Encoder[User] = Encoder.instance { t => + Json.fromFields( + Seq( + t.id.map(v => "id" -> v.asJson), + t.username.map(v => "username" -> v.asJson), + t.firstName.map(v => "firstName" -> v.asJson), + t.lastName.map(v => "lastName" -> v.asJson), + t.email.map(v => "email" -> v.asJson), + t.password.map(v => "password" -> v.asJson), + t.phone.map(v => "phone" -> v.asJson), + t.userStatus.map(v => "userStatus" -> v.asJson) + ).flatten + ) + } + implicit val decoder: Decoder[User] = Decoder.instance { c => + for { + id <- c.downField("id").as[Option[Long]] + username <- c.downField("username").as[Option[String]] + firstName <- c.downField("firstName").as[Option[String]] + lastName <- c.downField("lastName").as[Option[String]] + email <- c.downField("email").as[Option[String]] + password <- c.downField("password").as[Option[String]] + phone <- c.downField("phone").as[Option[String]] + userStatus <- c.downField("userStatus").as[Option[Int]] + } yield User( + id = id, + username = username, + firstName = firstName, + lastName = lastName, + email = email, + password = password, + phone = phone, + userStatus = userStatus + ) + } } diff --git a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/PetApi.scala index 23d94e4e0143..3d424db5e9ad 100644 --- a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -33,7 +33,7 @@ class PetApi(baseUrl: String) { * * @param pet Pet object that needs to be added to the store */ - def addPet(pet: Pet): Request[Either[ResponseException[String], Pet]] = + def addPet(pet: Pet): sttp.client4.Request[Either[ResponseException[String], Pet]] = basicRequest .method(Method.POST, uri"$baseUrl/pet") .contentType("application/json") @@ -49,7 +49,7 @@ class PetApi(baseUrl: String) { * @param petId Pet id to delete * @param apiKey */ - def deletePet(petId: Long, apiKey: Option[String] = None): Request[Either[ResponseException[String], Unit]] = + def deletePet(petId: Long, apiKey: Option[String] = None): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.DELETE, uri"$baseUrl/pet/${petId}") .contentType("application/json") @@ -65,7 +65,7 @@ class PetApi(baseUrl: String) { * * @param status Status values that need to be considered for filter */ - def findPetsByStatus(status: Seq[String] = Seq.empty): Request[Either[ResponseException[String], Seq[Pet]]] = + def findPetsByStatus(status: Seq[String] = Seq.empty): sttp.client4.Request[Either[ResponseException[String], Seq[Pet]]] = basicRequest .method(Method.GET, uri"$baseUrl/pet/findByStatus?status=${ status }") .contentType("application/json") @@ -80,7 +80,7 @@ class PetApi(baseUrl: String) { * * @param tags Tags to filter by */ - def findPetsByTags(tags: Seq[String] = Seq.empty): Request[Either[ResponseException[String], Seq[Pet]]] = + def findPetsByTags(tags: Seq[String] = Seq.empty): sttp.client4.Request[Either[ResponseException[String], Seq[Pet]]] = basicRequest .method(Method.GET, uri"$baseUrl/pet/findByTags?tags=${ tags }") .contentType("application/json") @@ -99,7 +99,7 @@ class PetApi(baseUrl: String) { * * @param petId ID of pet to return */ - def getPetById(apiKeyHeader: String)(petId: Long): Request[Either[ResponseException[String], Pet]] = + def getPetById(apiKeyHeader: String)(petId: Long): sttp.client4.Request[Either[ResponseException[String], Pet]] = basicRequest .method(Method.GET, uri"$baseUrl/pet/${petId}") .contentType("application/json") @@ -117,7 +117,7 @@ class PetApi(baseUrl: String) { * * @param pet Pet object that needs to be added to the store */ - def updatePet(pet: Pet): Request[Either[ResponseException[String], Pet]] = + def updatePet(pet: Pet): sttp.client4.Request[Either[ResponseException[String], Pet]] = basicRequest .method(Method.PUT, uri"$baseUrl/pet") .contentType("application/json") @@ -134,7 +134,7 @@ class PetApi(baseUrl: String) { * @param name Updated name of the pet * @param status Updated status of the pet */ - def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None): Request[Either[ResponseException[String], Unit]] = + def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/pet/${petId}") .contentType("application/x-www-form-urlencoded") @@ -154,7 +154,7 @@ class PetApi(baseUrl: String) { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): Request[Either[ResponseException[String], ApiResponse]] = + def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): sttp.client4.Request[Either[ResponseException[String], ApiResponse]] = basicRequest .method(Method.POST, uri"$baseUrl/pet/${petId}/uploadImage") .contentType("multipart/form-data") diff --git a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/StoreApi.scala index 27efb05281b1..133314fa142b 100644 --- a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -31,7 +31,7 @@ class StoreApi(baseUrl: String) { * * @param orderId ID of the order that needs to be deleted */ - def deleteOrder(orderId: String): Request[Either[ResponseException[String], Unit]] = + def deleteOrder(orderId: String): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.DELETE, uri"$baseUrl/store/order/${orderId}") .contentType("application/json") @@ -46,7 +46,7 @@ class StoreApi(baseUrl: String) { * Available security schemes: * api_key (apiKey) */ - def getInventory(apiKeyHeader: String)(): Request[Either[ResponseException[String], Map[String, Int]]] = + def getInventory(apiKeyHeader: String)(): sttp.client4.Request[Either[ResponseException[String], Map[String, Int]]] = basicRequest .method(Method.GET, uri"$baseUrl/store/inventory") .contentType("application/json") @@ -63,7 +63,7 @@ class StoreApi(baseUrl: String) { * * @param orderId ID of pet that needs to be fetched */ - def getOrderById(orderId: Long): Request[Either[ResponseException[String], Order]] = + def getOrderById(orderId: Long): sttp.client4.Request[Either[ResponseException[String], Order]] = basicRequest .method(Method.GET, uri"$baseUrl/store/order/${orderId}") .contentType("application/json") @@ -78,7 +78,7 @@ class StoreApi(baseUrl: String) { * * @param order order placed for purchasing the pet */ - def placeOrder(order: Order): Request[Either[ResponseException[String], Order]] = + def placeOrder(order: Order): sttp.client4.Request[Either[ResponseException[String], Order]] = basicRequest .method(Method.POST, uri"$baseUrl/store/order") .contentType("application/json") diff --git a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/UserApi.scala index 176c21e2b316..a601a14f45c6 100644 --- a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -34,7 +34,7 @@ class UserApi(baseUrl: String) { * * @param user Created user object */ - def createUser(apiKeyHeader: String)(user: User): Request[Either[ResponseException[String], Unit]] = + def createUser(apiKeyHeader: String)(user: User): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user") .contentType("application/json") @@ -53,7 +53,7 @@ class UserApi(baseUrl: String) { * * @param user List of user object */ - def createUsersWithArrayInput(apiKeyHeader: String)(user: Seq[User]): Request[Either[ResponseException[String], Unit]] = + def createUsersWithArrayInput(apiKeyHeader: String)(user: Seq[User]): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithArray") .contentType("application/json") @@ -72,7 +72,7 @@ class UserApi(baseUrl: String) { * * @param user List of user object */ - def createUsersWithListInput(apiKeyHeader: String)(user: Seq[User]): Request[Either[ResponseException[String], Unit]] = + def createUsersWithListInput(apiKeyHeader: String)(user: Seq[User]): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithList") .contentType("application/json") @@ -92,7 +92,7 @@ class UserApi(baseUrl: String) { * * @param username The name that needs to be deleted */ - def deleteUser(apiKeyHeader: String)(username: String): Request[Either[ResponseException[String], Unit]] = + def deleteUser(apiKeyHeader: String)(username: String): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.DELETE, uri"$baseUrl/user/${username}") .contentType("application/json") @@ -109,7 +109,7 @@ class UserApi(baseUrl: String) { * * @param username The name that needs to be fetched. Use user1 for testing. */ - def getUserByName(username: String): Request[Either[ResponseException[String], User]] = + def getUserByName(username: String): sttp.client4.Request[Either[ResponseException[String], User]] = basicRequest .method(Method.GET, uri"$baseUrl/user/${username}") .contentType("application/json") @@ -129,7 +129,7 @@ class UserApi(baseUrl: String) { * @param username The user name for login * @param password The password for login in clear text */ - def loginUser(username: String, password: String): Request[Either[ResponseException[String], String]] = + def loginUser(username: String, password: String): sttp.client4.Request[Either[ResponseException[String], String]] = basicRequest .method(Method.GET, uri"$baseUrl/user/login?username=${ username }&password=${ password }") .contentType("application/json") @@ -144,7 +144,7 @@ class UserApi(baseUrl: String) { * Available security schemes: * api_key (apiKey) */ - def logoutUser(apiKeyHeader: String)(): Request[Either[ResponseException[String], Unit]] = + def logoutUser(apiKeyHeader: String)(): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.GET, uri"$baseUrl/user/logout") .contentType("application/json") @@ -164,7 +164,7 @@ class UserApi(baseUrl: String) { * @param username name that need to be deleted * @param user Updated user object */ - def updateUser(apiKeyHeader: String)(username: String, user: User): Request[Either[ResponseException[String], Unit]] = + def updateUser(apiKeyHeader: String)(username: String, user: User): sttp.client4.Request[Either[ResponseException[String], Unit]] = basicRequest .method(Method.PUT, uri"$baseUrl/user/${username}") .contentType("application/json") diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java index 4aa4e0f36117..83c89d9c9800 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Pet { + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType = "Pet"; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java index 0d9d99f20e09..53b64044c6e3 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable name = JsonNullable.undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) @Deprecated private List photoUrls = new ArrayList<>(); diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java index f655d26b20a7..141ad532407c 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 46a16d7fe21d..fb95071ae45f 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -58,7 +58,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AnimalDto.java index c724049e493b..ccfe65d189e1 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/AnimalDto.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/CategoryDto.java index 20129cb89013..44a1a1ea0b01 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/CategoryDto.java @@ -27,6 +27,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index ccb8f5a5647f..d88271c2bf46 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -29,14 +29,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/EnumTestDto.java index 9c39a7569a81..250a8a7fa9fb 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/EnumTestDto.java @@ -103,6 +103,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/FormatTestDto.java index ac2ef6be7859..0db61103ab8a 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/FormatTestDto.java @@ -39,6 +39,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -50,11 +51,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -65,6 +68,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NameDto.java index e11dd113cbc2..9dcea8d6c27b 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NameDto.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index 350b970a945d..f84d9d21f9cf 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -29,7 +28,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 1d18853e2e2e..cb3f764522a6 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java index 2052979417f7..b4eda9e7f9c4 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java @@ -39,8 +39,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 99d18a336d78..a1c213eb40de 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,14 +28,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index b0faf5aaa9ae..b0f401268821 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,16 +28,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index b893bb4ec7c6..613b36dd183c 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AnimalDto.java index e301cd61dba3..67474f01ec05 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/AnimalDto.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/CategoryDto.java index 5c51fa54cc0a..ca80887aed58 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/CategoryDto.java @@ -26,6 +26,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index af2b07f95d73..fe0be24e229d 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/EnumTestDto.java index 5263a4e2bc96..5069a1a9acbb 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/EnumTestDto.java @@ -102,6 +102,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/FormatTestDto.java index 18101da678fa..c68a2728bcb1 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/FormatTestDto.java @@ -38,6 +38,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -49,11 +50,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -64,6 +67,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NameDto.java index 0d4be7ac8140..b6b48d488ede 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NameDto.java @@ -23,6 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index f93832a65c98..d9edf72050f1 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 2300afd143a4..af08c71fb48f 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -74,7 +74,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java index 0ce2b93a2b0f..791eea25f843 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java @@ -38,8 +38,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 987983e43451..8ca218f8c704 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 4db40f3db382..eea548352cc7 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java index 457dd9ab011f..60c38d69c87f 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java @@ -25,9 +25,11 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public CategoryDto id(@Nullable Long id) { @@ -45,7 +47,6 @@ public CategoryDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -66,7 +67,6 @@ public CategoryDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java index 2bec6c231fc2..6a6e87714952 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java @@ -31,16 +31,21 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List tags = new ArrayList<>(); /** @@ -81,6 +86,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private @Nullable StatusEnum status; @@ -103,7 +109,6 @@ public PetDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -124,7 +129,6 @@ public PetDto category(@Nullable CategoryDto category) { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") public void setCategory(@Nullable CategoryDto category) { this.category = category; @@ -201,7 +205,6 @@ public List getTags() { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") public void setTags(List tags) { this.tags = tags; @@ -227,7 +230,6 @@ public PetDto status(@Nullable StatusEnum status) { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java index 453c993f1953..9f054df0c7c2 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java @@ -25,9 +25,11 @@ public class TagDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public TagDto id(@Nullable Long id) { @@ -45,7 +47,6 @@ public TagDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -66,7 +67,6 @@ public TagDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 0cd4c4edbd58..d143dbf68f9c 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -56,7 +56,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Animal.java index 282ca2ce689b..fe52d0aa116a 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Category.java index 6778a62dfd5e..a606369f1c61 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Category.java @@ -25,6 +25,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 16f74d8223aa..ca932fee5f0f 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -27,14 +27,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/EnumTest.java index 54c2c98f7fe4..58945182bd97 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/EnumTest.java @@ -103,6 +103,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/FormatTest.java index c2dc9d17f0b8..fe3df02f9da4 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/FormatTest.java @@ -39,6 +39,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -50,11 +51,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -65,6 +68,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Name.java index 07be2f99663a..1edf0813d0b5 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Name.java @@ -22,6 +22,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/NullableMapProperty.java index 3abb813498f2..dff5aa4523f8 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -27,7 +26,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ParentWithNullable.java index 79e274840817..9b895427687b 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -74,7 +74,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java index be762175a56b..2e84df56c536 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java @@ -37,8 +37,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 1f8e4dc3d890..7aedd82ea28e 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -25,14 +26,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderExample.java index d37cdc713ec3..f1609752ba2f 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -25,16 +26,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 120027d72686..b266f37f4576 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,7 +55,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java index f5d220bc1b43..29ecd6ae4724 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java index bcd733ba06d7..dd15acc4171f 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java @@ -24,6 +24,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java index a348b064c179..31a8133cb94f 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -26,14 +26,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java index c62cf18d0eee..07926663552d 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java @@ -102,6 +102,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java index c0831401197a..f4aea008dfa3 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java @@ -38,6 +38,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -49,11 +50,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -64,6 +67,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java index f237f6637dd5..5be398a7e1c9 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java @@ -21,6 +21,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java index d5fda5613396..5e0395f3fd34 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -26,7 +25,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java index 40350659ae78..a2e4fd94701a 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -73,7 +73,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index 89685de90050..906fa96ae1ee 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bf6cba777df..e8978ec83178 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -24,14 +25,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java index 5e77ca347711..4caccae69640 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -24,16 +25,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 120027d72686..b266f37f4576 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,7 +55,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java index f5d220bc1b43..29ecd6ae4724 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java index bcd733ba06d7..dd15acc4171f 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java @@ -24,6 +24,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java index a348b064c179..31a8133cb94f 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -26,14 +26,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java index c62cf18d0eee..07926663552d 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -102,6 +102,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java index c0831401197a..f4aea008dfa3 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -38,6 +38,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -49,11 +50,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -64,6 +67,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java index f237f6637dd5..5be398a7e1c9 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java @@ -21,6 +21,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java index d5fda5613396..5e0395f3fd34 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -26,7 +25,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java index 40350659ae78..a2e4fd94701a 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -73,7 +73,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java index 89685de90050..906fa96ae1ee 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bf6cba777df..e8978ec83178 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -24,14 +25,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 5e77ca347711..4caccae69640 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -24,16 +25,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index 1cb856bede0d..295d6b496a00 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -31,6 +31,7 @@ public class AdditionalPropertiesAnyTypeDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesAnyTypeDto name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesAnyTypeDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index 0676ea4382d6..1af5c4e3e427 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -32,6 +32,7 @@ public class AdditionalPropertiesArrayDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesArrayDto name(@Nullable String name) { @@ -49,7 +50,6 @@ public AdditionalPropertiesArrayDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index 2241c7d959f3..5186257ff7e9 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -31,6 +31,7 @@ public class AdditionalPropertiesBooleanDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesBooleanDto name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesBooleanDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 2ea6bd2cd002..a8a585b40488 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -31,35 +31,45 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapNumber = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapInteger = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapBoolean = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapArrayInteger = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapArrayAnytype = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapAnytype = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Object anytype1; private @Nullable Object anytype2 = null; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Object anytype3; public AdditionalPropertiesClassDto mapString(Map mapString) { @@ -85,7 +95,6 @@ public Map getMapString() { return mapString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_string") public void setMapString(Map mapString) { this.mapString = mapString; @@ -114,7 +123,6 @@ public Map getMapNumber() { return mapNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_number") public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -143,7 +151,6 @@ public Map getMapInteger() { return mapInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_integer") public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -172,7 +179,6 @@ public Map getMapBoolean() { return mapBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_boolean") public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -201,7 +207,6 @@ public Map> getMapArrayInteger() { return mapArrayInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_array_integer") public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -230,7 +235,6 @@ public Map> getMapArrayAnytype() { return mapArrayAnytype; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_array_anytype") public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -259,7 +263,6 @@ public Map> getMapMapString() { return mapMapString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_string") public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -288,7 +291,6 @@ public Map> getMapMapAnytype() { return mapMapAnytype; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_anytype") public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -309,7 +311,6 @@ public AdditionalPropertiesClassDto anytype1(@Nullable Object anytype1) { return anytype1; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("anytype_1") public void setAnytype1(@Nullable Object anytype1) { this.anytype1 = anytype1; @@ -350,7 +351,6 @@ public AdditionalPropertiesClassDto anytype3(@Nullable Object anytype3) { return anytype3; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("anytype_3") public void setAnytype3(@Nullable Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index b316d3c81cda..5953b7ef4a6f 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -31,6 +31,7 @@ public class AdditionalPropertiesIntegerDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesIntegerDto name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesIntegerDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index d5cc7439d547..5e1fd8bb52cb 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -32,6 +32,7 @@ public class AdditionalPropertiesNumberDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesNumberDto name(@Nullable String name) { @@ -49,7 +50,6 @@ public AdditionalPropertiesNumberDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index 5ba2d44f1289..e074be7e9fc1 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -32,6 +32,7 @@ public class AdditionalPropertiesObjectDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesObjectDto name(@Nullable String name) { @@ -49,7 +50,6 @@ public AdditionalPropertiesObjectDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index 1d2c057c67f8..7f2716e810b8 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -31,6 +31,7 @@ public class AdditionalPropertiesStringDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesStringDto name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesStringDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java index 79eb758c01f0..4accd0918d94 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/AnimalDto.java @@ -39,9 +39,11 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String color = "red"; public AnimalDto() { @@ -83,7 +85,6 @@ public String getColor() { return color; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("color") public void setColor(String color) { this.color = color; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ApiResponseDto.java index 816907e58b6a..1a2565b3fd59 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -27,12 +27,15 @@ public class ApiResponseDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer code; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String type; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String message; public ApiResponseDto code(@Nullable Integer code) { @@ -50,7 +53,6 @@ public ApiResponseDto code(@Nullable Integer code) { return code; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("code") public void setCode(@Nullable Integer code) { this.code = code; @@ -71,7 +73,6 @@ public ApiResponseDto type(@Nullable String type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(@Nullable String type) { this.type = type; @@ -92,7 +93,6 @@ public ApiResponseDto message(@Nullable String message) { return message; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("message") public void setMessage(@Nullable String message) { this.message = message; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index fa600276dd17..5ffe266b5d11 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -31,6 +31,7 @@ public class ArrayOfArrayOfNumberOnlyDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { @@ -56,7 +57,6 @@ public List> getArrayArrayNumber() { return arrayArrayNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ArrayArrayNumber") public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 59a9a5cf1f8f..e2e197848a86 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -31,6 +31,7 @@ public class ArrayOfNumberOnlyDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { @@ -56,7 +57,6 @@ public List getArrayNumber() { return arrayNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ArrayNumber") public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayTestDto.java index 9d892b04ccdb..9f9cd29a27ce 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -31,12 +31,15 @@ public class ArrayTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayOfString = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayOfInteger = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTestDto arrayOfString(List arrayOfString) { @@ -62,7 +65,6 @@ public List getArrayOfString() { return arrayOfString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_of_string") public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -91,7 +93,6 @@ public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_array_of_integer") public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -120,7 +121,6 @@ public ArrayTestDto addArrayArrayOfModelItem(List<@Valid ReadOnlyFirstDto> array return arrayArrayOfModel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_array_of_model") public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/BigCatDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/BigCatDto.java index d6dbc67f2d23..0157f3f90a5e 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/BigCatDto.java @@ -72,6 +72,7 @@ public static KindEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable KindEnum kind; public BigCatDto() { @@ -93,7 +94,6 @@ public BigCatDto kind(@Nullable KindEnum kind) { return kind; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("kind") public void setKind(@Nullable KindEnum kind) { this.kind = kind; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CapitalizationDto.java index 3e334c63cc44..b8cd114ab05d 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -27,21 +27,27 @@ public class CapitalizationDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String smallCamel; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String capitalCamel; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String smallSnake; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String capitalSnake; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String scAETHFlowPoints; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String ATT_NAME; public CapitalizationDto smallCamel(@Nullable String smallCamel) { @@ -59,7 +65,6 @@ public CapitalizationDto smallCamel(@Nullable String smallCamel) { return smallCamel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("smallCamel") public void setSmallCamel(@Nullable String smallCamel) { this.smallCamel = smallCamel; @@ -80,7 +85,6 @@ public CapitalizationDto capitalCamel(@Nullable String capitalCamel) { return capitalCamel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("CapitalCamel") public void setCapitalCamel(@Nullable String capitalCamel) { this.capitalCamel = capitalCamel; @@ -101,7 +105,6 @@ public CapitalizationDto smallSnake(@Nullable String smallSnake) { return smallSnake; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("small_Snake") public void setSmallSnake(@Nullable String smallSnake) { this.smallSnake = smallSnake; @@ -122,7 +125,6 @@ public CapitalizationDto capitalSnake(@Nullable String capitalSnake) { return capitalSnake; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("Capital_Snake") public void setCapitalSnake(@Nullable String capitalSnake) { this.capitalSnake = capitalSnake; @@ -143,7 +145,6 @@ public CapitalizationDto scAETHFlowPoints(@Nullable String scAETHFlowPoints) { return scAETHFlowPoints; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("SCA_ETH_Flow_Points") public void setScAETHFlowPoints(@Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -164,7 +165,6 @@ public CapitalizationDto ATT_NAME(@Nullable String ATT_NAME) { return ATT_NAME; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ATT_NAME") public void setATTNAME(@Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CatDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CatDto.java index cdad439483f3..8cc3ac72727a 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CatDto.java @@ -39,6 +39,7 @@ public class CatDto extends AnimalDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean declawed; public CatDto() { @@ -60,7 +61,6 @@ public CatDto declawed(@Nullable Boolean declawed) { return declawed; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("declawed") public void setDeclawed(@Nullable Boolean declawed) { this.declawed = declawed; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CategoryDto.java index a7974b8569f2..d594d20b7040 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/CategoryDto.java @@ -27,8 +27,10 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { @@ -50,7 +52,6 @@ public CategoryDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ChildWithNullableDto.java index f51abf8ece42..e8052ff73150 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ChildWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -33,6 +33,7 @@ public class ChildWithNullableDto extends ParentWithNullableDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String otherProperty; public ChildWithNullableDto otherProperty(@Nullable String otherProperty) { @@ -50,7 +51,6 @@ public ChildWithNullableDto otherProperty(@Nullable String otherProperty) { return otherProperty; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("otherProperty") public void setOtherProperty(@Nullable String otherProperty) { this.otherProperty = otherProperty; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClassModelDto.java index 224945aa2097..4946321f4ff8 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClassModelDto.java @@ -27,6 +27,7 @@ public class ClassModelDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyClass; public ClassModelDto propertyClass(@Nullable String propertyClass) { @@ -44,7 +45,6 @@ public ClassModelDto propertyClass(@Nullable String propertyClass) { return propertyClass; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("_class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClientDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClientDto.java index d56f7d0b101d..d1e32d687f45 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ClientDto.java @@ -27,6 +27,7 @@ public class ClientDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String client; public ClientDto client(@Nullable String client) { @@ -44,7 +45,6 @@ public ClientDto client(@Nullable String client) { return client; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("client") public void setClient(@Nullable String client) { this.client = client; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index b28ffec6be94..b5627e929b6b 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,8 +29,10 @@ public class ContainerDefaultValueDto { private @Nullable List nullableArray; + @JsonInclude(JsonInclude.Include.ALWAYS) private List nullableRequiredArray; + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); private @Nullable List nullableArrayWithDefault = new ArrayList<>(Arrays.asList("foo", "bar")); diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/DogDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/DogDto.java index 24cf4c298157..f5208d6b9613 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/DogDto.java @@ -32,6 +32,7 @@ public class DogDto extends AnimalDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String breed; public DogDto() { @@ -53,7 +54,6 @@ public DogDto breed(@Nullable String breed) { return breed; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("breed") public void setBreed(@Nullable String breed) { this.breed = breed; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumArraysDto.java index 77c896e6f7bb..1a573e6b8d0e 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -66,6 +66,7 @@ public static JustSymbolEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable JustSymbolEnum justSymbol; /** @@ -104,6 +105,7 @@ public static ArrayEnumEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayEnum = new ArrayList<>(); public EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) { @@ -121,7 +123,6 @@ public EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) { return justSymbol; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("just_symbol") public void setJustSymbol(@Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -150,7 +151,6 @@ public List getArrayEnum() { return arrayEnum; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_enum") public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java index f94de0c9c545..875ed5bc644b 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/EnumTestDto.java @@ -66,6 +66,7 @@ public static EnumStringEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumStringEnum enumString; /** @@ -105,6 +106,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -143,6 +145,7 @@ public static EnumIntegerEnum fromValue(Integer value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumIntegerEnum enumInteger; /** @@ -181,9 +184,11 @@ public static EnumNumberEnum fromValue(Double value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumNumberEnum enumNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable OuterEnumDto outerEnum; public EnumTestDto() { @@ -205,7 +210,6 @@ public EnumTestDto enumString(@Nullable EnumStringEnum enumString) { return enumString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_string") public void setEnumString(@Nullable EnumStringEnum enumString) { this.enumString = enumString; @@ -246,7 +250,6 @@ public EnumTestDto enumInteger(@Nullable EnumIntegerEnum enumInteger) { return enumInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_integer") public void setEnumInteger(@Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -267,7 +270,6 @@ public EnumTestDto enumNumber(@Nullable EnumNumberEnum enumNumber) { return enumNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_number") public void setEnumNumber(@Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -288,7 +290,6 @@ public EnumTestDto outerEnum(@Nullable OuterEnumDto outerEnum) { return outerEnum; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("outerEnum") public void setOuterEnum(@Nullable OuterEnumDto outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileDto.java index 8d754b6d329e..aa14224caf89 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileDto.java @@ -27,6 +27,7 @@ public class FileDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String sourceURI; public FileDto sourceURI(@Nullable String sourceURI) { @@ -44,7 +45,6 @@ public FileDto sourceURI(@Nullable String sourceURI) { return sourceURI; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("sourceURI") public void setSourceURI(@Nullable String sourceURI) { this.sourceURI = sourceURI; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index e64265eb2f4c..158f346707f0 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -31,9 +31,11 @@ public class FileSchemaTestClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable FileDto file; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid FileDto> files = new ArrayList<>(); public FileSchemaTestClassDto file(@Nullable FileDto file) { @@ -51,7 +53,6 @@ public FileSchemaTestClassDto file(@Nullable FileDto file) { return file; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("file") public void setFile(@Nullable FileDto file) { this.file = file; @@ -80,7 +81,6 @@ public FileSchemaTestClassDto addFilesItem(FileDto filesItem) { return files; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("files") public void setFiles(List<@Valid FileDto> files) { this.files = files; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FormatTestDto.java index e6c0613fa656..841e6c4ff31c 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/FormatTestDto.java @@ -33,43 +33,57 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer integer; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer int32; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Float _float; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Double _double; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal bigDecimal; public FormatTestDto() { @@ -93,7 +107,6 @@ public FormatTestDto integer(@Nullable Integer integer) { return integer; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("integer") public void setInteger(@Nullable Integer integer) { this.integer = integer; @@ -116,7 +129,6 @@ public FormatTestDto int32(@Nullable Integer int32) { return int32; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("int32") public void setInt32(@Nullable Integer int32) { this.int32 = int32; @@ -137,7 +149,6 @@ public FormatTestDto int64(@Nullable Long int64) { return int64; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("int64") public void setInt64(@Nullable Long int64) { this.int64 = int64; @@ -182,7 +193,6 @@ public FormatTestDto _float(@Nullable Float _float) { return _float; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("float") public void setFloat(@Nullable Float _float) { this._float = _float; @@ -205,7 +215,6 @@ public FormatTestDto _double(@Nullable Double _double) { return _double; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("double") public void setDouble(@Nullable Double _double) { this._double = _double; @@ -226,7 +235,6 @@ public FormatTestDto string(@Nullable String string) { return string; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("string") public void setString(@Nullable String string) { this.string = string; @@ -267,7 +275,6 @@ public FormatTestDto binary(@Nullable org.springframework.core.io.Resource binar return binary; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("binary") public void setBinary(@Nullable org.springframework.core.io.Resource binary) { this.binary = binary; @@ -308,7 +315,6 @@ public FormatTestDto dateTime(@Nullable OffsetDateTime dateTime) { return dateTime; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -329,7 +335,6 @@ public FormatTestDto uuid(@Nullable UUID uuid) { return uuid; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; @@ -370,7 +375,6 @@ public FormatTestDto bigDecimal(@Nullable BigDecimal bigDecimal) { return bigDecimal; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("BigDecimal") public void setBigDecimal(@Nullable BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index 7f1ec148d734..a4d5ad3f5be1 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -27,9 +27,11 @@ public class HasOnlyReadOnlyDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String bar; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String foo; public HasOnlyReadOnlyDto bar(@Nullable String bar) { @@ -47,7 +49,6 @@ public HasOnlyReadOnlyDto bar(@Nullable String bar) { return bar; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; @@ -68,7 +69,6 @@ public HasOnlyReadOnlyDto foo(@Nullable String foo) { return foo; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("foo") public void setFoo(@Nullable String foo) { this.foo = foo; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ListDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ListDto.java index f81d7e91fa7a..6d00c022246a 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ListDto.java @@ -27,6 +27,7 @@ public class ListDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String _123list; public ListDto _123list(@Nullable String _123list) { @@ -44,7 +45,6 @@ public ListDto _123list(@Nullable String _123list) { return _123list; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("123-list") public void set123list(@Nullable String _123list) { this._123list = _123list; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MapTestDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MapTestDto.java index 09940c4522d0..5cf480833005 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MapTestDto.java @@ -30,6 +30,7 @@ public class MapTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapOfString = new HashMap<>(); /** @@ -68,12 +69,15 @@ public static InnerEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapOfEnumString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map directMap = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map indirectMap = new HashMap<>(); public MapTestDto mapMapOfString(Map> mapMapOfString) { @@ -99,7 +103,6 @@ public Map> getMapMapOfString() { return mapMapOfString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_of_string") public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -128,7 +131,6 @@ public Map getMapOfEnumString() { return mapOfEnumString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_of_enum_string") public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -157,7 +159,6 @@ public Map getDirectMap() { return directMap; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("direct_map") public void setDirectMap(Map directMap) { this.directMap = directMap; @@ -186,7 +187,6 @@ public Map getIndirectMap() { return indirectMap; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("indirect_map") public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index e3ffa8984cf9..900a1ee469b4 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -33,13 +33,16 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable UUID uuid; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) { @@ -57,7 +60,6 @@ public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) return uuid; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; @@ -78,7 +80,6 @@ public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(@Nullable OffsetD return dateTime; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -107,7 +108,6 @@ public Map getMap() { return map; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map") public void setMap(Map map) { this.map = map; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/Model200ResponseDto.java index 68ab43312e9a..f88e19f2aa90 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -27,9 +27,11 @@ public class Model200ResponseDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyClass; public Model200ResponseDto name(@Nullable Integer name) { @@ -47,7 +49,6 @@ public Model200ResponseDto name(@Nullable Integer name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable Integer name) { this.name = name; @@ -68,7 +69,6 @@ public Model200ResponseDto propertyClass(@Nullable String propertyClass) { return propertyClass; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NameDto.java index 809f87f431c2..3ef8f8bb33c2 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NameDto.java @@ -26,15 +26,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer snakeCase; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String property; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer _123number; public NameDto() { @@ -76,7 +80,6 @@ public NameDto snakeCase(@Nullable Integer snakeCase) { return snakeCase; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("snake_case") public void setSnakeCase(@Nullable Integer snakeCase) { this.snakeCase = snakeCase; @@ -97,7 +100,6 @@ public NameDto property(@Nullable String property) { return property; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("property") public void setProperty(@Nullable String property) { this.property = property; @@ -118,7 +120,6 @@ public NameDto _123number(@Nullable Integer _123number) { return _123number; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("123Number") public void set123number(@Nullable Integer _123number) { this._123number = _123number; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NumberOnlyDto.java index 38d2fe30ad04..34b93588f32c 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -28,6 +28,7 @@ public class NumberOnlyDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal justNumber; public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { @@ -45,7 +46,6 @@ public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { return justNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("JustNumber") public void setJustNumber(@Nullable BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OrderDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OrderDto.java index 10749eefcf28..08c1defb229f 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OrderDto.java @@ -30,15 +30,19 @@ public class OrderDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long petId; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer quantity; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -80,9 +84,11 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable StatusEnum status; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Boolean complete = false; public OrderDto id(@Nullable Long id) { @@ -100,7 +106,6 @@ public OrderDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -121,7 +126,6 @@ public OrderDto petId(@Nullable Long petId) { return petId; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("petId") public void setPetId(@Nullable Long petId) { this.petId = petId; @@ -142,7 +146,6 @@ public OrderDto quantity(@Nullable Integer quantity) { return quantity; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("quantity") public void setQuantity(@Nullable Integer quantity) { this.quantity = quantity; @@ -163,7 +166,6 @@ public OrderDto shipDate(@Nullable OffsetDateTime shipDate) { return shipDate; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("shipDate") public void setShipDate(@Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -184,7 +186,6 @@ public OrderDto status(@Nullable StatusEnum status) { return status; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { this.status = status; @@ -205,7 +206,6 @@ public Boolean getComplete() { return complete; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("complete") public void setComplete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OuterCompositeDto.java index ef36d8f2150d..ec6558982ce0 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -28,12 +28,15 @@ public class OuterCompositeDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal myNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String myString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean myBoolean; public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { @@ -51,7 +54,6 @@ public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { return myNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_number") public void setMyNumber(@Nullable BigDecimal myNumber) { this.myNumber = myNumber; @@ -72,7 +74,6 @@ public OuterCompositeDto myString(@Nullable String myString) { return myString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_string") public void setMyString(@Nullable String myString) { this.myString = myString; @@ -93,7 +94,6 @@ public OuterCompositeDto myBoolean(@Nullable Boolean myBoolean) { return myBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_boolean") public void setMyBoolean(@Nullable Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 624aa64de1f3..e28ac8d9ab82 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -72,6 +72,7 @@ public static TypeEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable TypeEnum type; private @Nullable String nullableProperty = null; @@ -91,7 +92,6 @@ public ParentWithNullableDto type(@Nullable TypeEnum type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(@Nullable TypeEnum type) { this.type = type; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java index 30524a3fe8d0..9131504ef497 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java @@ -36,16 +36,21 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid TagDto> tags = new ArrayList<>(); /** @@ -86,6 +91,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private @Nullable StatusEnum status; @@ -108,7 +114,6 @@ public PetDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -129,7 +134,6 @@ public PetDto category(@Nullable CategoryDto category) { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") public void setCategory(@Nullable CategoryDto category) { this.category = category; @@ -207,7 +211,6 @@ public PetDto addTagsItem(TagDto tagsItem) { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") public void setTags(List<@Valid TagDto> tags) { this.tags = tags; @@ -233,7 +236,6 @@ public PetDto status(@Nullable StatusEnum status) { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index d2e84b1d47e6..0038c0006934 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -27,9 +27,11 @@ public class ReadOnlyFirstDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String bar; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String baz; public ReadOnlyFirstDto bar(@Nullable String bar) { @@ -47,7 +49,6 @@ public ReadOnlyFirstDto bar(@Nullable String bar) { return bar; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; @@ -68,7 +69,6 @@ public ReadOnlyFirstDto baz(@Nullable String baz) { return baz; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("baz") public void setBaz(@Nullable String baz) { this.baz = baz; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java index faa3512a89df..540124366238 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java @@ -27,15 +27,19 @@ public class ResponseObjectWithDifferentFieldNamesDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String normalPropertyName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String UPPER_CASE_PROPERTY_SNAKE; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lowerCasePropertyDashes; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyNameWithSpaces; public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(@Nullable String normalPropertyName) { @@ -53,7 +57,6 @@ public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(@Nullable Str return normalPropertyName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("normalPropertyName") public void setNormalPropertyName(@Nullable String normalPropertyName) { this.normalPropertyName = normalPropertyName; @@ -74,7 +77,6 @@ public ResponseObjectWithDifferentFieldNamesDto UPPER_CASE_PROPERTY_SNAKE(@Nulla return UPPER_CASE_PROPERTY_SNAKE; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public void setUPPERCASEPROPERTYSNAKE(@Nullable String UPPER_CASE_PROPERTY_SNAKE) { this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; @@ -95,7 +97,6 @@ public ResponseObjectWithDifferentFieldNamesDto lowerCasePropertyDashes(@Nullabl return lowerCasePropertyDashes; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lower-case-property-dashes") public void setLowerCasePropertyDashes(@Nullable String lowerCasePropertyDashes) { this.lowerCasePropertyDashes = lowerCasePropertyDashes; @@ -116,7 +117,6 @@ public ResponseObjectWithDifferentFieldNamesDto propertyNameWithSpaces(@Nullable return propertyNameWithSpaces; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("property name with spaces") public void setPropertyNameWithSpaces(@Nullable String propertyNameWithSpaces) { this.propertyNameWithSpaces = propertyNameWithSpaces; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReturnDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReturnDto.java index 9d4d479f06ab..d5cca17c65a9 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/ReturnDto.java @@ -27,6 +27,7 @@ public class ReturnDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer _return; public ReturnDto _return(@Nullable Integer _return) { @@ -44,7 +45,6 @@ public ReturnDto _return(@Nullable Integer _return) { return _return; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("return") public void setReturn(@Nullable Integer _return) { this._return = _return; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 46736897a1ac..bed961337881 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -27,6 +27,7 @@ public class SpecialModelNameDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long $specialPropertyName; public SpecialModelNameDto $specialPropertyName(@Nullable Long $specialPropertyName) { @@ -44,7 +45,6 @@ public class SpecialModelNameDto { return $specialPropertyName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("$special[property.name]") public void set$SpecialPropertyName(@Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TagDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TagDto.java index 0580a3e0b343..a3bed1aa2cab 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TagDto.java @@ -27,9 +27,11 @@ public class TagDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public TagDto id(@Nullable Long id) { @@ -47,7 +49,6 @@ public TagDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -68,7 +69,6 @@ public TagDto name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index e92f8c79ef5f..c0325225555f 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,14 +28,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 0400294f91bc..522e6a5f3520 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -27,16 +28,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/UserDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/UserDto.java index 815716c0500e..8f158989a646 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/UserDto.java @@ -27,27 +27,35 @@ public class UserDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String username; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String firstName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lastName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String email; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String phone; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer userStatus; public UserDto id(@Nullable Long id) { @@ -65,7 +73,6 @@ public UserDto id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -86,7 +93,6 @@ public UserDto username(@Nullable String username) { return username; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("username") public void setUsername(@Nullable String username) { this.username = username; @@ -107,7 +113,6 @@ public UserDto firstName(@Nullable String firstName) { return firstName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("firstName") public void setFirstName(@Nullable String firstName) { this.firstName = firstName; @@ -128,7 +133,6 @@ public UserDto lastName(@Nullable String lastName) { return lastName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lastName") public void setLastName(@Nullable String lastName) { this.lastName = lastName; @@ -149,7 +153,6 @@ public UserDto email(@Nullable String email) { return email; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("email") public void setEmail(@Nullable String email) { this.email = email; @@ -170,7 +173,6 @@ public UserDto password(@Nullable String password) { return password; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("password") public void setPassword(@Nullable String password) { this.password = password; @@ -191,7 +193,6 @@ public UserDto phone(@Nullable String phone) { return phone; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("phone") public void setPhone(@Nullable String phone) { this.phone = phone; @@ -212,7 +213,6 @@ public UserDto userStatus(@Nullable Integer userStatus) { return userStatus; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("userStatus") public void setUserStatus(@Nullable Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/XmlItemDto.java index d018521c12a3..4f0e84c89802 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/XmlItemDto.java @@ -31,90 +31,119 @@ public class XmlItemDto { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String attributeString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal attributeNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer attributeInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean attributeBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List wrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String nameString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal nameNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer nameInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean nameBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List nameArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List nameWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String prefixString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal prefixNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer prefixInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean prefixBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String namespaceString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal namespaceNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer namespaceInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean namespaceBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List namespaceArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List namespaceWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String prefixNsString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal prefixNsNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer prefixNsInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean prefixNsBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixNsArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItemDto attributeString(@Nullable String attributeString) { @@ -132,7 +161,6 @@ public XmlItemDto attributeString(@Nullable String attributeString) { return attributeString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_string") public void setAttributeString(@Nullable String attributeString) { this.attributeString = attributeString; @@ -153,7 +181,6 @@ public XmlItemDto attributeNumber(@Nullable BigDecimal attributeNumber) { return attributeNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_number") public void setAttributeNumber(@Nullable BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -174,7 +201,6 @@ public XmlItemDto attributeInteger(@Nullable Integer attributeInteger) { return attributeInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_integer") public void setAttributeInteger(@Nullable Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -195,7 +221,6 @@ public XmlItemDto attributeBoolean(@Nullable Boolean attributeBoolean) { return attributeBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_boolean") public void setAttributeBoolean(@Nullable Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -224,7 +249,6 @@ public List getWrappedArray() { return wrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("wrapped_array") public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -245,7 +269,6 @@ public XmlItemDto nameString(@Nullable String nameString) { return nameString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_string") public void setNameString(@Nullable String nameString) { this.nameString = nameString; @@ -266,7 +289,6 @@ public XmlItemDto nameNumber(@Nullable BigDecimal nameNumber) { return nameNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_number") public void setNameNumber(@Nullable BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -287,7 +309,6 @@ public XmlItemDto nameInteger(@Nullable Integer nameInteger) { return nameInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_integer") public void setNameInteger(@Nullable Integer nameInteger) { this.nameInteger = nameInteger; @@ -308,7 +329,6 @@ public XmlItemDto nameBoolean(@Nullable Boolean nameBoolean) { return nameBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_boolean") public void setNameBoolean(@Nullable Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -337,7 +357,6 @@ public List getNameArray() { return nameArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_array") public void setNameArray(List nameArray) { this.nameArray = nameArray; @@ -366,7 +385,6 @@ public List getNameWrappedArray() { return nameWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_wrapped_array") public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -387,7 +405,6 @@ public XmlItemDto prefixString(@Nullable String prefixString) { return prefixString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_string") public void setPrefixString(@Nullable String prefixString) { this.prefixString = prefixString; @@ -408,7 +425,6 @@ public XmlItemDto prefixNumber(@Nullable BigDecimal prefixNumber) { return prefixNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_number") public void setPrefixNumber(@Nullable BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -429,7 +445,6 @@ public XmlItemDto prefixInteger(@Nullable Integer prefixInteger) { return prefixInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_integer") public void setPrefixInteger(@Nullable Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -450,7 +465,6 @@ public XmlItemDto prefixBoolean(@Nullable Boolean prefixBoolean) { return prefixBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_boolean") public void setPrefixBoolean(@Nullable Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -479,7 +493,6 @@ public List getPrefixArray() { return prefixArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_array") public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -508,7 +521,6 @@ public List getPrefixWrappedArray() { return prefixWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_wrapped_array") public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -529,7 +541,6 @@ public XmlItemDto namespaceString(@Nullable String namespaceString) { return namespaceString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_string") public void setNamespaceString(@Nullable String namespaceString) { this.namespaceString = namespaceString; @@ -550,7 +561,6 @@ public XmlItemDto namespaceNumber(@Nullable BigDecimal namespaceNumber) { return namespaceNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_number") public void setNamespaceNumber(@Nullable BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -571,7 +581,6 @@ public XmlItemDto namespaceInteger(@Nullable Integer namespaceInteger) { return namespaceInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_integer") public void setNamespaceInteger(@Nullable Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -592,7 +601,6 @@ public XmlItemDto namespaceBoolean(@Nullable Boolean namespaceBoolean) { return namespaceBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_boolean") public void setNamespaceBoolean(@Nullable Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -621,7 +629,6 @@ public List getNamespaceArray() { return namespaceArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_array") public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -650,7 +657,6 @@ public List getNamespaceWrappedArray() { return namespaceWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_wrapped_array") public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -671,7 +677,6 @@ public XmlItemDto prefixNsString(@Nullable String prefixNsString) { return prefixNsString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_string") public void setPrefixNsString(@Nullable String prefixNsString) { this.prefixNsString = prefixNsString; @@ -692,7 +697,6 @@ public XmlItemDto prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { return prefixNsNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_number") public void setPrefixNsNumber(@Nullable BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -713,7 +717,6 @@ public XmlItemDto prefixNsInteger(@Nullable Integer prefixNsInteger) { return prefixNsInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_integer") public void setPrefixNsInteger(@Nullable Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -734,7 +737,6 @@ public XmlItemDto prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { return prefixNsBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_boolean") public void setPrefixNsBoolean(@Nullable Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -763,7 +765,6 @@ public List getPrefixNsArray() { return prefixNsArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_array") public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -792,7 +793,6 @@ public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_wrapped_array") public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 5daca86cbb74..a3e051349288 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Animal.java index 2e8e804a79d3..e4e0790b3e92 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Category.java index 08c3a1d9091a..3455dcf8b80b 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 09216052292e..219aeb0cd0ed 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/EnumTest.java index bab57721b404..671101c3ca77 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/FormatTest.java index 6c85cd100777..17566a89eeda 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Name.java index 9b15554afbc6..aa4b273b332e 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Name.java @@ -23,6 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/NullableMapProperty.java index d606c62a8fcf..c25a2eaa55bf 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ParentWithNullable.java index d6a067cca4e5..fde0586fa40c 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java index f4272d0f6c80..a879f5ebd770 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderDefault.java index a3fc75dcc4f8..ac5a2fd1272b 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderExample.java index 4171f01f6aed..faf1e1ff30ef 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index b893bb4ec7c6..613b36dd183c 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java index e301cd61dba3..67474f01ec05 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java index 5c51fa54cc0a..ca80887aed58 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java @@ -26,6 +26,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index af2b07f95d73..fe0be24e229d 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java index 5263a4e2bc96..5069a1a9acbb 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java @@ -102,6 +102,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java index 18101da678fa..c68a2728bcb1 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java @@ -38,6 +38,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -49,11 +50,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -64,6 +67,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java index 0d4be7ac8140..b6b48d488ede 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java @@ -23,6 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index f93832a65c98..d9edf72050f1 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 2300afd143a4..af08c71fb48f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -74,7 +74,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java index 0ce2b93a2b0f..791eea25f843 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java @@ -38,8 +38,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 987983e43451..8ca218f8c704 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 4db40f3db382..eea548352cc7 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/client/petstore/swift5/alamofireLibrary/git_push.sh b/samples/client/petstore/swift5/alamofireLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/git_push.sh +++ b/samples/client/petstore/swift5/alamofireLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/git_push.sh b/samples/client/petstore/swift5/asyncAwaitLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/git_push.sh +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/combineLibrary/git_push.sh b/samples/client/petstore/swift5/combineLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/combineLibrary/git_push.sh +++ b/samples/client/petstore/swift5/combineLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/default/git_push.sh b/samples/client/petstore/swift5/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/default/git_push.sh +++ b/samples/client/petstore/swift5/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/objcCompatible/git_push.sh b/samples/client/petstore/swift5/objcCompatible/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/objcCompatible/git_push.sh +++ b/samples/client/petstore/swift5/objcCompatible/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/oneOf/git_push.sh b/samples/client/petstore/swift5/oneOf/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/oneOf/git_push.sh +++ b/samples/client/petstore/swift5/oneOf/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/promisekitLibrary/git_push.sh b/samples/client/petstore/swift5/promisekitLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/git_push.sh +++ b/samples/client/petstore/swift5/promisekitLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/resultLibrary/git_push.sh b/samples/client/petstore/swift5/resultLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/resultLibrary/git_push.sh +++ b/samples/client/petstore/swift5/resultLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/rxswiftLibrary/git_push.sh b/samples/client/petstore/swift5/rxswiftLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/git_push.sh +++ b/samples/client/petstore/swift5/rxswiftLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/urlsessionLibrary/git_push.sh b/samples/client/petstore/swift5/urlsessionLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/git_push.sh +++ b/samples/client/petstore/swift5/urlsessionLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift5/validation/git_push.sh b/samples/client/petstore/swift5/validation/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift5/validation/git_push.sh +++ b/samples/client/petstore/swift5/validation/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/alamofireLibrary/git_push.sh b/samples/client/petstore/swift6/alamofireLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/git_push.sh +++ b/samples/client/petstore/swift6/alamofireLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/git_push.sh b/samples/client/petstore/swift6/apiNonStaticMethod/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/git_push.sh +++ b/samples/client/petstore/swift6/apiNonStaticMethod/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/git_push.sh b/samples/client/petstore/swift6/asyncAwaitLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/git_push.sh +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/git_push.sh b/samples/client/petstore/swift6/combineDeferredLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/git_push.sh +++ b/samples/client/petstore/swift6/combineDeferredLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/combineLibrary/git_push.sh b/samples/client/petstore/swift6/combineLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/combineLibrary/git_push.sh +++ b/samples/client/petstore/swift6/combineLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/default/git_push.sh b/samples/client/petstore/swift6/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/default/git_push.sh +++ b/samples/client/petstore/swift6/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/objcCompatible/git_push.sh b/samples/client/petstore/swift6/objcCompatible/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/objcCompatible/git_push.sh +++ b/samples/client/petstore/swift6/objcCompatible/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/oneOf/git_push.sh b/samples/client/petstore/swift6/oneOf/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/oneOf/git_push.sh +++ b/samples/client/petstore/swift6/oneOf/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/promisekitLibrary/git_push.sh b/samples/client/petstore/swift6/promisekitLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/git_push.sh +++ b/samples/client/petstore/swift6/promisekitLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/resultLibrary/git_push.sh b/samples/client/petstore/swift6/resultLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/resultLibrary/git_push.sh +++ b/samples/client/petstore/swift6/resultLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/rxswiftLibrary/git_push.sh b/samples/client/petstore/swift6/rxswiftLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/git_push.sh +++ b/samples/client/petstore/swift6/rxswiftLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/urlsessionLibrary/git_push.sh b/samples/client/petstore/swift6/urlsessionLibrary/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/git_push.sh +++ b/samples/client/petstore/swift6/urlsessionLibrary/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/swift6/validation/git_push.sh b/samples/client/petstore/swift6/validation/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/swift6/validation/git_push.sh +++ b/samples/client/petstore/swift6/validation/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/order.ts index b1bea2ba5024..3b4a2eb5e942 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/package-lock.json b/samples/client/petstore/typescript-angular-v18-provided-in-root/package-lock.json index 923217d5e83e..e8a8a54ca2df 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/package-lock.json +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/package-lock.json @@ -3552,9 +3552,9 @@ } }, "node_modules/@hono/node-server": { - "version": "1.19.13", - "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.13.tgz", - "integrity": "sha512-TsQLe4i2gvoTtrHje625ngThGBySOgSK3Xo2XRYOdqGN1teR8+I7vchQC46uLJi8OF62YTYA3AhSpumtkhsaKQ==", + "version": "1.19.17", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.17.tgz", + "integrity": "sha512-dSneS5qhiauZWGDCeK4o695Xd9nUNjviSZCMQrj10eetr8Uln1ucn6bbphOM6UynAMMtNIzZNSpL9vnASJwrPQ==", "dev": true, "license": "MIT", "engines": { diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts index fcc8b99fdf6f..1b3e1b665d8f 100644 --- a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - SHIPPED: 'delivered' + SHIPPED: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/order.ts index b1bea2ba5024..3b4a2eb5e942 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v19/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v19/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/order.ts index b1bea2ba5024..3b4a2eb5e942 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v19/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/model/order.ts index fcc8b99fdf6f..1b3e1b665d8f 100644 --- a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - SHIPPED: 'delivered' + SHIPPED: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v20/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v20/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v20/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v20/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v20/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v20/builds/default/model/order.ts index b1bea2ba5024..3b4a2eb5e942 100644 --- a/samples/client/petstore/typescript-angular-v20/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v20/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v20/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v20/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v20/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v20/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/model/order.ts index fcc8b99fdf6f..1b3e1b665d8f 100644 --- a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - SHIPPED: 'delivered' + SHIPPED: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v21/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v21/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v21/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v21/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v21/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v21/builds/default/model/order.ts index b1bea2ba5024..3b4a2eb5e942 100644 --- a/samples/client/petstore/typescript-angular-v21/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v21/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v21/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v21/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v21/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v21/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/model/order.ts index fcc8b99fdf6f..1b3e1b665d8f 100644 --- a/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - SHIPPED: 'delivered' + SHIPPED: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v22-provided-in-root/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v22/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v22/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-angular-v22/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v22/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-angular-v22/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v22/builds/default/model/order.ts index b1bea2ba5024..3b4a2eb5e942 100644 --- a/samples/client/petstore/typescript-angular-v22/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v22/builds/default/model/order.ts @@ -27,7 +27,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-angular-v22/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v22/builds/default/model/pet.ts index 5c189773cf03..72a208581657 100644 --- a/samples/client/petstore/typescript-angular-v22/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v22/builds/default/model/pet.ts @@ -30,7 +30,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/client/petstore/typescript-aurelia/default/git_push.sh b/samples/client/petstore/typescript-aurelia/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-aurelia/default/git_push.sh +++ b/samples/client/petstore/typescript-aurelia/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/git_push.sh b/samples/client/petstore/typescript-axios/builds/composed-schemas/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/default/git_push.sh b/samples/client/petstore/typescript-axios/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/git_push.sh b/samples/client/petstore/typescript-axios/builds/es6-target/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/es6-target/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/git_push.sh b/samples/client/petstore/typescript-axios/builds/test-petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-interfaces/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-npm-version/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-string-enums/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-string-enums/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index e54629f53eca..9e32d8b9d52b 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -1653,7 +1653,7 @@ export class FakeApi extends runtime.BaseAPI { */ export const TestEnumParametersEnumHeaderStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumHeaderStringArrayEnum = typeof TestEnumParametersEnumHeaderStringArrayEnum[keyof typeof TestEnumParametersEnumHeaderStringArrayEnum]; /** @@ -1662,7 +1662,7 @@ export type TestEnumParametersEnumHeaderStringArrayEnum = typeof TestEnumParamet export const TestEnumParametersEnumHeaderStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumHeaderStringEnum = typeof TestEnumParametersEnumHeaderStringEnum[keyof typeof TestEnumParametersEnumHeaderStringEnum]; /** @@ -1670,7 +1670,7 @@ export type TestEnumParametersEnumHeaderStringEnum = typeof TestEnumParametersEn */ export const TestEnumParametersEnumQueryStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumQueryStringArrayEnum = typeof TestEnumParametersEnumQueryStringArrayEnum[keyof typeof TestEnumParametersEnumQueryStringArrayEnum]; /** @@ -1679,7 +1679,7 @@ export type TestEnumParametersEnumQueryStringArrayEnum = typeof TestEnumParamete export const TestEnumParametersEnumQueryStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumQueryStringEnum = typeof TestEnumParametersEnumQueryStringEnum[keyof typeof TestEnumParametersEnumQueryStringEnum]; /** @@ -1687,7 +1687,7 @@ export type TestEnumParametersEnumQueryStringEnum = typeof TestEnumParametersEnu */ export const TestEnumParametersEnumQueryIntegerEnum = { NUMBER_1: 1, - NUMBER_MINUS_2: -2 + NUMBER_MINUS_2: -2, } as const; export type TestEnumParametersEnumQueryIntegerEnum = typeof TestEnumParametersEnumQueryIntegerEnum[keyof typeof TestEnumParametersEnumQueryIntegerEnum]; /** @@ -1695,7 +1695,7 @@ export type TestEnumParametersEnumQueryIntegerEnum = typeof TestEnumParametersEn */ export const TestEnumParametersEnumQueryDoubleEnum = { NUMBER_1_DOT_1: 1.1, - NUMBER_MINUS_1_DOT_2: -1.2 + NUMBER_MINUS_1_DOT_2: -1.2, } as const; export type TestEnumParametersEnumQueryDoubleEnum = typeof TestEnumParametersEnumQueryDoubleEnum[keyof typeof TestEnumParametersEnumQueryDoubleEnum]; /** @@ -1703,7 +1703,7 @@ export type TestEnumParametersEnumQueryDoubleEnum = typeof TestEnumParametersEnu */ export const TestEnumParametersEnumFormStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumFormStringArrayEnum = typeof TestEnumParametersEnumFormStringArrayEnum[keyof typeof TestEnumParametersEnumFormStringArrayEnum]; /** @@ -1712,6 +1712,6 @@ export type TestEnumParametersEnumFormStringArrayEnum = typeof TestEnumParameter export const TestEnumParametersEnumFormStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumFormStringEnum = typeof TestEnumParametersEnumFormStringEnum[keyof typeof TestEnumParametersEnumFormStringEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/PetApi.ts index 16bcd6ed6b0b..022abaa2616d 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/PetApi.ts @@ -689,6 +689,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumArrays.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumArrays.ts index 84cd87dd1408..7de8c51549a6 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumArrays.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumArrays.ts @@ -35,7 +35,7 @@ export interface EnumArrays { */ export const EnumArraysJustSymbolEnum = { GreaterThanOrEqualTo: '>=', - Dollar: '$' + Dollar: '$', } as const; export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typeof EnumArraysJustSymbolEnum]; @@ -44,7 +44,7 @@ export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typ */ export const EnumArraysArrayEnumEnum = { Fish: 'fish', - Crab: 'crab' + Crab: 'crab', } as const; export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeof EnumArraysArrayEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts index 6878b8591431..510eed277b57 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts @@ -20,7 +20,7 @@ export const EnumClass = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts index 4c27767e593c..fc0968a4226a 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts @@ -89,7 +89,7 @@ export interface EnumTest { export const EnumTestEnumStringEnum = { Upper: 'UPPER', Lower: 'lower', - Empty: '' + Empty: '', } as const; export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof EnumTestEnumStringEnum]; @@ -99,7 +99,7 @@ export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof export const EnumTestEnumStringRequiredEnum = { Upper: 'UPPER', Lower: 'lower', - Empty: '' + Empty: '', } as const; export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEnum[keyof typeof EnumTestEnumStringRequiredEnum]; @@ -108,7 +108,7 @@ export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEn */ export const EnumTestEnumIntegerEnum = { NUMBER_1: 1, - NUMBER_MINUS_1: -1 + NUMBER_MINUS_1: -1, } as const; export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeof EnumTestEnumIntegerEnum]; @@ -117,7 +117,7 @@ export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeo */ export const EnumTestEnumNumberEnum = { NUMBER_1_DOT_1: 1.1, - NUMBER_MINUS_1_DOT_2: -1.2 + NUMBER_MINUS_1_DOT_2: -1.2, } as const; export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof EnumTestEnumNumberEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts index 18ea456c8951..3636df53f338 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts @@ -43,7 +43,7 @@ export interface MapTest { */ export const MapTestMapOfEnumStringEnum = { Upper: 'UPPER', - Lower: 'lower' + Lower: 'lower', } as const; export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof typeof MapTestMapOfEnumStringEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Order.ts index 1d32da2609f6..25207f7af636 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts index 4be9edeac589..3cd56b943445 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts @@ -20,7 +20,7 @@ export const OuterEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts index de44a7878120..0d31746d36c7 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts @@ -20,7 +20,7 @@ export const OuterEnumDefaultValue = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof OuterEnumDefaultValue]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts index b899dc358ea0..c5396b00d766 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts @@ -20,7 +20,7 @@ export const OuterEnumInteger = { NUMBER_0: 0, NUMBER_1: 1, - NUMBER_2: 2 + NUMBER_2: 2, } as const; export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInteger]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts index 1a6941699214..c6958ecba1a5 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts @@ -20,7 +20,7 @@ export const OuterEnumIntegerDefaultValue = { NUMBER_0: 0, NUMBER_1: 1, - NUMBER_2: 2 + NUMBER_2: 2, } as const; export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[keyof typeof OuterEnumIntegerDefaultValue]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts index 0eedf046f63c..05c2dbb3775f 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts @@ -35,7 +35,7 @@ export interface ParentWithNullable { * @export */ export const ParentWithNullableTypeEnum = { - ChildWithNullable: 'ChildWithNullable' + ChildWithNullable: 'ChildWithNullable', } as const; export type ParentWithNullableTypeEnum = typeof ParentWithNullableTypeEnum[keyof typeof ParentWithNullableTypeEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts index 20d21e2f1aad..3d92e97597ea 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts index 8247fdf99d23..6ef73237a553 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts @@ -19,7 +19,7 @@ */ export const SingleRefType = { Admin: 'admin', - User: 'user' + User: 'user', } as const; export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts index c4dbaa469281..08701d5f9df8 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts @@ -579,6 +579,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts index cb6b5c016de6..96f4f6a631b0 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts index 4c0cb6e73685..c97eff821d6a 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts index 21b890818e10..2e68788404cc 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts @@ -277,7 +277,7 @@ export class DefaultApi extends runtime.BaseAPI { export const FakeEnumRequestGetInlineStringEnumEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type FakeEnumRequestGetInlineStringEnumEnum = typeof FakeEnumRequestGetInlineStringEnumEnum[keyof typeof FakeEnumRequestGetInlineStringEnumEnum]; /** @@ -286,7 +286,7 @@ export type FakeEnumRequestGetInlineStringEnumEnum = typeof FakeEnumRequestGetIn export const FakeEnumRequestGetInlineNullableStringEnumEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type FakeEnumRequestGetInlineNullableStringEnumEnum = typeof FakeEnumRequestGetInlineNullableStringEnumEnum[keyof typeof FakeEnumRequestGetInlineNullableStringEnumEnum]; /** @@ -295,7 +295,7 @@ export type FakeEnumRequestGetInlineNullableStringEnumEnum = typeof FakeEnumRequ export const FakeEnumRequestGetInlineNumberEnumEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type FakeEnumRequestGetInlineNumberEnumEnum = typeof FakeEnumRequestGetInlineNumberEnumEnum[keyof typeof FakeEnumRequestGetInlineNumberEnumEnum]; /** @@ -304,6 +304,6 @@ export type FakeEnumRequestGetInlineNumberEnumEnum = typeof FakeEnumRequestGetIn export const FakeEnumRequestGetInlineNullableNumberEnumEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type FakeEnumRequestGetInlineNullableNumberEnumEnum = typeof FakeEnumRequestGetInlineNullableNumberEnumEnum[keyof typeof FakeEnumRequestGetInlineNullableNumberEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestGetInline200Response.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestGetInline200Response.ts index 50912880cb8f..1854a3c5f02d 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestGetInline200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestGetInline200Response.ts @@ -44,7 +44,7 @@ export interface FakeEnumRequestGetInline200Response { export const FakeEnumRequestGetInline200ResponseStringEnumEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type FakeEnumRequestGetInline200ResponseStringEnumEnum = typeof FakeEnumRequestGetInline200ResponseStringEnumEnum[keyof typeof FakeEnumRequestGetInline200ResponseStringEnumEnum]; @@ -54,7 +54,7 @@ export type FakeEnumRequestGetInline200ResponseStringEnumEnum = typeof FakeEnumR export const FakeEnumRequestGetInline200ResponseNullableStringEnumEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type FakeEnumRequestGetInline200ResponseNullableStringEnumEnum = typeof FakeEnumRequestGetInline200ResponseNullableStringEnumEnum[keyof typeof FakeEnumRequestGetInline200ResponseNullableStringEnumEnum]; @@ -64,7 +64,7 @@ export type FakeEnumRequestGetInline200ResponseNullableStringEnumEnum = typeof F export const FakeEnumRequestGetInline200ResponseNumberEnumEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type FakeEnumRequestGetInline200ResponseNumberEnumEnum = typeof FakeEnumRequestGetInline200ResponseNumberEnumEnum[keyof typeof FakeEnumRequestGetInline200ResponseNumberEnumEnum]; @@ -74,7 +74,7 @@ export type FakeEnumRequestGetInline200ResponseNumberEnumEnum = typeof FakeEnumR export const FakeEnumRequestGetInline200ResponseNullableNumberEnumEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type FakeEnumRequestGetInline200ResponseNullableNumberEnumEnum = typeof FakeEnumRequestGetInline200ResponseNullableNumberEnumEnum[keyof typeof FakeEnumRequestGetInline200ResponseNullableNumberEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestPostInlineRequest.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestPostInlineRequest.ts index ea6fee11aa78..ef12f27e3770 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestPostInlineRequest.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestPostInlineRequest.ts @@ -52,7 +52,7 @@ export interface FakeEnumRequestPostInlineRequest { export const FakeEnumRequestPostInlineRequestStringEnumEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type FakeEnumRequestPostInlineRequestStringEnumEnum = typeof FakeEnumRequestPostInlineRequestStringEnumEnum[keyof typeof FakeEnumRequestPostInlineRequestStringEnumEnum]; @@ -62,7 +62,7 @@ export type FakeEnumRequestPostInlineRequestStringEnumEnum = typeof FakeEnumRequ export const FakeEnumRequestPostInlineRequestNullableStringEnumEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type FakeEnumRequestPostInlineRequestNullableStringEnumEnum = typeof FakeEnumRequestPostInlineRequestNullableStringEnumEnum[keyof typeof FakeEnumRequestPostInlineRequestNullableStringEnumEnum]; @@ -72,7 +72,7 @@ export type FakeEnumRequestPostInlineRequestNullableStringEnumEnum = typeof Fake export const FakeEnumRequestPostInlineRequestNumberEnumEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type FakeEnumRequestPostInlineRequestNumberEnumEnum = typeof FakeEnumRequestPostInlineRequestNumberEnumEnum[keyof typeof FakeEnumRequestPostInlineRequestNumberEnumEnum]; @@ -82,7 +82,7 @@ export type FakeEnumRequestPostInlineRequestNumberEnumEnum = typeof FakeEnumRequ export const FakeEnumRequestPostInlineRequestNullableNumberEnumEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type FakeEnumRequestPostInlineRequestNullableNumberEnumEnum = typeof FakeEnumRequestPostInlineRequestNullableNumberEnumEnum[keyof typeof FakeEnumRequestPostInlineRequestNullableNumberEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/InlineObject.ts index 92edc483c907..bcf7b062b2d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/InlineObject.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/InlineObject.ts @@ -52,7 +52,7 @@ export interface InlineObject { export const InlineObjectStringEnumEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type InlineObjectStringEnumEnum = typeof InlineObjectStringEnumEnum[keyof typeof InlineObjectStringEnumEnum]; @@ -62,7 +62,7 @@ export type InlineObjectStringEnumEnum = typeof InlineObjectStringEnumEnum[keyof export const InlineObjectNumberEnumEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type InlineObjectNumberEnumEnum = typeof InlineObjectNumberEnumEnum[keyof typeof InlineObjectNumberEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/InlineResponse200.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/InlineResponse200.ts index dc31a9b0f608..89327242dba0 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/InlineResponse200.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/InlineResponse200.ts @@ -52,7 +52,7 @@ export interface InlineResponse200 { export const InlineResponse200StringEnumEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type InlineResponse200StringEnumEnum = typeof InlineResponse200StringEnumEnum[keyof typeof InlineResponse200StringEnumEnum]; @@ -62,7 +62,7 @@ export type InlineResponse200StringEnumEnum = typeof InlineResponse200StringEnum export const InlineResponse200NumberEnumEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type InlineResponse200NumberEnumEnum = typeof InlineResponse200NumberEnumEnum[keyof typeof InlineResponse200NumberEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts index d893f1143456..efea71543d42 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts @@ -20,7 +20,7 @@ export const NumberEnum = { NUMBER_1: 1, NUMBER_2: 2, - NUMBER_3: 3 + NUMBER_3: 3, } as const; export type NumberEnum = typeof NumberEnum[keyof typeof NumberEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts index 172e15ef52d4..a88c4171dc4a 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts @@ -20,7 +20,7 @@ export const StringEnum = { One: 'one', Two: 'two', - Three: 'three' + Three: 'three', } as const; export type StringEnum = typeof StringEnum[keyof typeof StringEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts index c4dbaa469281..08701d5f9df8 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts @@ -579,6 +579,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts index cb6b5c016de6..96f4f6a631b0 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts index 4c0cb6e73685..c97eff821d6a 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-api.ts index f62eb520f8d1..3eca2bd04f65 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-api.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-api.ts @@ -1653,7 +1653,7 @@ export class FakeApi extends runtime.BaseAPI { */ export const TestEnumParametersEnumHeaderStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumHeaderStringArrayEnum = typeof TestEnumParametersEnumHeaderStringArrayEnum[keyof typeof TestEnumParametersEnumHeaderStringArrayEnum]; /** @@ -1662,7 +1662,7 @@ export type TestEnumParametersEnumHeaderStringArrayEnum = typeof TestEnumParamet export const TestEnumParametersEnumHeaderStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumHeaderStringEnum = typeof TestEnumParametersEnumHeaderStringEnum[keyof typeof TestEnumParametersEnumHeaderStringEnum]; /** @@ -1670,7 +1670,7 @@ export type TestEnumParametersEnumHeaderStringEnum = typeof TestEnumParametersEn */ export const TestEnumParametersEnumQueryStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumQueryStringArrayEnum = typeof TestEnumParametersEnumQueryStringArrayEnum[keyof typeof TestEnumParametersEnumQueryStringArrayEnum]; /** @@ -1679,7 +1679,7 @@ export type TestEnumParametersEnumQueryStringArrayEnum = typeof TestEnumParamete export const TestEnumParametersEnumQueryStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumQueryStringEnum = typeof TestEnumParametersEnumQueryStringEnum[keyof typeof TestEnumParametersEnumQueryStringEnum]; /** @@ -1687,7 +1687,7 @@ export type TestEnumParametersEnumQueryStringEnum = typeof TestEnumParametersEnu */ export const TestEnumParametersEnumQueryIntegerEnum = { NUMBER_1: 1, - NUMBER_MINUS_2: -2 + NUMBER_MINUS_2: -2, } as const; export type TestEnumParametersEnumQueryIntegerEnum = typeof TestEnumParametersEnumQueryIntegerEnum[keyof typeof TestEnumParametersEnumQueryIntegerEnum]; /** @@ -1695,7 +1695,7 @@ export type TestEnumParametersEnumQueryIntegerEnum = typeof TestEnumParametersEn */ export const TestEnumParametersEnumQueryDoubleEnum = { NUMBER_1_DOT_1: 1.1, - NUMBER_MINUS_1_DOT_2: -1.2 + NUMBER_MINUS_1_DOT_2: -1.2, } as const; export type TestEnumParametersEnumQueryDoubleEnum = typeof TestEnumParametersEnumQueryDoubleEnum[keyof typeof TestEnumParametersEnumQueryDoubleEnum]; /** @@ -1703,7 +1703,7 @@ export type TestEnumParametersEnumQueryDoubleEnum = typeof TestEnumParametersEnu */ export const TestEnumParametersEnumFormStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumFormStringArrayEnum = typeof TestEnumParametersEnumFormStringArrayEnum[keyof typeof TestEnumParametersEnumFormStringArrayEnum]; /** @@ -1712,6 +1712,6 @@ export type TestEnumParametersEnumFormStringArrayEnum = typeof TestEnumParameter export const TestEnumParametersEnumFormStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumFormStringEnum = typeof TestEnumParametersEnumFormStringEnum[keyof typeof TestEnumParametersEnumFormStringEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/pet-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/pet-api.ts index 36fd402605f9..51e199a31980 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/pet-api.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/pet-api.ts @@ -689,6 +689,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-arrays.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-arrays.ts index 84cd87dd1408..7de8c51549a6 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-arrays.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-arrays.ts @@ -35,7 +35,7 @@ export interface EnumArrays { */ export const EnumArraysJustSymbolEnum = { GreaterThanOrEqualTo: '>=', - Dollar: '$' + Dollar: '$', } as const; export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typeof EnumArraysJustSymbolEnum]; @@ -44,7 +44,7 @@ export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typ */ export const EnumArraysArrayEnumEnum = { Fish: 'fish', - Crab: 'crab' + Crab: 'crab', } as const; export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeof EnumArraysArrayEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-class.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-class.ts index 6878b8591431..510eed277b57 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-class.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-class.ts @@ -20,7 +20,7 @@ export const EnumClass = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-test.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-test.ts index ebfff184b281..af30bc5e5238 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-test.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-test.ts @@ -89,7 +89,7 @@ export interface EnumTest { export const EnumTestEnumStringEnum = { Upper: 'UPPER', Lower: 'lower', - Empty: '' + Empty: '', } as const; export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof EnumTestEnumStringEnum]; @@ -99,7 +99,7 @@ export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof export const EnumTestEnumStringRequiredEnum = { Upper: 'UPPER', Lower: 'lower', - Empty: '' + Empty: '', } as const; export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEnum[keyof typeof EnumTestEnumStringRequiredEnum]; @@ -108,7 +108,7 @@ export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEn */ export const EnumTestEnumIntegerEnum = { NUMBER_1: 1, - NUMBER_MINUS_1: -1 + NUMBER_MINUS_1: -1, } as const; export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeof EnumTestEnumIntegerEnum]; @@ -117,7 +117,7 @@ export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeo */ export const EnumTestEnumNumberEnum = { NUMBER_1_DOT_1: 1.1, - NUMBER_MINUS_1_DOT_2: -1.2 + NUMBER_MINUS_1_DOT_2: -1.2, } as const; export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof EnumTestEnumNumberEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/map-test.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/map-test.ts index 18ea456c8951..3636df53f338 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/map-test.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/map-test.ts @@ -43,7 +43,7 @@ export interface MapTest { */ export const MapTestMapOfEnumStringEnum = { Upper: 'UPPER', - Lower: 'lower' + Lower: 'lower', } as const; export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof typeof MapTestMapOfEnumStringEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/order.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/order.ts index 1d32da2609f6..25207f7af636 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/order.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-default-value.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-default-value.ts index de44a7878120..0d31746d36c7 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-default-value.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-default-value.ts @@ -20,7 +20,7 @@ export const OuterEnumDefaultValue = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof OuterEnumDefaultValue]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer-default-value.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer-default-value.ts index 1a6941699214..c6958ecba1a5 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer-default-value.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer-default-value.ts @@ -20,7 +20,7 @@ export const OuterEnumIntegerDefaultValue = { NUMBER_0: 0, NUMBER_1: 1, - NUMBER_2: 2 + NUMBER_2: 2, } as const; export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[keyof typeof OuterEnumIntegerDefaultValue]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer.ts index b899dc358ea0..c5396b00d766 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer.ts @@ -20,7 +20,7 @@ export const OuterEnumInteger = { NUMBER_0: 0, NUMBER_1: 1, - NUMBER_2: 2 + NUMBER_2: 2, } as const; export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInteger]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum.ts index 4be9edeac589..3cd56b943445 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum.ts @@ -20,7 +20,7 @@ export const OuterEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/parent-with-nullable.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/parent-with-nullable.ts index 0eedf046f63c..05c2dbb3775f 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/parent-with-nullable.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/parent-with-nullable.ts @@ -35,7 +35,7 @@ export interface ParentWithNullable { * @export */ export const ParentWithNullableTypeEnum = { - ChildWithNullable: 'ChildWithNullable' + ChildWithNullable: 'ChildWithNullable', } as const; export type ParentWithNullableTypeEnum = typeof ParentWithNullableTypeEnum[keyof typeof ParentWithNullableTypeEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/pet.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/pet.ts index add649416353..3f38da1f7f75 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/single-ref-type.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/single-ref-type.ts index 8247fdf99d23..6ef73237a553 100644 --- a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/single-ref-type.ts +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/single-ref-type.ts @@ -19,7 +19,7 @@ */ export const SingleRefType = { Admin: 'admin', - User: 'user' + User: 'user', } as const; export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts index 2ec1b3d4cc57..90a3ddba16f6 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts @@ -579,6 +579,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts index cb6b5c016de6..96f4f6a631b0 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts index 4c0cb6e73685..c97eff821d6a 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/DashedOptionOne.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/DashedOptionOne.ts index 42b09a797522..eec4844c1fca 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/models/DashedOptionOne.ts +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/DashedOptionOne.ts @@ -34,7 +34,7 @@ export interface DashedOptionOne { * @export */ export const DashedOptionOneDiscriminatorFieldEnum = { - DashedOptionOne: 'dashedOptionOne' + DashedOptionOne: 'dashedOptionOne', } as const; export type DashedOptionOneDiscriminatorFieldEnum = typeof DashedOptionOneDiscriminatorFieldEnum[keyof typeof DashedOptionOneDiscriminatorFieldEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/DashedOptionTwo.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/DashedOptionTwo.ts index a7f16917f6de..df4b5e9dad37 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/models/DashedOptionTwo.ts +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/DashedOptionTwo.ts @@ -34,7 +34,7 @@ export interface DashedOptionTwo { * @export */ export const DashedOptionTwoDiscriminatorFieldEnum = { - DashedOptionTwo: 'dashedOptionTwo' + DashedOptionTwo: 'dashedOptionTwo', } as const; export type DashedOptionTwoDiscriminatorFieldEnum = typeof DashedOptionTwoDiscriminatorFieldEnum[keyof typeof DashedOptionTwoDiscriminatorFieldEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/NumericSingletonEnumModel.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/NumericSingletonEnumModel.ts index 45551ae6a917..44d44774d7e1 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/models/NumericSingletonEnumModel.ts +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/NumericSingletonEnumModel.ts @@ -30,7 +30,7 @@ export interface NumericSingletonEnumModel { * @export */ export const NumericSingletonEnumModelKindEnum = { - NUMBER_42: 42 + NUMBER_42: 42, } as const; export type NumericSingletonEnumModelKindEnum = typeof NumericSingletonEnumModelKindEnum[keyof typeof NumericSingletonEnumModelKindEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/OptionOne.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/OptionOne.ts index ccfc53dfe05e..857c9ce4b003 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/models/OptionOne.ts +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/OptionOne.ts @@ -30,7 +30,7 @@ export interface OptionOne { * @export */ export const OptionOneDiscriminatorFieldEnum = { - OptionOne: 'optionOne' + OptionOne: 'optionOne', } as const; export type OptionOneDiscriminatorFieldEnum = typeof OptionOneDiscriminatorFieldEnum[keyof typeof OptionOneDiscriminatorFieldEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/OptionTwo.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/OptionTwo.ts index ff75902cb6fd..21ab56026b6f 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/models/OptionTwo.ts +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/OptionTwo.ts @@ -30,7 +30,7 @@ export interface OptionTwo { * @export */ export const OptionTwoDiscriminatorFieldEnum = { - OptionTwo: 'optionTwo' + OptionTwo: 'optionTwo', } as const; export type OptionTwoDiscriminatorFieldEnum = typeof OptionTwoDiscriminatorFieldEnum[keyof typeof OptionTwoDiscriminatorFieldEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/SnakeOptionOne.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/SnakeOptionOne.ts index d738d4d73a15..8dd2ba1da5b9 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/models/SnakeOptionOne.ts +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/SnakeOptionOne.ts @@ -34,7 +34,7 @@ export interface SnakeOptionOne { * @export */ export const SnakeOptionOneDiscriminatorFieldEnum = { - SnakeOptionOne: 'snakeOptionOne' + SnakeOptionOne: 'snakeOptionOne', } as const; export type SnakeOptionOneDiscriminatorFieldEnum = typeof SnakeOptionOneDiscriminatorFieldEnum[keyof typeof SnakeOptionOneDiscriminatorFieldEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/SnakeOptionTwo.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/SnakeOptionTwo.ts index c8b1f9451572..8cd83044ac83 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/models/SnakeOptionTwo.ts +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/SnakeOptionTwo.ts @@ -34,7 +34,7 @@ export interface SnakeOptionTwo { * @export */ export const SnakeOptionTwoDiscriminatorFieldEnum = { - SnakeOptionTwo: 'snakeOptionTwo' + SnakeOptionTwo: 'snakeOptionTwo', } as const; export type SnakeOptionTwoDiscriminatorFieldEnum = typeof SnakeOptionTwoDiscriminatorFieldEnum[keyof typeof SnakeOptionTwoDiscriminatorFieldEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts index a5dca0be772b..f959d1785b55 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts @@ -579,6 +579,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts index cb6b5c016de6..96f4f6a631b0 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts index 4c0cb6e73685..c97eff821d6a 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts index 1fa82dbf26ab..05b3a0ff97ac 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts @@ -847,6 +847,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts index 0cb828571b67..c645ffadcebc 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts @@ -20,7 +20,7 @@ export const BehaviorType = { Voluntary: 'Voluntary', Involuntary: 'Involuntary', - Overt: 'Overt' + Overt: 'Overt', } as const; export type BehaviorType = typeof BehaviorType[keyof typeof BehaviorType]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts index 33f8b83b6c9a..ae427711e48b 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts @@ -29,7 +29,7 @@ export const DeploymentRequestStatus = { Ready: 'Ready', Packaged: 'Packaged', Pairing: 'Pairing', - Paired: 'Paired' + Paired: 'Paired', } as const; export type DeploymentRequestStatus = typeof DeploymentRequestStatus[keyof typeof DeploymentRequestStatus]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts index 43db96d9b1aa..e4a88ea2279a 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts @@ -35,7 +35,7 @@ export const ErrorCode = { MaximumMessageGainHigherThanMaximum: 'Maximum_Message_Gain_Higher_Than_Maximum', MaximumMessageGainLowerThanMessageGain: 'Maximum_Message_Gain_Lower_Than_Message_Gain', MinimumVolumeBlocksMusicVolumeDecrease: 'Minimum_Volume_Blocks_Music_Volume_Decrease', - MaximumVolumeBlocksMusicVolumeIncrease: 'Maximum_Volume_Blocks_Music_Volume_Increase' + MaximumVolumeBlocksMusicVolumeIncrease: 'Maximum_Volume_Blocks_Music_Volume_Increase', } as const; export type ErrorCode = typeof ErrorCode[keyof typeof ErrorCode]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Order.ts index cb6b5c016de6..96f4f6a631b0 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts index 3d20dc56c6c8..cda46da30778 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts @@ -141,7 +141,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts index 40a214555e6a..b231814e634c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts @@ -20,7 +20,7 @@ export const PetPartType = { Curved: 'Curved', Smooth: 'Smooth', - Long: 'Long' + Long: 'Long', } as const; export type PetPartType = typeof PetPartType[keyof typeof PetPartType]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts index df38da1be6e4..91f6c48c3d31 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts @@ -80,7 +80,7 @@ export const ResponseMetaCodeEnum = { UserAlreadyHasMultipleGalaxieApiProductsException: 'User_Already_Has_Multiple_Galaxie_Api_Products_Exception', RecurlyApiException: 'Recurly_Api_Exception', RecurlyTransactionErrorException: 'Recurly_Transaction_Error_Exception', - GalaxieApiException: 'Galaxie_Api_Exception' + GalaxieApiException: 'Galaxie_Api_Exception', } as const; export type ResponseMetaCodeEnum = typeof ResponseMetaCodeEnum[keyof typeof ResponseMetaCodeEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts index 16b7bb37e969..c9dd5475140c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts @@ -20,7 +20,7 @@ export const WarningCode = { ReduceVolumeRangeToAvoidLargeSteps: 'Reduce_Volume_Range_To_Avoid_Large_Steps', RaiseAmplifierVolume: 'Raise_Amplifier_Volume', - NoVolumeRangeSpecified: 'No_Volume_Range_Specified' + NoVolumeRangeSpecified: 'No_Volume_Range_Specified', } as const; export type WarningCode = typeof WarningCode[keyof typeof WarningCode]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts index 9514b1d2ab5a..3f34373519b9 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts @@ -1423,7 +1423,7 @@ export class FakeApi extends runtime.BaseAPI { */ export const TestEnumParametersEnumHeaderStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumHeaderStringArrayEnum = typeof TestEnumParametersEnumHeaderStringArrayEnum[keyof typeof TestEnumParametersEnumHeaderStringArrayEnum]; /** @@ -1432,7 +1432,7 @@ export type TestEnumParametersEnumHeaderStringArrayEnum = typeof TestEnumParamet export const TestEnumParametersEnumHeaderStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumHeaderStringEnum = typeof TestEnumParametersEnumHeaderStringEnum[keyof typeof TestEnumParametersEnumHeaderStringEnum]; /** @@ -1440,7 +1440,7 @@ export type TestEnumParametersEnumHeaderStringEnum = typeof TestEnumParametersEn */ export const TestEnumParametersEnumQueryStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumQueryStringArrayEnum = typeof TestEnumParametersEnumQueryStringArrayEnum[keyof typeof TestEnumParametersEnumQueryStringArrayEnum]; /** @@ -1449,7 +1449,7 @@ export type TestEnumParametersEnumQueryStringArrayEnum = typeof TestEnumParamete export const TestEnumParametersEnumQueryStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumQueryStringEnum = typeof TestEnumParametersEnumQueryStringEnum[keyof typeof TestEnumParametersEnumQueryStringEnum]; /** @@ -1457,7 +1457,7 @@ export type TestEnumParametersEnumQueryStringEnum = typeof TestEnumParametersEnu */ export const TestEnumParametersEnumQueryIntegerEnum = { NUMBER_1: 1, - NUMBER_MINUS_2: -2 + NUMBER_MINUS_2: -2, } as const; export type TestEnumParametersEnumQueryIntegerEnum = typeof TestEnumParametersEnumQueryIntegerEnum[keyof typeof TestEnumParametersEnumQueryIntegerEnum]; /** @@ -1465,7 +1465,7 @@ export type TestEnumParametersEnumQueryIntegerEnum = typeof TestEnumParametersEn */ export const TestEnumParametersEnumQueryDoubleEnum = { NUMBER_1_DOT_1: 1.1, - NUMBER_MINUS_1_DOT_2: -1.2 + NUMBER_MINUS_1_DOT_2: -1.2, } as const; export type TestEnumParametersEnumQueryDoubleEnum = typeof TestEnumParametersEnumQueryDoubleEnum[keyof typeof TestEnumParametersEnumQueryDoubleEnum]; /** @@ -1473,7 +1473,7 @@ export type TestEnumParametersEnumQueryDoubleEnum = typeof TestEnumParametersEnu */ export const TestEnumParametersEnumFormStringArrayEnum = { GreaterThan: '>', - Dollar: '$' + Dollar: '$', } as const; export type TestEnumParametersEnumFormStringArrayEnum = typeof TestEnumParametersEnumFormStringArrayEnum[keyof typeof TestEnumParametersEnumFormStringArrayEnum]; /** @@ -1482,6 +1482,6 @@ export type TestEnumParametersEnumFormStringArrayEnum = typeof TestEnumParameter export const TestEnumParametersEnumFormStringEnum = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type TestEnumParametersEnumFormStringEnum = typeof TestEnumParametersEnumFormStringEnum[keyof typeof TestEnumParametersEnumFormStringEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/PetApi.ts index 16bcd6ed6b0b..022abaa2616d 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/PetApi.ts @@ -689,6 +689,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumArrays.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumArrays.ts index 84cd87dd1408..7de8c51549a6 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumArrays.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumArrays.ts @@ -35,7 +35,7 @@ export interface EnumArrays { */ export const EnumArraysJustSymbolEnum = { GreaterThanOrEqualTo: '>=', - Dollar: '$' + Dollar: '$', } as const; export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typeof EnumArraysJustSymbolEnum]; @@ -44,7 +44,7 @@ export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typ */ export const EnumArraysArrayEnumEnum = { Fish: 'fish', - Crab: 'crab' + Crab: 'crab', } as const; export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeof EnumArraysArrayEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts index 6878b8591431..510eed277b57 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts @@ -20,7 +20,7 @@ export const EnumClass = { Abc: '_abc', Efg: '-efg', - Xyz: '(xyz)' + Xyz: '(xyz)', } as const; export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumTest.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumTest.ts index 4c27767e593c..fc0968a4226a 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumTest.ts @@ -89,7 +89,7 @@ export interface EnumTest { export const EnumTestEnumStringEnum = { Upper: 'UPPER', Lower: 'lower', - Empty: '' + Empty: '', } as const; export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof EnumTestEnumStringEnum]; @@ -99,7 +99,7 @@ export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof export const EnumTestEnumStringRequiredEnum = { Upper: 'UPPER', Lower: 'lower', - Empty: '' + Empty: '', } as const; export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEnum[keyof typeof EnumTestEnumStringRequiredEnum]; @@ -108,7 +108,7 @@ export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEn */ export const EnumTestEnumIntegerEnum = { NUMBER_1: 1, - NUMBER_MINUS_1: -1 + NUMBER_MINUS_1: -1, } as const; export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeof EnumTestEnumIntegerEnum]; @@ -117,7 +117,7 @@ export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeo */ export const EnumTestEnumNumberEnum = { NUMBER_1_DOT_1: 1.1, - NUMBER_MINUS_1_DOT_2: -1.2 + NUMBER_MINUS_1_DOT_2: -1.2, } as const; export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof EnumTestEnumNumberEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts index 18ea456c8951..3636df53f338 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts @@ -43,7 +43,7 @@ export interface MapTest { */ export const MapTestMapOfEnumStringEnum = { Upper: 'UPPER', - Lower: 'lower' + Lower: 'lower', } as const; export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof typeof MapTestMapOfEnumStringEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Order.ts index 1d32da2609f6..25207f7af636 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts index 4be9edeac589..3cd56b943445 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts @@ -20,7 +20,7 @@ export const OuterEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts index de44a7878120..0d31746d36c7 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts @@ -20,7 +20,7 @@ export const OuterEnumDefaultValue = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof OuterEnumDefaultValue]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts index b899dc358ea0..c5396b00d766 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts @@ -20,7 +20,7 @@ export const OuterEnumInteger = { NUMBER_0: 0, NUMBER_1: 1, - NUMBER_2: 2 + NUMBER_2: 2, } as const; export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInteger]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts index 1a6941699214..c6958ecba1a5 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts @@ -20,7 +20,7 @@ export const OuterEnumIntegerDefaultValue = { NUMBER_0: 0, NUMBER_1: 1, - NUMBER_2: 2 + NUMBER_2: 2, } as const; export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[keyof typeof OuterEnumIntegerDefaultValue]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Pet.ts index 20d21e2f1aad..3d92e97597ea 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts index 8247fdf99d23..6ef73237a553 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts @@ -19,7 +19,7 @@ */ export const SingleRefType = { Admin: 'admin', - User: 'user' + User: 'user', } as const; export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; diff --git a/samples/client/petstore/typescript-fetch/builds/split-by-content-type/src/apis/OrderApi.ts b/samples/client/petstore/typescript-fetch/builds/split-by-content-type/src/apis/OrderApi.ts index aed1acf1f6b1..2b5fc1bda49e 100644 --- a/samples/client/petstore/typescript-fetch/builds/split-by-content-type/src/apis/OrderApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/split-by-content-type/src/apis/OrderApi.ts @@ -85,6 +85,6 @@ export class OrderApi extends runtime.BaseAPI { */ export const GetOrdersOrderByEnum = { Date: 'date', - Amount: 'amount' + Amount: 'amount', } as const; export type GetOrdersOrderByEnum = typeof GetOrdersOrderByEnum[keyof typeof GetOrdersOrderByEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/validation-attributes/apis/PetApi.ts index b51ca27fe3b4..1f5737779542 100644 --- a/samples/client/petstore/typescript-fetch/builds/validation-attributes/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/apis/PetApi.ts @@ -592,6 +592,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Order.ts index 0ad9b3725c98..83a57619181d 100644 --- a/samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Order.ts @@ -53,7 +53,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Pet.ts index cde0e7b42de0..d21d610cef16 100644 --- a/samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Pet.ts @@ -68,7 +68,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts index dd68a19f9f3b..d1d35722ba27 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts @@ -788,6 +788,6 @@ export class PetApi extends runtime.BaseAPI implements PetApiInterface { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts index cb6b5c016de6..96f4f6a631b0 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts index 4c0cb6e73685..c97eff821d6a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts index c4dbaa469281..08701d5f9df8 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts @@ -579,6 +579,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts index cb6b5c016de6..96f4f6a631b0 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts @@ -52,7 +52,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts index 4c0cb6e73685..c97eff821d6a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts @@ -67,7 +67,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts index 5efd9454bc33..20c41254c283 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts @@ -278,7 +278,7 @@ export class DefaultApi extends runtime.BaseAPI { export enum FakeEnumRequestGetInlineStringEnumEnum { One = 'one', Two = 'two', - Three = 'three' + Three = 'three', } /** * @export @@ -287,7 +287,7 @@ export enum FakeEnumRequestGetInlineStringEnumEnum { export enum FakeEnumRequestGetInlineNullableStringEnumEnum { One = 'one', Two = 'two', - Three = 'three' + Three = 'three', } /** * @export @@ -296,7 +296,7 @@ export enum FakeEnumRequestGetInlineNullableStringEnumEnum { export enum FakeEnumRequestGetInlineNumberEnumEnum { NUMBER_1 = 1, NUMBER_2 = 2, - NUMBER_3 = 3 + NUMBER_3 = 3, } /** * @export @@ -305,5 +305,5 @@ export enum FakeEnumRequestGetInlineNumberEnumEnum { export enum FakeEnumRequestGetInlineNullableNumberEnumEnum { NUMBER_1 = 1, NUMBER_2 = 2, - NUMBER_3 = 3 + NUMBER_3 = 3, } diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/PetApi.ts index fabc4247a731..8abd817792e8 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/PetApi.ts @@ -573,6 +573,6 @@ export class PetApi extends runtime.BaseAPI { export const FindPetsByStatusStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/index.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/index.ts index 1aae32c076a7..6785269fdf4f 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/index.ts @@ -73,7 +73,7 @@ export interface Order { export const OrderStatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; @@ -116,7 +116,7 @@ export interface Pet { export const PetStatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-jquery/default/git_push.sh b/samples/client/petstore/typescript-jquery/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-jquery/default/git_push.sh +++ b/samples/client/petstore/typescript-jquery/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-jquery/npm/git_push.sh b/samples/client/petstore/typescript-jquery/npm/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-jquery/npm/git_push.sh +++ b/samples/client/petstore/typescript-jquery/npm/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/git_push.sh b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/git_push.sh +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-node/3_0/git_push.sh b/samples/client/petstore/typescript-node/3_0/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-node/3_0/git_push.sh +++ b/samples/client/petstore/typescript-node/3_0/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-node/default/git_push.sh b/samples/client/petstore/typescript-node/default/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-node/default/git_push.sh +++ b/samples/client/petstore/typescript-node/default/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/client/petstore/typescript-node/npm/git_push.sh b/samples/client/petstore/typescript-node/npm/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/client/petstore/typescript-node/npm/git_push.sh +++ b/samples/client/petstore/typescript-node/npm/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/git_push.sh b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/git_push.sh +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/git_push.sh b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/git_push.sh +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/git_push.sh b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/git_push.sh +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/git_push.sh b/samples/openapi3/client/features/dynamic-servers/ruby/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/git_push.sh +++ b/samples/openapi3/client/features/dynamic-servers/ruby/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/git_push.sh b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/git_push.sh +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/git_push.sh b/samples/openapi3/client/petstore/dart2/petstore_client_lib/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/git_push.sh +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/git_push.sh b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/git_push.sh +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/git_push.sh b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/git_push.sh +++ b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/go-petstore-withXml/git_push.sh b/samples/openapi3/client/petstore/go-petstore-withXml/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/go-petstore-withXml/git_push.sh +++ b/samples/openapi3/client/petstore/go-petstore-withXml/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/go/go-petstore-aws-signature/git_push.sh b/samples/openapi3/client/petstore/go/go-petstore-aws-signature/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore-aws-signature/git_push.sh +++ b/samples/openapi3/client/petstore/go/go-petstore-aws-signature/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/go/go-petstore/git_push.sh b/samples/openapi3/client/petstore/go/go-petstore/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/git_push.sh +++ b/samples/openapi3/client/petstore/go/go-petstore/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go index 30c3b9ffa59a..a9baa9c39a18 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go @@ -84,16 +84,11 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(Fruit): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(Fruit)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(Fruit): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(Fruit)") - } + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf(Fruit): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf(Fruit)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go index 6b49630ff444..5cc9844f5ab5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go @@ -84,16 +84,11 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(FruitReq): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(FruitReq)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(FruitReq): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(FruitReq)") - } + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf(FruitReq): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf(FruitReq)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_incident_data.go b/samples/openapi3/client/petstore/go/go-petstore/model_incident_data.go index 5ab3c7c5e7d6..207222c9f018 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_incident_data.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_incident_data.go @@ -89,16 +89,11 @@ func (dst *IncidentData) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(IncidentData): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(IncidentData)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(IncidentData): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(IncidentData)") - } + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf(IncidentData): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf(IncidentData)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go index e8a67f3943bf..f5f588b6286b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go @@ -84,16 +84,11 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(Mammal): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(Mammal)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(Mammal): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(Mammal)") - } + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf(Mammal): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf(Mammal)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go index 512b240afdc9..ed5b7b6936ce 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go @@ -110,21 +110,11 @@ func (dst *OneOfPrimitiveType) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType)") - } + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go index 9bce2b8be1d9..ea54b0351f6c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go @@ -85,16 +85,11 @@ func (dst *OneOfPrimitiveTypes) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveTypes): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveTypes)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveTypes): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveTypes)") - } + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveTypes): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveTypes)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_with_complex_type.go b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_with_complex_type.go index fc4192914bda..89752db0c4db 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_with_complex_type.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_with_complex_type.go @@ -84,16 +84,11 @@ func (dst *OneOfWithComplexType) UnmarshalJSON(data []byte) error { } else if match == 1 { return nil // exactly one match } else { // no match - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfWithComplexType): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfWithComplexType)") - } - if err != nil { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfWithComplexType): %v", err) - } else { - return fmt.Errorf("data failed to match schemas in oneOf(OneOfWithComplexType)") - } + if err != nil { + return fmt.Errorf("data failed to match schemas in oneOf(OneOfWithComplexType): %v", err) + } + + return fmt.Errorf("data failed to match schemas in oneOf(OneOfWithComplexType)") } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/git_push.sh b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/git_push.sh +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/git_push.sh b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/git_push.sh +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/git_push.sh b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/git_push.sh +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/git_push.sh b/samples/openapi3/client/petstore/java/jersey2-java8/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/git_push.sh +++ b/samples/openapi3/client/petstore/java/jersey2-java8/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/python-aiohttp/git_push.sh b/samples/openapi3/client/petstore/python-aiohttp/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/git_push.sh +++ b/samples/openapi3/client/petstore/python-aiohttp/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/python-httpx-sync/git_push.sh b/samples/openapi3/client/petstore/python-httpx-sync/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/git_push.sh +++ b/samples/openapi3/client/petstore/python-httpx-sync/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/python-httpx/git_push.sh b/samples/openapi3/client/petstore/python-httpx/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/python-httpx/git_push.sh +++ b/samples/openapi3/client/petstore/python-httpx/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/python-lazyImports/git_push.sh b/samples/openapi3/client/petstore/python-lazyImports/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/git_push.sh +++ b/samples/openapi3/client/petstore/python-lazyImports/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/git_push.sh b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/git_push.sh +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/git_push.sh b/samples/openapi3/client/petstore/python-pydantic-v1/git_push.sh index bf9924d0cc13..273c43a22855 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/git_push.sh +++ b/samples/openapi3/client/petstore/python-pydantic-v1/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="GIT_HOST" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/python/git_push.sh b/samples/openapi3/client/petstore/python/git_push.sh index f53a75d4fabe..a35991cd51a1 100755 --- a/samples/openapi3/client/petstore/python/git_push.sh +++ b/samples/openapi3/client/petstore/python/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java index 4e2975bfa72e..c167690b5e70 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -34,8 +34,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private Optional category = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Category.java index dbf469c8a29d..483560d2f820 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Category.java @@ -24,9 +24,11 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String name; public Category id(Long id) { @@ -44,7 +46,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -65,7 +66,6 @@ public String getName() { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(String name) { this.name = name; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java index adb817548950..c4f92369d644 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -26,12 +26,15 @@ public class ModelApiResponse { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Integer code; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String type; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String message; public ModelApiResponse code(Integer code) { @@ -49,7 +52,6 @@ public Integer getCode() { return code; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("code") public void setCode(Integer code) { this.code = code; @@ -70,7 +72,6 @@ public String getType() { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(String type) { this.type = type; @@ -91,7 +92,6 @@ public String getMessage() { return message; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("message") public void setMessage(String message) { this.message = message; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Order.java index d4ce7756adbf..3e4e1ce45db4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Order.java @@ -27,15 +27,19 @@ public class Order { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long petId; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Integer quantity; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -77,9 +81,11 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private StatusEnum status; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Boolean complete = false; public Order id(Long id) { @@ -97,7 +103,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -118,7 +123,6 @@ public Long getPetId() { return petId; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("petId") public void setPetId(Long petId) { this.petId = petId; @@ -139,7 +143,6 @@ public Integer getQuantity() { return quantity; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("quantity") public void setQuantity(Integer quantity) { this.quantity = quantity; @@ -160,7 +163,6 @@ public OffsetDateTime getShipDate() { return shipDate; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("shipDate") public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -181,7 +183,6 @@ public StatusEnum getStatus() { return status; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("status") public void setStatus(StatusEnum status) { this.status = status; @@ -202,7 +203,6 @@ public Boolean getComplete() { return complete; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("complete") public void setComplete(Boolean complete) { this.complete = complete; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java index c21fc068dae5..85a0a6bec7be 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -30,16 +30,21 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -80,6 +85,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private StatusEnum status; @@ -110,7 +116,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -131,7 +136,6 @@ public Category getCategory() { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") public void setCategory(Category category) { this.category = category; @@ -208,7 +212,6 @@ public Pet addTagsItem(Tag tagsItem) { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") public void setTags(List<@Valid Tag> tags) { this.tags = tags; @@ -234,7 +237,6 @@ public StatusEnum getStatus() { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") public void setStatus(StatusEnum status) { diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Tag.java index 214ba439e558..1b73abf4ad1e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Tag.java @@ -24,9 +24,11 @@ public class Tag { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String name; public Tag id(Long id) { @@ -44,7 +46,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -65,7 +66,6 @@ public String getName() { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(String name) { this.name = name; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/User.java index d41f0454d85d..5998c78710cb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/User.java @@ -24,27 +24,35 @@ public class User { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String username; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String firstName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String lastName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String email; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String phone; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Integer userStatus; public User id(Long id) { @@ -62,7 +70,6 @@ public Long getId() { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(Long id) { this.id = id; @@ -83,7 +90,6 @@ public String getUsername() { return username; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("username") public void setUsername(String username) { this.username = username; @@ -104,7 +110,6 @@ public String getFirstName() { return firstName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("firstName") public void setFirstName(String firstName) { this.firstName = firstName; @@ -125,7 +130,6 @@ public String getLastName() { return lastName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lastName") public void setLastName(String lastName) { this.lastName = lastName; @@ -146,7 +150,6 @@ public String getEmail() { return email; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("email") public void setEmail(String email) { this.email = email; @@ -167,7 +170,6 @@ public String getPassword() { return password; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("password") public void setPassword(String password) { this.password = password; @@ -188,7 +190,6 @@ public String getPhone() { return phone; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("phone") public void setPhone(String phone) { this.phone = phone; @@ -209,7 +210,6 @@ public Integer getUserStatus() { return userStatus; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("userStatus") public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java index 4aa4e0f36117..83c89d9c9800 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Pet { + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType = "Pet"; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java index d5f2df7bca2b..56776316e18b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java index 212def45ba53..cf8d702378be 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 9fcdefe1da2e..5e934e643224 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java index aeb76fdcd3b2..65e0ceefa324 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java index 526aa66a1882..3f9be180fd12 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java index 87c1af437ed4..ad228020783e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java index ab6a00effad0..2905cdf83cf0 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java index 56da244f404e..8eb2ebe70171 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java index 2796a8f8c4ec..7547cfb95047 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index f655d26b20a7..141ad532407c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/go/go-petstore/go.mod b/samples/openapi3/server/petstore/go/go-petstore/go.mod index 86767616d660..5753fde0cb49 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go.mod +++ b/samples/openapi3/server/petstore/go/go-petstore/go.mod @@ -1,5 +1,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID -go 1.18 +go 1.25 -require github.com/go-chi/chi/v5 v5.2.2 +require github.com/go-chi/chi/v5 v5.2.4 diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Apple.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Apple.java index 3ea2af2720cd..0f2566549e46 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Apple.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Apple.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Apple implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer seeds; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Apple() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Banana.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Banana.java index 8b42e4bccec3..d6f893866d1e 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Banana.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Banana.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Banana implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer length; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Banana() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Bar.java index 93a0bdb89f2a..183cf2f6e604 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Bar.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Bar.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Bar extends Entity implements BarRefOrValue { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Entity.java index c6bff315d94c..d3b3476145d6 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Entity.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Entity.java @@ -52,6 +52,7 @@ public class Entity { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Entity() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/EntityRef.java index c3e7425d99a4..fb39bfa8fd71 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/EntityRef.java @@ -48,6 +48,7 @@ public class EntityRef { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Extensible.java index 6b1a418efa4e..5426785a0d55 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Extensible.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Extensible.java @@ -29,6 +29,7 @@ public class Extensible { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Extensible() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Fruit.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Fruit.java index 3d77543df254..2233230221a9 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Fruit.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/model/Fruit.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Apple.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Apple.java index f98df374ed7a..3cb15460b8cf 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Apple.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Apple.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public final class Apple implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer seeds; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Apple() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Banana.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Banana.java index b168fc3d764e..1796fc81d4be 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Banana.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Banana.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public final class Banana implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer length; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Banana() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Bar.java index c27bcfa659c7..0a385721560a 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Bar.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Bar.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public final class Bar extends Entity implements BarRefOrValue { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Entity.java index 4a0620729d17..10167c1164ee 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Entity.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Entity.java @@ -52,6 +52,7 @@ public sealed class Entity permits Bar, BarCreate, Foo, Pasta, Pizza { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Entity() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/EntityRef.java index 33e1b724576b..6d9b7196a1ee 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/EntityRef.java @@ -48,6 +48,7 @@ public sealed class EntityRef permits BarRef, FooRef { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Extensible.java index b9e911f48fa7..bf5afd3ab33b 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Extensible.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Extensible.java @@ -29,6 +29,7 @@ public final class Extensible { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Extensible() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Fruit.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Fruit.java index 45b655f0ce22..a9901953bd7e 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Fruit.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/model/Fruit.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java index 0be64c62685f..cd02d6d6bdab 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Apple implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer seeds; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Apple() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java index cb801806025f..cd3bb74e50bd 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -26,8 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Banana implements Fruit { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer length; + @JsonInclude(JsonInclude.Include.NON_NULL) private FruitType fruitType; public Banana() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java index acaa8e50aa91..9854268cedbe 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java @@ -29,6 +29,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Bar extends Entity implements BarRefOrValue { + @JsonInclude(JsonInclude.Include.NON_NULL) private String id; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java index 3614b2ed6844..0068e39ff4cc 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java @@ -52,6 +52,7 @@ public class Entity { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Entity() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java index 28083ecc80a2..782967688b0e 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java @@ -48,6 +48,7 @@ public class EntityRef { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java index 1ea149bee2a5..ee4781a36c64 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java @@ -29,6 +29,7 @@ public class Extensible { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String atBaseType; + @JsonInclude(JsonInclude.Include.NON_NULL) private String atType; public Extensible() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java index 3d77543df254..2233230221a9 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java @@ -3,6 +3,7 @@ import java.net.URI; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java index 34fefa217937..0ff80dbce269 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java @@ -44,8 +44,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java index 76e94c5b80a7..8b46bc621498 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java @@ -43,8 +43,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/model/Foo.java b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/model/Foo.java index 8e024c35235d..59f585f6eb8d 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/model/Foo.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/model/Foo.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -38,44 +37,33 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Foo { - @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private java.time.@Nullable Instant dt; - @JsonInclude(JsonInclude.Include.NON_ABSENT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private JsonNullable nullableDt = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_NULL) private org.springframework.core.io.@Nullable Resource binary; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableBinary = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable List listOfDt = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable List listMinIntems = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableListMinIntems = JsonNullable.>undefined(); @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private java.time.Instant requiredDt; - @JsonInclude(JsonInclude.Include.NON_NULL) private java.math.@Nullable BigDecimal number; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableNumber = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String color = "red"; private String requiredColor = "red"; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableColor = JsonNullable.undefined(); public Foo() { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/model/Foo.java b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/model/Foo.java index 5a9e1038639a..53fae78adf9f 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/model/Foo.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/model/Foo.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -38,44 +37,33 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Foo { - @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Optional dt = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private JsonNullable nullableDt = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_NULL) private Optional binary = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableBinary = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_NULL) private List listOfDt = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) private List listMinIntems = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableListMinIntems = JsonNullable.>undefined(); @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private java.time.Instant requiredDt; - @JsonInclude(JsonInclude.Include.NON_NULL) private Optional number = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableNumber = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_NULL) private Optional color = Optional.of("red"); private String requiredColor = "red"; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableColor = JsonNullable.undefined(); public Foo() { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/Foo.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/Foo.java index 5afb0bd73c8c..41b025136ba6 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/Foo.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/model/Foo.java @@ -38,6 +38,7 @@ public class Foo { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private java.time.@Nullable Instant dt; @@ -45,29 +46,36 @@ public class Foo { private java.time.@Nullable Instant nullableDt = null; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private org.springframework.core.io.@Nullable Resource binary; private org.springframework.core.io.@Nullable Resource nullableBinary = null; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable List listOfDt = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable List listMinIntems = new ArrayList<>(); private @Nullable List nullableListMinIntems; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private java.time.Instant requiredDt; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private java.math.@Nullable BigDecimal number; private java.math.@Nullable BigDecimal nullableNumber = null; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String color = "red"; + @JsonInclude(JsonInclude.Include.NON_NULL) private String requiredColor = "red"; private @Nullable String nullableColor = null; @@ -121,7 +129,6 @@ public Foo dt(java.time.@Nullable Instant dt) { return dt; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dt") @JacksonXmlProperty(localName = "dt") public void setDt(java.time.@Nullable Instant dt) { @@ -170,7 +177,6 @@ public Foo binary(org.springframework.core.io.@Nullable Resource binary) { return binary; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("binary") @JacksonXmlProperty(localName = "binary") public void setBinary(org.springframework.core.io.@Nullable Resource binary) { @@ -228,7 +234,6 @@ public Foo addListOfDtItem(java.time.Instant listOfDtItem) { return listOfDt; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("listOfDt") @JacksonXmlProperty(localName = "listOfDt") @JacksonXmlElementWrapper(useWrapping = false) @@ -263,7 +268,6 @@ public Foo addListMinIntemsItem(java.time.Instant listMinIntemsItem) { return listMinIntems; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("listMinIntems") @JacksonXmlProperty(localName = "listMinIntems") @JacksonXmlElementWrapper(useWrapping = false) @@ -347,7 +351,6 @@ public Foo number(java.math.@Nullable BigDecimal number) { return number; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("number") @JacksonXmlProperty(localName = "number") public void setNumber(java.math.@Nullable BigDecimal number) { @@ -396,7 +399,6 @@ public Foo color(@Nullable String color) { return color; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("color") @JacksonXmlProperty(localName = "color") public void setColor(@Nullable String color) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Category.java index ee0512f727d5..31dda006bb3b 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Category.java @@ -33,9 +33,11 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public Category() { @@ -68,7 +70,6 @@ public Category id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -93,7 +94,6 @@ public Category name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") @JacksonXmlProperty(localName = "name") public void setName(@Nullable String name) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/ModelApiResponse.java index 09bec0e60ea4..1f3adcabd406 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -35,12 +35,15 @@ public class ModelApiResponse { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer code; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String type; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String message; public ModelApiResponse() { @@ -74,7 +77,6 @@ public ModelApiResponse code(@Nullable Integer code) { return code; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("code") @JacksonXmlProperty(localName = "code") public void setCode(@Nullable Integer code) { @@ -99,7 +101,6 @@ public ModelApiResponse type(@Nullable String type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") @JacksonXmlProperty(localName = "type") public void setType(@Nullable String type) { @@ -124,7 +125,6 @@ public ModelApiResponse message(@Nullable String message) { return message; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("message") @JacksonXmlProperty(localName = "message") public void setMessage(@Nullable String message) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Order.java index 3a45cca8c07e..376d86e8d637 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Order.java @@ -37,15 +37,19 @@ public class Order { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long petId; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer quantity; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -87,9 +91,11 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable StatusEnum status; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Boolean complete = false; public Order() { @@ -126,7 +132,6 @@ public Order id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -151,7 +156,6 @@ public Order petId(@Nullable Long petId) { return petId; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("petId") @JacksonXmlProperty(localName = "petId") public void setPetId(@Nullable Long petId) { @@ -176,7 +180,6 @@ public Order quantity(@Nullable Integer quantity) { return quantity; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("quantity") @JacksonXmlProperty(localName = "quantity") public void setQuantity(@Nullable Integer quantity) { @@ -201,7 +204,6 @@ public Order shipDate(@Nullable OffsetDateTime shipDate) { return shipDate; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("shipDate") @JacksonXmlProperty(localName = "shipDate") public void setShipDate(@Nullable OffsetDateTime shipDate) { @@ -226,7 +228,6 @@ public Order status(@Nullable StatusEnum status) { return status; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("status") @JacksonXmlProperty(localName = "status") public void setStatus(@Nullable StatusEnum status) { @@ -251,7 +252,6 @@ public Boolean getComplete() { return complete; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("complete") @JacksonXmlProperty(localName = "complete") public void setComplete(Boolean complete) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java index ce7523e6fee7..4f2e1cb02f2f 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java @@ -40,16 +40,21 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -90,6 +95,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private @Nullable StatusEnum status; @@ -135,7 +141,6 @@ public Pet id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -160,7 +165,6 @@ public Pet category(@Nullable Category category) { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") @JacksonXmlProperty(localName = "Category") public void setCategory(@Nullable Category category) { @@ -254,7 +258,6 @@ public Pet addTagsItem(Tag tagsItem) { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") @JacksonXmlProperty(localName = "Tag") @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) @@ -285,7 +288,6 @@ public Pet status(@Nullable StatusEnum status) { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") @JacksonXmlProperty(localName = "status") diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Tag.java index 8b0e49eb8941..fcf543d6cf15 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Tag.java @@ -33,9 +33,11 @@ public class Tag { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public Tag() { @@ -68,7 +70,6 @@ public Tag id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -93,7 +94,6 @@ public Tag name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") @JacksonXmlProperty(localName = "name") public void setName(@Nullable String name) { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/User.java index 312a09e79028..73194fbf692a 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/User.java @@ -33,27 +33,35 @@ public class User { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String username; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String firstName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lastName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String email; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String phone; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer userStatus; public User() { @@ -92,7 +100,6 @@ public User id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") @JacksonXmlProperty(localName = "id") public void setId(@Nullable Long id) { @@ -117,7 +124,6 @@ public User username(@Nullable String username) { return username; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("username") @JacksonXmlProperty(localName = "username") public void setUsername(@Nullable String username) { @@ -142,7 +148,6 @@ public User firstName(@Nullable String firstName) { return firstName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("firstName") @JacksonXmlProperty(localName = "firstName") public void setFirstName(@Nullable String firstName) { @@ -167,7 +172,6 @@ public User lastName(@Nullable String lastName) { return lastName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lastName") @JacksonXmlProperty(localName = "lastName") public void setLastName(@Nullable String lastName) { @@ -192,7 +196,6 @@ public User email(@Nullable String email) { return email; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("email") @JacksonXmlProperty(localName = "email") public void setEmail(@Nullable String email) { @@ -217,7 +220,6 @@ public User password(@Nullable String password) { return password; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("password") @JacksonXmlProperty(localName = "password") public void setPassword(@Nullable String password) { @@ -242,7 +244,6 @@ public User phone(@Nullable String phone) { return phone; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("phone") @JacksonXmlProperty(localName = "phone") public void setPhone(@Nullable String phone) { @@ -267,7 +268,6 @@ public User userStatus(@Nullable Integer userStatus) { return userStatus; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("userStatus") @JacksonXmlProperty(localName = "userStatus") public void setUserStatus(@Nullable Integer userStatus) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java index aa7e8049ad41..47e43e89eb8a 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java @@ -34,8 +34,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java index 68aca95b6987..b3d2b8e934ca 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -24,10 +23,8 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Category { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String name; public Category id(@Nullable Long id) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index f8e6a50f1cb5..ea0b507c324b 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,13 +25,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ModelApiResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Integer code; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String type; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String message; public ModelApiResponse code(@Nullable Integer code) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java index 2e07158268fa..f45d4cfe2d8d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -27,16 +26,12 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Order { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long petId; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Integer quantity; - @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -77,10 +72,8 @@ public static StatusEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable StatusEnum status; - @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean complete = false; public Order id(@Nullable Long id) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..e3002073fbe6 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -30,17 +30,16 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Pet { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -80,7 +79,6 @@ public static StatusEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) @Deprecated private @Nullable StatusEnum status; diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java index 17d305647101..ec805dc81eee 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -24,10 +23,8 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Tag { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String name; public Tag id(@Nullable Long id) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java index bac00b6cdd0b..5d8ac5c931ae 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -24,28 +23,20 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class User { - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String username; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String firstName; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String lastName; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String email; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String password; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String phone; - @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Integer userStatus; public User id(@Nullable Long id) { diff --git a/samples/server/others/go-server/no-body-path-params/go.mod b/samples/server/others/go-server/no-body-path-params/go.mod index 65afa7e70717..15c2fb54b9fc 100644 --- a/samples/server/others/go-server/no-body-path-params/go.mod +++ b/samples/server/others/go-server/no-body-path-params/go.mod @@ -1,5 +1,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID -go 1.18 +go 1.25 require github.com/gorilla/mux v1.8.0 diff --git a/samples/server/others/go-server/optional-body/go.mod b/samples/server/others/go-server/optional-body/go.mod index f71ce9c8223d..96958cd5cad0 100644 --- a/samples/server/others/go-server/optional-body/go.mod +++ b/samples/server/others/go-server/optional-body/go.mod @@ -1,4 +1,4 @@ module github.com/GIT_USER_ID/GIT_REPO_ID -go 1.18 +go 1.25 diff --git a/samples/server/others/go-server/required-zero-value/go.mod b/samples/server/others/go-server/required-zero-value/go.mod index f71ce9c8223d..96958cd5cad0 100644 --- a/samples/server/others/go-server/required-zero-value/go.mod +++ b/samples/server/others/go-server/required-zero-value/go.mod @@ -1,4 +1,4 @@ module github.com/GIT_USER_ID/GIT_REPO_ID -go 1.18 +go 1.25 diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt index d5af2e05d658..4887b45e853b 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -24,6 +25,7 @@ import jakarta.validation.Valid */ data class Cat( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("huntingSkill") @get:JsonProperty("huntingSkill", required = true) val huntingSkill: Cat.HuntingSkill, diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Dog.kt index de31e3c6a74b..599607754f1d 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Dog.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonIgnoreProperties @@ -25,10 +26,12 @@ import jakarta.validation.Valid data class Dog( @field:Valid + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String = "dog", @get:Min(value=0) + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("packSize") @get:JsonProperty("packSize", required = true) val packSize: kotlin.Int = 0 ) : Pet { diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Pet.kt index 40869b85e6bb..373c49ea1ab7 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Pet.kt @@ -3,6 +3,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSubTypes import com.fasterxml.jackson.annotation.JsonTypeInfo diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Bird.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Bird.kt index c5611ef934c7..cf8ed4566029 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Bird.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Bird.kt @@ -27,9 +27,11 @@ import jakarta.validation.Valid */ data class Bird( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("discriminator") @get:JsonProperty("discriminator", required = true) override val discriminator: kotlin.String = "BIRD", + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("another_discriminator") @get:JsonProperty("another_discriminator", required = true) override val anotherDiscriminator: kotlin.String = "ANOTHER_BIRD", diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Robobird.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Robobird.kt index e11c5a0a1af1..374a42c3886d 100644 --- a/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Robobird.kt +++ b/samples/server/others/kotlin-springboot/oneOf-discriminator/src/main/kotlin/org/openapitools/model/Robobird.kt @@ -27,9 +27,11 @@ import jakarta.validation.Valid */ data class Robobird( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("discriminator") @get:JsonProperty("discriminator", required = true) override val discriminator: kotlin.String = "ROBOBIRD", + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("another_discriminator") @get:JsonProperty("another_discriminator", required = true) override val anotherDiscriminator: kotlin.String = "ANOTHER_ROBOBIRD", diff --git a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Car.kt b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Car.kt index f4e25930868d..831595203de0 100644 --- a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Car.kt +++ b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Car.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.VehicleType @@ -26,9 +27,11 @@ import jakarta.validation.Valid data class Car( @field:Valid + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("vehicleType") @get:JsonProperty("vehicleType", required = true) override val vehicleType: VehicleType = VehicleType.CAR, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("numDoors") @get:JsonProperty("numDoors", required = true) val numDoors: kotlin.Int ) : Vehicle { diff --git a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Truck.kt b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Truck.kt index 61b3bda8c499..723e2f2376e8 100644 --- a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Truck.kt +++ b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Truck.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.VehicleType @@ -26,9 +27,11 @@ import jakarta.validation.Valid data class Truck( @field:Valid + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("vehicleType") @get:JsonProperty("vehicleType", required = true) override val vehicleType: VehicleType = VehicleType.TRUCK, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("payloadCapacity") @get:JsonProperty("payloadCapacity", required = true) val payloadCapacity: java.math.BigDecimal ) : Vehicle { diff --git a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Vehicle.kt b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Vehicle.kt index 637caa41c0e0..afd7fad1a33d 100644 --- a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Vehicle.kt +++ b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/Vehicle.kt @@ -3,6 +3,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSubTypes import com.fasterxml.jackson.annotation.JsonTypeInfo diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/git_push.sh b/samples/server/petstore/cpp-restbed/generated/3_0/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/git_push.sh +++ b/samples/server/petstore/cpp-restbed/generated/3_0/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/server/petstore/go-api-server/go.mod b/samples/server/petstore/go-api-server/go.mod index 65afa7e70717..15c2fb54b9fc 100644 --- a/samples/server/petstore/go-api-server/go.mod +++ b/samples/server/petstore/go-api-server/go.mod @@ -1,5 +1,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID -go 1.18 +go 1.25 require github.com/gorilla/mux v1.8.0 diff --git a/samples/server/petstore/go-api-server/samples_tests/go_mod_test.go b/samples/server/petstore/go-api-server/samples_tests/go_mod_test.go index 75c769eb2bce..ed16f2b685fd 100644 --- a/samples/server/petstore/go-api-server/samples_tests/go_mod_test.go +++ b/samples/server/petstore/go-api-server/samples_tests/go_mod_test.go @@ -25,7 +25,7 @@ func Test_Go_Mod(t *testing.T) { filepath := "../go.mod" lines := utils.ReadLines(filepath) - expected := "go 1.18" + expected := "go 1.25" if lines[2] != expected { t.Errorf("Expected '%s', but got '%s'", expected, lines[2]) diff --git a/samples/server/petstore/go-chi-server/go.mod b/samples/server/petstore/go-chi-server/go.mod index 86767616d660..5753fde0cb49 100644 --- a/samples/server/petstore/go-chi-server/go.mod +++ b/samples/server/petstore/go-chi-server/go.mod @@ -1,5 +1,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID -go 1.18 +go 1.25 -require github.com/go-chi/chi/v5 v5.2.2 +require github.com/go-chi/chi/v5 v5.2.4 diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java index 4012cb04f231..4712b79a3cac 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.openapitools.jackson.nullable.JsonNullable; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java index 9ee0c1b2807d..bfdb5b06105f 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java index 05024e14114d..f4c5514f4426 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java index 30902a60c2df..36365c9a7a1b 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java index 59823ce029a6..671b2504940e 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.openapitools.jackson.nullable.JsonNullable; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java index dde60f69542a..e6053f2676f6 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.openapitools.jackson.nullable.JsonNullable; diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Category.kt index f44ed4c7ace6..84485a66eb96 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Category.kt @@ -1,10 +1,7 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -22,14 +19,10 @@ import jakarta.validation.Valid */ data class Category( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 8d84914db2ba..bc1eb76d4b71 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -1,10 +1,7 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -23,18 +20,12 @@ import jakarta.validation.Valid */ data class ModelApiResponse( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("code") @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("type") @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("message") @get:JsonProperty("message") val message: kotlin.String? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Order.kt index 486848e14599..e865644bd4f8 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Order.kt @@ -2,11 +2,8 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.JsonValue -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -28,33 +25,21 @@ import jakarta.validation.Valid */ data class Order( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("petId") @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("quantity") @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("shipDate") @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("complete") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..472eb39902dc 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Pet.kt @@ -2,11 +2,8 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.JsonValue -import com.fasterxml.jackson.annotation.Nulls import org.openapitools.model.Category import org.openapitools.model.Tag import jakarta.validation.constraints.DecimalMax @@ -36,26 +33,18 @@ data class Pet( @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("category") @get:JsonProperty("category") val category: Category? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("tags") @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, @Deprecated(message = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Pet.Status? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Tag.kt index e3ec341838e6..f60b101132b0 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/Tag.kt @@ -1,10 +1,7 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -22,13 +19,9 @@ import jakarta.validation.Valid */ data class Tag( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/User.kt index 93294737c422..3fcde2466802 100644 --- a/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-cloud-4/src/main/kotlin/org/openapitools/model/User.kt @@ -1,10 +1,7 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.annotation.JsonSetter -import com.fasterxml.jackson.annotation.Nulls import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -28,43 +25,27 @@ import jakarta.validation.Valid */ data class User( - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("username") @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("firstName") @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("lastName") @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("email") @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("password") @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("phone") @get:JsonProperty("phone") val phone: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) - @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("userStatus") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt index 978290446045..d37fcde397d1 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import javax.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt index ebd784c67532..818ca34ee824 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt index b0c7a8a472e2..28f9f7e2cf42 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt @@ -41,14 +41,17 @@ import io.swagger.v3.oas.annotations.media.Schema data class AnyOfUserOrPet( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("username") @get:JsonProperty("username", required = true) val username: kotlin.String, @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt index 245556f67207..7e5d66de499d 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt @@ -41,14 +41,17 @@ import io.swagger.v3.oas.annotations.media.Schema data class AnyOfUserOrPetOrArrayString( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("username") @get:JsonProperty("username", required = true) val username: kotlin.String, @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt index edcf36d7df67..ab6822d9644c 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt index 67857d6d788d..e16108c6b858 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt @@ -32,6 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class User( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("username") @get:JsonProperty("username", required = true) val username: kotlin.String, diff --git a/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt index 0de23f8edb3c..4734ca04df3e 100644 --- a/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt @@ -33,9 +33,11 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..7cf3de7d9c48 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt index f44ed4c7ace6..51d9077df63b 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt @@ -1,7 +1,6 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls @@ -22,13 +21,11 @@ import jakarta.validation.Valid */ data class Category( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 8d84914db2ba..7689e944371e 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -1,7 +1,6 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls @@ -23,17 +22,14 @@ import jakarta.validation.Valid */ data class ModelApiResponse( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("code") @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("type") @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("message") @get:JsonProperty("message") val message: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt index 486848e14599..c14d1323ba00 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.JsonValue @@ -28,32 +27,26 @@ import jakarta.validation.Valid */ data class Order( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("petId") @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("quantity") @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("shipDate") @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("complete") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..35b6f48617a1 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,31 +30,29 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("category") @get:JsonProperty("category") val category: Category? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("tags") @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, @Deprecated(message = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Pet.Status? = null diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt index e3ec341838e6..38364c2ba7a2 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt @@ -1,7 +1,6 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls @@ -22,12 +21,10 @@ import jakarta.validation.Valid */ data class Tag( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt index 93294737c422..268dc150996d 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt @@ -1,7 +1,6 @@ package org.openapitools.model import java.util.Objects -import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonSetter import com.fasterxml.jackson.annotation.Nulls @@ -28,42 +27,34 @@ import jakarta.validation.Valid */ data class User( - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("username") @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("firstName") @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("lastName") @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("email") @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("password") @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("phone") @get:JsonProperty("phone") val phone: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("userStatus") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null diff --git a/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt index 56c523367969..7cf3de7d9c48 100644 --- a/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt index c076750eb99a..f6f096f6eed4 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/model/Apa.kt b/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/model/Apa.kt index 70d1f73e208f..9ec6249ca10e 100644 --- a/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/model/Apa.kt +++ b/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/model/Apa.kt @@ -28,10 +28,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Apa( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("bepa") @get:JsonProperty("bepa", required = true) val bepa: java.math.BigDecimal = java.math.BigDecimal("0"), @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("cepa") @get:JsonProperty("cepa", required = true) val cepa: java.math.BigDecimal = java.math.BigDecimal("6.28318"), diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt index 0aa99a764a76..7cd760e87cc8 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index 45c87638f15f..0a072512fd08 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt index 4db812f3390c..0869716cacdd 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt @@ -37,14 +37,17 @@ import io.swagger.annotations.ApiModelProperty data class Cat( @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) override val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) override val photoUrls: kotlin.collections.List, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt index 301b4c80b12f..9cd0d8edc3f8 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt @@ -38,26 +38,32 @@ import io.swagger.annotations.ApiModelProperty data class Dog( @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("bark") @get:JsonProperty("bark", required = true) val bark: kotlin.Boolean, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("breed") @get:JsonProperty("breed", required = true) val breed: Dog.Breed, @ApiModelProperty(required = true, value = "Whether the dog enjoys fetching") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("likesFetch") @get:JsonProperty("likesFetch", required = true) override val likesFetch: kotlin.Boolean, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) override val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) override val photoUrls: kotlin.collections.List, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt index c7effc69943c..eb40a7638b18 100644 --- a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt @@ -26,6 +26,7 @@ import jakarta.validation.Valid */ data class ApiError( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("errorCode") @get:JsonProperty("errorCode", required = true) val errorCode: ApiError.ErrorCode, diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index 6c4d3c5f36ee..521ef45226d1 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -24,13 +24,13 @@ import io.swagger.v3.oas.annotations.media.Schema data class Category( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") var name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 9886cbcdc3ad..00e04fb41353 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -25,19 +25,19 @@ import io.swagger.v3.oas.annotations.media.Schema data class ModelApiResponse( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("code") @get:JsonProperty("code") var code: kotlin.Int? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("type") @get:JsonProperty("type") var type: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("message") @get:JsonProperty("message") var message: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index 7d68cd3f584e..acbf3a877d82 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -30,37 +30,37 @@ import io.swagger.v3.oas.annotations.media.Schema data class Order( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("petId") @get:JsonProperty("petId") var petId: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("quantity") @get:JsonProperty("quantity") var quantity: kotlin.Int? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("shipDate") @get:JsonProperty("shipDate") var shipDate: java.time.OffsetDateTime? = null, @Schema(description = "Order Status") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") var status: Order.Status? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("complete") @get:JsonProperty("complete") var complete: kotlin.Boolean? = false diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index 3f3a4d005b5b..687cc12f771f 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,35 +32,37 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) var name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) var photoUrls: kotlin.collections.MutableList, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @field:Valid @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("category") @get:JsonProperty("category") var category: Category? = null, @field:Valid @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("tags") @get:JsonProperty("tags") var tags: kotlin.collections.MutableList? = null, @Schema(description = "pet status in the store") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") var status: Pet.Status? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index 8dabb08a5f93..858c04d95899 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -24,13 +24,13 @@ import io.swagger.v3.oas.annotations.media.Schema data class Tag( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") var name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index 86c750bac0c9..c9063f163fe6 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -30,49 +30,49 @@ import io.swagger.v3.oas.annotations.media.Schema data class User( @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") var id: kotlin.Long? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("username") @get:JsonProperty("username") var username: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("firstName") @get:JsonProperty("firstName") var firstName: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("lastName") @get:JsonProperty("lastName") var lastName: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("email") @get:JsonProperty("email") var email: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("password") @get:JsonProperty("password") var password: kotlin.String? = null, @Schema(description = "") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("phone") @get:JsonProperty("phone") var phone: kotlin.String? = null, @Schema(description = "User Status") - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_DEFAULT) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("userStatus") @get:JsonProperty("userStatus") var userStatus: kotlin.Int? = null diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index d5959182a70f..572741c45089 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import javax.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt index d5959182a70f..572741c45089 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt @@ -30,9 +30,11 @@ import javax.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PageMeta.kt b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PageMeta.kt index d2938312720f..a40d0746abed 100644 --- a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PageMeta.kt +++ b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PageMeta.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonProperty import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin @@ -21,15 +22,19 @@ import jakarta.validation.Valid */ data class PageMeta( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("size") @get:JsonProperty("size", required = true) val propertySize: kotlin.Long, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("number") @get:JsonProperty("number", required = true) val number: kotlin.Long, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("totalElements") @get:JsonProperty("totalElements", required = true) val totalElements: kotlin.Long, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("totalPages") @get:JsonProperty("totalPages", required = true) val totalPages: kotlin.Long ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/Pet.kt index 983d1f583f52..1fef46231b24 100644 --- a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/Pet.kt @@ -23,6 +23,7 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt index 45c87638f15f..0a072512fd08 100644 --- a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index 45c87638f15f..0a072512fd08 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Cat.kt index 148d5e215f21..3ded71b1e461 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Cat.kt @@ -26,6 +26,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class Cat( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("className") @get:JsonProperty("className", required = true) override val className: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Category.kt index 0349895b01be..48a8f76d11bf 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Category.kt @@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class Category( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String = "default-name", diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Dog.kt index 856de1f1a7b0..f6565a59f920 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Dog.kt @@ -26,6 +26,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class Dog( @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("className") @get:JsonProperty("className", required = true) override val className: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt index 3933754b80f8..664fcc2f0214 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.Set, diff --git a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/NullableModel.kt b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/NullableModel.kt index 9ed84667a2bd..808f5695c0c8 100644 --- a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/NullableModel.kt +++ b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/NullableModel.kt @@ -25,9 +25,11 @@ import jakarta.validation.Valid */ data class NullableModel( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("requiredNonNullable") @get:JsonProperty("requiredNonNullable", required = true) val requiredNonNullable: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("requiredNullable") @get:JsonProperty("requiredNullable", required = true) val requiredNullable: kotlin.String?, @@ -36,7 +38,6 @@ data class NullableModel( @param:JsonProperty("optionalNonNullable") @get:JsonProperty("optionalNonNullable") val optionalNonNullable: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_ABSENT) @param:JsonProperty("optionalNullable") @get:JsonProperty("optionalNullable") val optionalNullable: JsonNullable = JsonNullable.undefined() ) : java.io.Serializable { diff --git a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/Pet.kt index 11b4702d5b38..3adf7cb3f88b 100644 --- a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/Pet.kt @@ -23,6 +23,7 @@ import jakarta.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt index 3de771e29973..121502d59510 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.annotations.ApiModelProperty data class Pet( @ApiModelProperty(example = "doggie", required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt index 2f4708fe0104..298428490fdf 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt @@ -32,10 +32,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class Pet( @Schema(example = "doggie", required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, @Schema(required = true, description = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt index 4db812f3390c..0869716cacdd 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt @@ -37,14 +37,17 @@ import io.swagger.annotations.ApiModelProperty data class Cat( @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) override val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) override val photoUrls: kotlin.collections.List, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt index 2202f4aae40b..911756347da6 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt @@ -38,26 +38,32 @@ import io.swagger.annotations.ApiModelProperty data class Dog( @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("bark") @get:JsonProperty("bark", required = true) override val bark: kotlin.Boolean, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("breed") @get:JsonProperty("breed", required = true) override val breed: Dog.Breed, @ApiModelProperty(required = true, value = "Whether the dog enjoys fetching") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("likesFetch") @get:JsonProperty("likesFetch", required = true) override val likesFetch: kotlin.Boolean, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) override val name: kotlin.String, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) override val photoUrls: kotlin.collections.List, @ApiModelProperty(required = true, value = "") + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("petType") @get:JsonProperty("petType", required = true) override val petType: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 8699b8c6b258..d86ba248177e 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -22,12 +22,12 @@ import javax.validation.Valid */ data class Category( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 876981873b0e..748516067b24 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -23,17 +23,17 @@ import javax.validation.Valid */ data class ModelApiResponse( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("code") @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("type") @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("message") @get:JsonProperty("message") val message: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 05b5fbbae3f3..10df079f91ab 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -29,32 +29,32 @@ import javax.validation.Valid */ data class Order( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("petId") @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("quantity") @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("shipDate") @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("complete") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index a94d6438c2b5..e4dd73bb038b 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -31,30 +31,32 @@ import javax.validation.Valid */ data class Pet( + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("name") @get:JsonProperty("name", required = true) val name: kotlin.String, + @field:JsonInclude(JsonInclude.Include.ALWAYS) @param:JsonProperty("photoUrls") @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("category") @get:JsonProperty("category") val category: Category? = null, @field:Valid - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("tags") @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("status") @get:JsonProperty("status") val status: Pet.Status? = null diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index cd1a35d618e7..d697b5ebfa6e 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -22,12 +22,12 @@ import javax.validation.Valid */ data class Tag( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("name") @get:JsonProperty("name") val name: kotlin.String? = null diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 12b33d8f20a6..d7b4d95ef2c8 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -28,42 +28,42 @@ import javax.validation.Valid */ data class User( - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("id") @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("username") @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("firstName") @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("lastName") @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("email") @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("password") @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("phone") @get:JsonProperty("phone") val phone: kotlin.String? = null, - @field:JsonInclude(JsonInclude.Include.NON_NULL) + @field:JsonInclude(JsonInclude.Include.NON_EMPTY) @field:JsonSetter(nulls = Nulls.SKIP) @param:JsonProperty("userStatus") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh b/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh index 1d215e4cb28e..4dbac3505dd6 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="openapitools" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="petstore" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/server/petstore/python-flask-connexion3/git_push.sh b/samples/server/petstore/python-flask-connexion3/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/server/petstore/python-flask-connexion3/git_push.sh +++ b/samples/server/petstore/python-flask-connexion3/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/server/petstore/python-flask/git_push.sh b/samples/server/petstore/python-flask/git_push.sh index f53a75d4fabe..a35991cd51a1 100644 --- a/samples/server/petstore/python-flask/git_push.sh +++ b/samples/server/petstore/python-flask/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES index bbae578c96d2..02a74031e2c2 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES @@ -64,3 +64,4 @@ src/models.rs src/server/callbacks.rs src/server/mod.rs src/server/server_auth.rs +tests/auth_scheme_precedence.rs diff --git a/samples/server/petstore/rust-server/output/openapi-v3/tests/auth_scheme_precedence.rs b/samples/server/petstore/rust-server/output/openapi-v3/tests/auth_scheme_precedence.rs new file mode 100644 index 000000000000..c0dc7e9f603a --- /dev/null +++ b/samples/server/petstore/rust-server/output/openapi-v3/tests/auth_scheme_precedence.rs @@ -0,0 +1,81 @@ +//! Runtime checks for auth-scheme precedence in the generated `AddContext` middleware. +//! +//! This file is generated. `swagger::auth::from_headers` returns an *untyped* `AuthData`, +//! matching an `Authorization` header that carries either `Basic` or `Bearer` credentials. +//! Every generated auth block returns early once it matches, so a block that does not check +//! which variant it received will claim credentials belonging to a different scheme and +//! prevent every later block - including API-key blocks - from ever running. +//! +//! The expectations below are derived from the security schemes this API declares, in the +//! order their blocks are generated. + +#![cfg(feature = "server")] + +use std::sync::{Arc, Mutex}; + +use hyper::service::Service; +use hyper::{Request, Response}; +use swagger::auth::AuthData; +use swagger::{EmptyContext, Has}; +use openapi_v3::context::AddContext; + +/// Innermost service: records the `Option` that `AddContext` pushed onto the context. +#[derive(Clone, Default)] +struct CaptureAuthData(Arc>>); + +impl Service<(Request, C)> for CaptureAuthData +where + C: Has>, +{ + type Response = Response; + type Error = std::convert::Infallible; + type Future = std::future::Ready>; + + fn call(&self, (_request, context): (Request, C)) -> Self::Future { + let auth_data: &Option = context.get(); + *self.0.lock().expect("lock poisoned") = auth_data.clone(); + std::future::ready(Ok(Response::new(String::new()))) + } +} + +/// Drives a request through `AddContext` and returns the `AuthData` it resolved. +fn resolve_auth_data(uri: &str, headers: &[(&str, &str)]) -> Option { + let capture = CaptureAuthData::default(); + let service = AddContext::<_, EmptyContext>::new(capture.clone()); + + let mut builder = Request::get(uri); + for (name, value) in headers { + builder = builder.header(*name, *value); + } + let request = builder.body(()).expect("request should build"); + + futures::executor::block_on(service.call(request)).expect("service call should succeed"); + + let resolved = capture.0.lock().expect("lock poisoned").clone(); + resolved +} + +/// `dXNlcjpwYXNzd29yZA==` is `user:password`. +const BASIC_HEADER: &str = "Basic dXNlcjpwYXNzd29yZA=="; +const BEARER_HEADER: &str = "Bearer some-token"; + +#[test] +fn no_credentials_resolve_to_no_auth_data() { + assert_eq!(resolve_auth_data("/", &[]), None); +} + +#[test] +fn basic_credentials_resolve_to_none_when_no_basic_scheme_is_declared() { + assert_eq!( + resolve_auth_data("/", &[("authorization", BASIC_HEADER)]), + None, + ); +} + +#[test] +fn bearer_credentials_resolve_to_the_declared_bearer_scheme() { + assert_eq!( + resolve_auth_data("/", &[("authorization", BEARER_HEADER)]), + Some(AuthData::Bearer("some-token".to_owned())), + ); +} diff --git a/samples/server/petstore/rust-server/output/overlapping-auth-schemes/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/overlapping-auth-schemes/.openapi-generator/FILES index 913ced3d98a4..5da8def13d90 100644 --- a/samples/server/petstore/rust-server/output/overlapping-auth-schemes/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/overlapping-auth-schemes/.openapi-generator/FILES @@ -21,3 +21,4 @@ src/lib.rs src/models.rs src/server/mod.rs src/server/server_auth.rs +tests/auth_scheme_precedence.rs diff --git a/samples/server/petstore/rust-server/output/overlapping-auth-schemes/tests/auth_scheme_precedence.rs b/samples/server/petstore/rust-server/output/overlapping-auth-schemes/tests/auth_scheme_precedence.rs index 5640cae3ed27..2aa1835784ea 100644 --- a/samples/server/petstore/rust-server/output/overlapping-auth-schemes/tests/auth_scheme_precedence.rs +++ b/samples/server/petstore/rust-server/output/overlapping-auth-schemes/tests/auth_scheme_precedence.rs @@ -1,26 +1,13 @@ -//! Runtime regression tests for auth-scheme precedence in the generated `AddContext` middleware. +//! Runtime checks for auth-scheme precedence in the generated `AddContext` middleware. //! -//! Companion to the same test in the `petstore-with-fake-endpoints-models-for-testing` -//! sample. That spec generates the OAuth2 block first and the HTTP Basic block last, so it -//! can only prove that an `isOAuth` block leaves Basic credentials alone. This spec covers -//! the opposite direction - an `isBasicBasic` block ahead of an `isBasicBearer` block - -//! which is the `from_headers` pairing issue #24095 was reported against. +//! This file is generated. `swagger::auth::from_headers` returns an *untyped* `AuthData`, +//! matching an `Authorization` header that carries either `Basic` or `Bearer` credentials. +//! Every generated auth block returns early once it matches, so a block that does not check +//! which variant it received will claim credentials belonging to a different scheme and +//! prevent every later block - including API-key blocks - from ever running. //! -//! This spec generates the blocks in the following order: -//! -//! 1. `basicAuth` - HTTP Basic, reads `Authorization` -//! 2. `apiKeyAuth` - API key, reads the `x-api-key` header -//! 3. `bearerAuth` - HTTP Bearer, reads `Authorization` -//! -//! `swagger::auth::from_headers` returns an *untyped* `AuthData` and matches an -//! `Authorization` header carrying either HTTP scheme, and every generated block returns -//! early once it matches. So an unrestricted block 1 claims bearer credentials, and in -//! doing so also makes blocks 2 and 3 unreachable. -//! -//! The apiKey scheme sits deliberately *between* the two HTTP schemes: that is what makes -//! the bug observable from outside. Were blocks 1 and 3 adjacent, both the broken and the -//! fixed generator would resolve bearer credentials to `AuthData::Bearer` - via the wrong -//! block in the broken case - and no request-level assertion could distinguish them. +//! The expectations below are derived from the security schemes this API declares, in the +//! order their blocks are generated. #![cfg(feature = "server")] @@ -28,9 +15,9 @@ use std::sync::{Arc, Mutex}; use hyper::service::Service; use hyper::{Request, Response}; -use overlapping_auth_schemes::context::AddContext; use swagger::auth::AuthData; use swagger::{EmptyContext, Has}; +use overlapping_auth_schemes::context::AddContext; /// Innermost service: records the `Option` that `AddContext` pushed onto the context. #[derive(Clone, Default)] @@ -52,11 +39,11 @@ where } /// Drives a request through `AddContext` and returns the `AuthData` it resolved. -fn resolve_auth_data(headers: &[(&str, &str)]) -> Option { +fn resolve_auth_data(uri: &str, headers: &[(&str, &str)]) -> Option { let capture = CaptureAuthData::default(); let service = AddContext::<_, EmptyContext>::new(capture.clone()); - let mut builder = Request::get("/"); + let mut builder = Request::get(uri); for (name, value) in headers { builder = builder.header(*name, *value); } @@ -71,65 +58,51 @@ fn resolve_auth_data(headers: &[(&str, &str)]) -> Option { /// `dXNlcjpwYXNzd29yZA==` is `user:password`. const BASIC_HEADER: &str = "Basic dXNlcjpwYXNzd29yZA=="; const BEARER_HEADER: &str = "Bearer some-token"; -const BEARER_TOKEN: &str = "some-token"; +const API_KEY: &str = "test-api-key"; #[test] -fn basic_block_does_not_swallow_bearer_credentials() { - // The regression, in the only form that is observable at runtime. With an unrestricted - // Basic block, block 1 claims the bearer credentials and returns early, so the - // `x-api-key` block below it never runs and the request resolves to `AuthData::Bearer`. - // With the fix, block 1 declines, and the API key below it is reached - which is what - // this test asserts. - assert_eq!( - resolve_auth_data(&[ - ("authorization", BEARER_HEADER), - ("x-api-key", "header-key") - ]), - Some(AuthData::ApiKey("header-key".to_owned())), - ); +fn no_credentials_resolve_to_no_auth_data() { + assert_eq!(resolve_auth_data("/", &[]), None); } #[test] -fn bearer_block_is_still_reached_when_it_is_the_only_match() { - // Restricting block 1 must not strand block 3: bearer credentials with no API key - // still have to fall all the way through to the Bearer block. +fn basic_credentials_resolve_to_the_declared_basic_scheme() { assert_eq!( - resolve_auth_data(&[("authorization", BEARER_HEADER)]), - Some(AuthData::Bearer(BEARER_TOKEN.to_owned())), + resolve_auth_data("/", &[("authorization", BASIC_HEADER)]), + Some(AuthData::Basic("user".to_owned(), "password".to_owned())), ); } #[test] -fn basic_credentials_are_claimed_by_the_basic_block() { - // Block 1 legitimately matches here and must still take precedence over the API key. +fn bearer_credentials_resolve_to_the_declared_bearer_scheme() { assert_eq!( - resolve_auth_data(&[("authorization", BASIC_HEADER), ("x-api-key", "header-key")]), - Some(AuthData::Basic("user".to_owned(), "password".to_owned())), + resolve_auth_data("/", &[("authorization", BEARER_HEADER)]), + Some(AuthData::Bearer("some-token".to_owned())), ); } #[test] -fn header_api_key_is_reachable_when_an_unhandled_authorization_scheme_is_present() { - // Neither HTTP block handles `Digest`, so both must decline and leave the API key - // block reachable. +fn header_api_key_resolves_when_it_is_the_only_credential() { assert_eq!( - resolve_auth_data(&[ - ("authorization", "Digest username=\"user\""), - ("x-api-key", "header-key"), - ]), - Some(AuthData::ApiKey("header-key".to_owned())), + resolve_auth_data("/", &[("x-api-key", API_KEY)]), + Some(AuthData::ApiKey(API_KEY.to_owned())), ); } +/// An `Authorization` header must not shadow the apiKey block unless a block that actually +/// handles that scheme is generated before it. #[test] -fn header_api_key_resolves_when_no_authorization_header_is_present() { +fn header_api_key_is_reachable_alongside_bearer_credentials() { assert_eq!( - resolve_auth_data(&[("x-api-key", "header-key")]), - Some(AuthData::ApiKey("header-key".to_owned())), + resolve_auth_data("/", &[("authorization", BEARER_HEADER), ("x-api-key", API_KEY)]), + Some(AuthData::ApiKey(API_KEY.to_owned())), ); } #[test] -fn no_credentials_resolve_to_no_auth_data() { - assert_eq!(resolve_auth_data(&[]), None); +fn header_api_key_is_reachable_alongside_basic_credentials() { + assert_eq!( + resolve_auth_data("/", &[("authorization", BASIC_HEADER), ("x-api-key", API_KEY)]), + Some(AuthData::Basic("user".to_owned(), "password".to_owned())), + ); } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES index 5332ab08344d..c6e6d11d260f 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES @@ -78,3 +78,4 @@ src/lib.rs src/models.rs src/server/mod.rs src/server/server_auth.rs +tests/auth_scheme_precedence.rs diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/tests/auth_scheme_precedence.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/tests/auth_scheme_precedence.rs index 0886639b6564..f2c534173151 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/tests/auth_scheme_precedence.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/tests/auth_scheme_precedence.rs @@ -1,22 +1,13 @@ -//! Runtime regression tests for auth-scheme precedence in the generated `AddContext` middleware. +//! Runtime checks for auth-scheme precedence in the generated `AddContext` middleware. //! -//! `swagger::auth::from_headers` returns an *untyped* `AuthData`, matching an -//! `Authorization` header that carries either `Basic` or `Bearer` credentials. Every -//! generated auth block returns early once it matches, so a block that does not check +//! This file is generated. `swagger::auth::from_headers` returns an *untyped* `AuthData`, +//! matching an `Authorization` header that carries either `Basic` or `Bearer` credentials. +//! Every generated auth block returns early once it matches, so a block that does not check //! which variant it received will claim credentials belonging to a different scheme and //! prevent every later block - including API-key blocks - from ever running. //! -//! This spec generates the blocks in the following order, which is what makes the -//! behaviour observable from the outside: -//! -//! 1. `petstore_auth` - OAuth2, reads `Authorization: Bearer` -//! 2. `api_key` - API key, reads the `api_key` header -//! 3. `api_key_query` - API key, reads the `api_key_query` query parameter -//! 4. `http_basic_test` - HTTP Basic, reads `Authorization: Basic` -//! -//! Presenting Basic credentials alongside an API key therefore proves whether block 1 -//! stays in its lane: if it wrongly claims the Basic credentials it also swallows -//! blocks 2 and 3. +//! The expectations below are derived from the security schemes this API declares, in the +//! order their blocks are generated. #![cfg(feature = "server")] @@ -24,9 +15,9 @@ use std::sync::{Arc, Mutex}; use hyper::service::Service; use hyper::{Request, Response}; -use petstore_with_fake_endpoints_models_for_testing::context::AddContext; use swagger::auth::AuthData; use swagger::{EmptyContext, Has}; +use petstore_with_fake_endpoints_models_for_testing::context::AddContext; /// Innermost service: records the `Option` that `AddContext` pushed onto the context. #[derive(Clone, Default)] @@ -66,11 +57,16 @@ fn resolve_auth_data(uri: &str, headers: &[(&str, &str)]) -> Option { /// `dXNlcjpwYXNzd29yZA==` is `user:password`. const BASIC_HEADER: &str = "Basic dXNlcjpwYXNzd29yZA=="; +const BEARER_HEADER: &str = "Bearer some-token"; +const API_KEY: &str = "test-api-key"; #[test] -fn bearer_block_does_not_claim_basic_credentials() { - // The OAuth2 (Bearer) block is generated first. It must ignore Basic credentials and - // let them fall through to the HTTP Basic block generated last. +fn no_credentials_resolve_to_no_auth_data() { + assert_eq!(resolve_auth_data("/", &[]), None); +} + +#[test] +fn basic_credentials_resolve_to_the_declared_basic_scheme() { assert_eq!( resolve_auth_data("/", &[("authorization", BASIC_HEADER)]), Some(AuthData::Basic("user".to_owned(), "password".to_owned())), @@ -78,44 +74,62 @@ fn bearer_block_does_not_claim_basic_credentials() { } #[test] -fn bearer_credentials_resolve_to_bearer_auth_data() { - // Note this cannot prove the *Basic* block stays in its lane: the OAuth block above it - // legitimately claims these credentials first, so a broken Basic block would be - // unobservable here. That direction is covered at request level by the - // `overlapping-auth-schemes` sample, whose spec interleaves an apiKey scheme between - // the Basic and Bearer blocks. +fn bearer_credentials_resolve_to_the_declared_bearer_scheme() { assert_eq!( - resolve_auth_data("/", &[("authorization", "Bearer some-token")]), + resolve_auth_data("/", &[("authorization", BEARER_HEADER)]), Some(AuthData::Bearer("some-token".to_owned())), ); } #[test] -fn header_api_key_is_reachable_when_basic_credentials_are_also_present() { - // Regression test: an unguarded Bearer block matches the Basic credentials, returns - // early, and the `api_key` header block below it never runs. +fn header_api_key_resolves_when_it_is_the_only_credential() { assert_eq!( - resolve_auth_data( - "/", - &[("authorization", BASIC_HEADER), ("api_key", "header-key")], - ), - Some(AuthData::ApiKey("header-key".to_owned())), + resolve_auth_data("/", &[("api_key", API_KEY)]), + Some(AuthData::ApiKey(API_KEY.to_owned())), ); } +/// An `Authorization` header must not shadow the apiKey block unless a block that actually +/// handles that scheme is generated before it. #[test] -fn query_api_key_is_reachable_when_basic_credentials_are_also_present() { - // Same regression, for the query-parameter API-key block. +fn header_api_key_is_reachable_alongside_bearer_credentials() { assert_eq!( - resolve_auth_data( - "/?api_key_query=query-key", - &[("authorization", BASIC_HEADER)], - ), - Some(AuthData::ApiKey("query-key".to_owned())), + resolve_auth_data("/", &[("authorization", BEARER_HEADER), ("api_key", API_KEY)]), + Some(AuthData::Bearer("some-token".to_owned())), ); } #[test] -fn no_credentials_resolve_to_no_auth_data() { - assert_eq!(resolve_auth_data("/", &[]), None); +fn header_api_key_is_reachable_alongside_basic_credentials() { + assert_eq!( + resolve_auth_data("/", &[("authorization", BASIC_HEADER), ("api_key", API_KEY)]), + Some(AuthData::ApiKey(API_KEY.to_owned())), + ); +} + +#[test] +fn query_api_key_resolves_when_it_is_the_only_credential() { + assert_eq!( + resolve_auth_data("/?api_key_query=test-api-key", &[]), + Some(AuthData::ApiKey(API_KEY.to_owned())), + ); +} + +/// The query apiKey block is shadowed independently of the header one: an `Authorization` +/// header must not claim a request whose credentials are in the query string unless a block +/// that actually handles that scheme is generated before the query block. +#[test] +fn query_api_key_is_reachable_alongside_bearer_credentials() { + assert_eq!( + resolve_auth_data("/?api_key_query=test-api-key", &[("authorization", BEARER_HEADER)]), + Some(AuthData::Bearer("some-token".to_owned())), + ); +} + +#[test] +fn query_api_key_is_reachable_alongside_basic_credentials() { + assert_eq!( + resolve_auth_data("/?api_key_query=test-api-key", &[("authorization", BASIC_HEADER)]), + Some(AuthData::ApiKey(API_KEY.to_owned())), + ); } diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/FILES index 913ced3d98a4..5da8def13d90 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/FILES @@ -21,3 +21,4 @@ src/lib.rs src/models.rs src/server/mod.rs src/server/server_auth.rs +tests/auth_scheme_precedence.rs diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/tests/auth_scheme_precedence.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/tests/auth_scheme_precedence.rs new file mode 100644 index 000000000000..e6410b65e8fd --- /dev/null +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/tests/auth_scheme_precedence.rs @@ -0,0 +1,81 @@ +//! Runtime checks for auth-scheme precedence in the generated `AddContext` middleware. +//! +//! This file is generated. `swagger::auth::from_headers` returns an *untyped* `AuthData`, +//! matching an `Authorization` header that carries either `Basic` or `Bearer` credentials. +//! Every generated auth block returns early once it matches, so a block that does not check +//! which variant it received will claim credentials belonging to a different scheme and +//! prevent every later block - including API-key blocks - from ever running. +//! +//! The expectations below are derived from the security schemes this API declares, in the +//! order their blocks are generated. + +#![cfg(feature = "server")] + +use std::sync::{Arc, Mutex}; + +use hyper::service::Service; +use hyper::{Request, Response}; +use swagger::auth::AuthData; +use swagger::{EmptyContext, Has}; +use ping_bearer_auth::context::AddContext; + +/// Innermost service: records the `Option` that `AddContext` pushed onto the context. +#[derive(Clone, Default)] +struct CaptureAuthData(Arc>>); + +impl Service<(Request, C)> for CaptureAuthData +where + C: Has>, +{ + type Response = Response; + type Error = std::convert::Infallible; + type Future = std::future::Ready>; + + fn call(&self, (_request, context): (Request, C)) -> Self::Future { + let auth_data: &Option = context.get(); + *self.0.lock().expect("lock poisoned") = auth_data.clone(); + std::future::ready(Ok(Response::new(String::new()))) + } +} + +/// Drives a request through `AddContext` and returns the `AuthData` it resolved. +fn resolve_auth_data(uri: &str, headers: &[(&str, &str)]) -> Option { + let capture = CaptureAuthData::default(); + let service = AddContext::<_, EmptyContext>::new(capture.clone()); + + let mut builder = Request::get(uri); + for (name, value) in headers { + builder = builder.header(*name, *value); + } + let request = builder.body(()).expect("request should build"); + + futures::executor::block_on(service.call(request)).expect("service call should succeed"); + + let resolved = capture.0.lock().expect("lock poisoned").clone(); + resolved +} + +/// `dXNlcjpwYXNzd29yZA==` is `user:password`. +const BASIC_HEADER: &str = "Basic dXNlcjpwYXNzd29yZA=="; +const BEARER_HEADER: &str = "Bearer some-token"; + +#[test] +fn no_credentials_resolve_to_no_auth_data() { + assert_eq!(resolve_auth_data("/", &[]), None); +} + +#[test] +fn basic_credentials_resolve_to_none_when_no_basic_scheme_is_declared() { + assert_eq!( + resolve_auth_data("/", &[("authorization", BASIC_HEADER)]), + None, + ); +} + +#[test] +fn bearer_credentials_resolve_to_the_declared_bearer_scheme() { + assert_eq!( + resolve_auth_data("/", &[("authorization", BEARER_HEADER)]), + Some(AuthData::Bearer("some-token".to_owned())), + ); +} diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java index 30bc93ff4da5..430f680158d4 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java @@ -33,13 +33,11 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ObjectWithUniqueItems { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullSet = JsonNullable.>undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) private Set notNullSet = new LinkedHashSet<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullList = JsonNullable.>undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e8a5db7c2cfe..675b856d3e45 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -29,6 +29,7 @@ public class AdditionalPropertiesAnyType { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesAnyType name(@Nullable String name) { @@ -47,7 +48,6 @@ public AdditionalPropertiesAnyType name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3790bf7ab569..c4cc93375b6a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -30,6 +30,7 @@ public class AdditionalPropertiesArray { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesArray name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesArray name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5785f0edaf45..4fc0a9cc16da 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -29,6 +29,7 @@ public class AdditionalPropertiesBoolean { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesBoolean name(@Nullable String name) { @@ -47,7 +48,6 @@ public AdditionalPropertiesBoolean name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index dabffe7b93a1..8c8fef587001 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -29,35 +29,45 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapNumber = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapInteger = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapBoolean = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapArrayInteger = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapArrayAnytype = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapAnytype = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Object anytype1; private @Nullable Object anytype2 = null; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -84,7 +94,6 @@ public Map getMapString() { return mapString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_string") public void setMapString(Map mapString) { this.mapString = mapString; @@ -114,7 +123,6 @@ public Map getMapNumber() { return mapNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_number") public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -144,7 +152,6 @@ public Map getMapInteger() { return mapInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_integer") public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -174,7 +181,6 @@ public Map getMapBoolean() { return mapBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_boolean") public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -204,7 +210,6 @@ public Map> getMapArrayInteger() { return mapArrayInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_array_integer") public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -234,7 +239,6 @@ public Map> getMapArrayAnytype() { return mapArrayAnytype; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_array_anytype") public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -264,7 +268,6 @@ public Map> getMapMapString() { return mapMapString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_string") public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -294,7 +297,6 @@ public Map> getMapMapAnytype() { return mapMapAnytype; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_anytype") public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -316,7 +318,6 @@ public AdditionalPropertiesClass anytype1(@Nullable Object anytype1) { return anytype1; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("anytype_1") public void setAnytype1(@Nullable Object anytype1) { this.anytype1 = anytype1; @@ -359,7 +360,6 @@ public AdditionalPropertiesClass anytype3(@Nullable Object anytype3) { return anytype3; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("anytype_3") public void setAnytype3(@Nullable Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 360609409551..6ac9fdff8fb4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -29,6 +29,7 @@ public class AdditionalPropertiesInteger { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesInteger name(@Nullable String name) { @@ -47,7 +48,6 @@ public AdditionalPropertiesInteger name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 60915b85b8b7..76a52001f257 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -30,6 +30,7 @@ public class AdditionalPropertiesNumber { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesNumber name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesNumber name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 680678b588e2..8658dce01653 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -30,6 +30,7 @@ public class AdditionalPropertiesObject { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesObject name(@Nullable String name) { @@ -48,7 +49,6 @@ public AdditionalPropertiesObject name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 0602a16979f5..943185937e9d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -29,6 +29,7 @@ public class AdditionalPropertiesString { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public AdditionalPropertiesString name(@Nullable String name) { @@ -47,7 +48,6 @@ public AdditionalPropertiesString name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index 0364cbeb451f..d68a905f982a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -38,9 +38,11 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private String color = "red"; public Animal() { @@ -91,7 +93,6 @@ public String getColor() { return color; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("color") public void setColor(String color) { this.color = color; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 3580fffc402f..c501f85aa0a4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -29,6 +29,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { @@ -55,7 +56,6 @@ public List> getArrayArrayNumber() { return arrayArrayNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ArrayArrayNumber") public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 424ea6ded9b5..3f92a31d8455 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -29,6 +29,7 @@ public class ArrayOfNumberOnly { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { @@ -55,7 +56,6 @@ public List getArrayNumber() { return arrayNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ArrayNumber") public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 2a1da8ab2c7a..7241c0a4be53 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -29,12 +29,15 @@ public class ArrayTest { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayOfString = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayOfInteger = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { @@ -61,7 +64,6 @@ public List getArrayOfString() { return arrayOfString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_of_string") public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -91,7 +93,6 @@ public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_array_of_integer") public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -121,7 +122,6 @@ public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayO return arrayArrayOfModel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_array_of_model") public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index a344aa882002..06709bc31808 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -70,6 +70,7 @@ public static KindEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable KindEnum kind; public BigCat() { @@ -99,7 +100,6 @@ public BigCat kind(@Nullable KindEnum kind) { return kind; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("kind") public void setKind(@Nullable KindEnum kind) { this.kind = kind; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index 811258d49330..bb54603e5ccd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -25,21 +25,27 @@ public class Capitalization { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String smallCamel; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String capitalCamel; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String smallSnake; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String capitalSnake; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String scAETHFlowPoints; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String ATT_NAME; public Capitalization smallCamel(@Nullable String smallCamel) { @@ -58,7 +64,6 @@ public Capitalization smallCamel(@Nullable String smallCamel) { return smallCamel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("smallCamel") public void setSmallCamel(@Nullable String smallCamel) { this.smallCamel = smallCamel; @@ -80,7 +85,6 @@ public Capitalization capitalCamel(@Nullable String capitalCamel) { return capitalCamel; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("CapitalCamel") public void setCapitalCamel(@Nullable String capitalCamel) { this.capitalCamel = capitalCamel; @@ -102,7 +106,6 @@ public Capitalization smallSnake(@Nullable String smallSnake) { return smallSnake; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("small_Snake") public void setSmallSnake(@Nullable String smallSnake) { this.smallSnake = smallSnake; @@ -124,7 +127,6 @@ public Capitalization capitalSnake(@Nullable String capitalSnake) { return capitalSnake; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("Capital_Snake") public void setCapitalSnake(@Nullable String capitalSnake) { this.capitalSnake = capitalSnake; @@ -146,7 +148,6 @@ public Capitalization scAETHFlowPoints(@Nullable String scAETHFlowPoints) { return scAETHFlowPoints; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("SCA_ETH_Flow_Points") public void setScAETHFlowPoints(@Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -168,7 +169,6 @@ public Capitalization ATT_NAME(@Nullable String ATT_NAME) { return ATT_NAME; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("ATT_NAME") public void setATTNAME(@Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index e8666d33a3e2..5007778d234b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -38,6 +38,7 @@ public class Cat extends Animal { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean declawed; public Cat() { @@ -67,7 +68,6 @@ public Cat declawed(@Nullable Boolean declawed) { return declawed; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("declawed") public void setDeclawed(@Nullable Boolean declawed) { this.declawed = declawed; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index 0920e9972f19..c70eaa3e66f9 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -25,8 +25,10 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { @@ -56,7 +58,6 @@ public Category id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java index ecf4dd98d0fc..201010e97d87 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -31,6 +31,7 @@ public class ChildWithNullable extends ParentWithNullable { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String otherProperty; public ChildWithNullable otherProperty(@Nullable String otherProperty) { @@ -49,7 +50,6 @@ public ChildWithNullable otherProperty(@Nullable String otherProperty) { return otherProperty; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("otherProperty") public void setOtherProperty(@Nullable String otherProperty) { this.otherProperty = otherProperty; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index ae7726959eeb..3fb8e61e8b38 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -26,6 +26,7 @@ public class ClassModel { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyClass; public ClassModel propertyClass(@Nullable String propertyClass) { @@ -44,7 +45,6 @@ public ClassModel propertyClass(@Nullable String propertyClass) { return propertyClass; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("_class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index 68d1d67e9d69..9be6d4099760 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -25,6 +25,7 @@ public class Client { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String client; public Client client(@Nullable String client) { @@ -43,7 +44,6 @@ public Client client(@Nullable String client) { return client; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("client") public void setClient(@Nullable String client) { this.client = client; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 518f33493840..6674c88a2e4f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.ArrayList; @@ -26,8 +27,10 @@ public class ContainerDefaultValue { private @Nullable List nullableArray; + @JsonInclude(JsonInclude.Include.ALWAYS) private List nullableRequiredArray; + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); private @Nullable List nullableArrayWithDefault = new ArrayList<>(Arrays.asList("foo", "bar")); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index 0f0727d69986..794aae78d768 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -30,6 +30,7 @@ public class Dog extends Animal { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String breed; public Dog() { @@ -59,7 +60,6 @@ public Dog breed(@Nullable String breed) { return breed; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("breed") public void setBreed(@Nullable String breed) { this.breed = breed; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 00a83253dffe..4f89c8476898 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -64,6 +64,7 @@ public static JustSymbolEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable JustSymbolEnum justSymbol; /** @@ -102,6 +103,7 @@ public static ArrayEnumEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(@Nullable JustSymbolEnum justSymbol) { @@ -120,7 +122,6 @@ public EnumArrays justSymbol(@Nullable JustSymbolEnum justSymbol) { return justSymbol; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("just_symbol") public void setJustSymbol(@Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -150,7 +151,6 @@ public List getArrayEnum() { return arrayEnum; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("array_enum") public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index c5b52e5f1168..bd138a9d4845 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -66,6 +66,7 @@ public static EnumStringEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumStringEnum enumString; /** @@ -105,6 +106,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -143,6 +145,7 @@ public static EnumIntegerEnum fromValue(Integer value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumIntegerEnum enumInteger; /** @@ -181,9 +184,11 @@ public static EnumNumberEnum fromValue(Double value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable EnumNumberEnum enumNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable OuterEnum outerEnum; public EnumTest() { @@ -213,7 +218,6 @@ public EnumTest enumString(@Nullable EnumStringEnum enumString) { return enumString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_string") public void setEnumString(@Nullable EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +260,6 @@ public EnumTest enumInteger(@Nullable EnumIntegerEnum enumInteger) { return enumInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_integer") public void setEnumInteger(@Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -278,7 +281,6 @@ public EnumTest enumNumber(@Nullable EnumNumberEnum enumNumber) { return enumNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("enum_number") public void setEnumNumber(@Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -300,7 +302,6 @@ public EnumTest outerEnum(@Nullable OuterEnum outerEnum) { return outerEnum; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("outerEnum") public void setOuterEnum(@Nullable OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java index a534baa11503..fb2777c8d8ad 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java @@ -26,6 +26,7 @@ public class File { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String sourceURI; public File sourceURI(@Nullable String sourceURI) { @@ -44,7 +45,6 @@ public File sourceURI(@Nullable String sourceURI) { return sourceURI; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("sourceURI") public void setSourceURI(@Nullable String sourceURI) { this.sourceURI = sourceURI; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 85da24365011..bfeb4444c19e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -29,9 +29,11 @@ public class FileSchemaTestClass { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable File file; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(@Nullable File file) { @@ -50,7 +52,6 @@ public FileSchemaTestClass file(@Nullable File file) { return file; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("file") public void setFile(@Nullable File file) { this.file = file; @@ -80,7 +81,6 @@ public FileSchemaTestClass addFilesItem(File filesItem) { return files; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("files") public void setFiles(List<@Valid File> files) { this.files = files; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 12be011e4b50..b84f5c1254d3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -33,43 +33,57 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer integer; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer int32; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Float _float; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Double _double; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal bigDecimal; public FormatTest() { @@ -104,7 +118,6 @@ public FormatTest integer(@Nullable Integer integer) { return integer; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("integer") public void setInteger(@Nullable Integer integer) { this.integer = integer; @@ -128,7 +141,6 @@ public FormatTest int32(@Nullable Integer int32) { return int32; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("int32") public void setInt32(@Nullable Integer int32) { this.int32 = int32; @@ -150,7 +162,6 @@ public FormatTest int64(@Nullable Long int64) { return int64; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("int64") public void setInt64(@Nullable Long int64) { this.int64 = int64; @@ -197,7 +208,6 @@ public FormatTest _float(@Nullable Float _float) { return _float; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("float") public void setFloat(@Nullable Float _float) { this._float = _float; @@ -221,7 +231,6 @@ public FormatTest _double(@Nullable Double _double) { return _double; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("double") public void setDouble(@Nullable Double _double) { this._double = _double; @@ -243,7 +252,6 @@ public FormatTest string(@Nullable String string) { return string; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("string") public void setString(@Nullable String string) { this.string = string; @@ -286,7 +294,6 @@ public FormatTest binary(@Nullable org.springframework.core.io.Resource binary) return binary; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("binary") public void setBinary(@Nullable org.springframework.core.io.Resource binary) { this.binary = binary; @@ -329,7 +336,6 @@ public FormatTest dateTime(@Nullable OffsetDateTime dateTime) { return dateTime; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -351,7 +357,6 @@ public FormatTest uuid(@Nullable UUID uuid) { return uuid; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; @@ -394,7 +399,6 @@ public FormatTest bigDecimal(@Nullable BigDecimal bigDecimal) { return bigDecimal; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("BigDecimal") public void setBigDecimal(@Nullable BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 67d03b549c9b..0a7610e2760a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -27,9 +27,11 @@ public class HasOnlyReadOnly { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String bar; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String foo; public HasOnlyReadOnly bar(@Nullable String bar) { @@ -48,7 +50,6 @@ public HasOnlyReadOnly bar(@Nullable String bar) { return bar; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; @@ -70,7 +71,6 @@ public HasOnlyReadOnly foo(@Nullable String foo) { return foo; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("foo") public void setFoo(@Nullable String foo) { this.foo = foo; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 20a4b78b97f4..91a4abcb039b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -28,6 +28,7 @@ public class MapTest { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map> mapMapOfString = new HashMap<>(); /** @@ -66,12 +67,15 @@ public static InnerEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map mapOfEnumString = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map directMap = new HashMap<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { @@ -98,7 +102,6 @@ public Map> getMapMapOfString() { return mapMapOfString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_map_of_string") public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -128,7 +131,6 @@ public Map getMapOfEnumString() { return mapOfEnumString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map_of_enum_string") public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -158,7 +160,6 @@ public Map getDirectMap() { return directMap; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("direct_map") public void setDirectMap(Map directMap) { this.directMap = directMap; @@ -188,7 +189,6 @@ public Map getIndirectMap() { return indirectMap; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("indirect_map") public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4a1a2fafc376..c890177e5c7d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,13 +31,16 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable UUID uuid; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { @@ -56,7 +59,6 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { return uuid; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; @@ -78,7 +80,6 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate return dateTime; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -108,7 +109,6 @@ public Map getMap() { return map; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("map") public void setMap(Map map) { this.map = map; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index c071004dcf37..aa582adbe1de 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -28,9 +28,11 @@ public class Model200Response { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyClass; public Model200Response name(@Nullable Integer name) { @@ -49,7 +51,6 @@ public Model200Response name(@Nullable Integer name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable Integer name) { this.name = name; @@ -71,7 +72,6 @@ public Model200Response propertyClass(@Nullable String propertyClass) { return propertyClass; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 2f93f69f9606..77b8d44c0593 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -27,12 +27,15 @@ public class ModelApiResponse { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer code; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String type; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String message; public ModelApiResponse code(@Nullable Integer code) { @@ -51,7 +54,6 @@ public ModelApiResponse code(@Nullable Integer code) { return code; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("code") public void setCode(@Nullable Integer code) { this.code = code; @@ -73,7 +75,6 @@ public ModelApiResponse type(@Nullable String type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(@Nullable String type) { this.type = type; @@ -95,7 +96,6 @@ public ModelApiResponse message(@Nullable String message) { return message; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("message") public void setMessage(@Nullable String message) { this.message = message; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 12c0719d562d..387898d916e3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -27,6 +27,7 @@ public class ModelList { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String _123list; public ModelList _123list(@Nullable String _123list) { @@ -45,7 +46,6 @@ public ModelList _123list(@Nullable String _123list) { return _123list; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("123-list") public void set123list(@Nullable String _123list) { this._123list = _123list; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 7f3e8f170726..bcb90c304d6a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -28,6 +28,7 @@ public class ModelReturn { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer _return; public ModelReturn _return(@Nullable Integer _return) { @@ -46,7 +47,6 @@ public ModelReturn _return(@Nullable Integer _return) { return _return; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("return") public void setReturn(@Nullable Integer _return) { this._return = _return; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index e9a7f9cc9d8a..a6e4993c1ddc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -25,15 +25,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer snakeCase; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String property; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer _123number; public Name() { @@ -84,7 +88,6 @@ public Name snakeCase(@Nullable Integer snakeCase) { return snakeCase; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("snake_case") public void setSnakeCase(@Nullable Integer snakeCase) { this.snakeCase = snakeCase; @@ -106,7 +109,6 @@ public Name property(@Nullable String property) { return property; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("property") public void setProperty(@Nullable String property) { this.property = property; @@ -128,7 +130,6 @@ public Name _123number(@Nullable Integer _123number) { return _123number; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("123Number") public void set123number(@Nullable Integer _123number) { this._123number = _123number; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index 22cea2d2d766..52a68b30ab73 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -26,6 +26,7 @@ public class NumberOnly { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal justNumber; public NumberOnly justNumber(@Nullable BigDecimal justNumber) { @@ -44,7 +45,6 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { return justNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("JustNumber") public void setJustNumber(@Nullable BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index fdc614781b08..1595738597f9 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -28,15 +28,19 @@ public class Order { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long petId; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer quantity; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -78,9 +82,11 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable StatusEnum status; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private Boolean complete = false; public Order id(@Nullable Long id) { @@ -99,7 +105,6 @@ public Order id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -121,7 +126,6 @@ public Order petId(@Nullable Long petId) { return petId; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("petId") public void setPetId(@Nullable Long petId) { this.petId = petId; @@ -143,7 +147,6 @@ public Order quantity(@Nullable Integer quantity) { return quantity; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("quantity") public void setQuantity(@Nullable Integer quantity) { this.quantity = quantity; @@ -165,7 +168,6 @@ public Order shipDate(@Nullable OffsetDateTime shipDate) { return shipDate; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("shipDate") public void setShipDate(@Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -187,7 +189,6 @@ public Order status(@Nullable StatusEnum status) { return status; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { this.status = status; @@ -209,7 +210,6 @@ public Boolean getComplete() { return complete; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("complete") public void setComplete(Boolean complete) { this.complete = complete; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 36b201b865cf..1fc9d46645e8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -26,12 +26,15 @@ public class OuterComposite { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal myNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String myString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean myBoolean; public OuterComposite myNumber(@Nullable BigDecimal myNumber) { @@ -50,7 +53,6 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { return myNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_number") public void setMyNumber(@Nullable BigDecimal myNumber) { this.myNumber = myNumber; @@ -72,7 +74,6 @@ public OuterComposite myString(@Nullable String myString) { return myString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_string") public void setMyString(@Nullable String myString) { this.myString = myString; @@ -94,7 +95,6 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { return myBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("my_boolean") public void setMyBoolean(@Nullable Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java index 67fe6b9074de..032a06cb2a2b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -71,6 +71,7 @@ public static TypeEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable TypeEnum type; private @Nullable String nullableProperty = null; @@ -91,7 +92,6 @@ public ParentWithNullable type(@Nullable TypeEnum type) { return type; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("type") public void setType(@Nullable TypeEnum type) { this.type = type; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 6a20ec90e83f..7bdf76f63b75 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -34,16 +34,21 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -84,6 +89,7 @@ public static StatusEnum fromValue(String value) { } @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) @Deprecated private @Nullable StatusEnum status; @@ -115,7 +121,6 @@ public Pet id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -137,7 +142,6 @@ public Pet category(@Nullable Category category) { return category; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("category") public void setCategory(@Nullable Category category) { this.category = category; @@ -218,7 +222,6 @@ public Pet addTagsItem(Tag tagsItem) { return tags; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("tags") public void setTags(List<@Valid Tag> tags) { this.tags = tags; @@ -245,7 +248,6 @@ public Pet status(@Nullable StatusEnum status) { /** * @deprecated */ - @JsonSetter(nulls = Nulls.SKIP) @Deprecated @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index ffdb54f62711..6047f75ef858 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -25,9 +25,11 @@ public class ReadOnlyFirst { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String bar; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String baz; public ReadOnlyFirst bar(@Nullable String bar) { @@ -46,7 +48,6 @@ public ReadOnlyFirst bar(@Nullable String bar) { return bar; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; @@ -68,7 +69,6 @@ public ReadOnlyFirst baz(@Nullable String baz) { return baz; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("baz") public void setBaz(@Nullable String baz) { this.baz = baz; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 49e5a3dbd7b6..f9d4a07cb8c8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -25,15 +25,19 @@ public class ResponseObjectWithDifferentFieldNames { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String normalPropertyName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String UPPER_CASE_PROPERTY_SNAKE; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lowerCasePropertyDashes; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String propertyNameWithSpaces; public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String normalPropertyName) { @@ -52,7 +56,6 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String return normalPropertyName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("normalPropertyName") public void setNormalPropertyName(@Nullable String normalPropertyName) { this.normalPropertyName = normalPropertyName; @@ -74,7 +77,6 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable return UPPER_CASE_PROPERTY_SNAKE; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public void setUPPERCASEPROPERTYSNAKE(@Nullable String UPPER_CASE_PROPERTY_SNAKE) { this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; @@ -96,7 +98,6 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S return lowerCasePropertyDashes; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lower-case-property-dashes") public void setLowerCasePropertyDashes(@Nullable String lowerCasePropertyDashes) { this.lowerCasePropertyDashes = lowerCasePropertyDashes; @@ -118,7 +119,6 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St return propertyNameWithSpaces; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("property name with spaces") public void setPropertyNameWithSpaces(@Nullable String propertyNameWithSpaces) { this.propertyNameWithSpaces = propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index a037c51871ba..6d8439318c14 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -27,6 +27,7 @@ public class SpecialModelName { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long $specialPropertyName; public SpecialModelName $specialPropertyName(@Nullable Long $specialPropertyName) { @@ -45,7 +46,6 @@ public class SpecialModelName { return $specialPropertyName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("$special[property.name]") public void set$SpecialPropertyName(@Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index 54480713e85b..7039951b34b3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -25,9 +25,11 @@ public class Tag { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String name; public Tag id(@Nullable Long id) { @@ -46,7 +48,6 @@ public Tag id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -68,7 +69,6 @@ public Tag name(@Nullable String name) { return name; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index e1ddc677876c..df8b8fbcdb51 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -25,14 +26,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index 088b142a7513..3b3204e03b16 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -25,16 +26,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index f7547a7e00c5..eb2111764012 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -25,27 +25,35 @@ public class User { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Long id; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String username; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String firstName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String lastName; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String email; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String password; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String phone; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer userStatus; public User id(@Nullable Long id) { @@ -64,7 +72,6 @@ public User id(@Nullable Long id) { return id; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; @@ -86,7 +93,6 @@ public User username(@Nullable String username) { return username; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("username") public void setUsername(@Nullable String username) { this.username = username; @@ -108,7 +114,6 @@ public User firstName(@Nullable String firstName) { return firstName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("firstName") public void setFirstName(@Nullable String firstName) { this.firstName = firstName; @@ -130,7 +135,6 @@ public User lastName(@Nullable String lastName) { return lastName; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("lastName") public void setLastName(@Nullable String lastName) { this.lastName = lastName; @@ -152,7 +156,6 @@ public User email(@Nullable String email) { return email; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("email") public void setEmail(@Nullable String email) { this.email = email; @@ -174,7 +177,6 @@ public User password(@Nullable String password) { return password; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("password") public void setPassword(@Nullable String password) { this.password = password; @@ -196,7 +198,6 @@ public User phone(@Nullable String phone) { return phone; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("phone") public void setPhone(@Nullable String phone) { this.phone = phone; @@ -218,7 +219,6 @@ public User userStatus(@Nullable Integer userStatus) { return userStatus; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("userStatus") public void setUserStatus(@Nullable Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index fe3ac71771db..e76b8fdf4d6b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -29,90 +29,119 @@ public class XmlItem { @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String attributeString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal attributeNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer attributeInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean attributeBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List wrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String nameString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal nameNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer nameInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean nameBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List nameArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List nameWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String prefixString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal prefixNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer prefixInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean prefixBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String namespaceString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal namespaceNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer namespaceInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean namespaceBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List namespaceArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List namespaceWrappedArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable String prefixNsString; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable BigDecimal prefixNsNumber; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Integer prefixNsInteger; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private @Nullable Boolean prefixNsBoolean; @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixNsArray = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSetter(nulls = Nulls.SKIP) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(@Nullable String attributeString) { @@ -131,7 +160,6 @@ public XmlItem attributeString(@Nullable String attributeString) { return attributeString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_string") public void setAttributeString(@Nullable String attributeString) { this.attributeString = attributeString; @@ -153,7 +181,6 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { return attributeNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_number") public void setAttributeNumber(@Nullable BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -175,7 +202,6 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { return attributeInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_integer") public void setAttributeInteger(@Nullable Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -197,7 +223,6 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { return attributeBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("attribute_boolean") public void setAttributeBoolean(@Nullable Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -227,7 +252,6 @@ public List getWrappedArray() { return wrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("wrapped_array") public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -249,7 +273,6 @@ public XmlItem nameString(@Nullable String nameString) { return nameString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_string") public void setNameString(@Nullable String nameString) { this.nameString = nameString; @@ -271,7 +294,6 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { return nameNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_number") public void setNameNumber(@Nullable BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -293,7 +315,6 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { return nameInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_integer") public void setNameInteger(@Nullable Integer nameInteger) { this.nameInteger = nameInteger; @@ -315,7 +336,6 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { return nameBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_boolean") public void setNameBoolean(@Nullable Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -345,7 +365,6 @@ public List getNameArray() { return nameArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_array") public void setNameArray(List nameArray) { this.nameArray = nameArray; @@ -375,7 +394,6 @@ public List getNameWrappedArray() { return nameWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("name_wrapped_array") public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -397,7 +415,6 @@ public XmlItem prefixString(@Nullable String prefixString) { return prefixString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_string") public void setPrefixString(@Nullable String prefixString) { this.prefixString = prefixString; @@ -419,7 +436,6 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { return prefixNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_number") public void setPrefixNumber(@Nullable BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -441,7 +457,6 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { return prefixInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_integer") public void setPrefixInteger(@Nullable Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -463,7 +478,6 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { return prefixBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_boolean") public void setPrefixBoolean(@Nullable Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -493,7 +507,6 @@ public List getPrefixArray() { return prefixArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_array") public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -523,7 +536,6 @@ public List getPrefixWrappedArray() { return prefixWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_wrapped_array") public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -545,7 +557,6 @@ public XmlItem namespaceString(@Nullable String namespaceString) { return namespaceString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_string") public void setNamespaceString(@Nullable String namespaceString) { this.namespaceString = namespaceString; @@ -567,7 +578,6 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { return namespaceNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_number") public void setNamespaceNumber(@Nullable BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -589,7 +599,6 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { return namespaceInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_integer") public void setNamespaceInteger(@Nullable Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -611,7 +620,6 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { return namespaceBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_boolean") public void setNamespaceBoolean(@Nullable Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -641,7 +649,6 @@ public List getNamespaceArray() { return namespaceArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_array") public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -671,7 +678,6 @@ public List getNamespaceWrappedArray() { return namespaceWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("namespace_wrapped_array") public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -693,7 +699,6 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { return prefixNsString; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_string") public void setPrefixNsString(@Nullable String prefixNsString) { this.prefixNsString = prefixNsString; @@ -715,7 +720,6 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { return prefixNsNumber; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_number") public void setPrefixNsNumber(@Nullable BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -737,7 +741,6 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { return prefixNsInteger; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_integer") public void setPrefixNsInteger(@Nullable Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -759,7 +762,6 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { return prefixNsBoolean; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_boolean") public void setPrefixNsBoolean(@Nullable Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -789,7 +791,6 @@ public List getPrefixNsArray() { return prefixNsArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_array") public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -819,7 +820,6 @@ public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } - @JsonSetter(nulls = Nulls.SKIP) @JsonProperty("prefix_ns_wrapped_array") public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 86be6e693c91..32023ee3da1e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index f5dda830a79d..6ce4f7f8914c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index 48bdaa9344f8..11e1022ae3d3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 30539406b232..b6557ceff4e9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index ef143d4788e3..8d3ed031d65d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index c81f93c993ea..150781082c6d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index bd408cc22a7c..76e74fd67579 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java index 897b2fe03dd2..e2ceeea637fe 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java index 6f7cb3fcb82c..50c34a0c9121 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 4a92bd5c7782..ea586df2067a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 157504edc6d6..d3800560158c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 405f1100a495..03b53c193ee8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java index c4d654ac44a6..bdce7e27156f 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java @@ -34,8 +34,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 3a1809dfa191..3f6cf5af234f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 99e7a4cdca08..dac8f14035fc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index 75246c9ff8ce..d15dbbf7d60c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 0e937a87f12b..1e996c854efe 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index c8c06116f9a1..795d53cd01a6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index e99a9a785740..79dc8a7432ae 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index 3a21421bf13c..4fd62bd3f389 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java index 14cce68e1223..56d45c3ad292 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java index 2b706856fd92..af16949486cc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index cf4719096fb0..1b1399efc065 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7cc05e11b994..57fabf941047 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index a2f08996fefa..ab33d9a13ef8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 37d3f00f767f..9ea7f74985a9 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -59,7 +59,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java index 234aef7fb345..fe05be4b1c68 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java @@ -38,6 +38,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java index b54dbbd66b7f..e62f4eb17757 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java @@ -28,6 +28,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index fe421ec5cd1d..2bc02f7a7cc3 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -30,14 +30,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java index 7bd7ee977200..4d3330046620 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java index 5894378400d2..e4f7ebda46b3 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java @@ -40,6 +40,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java index 6561257a70c2..6055fd7ceb2d 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index e82c4b3a1679..98ba228cdc9b 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -30,7 +29,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java index b4a5e5095239..982f8d038258 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -76,7 +76,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java index a760602c8d73..84bb38e9fc00 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java @@ -40,8 +40,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index f59eb21da480..4fba162597a9 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,14 +29,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 4b7506f903ec..fb1d40011dac 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,16 +29,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Category.java index 8bebe53b3407..327bdbf43f5b 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Category.java @@ -32,14 +32,14 @@ public class Category { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String name; } diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/ModelApiResponse.java index 741915556d54..7eba849384a7 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -34,21 +34,21 @@ public class ModelApiResponse { @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Integer code; @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String type; @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String message; } diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Order.java index c3b14de3f295..9638d243a3e9 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Order.java @@ -35,28 +35,28 @@ public class Order { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long petId; @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Integer quantity; @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime shipDate; @@ -101,7 +101,7 @@ public static StatusEnum fromValue(String value) { @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable StatusEnum status; @@ -109,7 +109,7 @@ public static StatusEnum fromValue(String value) { @JsonProperty("complete") @lombok.Builder.Default - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Boolean complete = false; } diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java index abb9aa57acef..f7fcbc4a1758 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Pet.java @@ -38,20 +38,21 @@ public class Pet { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Category category; @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; @@ -59,6 +60,7 @@ public class Pet { @JsonProperty("photoUrls") @lombok.Builder.Default + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @@ -66,7 +68,7 @@ public class Pet { @JsonProperty("tags") @lombok.Builder.Default - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -110,7 +112,7 @@ public static StatusEnum fromValue(String value) { @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) @Deprecated private @Nullable StatusEnum status; diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Tag.java index 0a70bef0dd88..af73a26fa88c 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/Tag.java @@ -32,14 +32,14 @@ public class Tag { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String name; } diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/User.java index df90dcfb454d..34a4dd74e2fc 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/model/User.java @@ -32,56 +32,56 @@ public class User { @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Long id; @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String username; @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String firstName; @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String lastName; @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String email; @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String password; @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable String phone; @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_EMPTY) private @Nullable Integer userStatus; } diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java index 3819f2efd3fb..1a5e177b89a4 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java @@ -41,8 +41,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/PageMeta.java b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/PageMeta.java index 6c356b8a5b13..a1a34c2041d5 100644 --- a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/PageMeta.java +++ b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/PageMeta.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import org.springframework.lang.Nullable; @@ -24,12 +25,16 @@ public class PageMeta implements Serializable { private static final long serialVersionUID = 1L; + @JsonInclude(JsonInclude.Include.NON_NULL) private Long size; + @JsonInclude(JsonInclude.Include.NON_NULL) private Long number; + @JsonInclude(JsonInclude.Include.NON_NULL) private Long totalElements; + @JsonInclude(JsonInclude.Include.NON_NULL) private Long totalPages; public PageMeta() { diff --git a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/Pet.java index 477568049136..5bbe5fb75ae0 100644 --- a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/model/Pet.java @@ -28,6 +28,7 @@ public class Pet implements Serializable { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java index 37d29c32b8da..c16ac8affc4e 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java @@ -36,8 +36,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 4798bc0c028d..fc4f770ac1d9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java index 2f923496661e..7812e1c12382 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a0936f8a784..a51bd99c90fc 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index b4d90992ea4c..0cb8e0d45c2d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java index 7330185d2021..31127013b739 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java index d095e6659db9..d394b3e38431 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 673bb2e90254..728f7cad250d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 81f9284d385e..79d663d04658 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/NullableModel.java b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/NullableModel.java index cad9a99b10f5..e6fa1ccea8b4 100644 --- a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/NullableModel.java +++ b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/NullableModel.java @@ -28,14 +28,15 @@ public class NullableModel implements Serializable { private static final long serialVersionUID = 1L; + @JsonInclude(JsonInclude.Include.NON_NULL) private String requiredNonNullable; + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable requiredNullable = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String optionalNonNullable; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable optionalNullable = JsonNullable.undefined(); public NullableModel() { diff --git a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/Pet.java index 81f0dd9c6551..5ec773c75180 100644 --- a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/model/Pet.java @@ -28,6 +28,7 @@ public class Pet implements Serializable { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java index 4e0c294dd76c..bceaaab0ee8e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index cb174a615f9b..e24c2373ad81 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index e3ff9a400f74..94004510586d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java index 4e0c294dd76c..bceaaab0ee8e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index cb174a615f9b..e24c2373ad81 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java index e3ff9a400f74..94004510586d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java index 4e0c294dd76c..bceaaab0ee8e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index cb174a615f9b..e24c2373ad81 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index e3ff9a400f74..94004510586d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java index 4e0c294dd76c..bceaaab0ee8e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java index f6a38799c911..03999441f921 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index cef26523d335..5bd8c11d9722 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index cb174a615f9b..e24c2373ad81 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java index 2fc98b6fb666..4b44b936d3e2 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index e3ff9a400f74..94004510586d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 8b1470e92bf0..31461adcaef0 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java index e58434a4f202..63a0767c6aba 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java @@ -35,8 +35,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private List photoUrls = new ArrayList<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 9eb240d9d5a8..f33d5b5f56bf 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesAnyType { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 1add36a533b8..0f0bb0aa76ba 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -28,7 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesArray { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesArray name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d9c3ae693371..840d4414510d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesBoolean { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f87316562344..f28336e48905 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -30,37 +30,36 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesClass { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapString = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapNumber = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapInteger = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapBoolean = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapArrayInteger = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapArrayAnytype = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapMapString = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapMapAnytype = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional anytype1 = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional anytype3 = Optional.empty(); public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index b0c102f5ae6f..d900d26d8a5a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesInteger { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesInteger name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index a38cbaf03e13..856b5557ca80 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -28,7 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesNumber { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesNumber name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index d0f101d44167..7ff2e6fc8ed4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -28,7 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesObject { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesObject name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index ae19d7973934..fe6dd4e63bb1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AdditionalPropertiesString { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public AdditionalPropertiesString name(String name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index 97abb84ee877..427edfa9b6c3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java @@ -37,9 +37,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional color = Optional.of("red"); public Animal() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index f79439c6d20b..84972f4b66ab 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ArrayOfArrayOfNumberOnly { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 307bbe54543c..bf1e9f36d6e6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ArrayOfNumberOnly { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index 88eb053ee46c..4f61fb9a20a1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,13 +27,13 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ArrayTest { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List arrayOfString = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index 6bf49bebde7f..944d0e6f6cca 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -68,7 +68,7 @@ public static KindEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional kind = Optional.empty(); public BigCat() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index afe0b670d434..6ebc2bb7c4aa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java @@ -23,22 +23,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Capitalization { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional smallCamel = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional capitalCamel = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional smallSnake = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional capitalSnake = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional scAETHFlowPoints = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional ATT_NAME = Optional.empty(); public Capitalization smallCamel(String smallCamel) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index 3d40464498c1..a6599c11a4ef 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -36,7 +36,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Cat extends Animal { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional declawed = Optional.empty(); public Cat() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index f4193cd0ecbd..2a8ac53c2ed9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java @@ -23,9 +23,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Category { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java index 06b479c7551e..054548686aba 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -31,7 +31,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ChildWithNullable extends ParentWithNullable { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional otherProperty = Optional.empty(); public ChildWithNullable otherProperty(String otherProperty) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index ea4aa22ef7bb..9b4274670669 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java @@ -24,7 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ClassModel { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional propertyClass = Optional.empty(); public ClassModel propertyClass(String propertyClass) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index 189d36a7f6db..3cfb72e6eb37 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java @@ -23,7 +23,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Client { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional client = Optional.empty(); public Client client(String client) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 8ce588187e8a..89a4873f502e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index 5b496c8bc108..5302ac5519f5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -28,7 +28,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Dog extends Animal { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional breed = Optional.empty(); public Dog() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index 08704f3320c3..a3dc222fd577 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -62,7 +62,7 @@ public static JustSymbolEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional justSymbol = Optional.empty(); /** @@ -100,7 +100,7 @@ public static ArrayEnumEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index ef550d16771d..4088a1bdcf9f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -64,7 +64,7 @@ public static EnumStringEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional enumString = Optional.empty(); /** @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +142,7 @@ public static EnumIntegerEnum fromValue(Integer value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional enumInteger = Optional.empty(); /** @@ -179,10 +180,10 @@ public static EnumNumberEnum fromValue(Double value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional enumNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional outerEnum = Optional.empty(); public EnumTest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java index f75da12fd5aa..53567d67d33c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java @@ -24,7 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class File { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional sourceURI = Optional.empty(); public File sourceURI(String sourceURI) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d8e285d7ce15..76b4fc2388f2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -27,10 +27,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class FileSchemaTestClass { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional file = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index 9d34a308ffd2..d9c424adc567 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -31,44 +31,48 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class FormatTest { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@Min(value = 10) @Max(value = 100) Integer> integer = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@Min(value = 20) @Max(value = 200) Integer> int32 = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional int64 = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@DecimalMin(value = "54.3") @DecimalMax(value = "987.6") Float> _float = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@DecimalMin(value = "67.8") @DecimalMax(value = "123.4") Double> _double = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional<@Pattern(regexp = "[a-zA-Z]") String> string = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional binary = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Optional dateTime = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional uuid = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional bigDecimal = Optional.empty(); public FormatTest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 98038a2d21ce..260a258e60ab 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -25,10 +25,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class HasOnlyReadOnly { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional bar = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional foo = Optional.empty(); public HasOnlyReadOnly bar(String bar) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index c3b1171a3695..67b48fa1701f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -26,7 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class MapTest { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map> mapMapOfString = new HashMap<>(); /** @@ -64,13 +64,13 @@ public static InnerEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map mapOfEnumString = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map directMap = new HashMap<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index b69fd3778180..f0bd3bcfeda0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -29,14 +29,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional uuid = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Optional dateTime = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 143749e83676..3f39f2de441d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -26,10 +26,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Model200Response { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional propertyClass = Optional.empty(); public Model200Response name(Integer name) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index abd732c379af..c768a547143e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -25,13 +25,13 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ModelApiResponse { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional code = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional type = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional message = Optional.empty(); public ModelApiResponse code(Integer code) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index 994c8addcf8b..76e242ce1fa0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -25,7 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ModelList { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional _123list = Optional.empty(); public ModelList _123list(String _123list) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 80cabaf2f12f..11cfff5345df 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -26,7 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ModelReturn { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional _return = Optional.empty(); public ModelReturn _return(Integer _return) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index 5d29bd897318..7d0b27ffd90b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java @@ -24,15 +24,16 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional snakeCase = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional property = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional _123number = Optional.empty(); public Name() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java index 7d40bce81d06..1c8b66beb4e6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index 4aa1933864ce..020e94d233ef 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -24,7 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NumberOnly { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional justNumber = Optional.empty(); public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index 3f007c80c632..c6facd4540ba 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java @@ -26,16 +26,16 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Order { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional petId = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional quantity = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Optional shipDate = Optional.empty(); @@ -76,10 +76,10 @@ public static StatusEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional status = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional complete = Optional.of(false); public Order id(Long id) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index 8923f202a80c..ec25e18fdb96 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -24,13 +24,13 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class OuterComposite { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional myNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional myString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional myBoolean = Optional.empty(); public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java index b06d51faa49c..db85e72833c9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -72,10 +72,9 @@ public static TypeEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional type = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(TypeEnum type) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 0041b2cb06ae..3f383d8fff3f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -32,17 +32,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Pet { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional category = Optional.empty(); + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List<@Valid Tag> tags = new ArrayList<>(); /** @@ -82,7 +84,7 @@ public static StatusEnum fromValue(String value) { } } - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) @Deprecated private Optional status = Optional.empty(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 3a3dfbad5671..0f9443f9dde9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -23,10 +23,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ReadOnlyFirst { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional bar = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional baz = Optional.empty(); public ReadOnlyFirst bar(String bar) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 08d6847e7eaa..70584cdc3721 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -23,16 +23,16 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ResponseObjectWithDifferentFieldNames { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional normalPropertyName = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional UPPER_CASE_PROPERTY_SNAKE = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional lowerCasePropertyDashes = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional propertyNameWithSpaces = Optional.empty(); public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index 87509132edd5..22cd30bdd32b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -25,7 +25,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class SpecialModelName { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional $specialPropertyName = Optional.empty(); public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index 6d1d0f373127..dd6c5c041fae 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java @@ -23,10 +23,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Tag { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional name = Optional.empty(); public Tag id(Long id) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index db57b9b6e93a..afd140f65cbe 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index 5bf6dd839642..01d99a494331 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index 74bf917ba910..8b701d522cb8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java @@ -23,28 +23,28 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class User { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional id = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional username = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional firstName = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional lastName = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional email = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional password = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional phone = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional userStatus = Optional.empty(); public User id(Long id) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index e52627ee08bf..c372ce11ee74 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -27,91 +27,91 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class XmlItem { - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional attributeString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional attributeNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional attributeInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional attributeBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List wrappedArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional nameString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional nameNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional nameInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional nameBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List nameArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List nameWrappedArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List prefixArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List prefixWrappedArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional namespaceString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional namespaceNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional namespaceInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional namespaceBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List namespaceArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List namespaceWrappedArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNsString = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNsNumber = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNsInteger = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private Optional prefixNsBoolean = Optional.empty(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List prefixNsArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java index a38602c22da4..51f8239e6287 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java @@ -57,7 +57,6 @@ public class AdditionalPropertiesClass { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java index b200b3f62188..9f6a83b4973f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Animal { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java index 1114456a68a1..e4a77578766d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java @@ -26,6 +26,7 @@ public class Category { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public Category() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java index e969b98a302b..2bd4f51c4140 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java @@ -28,14 +28,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValue { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValue() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index 7b02c6226925..65374acc591d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -104,6 +104,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index d1274d6cf08f..92a22136e7a7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -40,6 +40,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTest { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java index 5e8a32edb738..736006c8b6f5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java @@ -24,6 +24,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class Name { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java index 7db52928c1c6..fc013fe70f4c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; @@ -28,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapProperty { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapProperty languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java index d092b2fc47d5..bb28729decdd 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java @@ -75,7 +75,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index 68c3ebd77107..6c54f41ddd69 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -38,8 +38,10 @@ public class Pet { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Category category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java index b4242f545bc2..b6e5a480c71e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,14 +27,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefault { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java index c6167ecb0cd8..cba300e3a67e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; @@ -26,16 +27,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExample { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExample() { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java index eacc2158fcdd..db9084f361ed 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java @@ -37,6 +37,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto implements com.custompackage.InterfaceToKeep, com.custompackage.WithColor { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java index b54dbbd66b7f..e62f4eb17757 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java @@ -28,6 +28,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java index e64c0995389d..1576c5046e33 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java @@ -110,6 +110,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** @@ -188,7 +189,6 @@ public static EnumNumberEnum fromValue(Double value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable EnumNumberEnum enumNumber; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable outerEnum = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java index 9baeea9cc239..b2bcf9fec2d6 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java @@ -40,6 +40,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -54,11 +55,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -69,6 +72,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java index 2b3de797a45a..ac09a0a9834b 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -29,7 +28,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class HealthCheckResultDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableMessage = JsonNullable.undefined(); public HealthCheckResultDto nullableMessage(String nullableMessage) { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java index 6561257a70c2..6055fd7ceb2d 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java index 99e4c9ecbf90..55fe5702be7f 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java @@ -40,39 +40,29 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableClassDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable integerProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable numberProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable booleanProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable stringProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private JsonNullable dateProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private JsonNullable datetimeProp = JsonNullable.undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItemsNullable = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> objectNullableProp = JsonNullable.>undefined(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java index 2bc2073abb6a..ab45923a4570 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,6 +27,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class OuterObjectWithEnumPropertyDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private OuterEnumIntegerDto value; public OuterObjectWithEnumPropertyDto() { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java index b4a5e5095239..982f8d038258 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -76,7 +76,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java index 77a5d6571d54..5cbf751e6bd4 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java @@ -40,8 +40,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index d04080bd138a..3115be7ad0b3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -59,7 +59,6 @@ public class AdditionalPropertiesClassDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Object anytype1; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable anytype2 = JsonNullable.undefined(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java index 9954743744b8..0ea4d126864a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java @@ -38,6 +38,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class AnimalDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String className; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java index e9a8e17231e4..34487fc4bbc4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java @@ -28,6 +28,7 @@ public class CategoryDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long id; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name = "default-name"; public CategoryDto() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index 935dbf3e6f4d..39f4e40b9ba0 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -30,14 +30,14 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class ContainerDefaultValueDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.ALWAYS) private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + @JsonInclude(JsonInclude.Include.NON_NULL) private List requiredArray = new ArrayList<>(); - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java index 5ab270f93a2e..bf188bb1b01d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java @@ -105,6 +105,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } } + @JsonInclude(JsonInclude.Include.NON_NULL) private EnumStringRequiredEnum enumStringRequired; /** diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java index 13b1eb4fcd2e..4f54909c543d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java @@ -40,6 +40,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable Long int64; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal number; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -51,11 +52,13 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable String string; + @JsonInclude(JsonInclude.Include.NON_NULL) private byte[] _byte; @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable org.springframework.core.io.Resource binary; + @JsonInclude(JsonInclude.Include.NON_NULL) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @@ -66,6 +69,7 @@ public class FormatTestDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable UUID uuid; + @JsonInclude(JsonInclude.Include.NON_NULL) private String password; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java index 585d573dfecf..a4fdb5f297fd 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java @@ -26,6 +26,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NameDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer name; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index e712397bff32..50958c247610 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -2,7 +2,6 @@ import java.net.URI; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -30,7 +29,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class NullableMapPropertyDto { - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 2162ebf85db4..af2b3803d750 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -77,7 +77,6 @@ public static TypeEnum fromValue(String value) { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable TypeEnum type; - @JsonInclude(JsonInclude.Include.NON_ABSENT) private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullableDto type(@Nullable TypeEnum type) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java index 3953250b4693..bbeb1cf7c867 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -41,8 +41,10 @@ public class PetDto { @JsonInclude(JsonInclude.Include.NON_NULL) private @Nullable CategoryDto category; + @JsonInclude(JsonInclude.Include.NON_NULL) private String name; + @JsonInclude(JsonInclude.Include.NON_NULL) private Set photoUrls = new LinkedHashSet<>(); @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index d9d8b4f78585..0ef0624afb20 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,14 +29,19 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderDefaultDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem = "what"; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem = new BigDecimal("1.234"); + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem = -2; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem = true; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index aa7879602dc5..fbf86a0db3f3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -2,6 +2,7 @@ import java.net.URI; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -28,16 +29,22 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.25.0-SNAPSHOT") public class TypeHolderExampleDto { + @JsonInclude(JsonInclude.Include.NON_NULL) private String stringItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private BigDecimal numberItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Float floatItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Integer integerItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean boolItem; + @JsonInclude(JsonInclude.Include.NON_NULL) private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/server/petstore/typescript-nestjs-server/builds/default/models/order.ts b/samples/server/petstore/typescript-nestjs-server/builds/default/models/order.ts index 3efce320b716..882bfc5fe43f 100644 --- a/samples/server/petstore/typescript-nestjs-server/builds/default/models/order.ts +++ b/samples/server/petstore/typescript-nestjs-server/builds/default/models/order.ts @@ -18,7 +18,7 @@ export namespace Order { export const StatusEnum = { Placed: 'placed', Approved: 'approved', - Delivered: 'delivered' + Delivered: 'delivered', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; } diff --git a/samples/server/petstore/typescript-nestjs-server/builds/default/models/pet.ts b/samples/server/petstore/typescript-nestjs-server/builds/default/models/pet.ts index fd9e0070e172..e96be0dd46ed 100644 --- a/samples/server/petstore/typescript-nestjs-server/builds/default/models/pet.ts +++ b/samples/server/petstore/typescript-nestjs-server/builds/default/models/pet.ts @@ -21,7 +21,7 @@ export namespace Pet { export const StatusEnum = { Available: 'available', Pending: 'pending', - Sold: 'sold' + Sold: 'sold', } as const; export type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum]; }