From 14fd498ed0ef499979b6fa46b6553db5c9f22d96 Mon Sep 17 00:00:00 2001
From: Andy Li
Date: Wed, 21 May 2025 01:26:51 +0900
Subject: [PATCH] MINOR: API Responses missing latest version in Kafka protocol
guide (#19769)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
### Issue:
API Responses missing latest version in [Kafka protocol
guide](https://kafka.apache.org/protocol.html)
#### For example:
These are missing:
- ApiVersions Response (Version: 4) — Only versions 0–3 are documented,
though version 4 of the request is included.
- DescribeTopicPartitions Response — Not listed at all.
- Fetch Response (Version: 17) — Only versions 4–16 are documented,
though version 17 of the request is included.
#### After the fix:
docs/generated/protocol_messages.html
Reviewers: dengziming , Ken Huang
, Chia-Ping Tsai
---
.../main/java/org/apache/kafka/common/protocol/Protocol.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java b/clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java
index 237948f61c9..c23aa1782d6 100644
--- a/clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java
+++ b/clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java
@@ -208,7 +208,7 @@ public class Protocol {
// Responses
b.append("Responses:
\n");
Schema[] responses = key.messageType.responseSchemas();
- for (int version = key.oldestVersion(); version < key.latestVersion(); version++) {
+ for (int version = key.oldestVersion(); version <= key.latestVersion(); version++) {
Schema schema = responses[version];
if (schema == null)
throw new IllegalStateException("Unexpected null schema for " + key + " with version " + version);