Skip to content

Commit

Permalink
Fix unfolded map elements bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Duzhinsky committed Oct 11, 2023
1 parent af8be6d commit 3d60803
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public MapFieldTypeProcessor(@NotNull GenerationContext context) {
.filter(f -> f.getName().equals("key")).findFirst().orElseThrow();
Field value = entryDescriptor.getFields().stream()
.filter(f -> f.getName().equals("value")).findFirst().orElseThrow();
return new MapType(next(key), next(value));
return new MapType(
getContext().typeManager().processType(key),
getContext().typeManager().processType(value)
);
}
}
4 changes: 4 additions & 0 deletions tests/src/test/proto/general.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ message GrpcTask {
optional string context = 4;
}

message GrpcTaskMapped {
map<string, GrpcTask> taskMap = 1;
}

message GrpcTasksBatch {
GrpcBatchId id = 1;
repeated GrpcTask tasks = 2 [(.protogen.repeated_container) = SET];
Expand Down
4 changes: 4 additions & 0 deletions tests/src/test/proto/unfolding.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ message GrpcGeneratedIdConsumer {
GrpcGeneratedId genId = 1;
}

message GrpcUnfoldedMap {
map<int64, GrpcId> idMap = 1;
}

message GrpcDomain {
GrpcId id = 1;
GrpcOptionalId optionalId = 2;
Expand Down

0 comments on commit 3d60803

Please sign in to comment.