Skip to content

Commit 4124771

Browse files
authored
fix: Make historyLength consistent with pageSize in mapper (#600)
1 parent c50990c commit 4124771

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

spec-grpc/src/main/java/io/a2a/grpc/mapper/ListTasksParamsMapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public interface ListTasksParamsMapper {
4141
// pageSize: Check if field is set using hasPageSize() to distinguish unset (null) from explicit 0 (validation error)
4242
@Mapping(target = "pageSize", expression = "java(request.hasPageSize() ? request.getPageSize() : null)")
4343
@Mapping(target = "pageToken", source = "pageToken", qualifiedByName = "emptyToNull")
44-
@Mapping(target = "historyLength", source = "historyLength", qualifiedByName = "zeroToNull")
44+
// historyLength: Check if field is set using hasHistoryLength() for consistency with pageSize
45+
@Mapping(target = "historyLength", expression = "java(request.hasHistoryLength() ? request.getHistoryLength() : null)")
4546
@Mapping(target = "lastUpdatedAfter", source = "lastUpdatedAfter", qualifiedByName = "millisToInstant")
4647
@Mapping(target = "includeArtifacts", source = "includeArtifacts", qualifiedByName = "falseToNull")
4748
io.a2a.spec.ListTasksParams fromProto(ListTasksRequest request);

0 commit comments

Comments
 (0)