mimaison commented on code in PR #17498:
URL: https://github.com/apache/kafka/pull/17498#discussion_r1804367887
##########
clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java:
##########
@@ -103,14 +103,48 @@ private static void schemaToFieldTableHtml(Schema schema,
StringBuilder b) {
b.append("<th>Description</th>\n");
b.append("</tr>");
for (BoundField field : fields) {
- b.append("<tr>\n");
- b.append("<td>");
- b.append(field.def.name);
- b.append("</td>");
- b.append("<td>");
- b.append(field.def.docString);
- b.append("</td>");
- b.append("</tr>\n");
+ if (field.def.type instanceof TaggedFields) {
+ TaggedFields taggedFields = (TaggedFields) field.def.type;
+ // Only include the field in the table if there are actually
tags defined
+ if (taggedFields.numFields() > 0) {
Review Comment:
I wonder if we should still keep a row in the table even if there are no
tagged fields. Otherwise in some cases we end up with TAG_BUFFER appearing in
the schema and missing in the table. This can be confusing if there are
multiple TAG_BUFFER.
For example:
<img width="1011" alt="image"
src="https://github.com/user-attachments/assets/b887e2cf-678c-47c2-98c3-67d9ebcc63ef">
Could we also make the names match? In the schema we use `TAG_BUFFER` but
then in the table we use `_tagged_fields`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]