forked from loafle/openapi-generator-original
[Protobuf] Fix how map is generated (#8203)
* test map with protobuf * fix protobuf map * use unescaped value * use string * undo changes to spec
This commit is contained in:
@@ -490,7 +490,7 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf
|
||||
return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]";
|
||||
} else if (ModelUtils.isMapSchema(p)) {
|
||||
Schema inner = getAdditionalProperties(p);
|
||||
return getSchemaType(p) + "[str, " + getTypeDeclaration(inner) + "]";
|
||||
return getSchemaType(p) + "<string, " + getTypeDeclaration(inner) + ">";
|
||||
}
|
||||
return super.getTypeDeclaration(p);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ message {{classname}} {
|
||||
// {{{.}}}
|
||||
{{/description}}
|
||||
{{^isEnum}}
|
||||
{{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{name}} = {{vendorExtensions.x-protobuf-index}}{{#vendorExtensions.x-protobuf-packed}} [packed=true]{{/vendorExtensions.x-protobuf-packed}};
|
||||
{{#vendorExtensions.x-protobuf-type}}{{{.}}} {{/vendorExtensions.x-protobuf-type}}{{{vendorExtensions.x-protobuf-data-type}}} {{{name}}} = {{vendorExtensions.x-protobuf-index}}{{#vendorExtensions.x-protobuf-packed}} [packed=true]{{/vendorExtensions.x-protobuf-packed}};
|
||||
{{/isEnum}}
|
||||
{{#isEnum}}
|
||||
enum {{enumName}} {
|
||||
|
||||
Reference in New Issue
Block a user