From 34a386c5a32e0638dbf1e7523aaa70230c480fc9 Mon Sep 17 00:00:00 2001 From: Charles Treatman Date: Wed, 6 Mar 2024 20:36:08 -0600 Subject: [PATCH] [Go] Update generator docs to reflect supported features (#18044) * [Go] Update generator docs to reflect supported features * update feature support in code --- docs/generators/go.md | 8 ++++---- .../openapitools/codegen/languages/GoClientCodegen.java | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/generators/go.md b/docs/generators/go.md index 72c7fa56ec..31dae23e98 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -148,7 +148,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Uuid|✗| |Array|✓|OAS2,OAS3 |Null|✗|OAS3 -|AnyType|✗|OAS2,OAS3 +|AnyType|✓|OAS2,OAS3 |Object|✓|OAS2,OAS3 |Maps|✓|ToolingExtension |CollectionFormat|✓|OAS2 @@ -209,9 +209,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Composite|✓|OAS2,OAS3 |Polymorphism|✗|OAS2,OAS3 |Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 +|allOf|✓|OAS2,OAS3 +|anyOf|✓|OAS3 +|oneOf|✓|OAS3 |not|✗|OAS3 ### Security Feature 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 bc86bb8eae..d7c5e9820f 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 @@ -87,6 +87,12 @@ public class GoClientCodegen extends AbstractGoCodegen { GlobalFeature.LinkObjects, GlobalFeature.ParameterStyling ) + .includeSchemaSupportFeatures( + SchemaSupportFeature.anyOf, + SchemaSupportFeature.oneOf, + SchemaSupportFeature.allOf + + ) .excludeSchemaSupportFeatures( SchemaSupportFeature.Polymorphism ) @@ -97,6 +103,9 @@ public class GoClientCodegen extends AbstractGoCodegen { ClientModificationFeature.BasePath, ClientModificationFeature.UserAgent ) + .includeDataTypeFeatures( + DataTypeFeature.AnyType + ) ); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.STABLE).build();