diff --git a/docs/generators.md b/docs/generators.md index 8a8ff23086b8..bfa97dd22e54 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -68,7 +68,7 @@ The following generators are available: * [scala-sttp4-jsoniter (beta)](generators/scala-sttp4-jsoniter.md) * [scalaz](generators/scalaz.md) * [swift-combine](generators/swift-combine.md) -* [swift5](generators/swift5.md) +* [swift5 (deprecated)](generators/swift5.md) * [swift6](generators/swift6.md) * [typescript (experimental)](generators/typescript.md) * [typescript-angular](generators/typescript-angular.md) diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 9d565bf5993f..68376d466186 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -7,7 +7,7 @@ title: Documentation for the swift5 Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | swift5 | pass this to the generate command after -g | -| generator stability | STABLE | | +| generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Swift | | | generator default templating engine | mustache | | diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 89c2fffb8eb3..57ee37e1221b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -134,7 +134,7 @@ public Swift5ClientCodegen() { this.useOneOfInterfaces = true; generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.STABLE) + .stability(Stability.DEPRECATED) .build(); outputFolder = "generated-code" + File.separator + "swift"; @@ -430,6 +430,8 @@ protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, public void processOpts() { super.processOpts(); + LOGGER.warn("IMPORTANT: This generator has been deprecated. Please use `swift6` instead"); + if (StringUtils.isEmpty(System.getenv("SWIFT_POST_PROCESS_FILE"))) { LOGGER.info("Environment variable SWIFT_POST_PROCESS_FILE not defined so the Swift code may not be properly formatted. To define it, try 'export SWIFT_POST_PROCESS_FILE=/usr/local/bin/swiftformat' (Linux/Mac)"); LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");