diff --git a/bin/configs/protobuf-schema-config.yaml b/bin/configs/protobuf-schema-config.yaml index 03df6bce30cf..44ae7540fd8a 100644 --- a/bin/configs/protobuf-schema-config.yaml +++ b/bin/configs/protobuf-schema-config.yaml @@ -7,4 +7,8 @@ additionalProperties: addJsonNameAnnotation: true numberedFieldNumberList: true startEnumsWithUnspecified: true - wrapComplexType: false \ No newline at end of file + wrapComplexType: false +typeMappings: + object: "google.protobuf.Struct" +importMappings: + google.protobuf.Struct: "google/protobuf/struct" \ No newline at end of file diff --git a/bin/configs/protobuf-schema.yaml b/bin/configs/protobuf-schema.yaml index 30f606c915f3..c3947e075dca 100644 --- a/bin/configs/protobuf-schema.yaml +++ b/bin/configs/protobuf-schema.yaml @@ -4,3 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/protobuf/petstore.ya templateDir: modules/openapi-generator/src/main/resources/protobuf-schema additionalProperties: packageName: petstore +typeMappings: + object: "google.protobuf.Struct" +importMappings: + google.protobuf.Struct: "google/protobuf/struct" 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 052d1aa8321b..78938f1cacf8 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 @@ -912,7 +912,11 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List