You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/09/14 22:41:40 UTC

[GitHub] [kafka] cmccabe commented on a change in pull request #9279: MINOR: Fix common struct `JsonConverter` and `Schema` generation

cmccabe commented on a change in pull request #9279:
URL: https://github.com/apache/kafka/pull/9279#discussion_r488276782



##########
File path: generator/src/main/java/org/apache/kafka/message/JsonConverterGenerator.java
##########
@@ -53,17 +53,17 @@ public void generateAndWrite(MessageSpec message, BufferedWriter writer)
         buffer.incrementIndent();
         generateConverters(message.dataClassName(), message.struct(),
             message.validVersions());
+
+        for (Iterator<StructSpec> iter = structRegistry.commonStructs(); iter.hasNext(); ) {
+            generateStructClass(iter.next(), message.validVersions());
+        }
+
         for (Iterator<StructRegistry.StructInfo> iter = structRegistry.structs();

Review comment:
       It's not clear whether we need to generate the common struct JSON converters first.  Can you try without (or explain why it needs to be with?)  Or is the iterator returned from `structs` not returning the correct data for common structs?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org