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/10 20:45:18 UTC

[GitHub] [kafka] hachikuji opened a new pull request #9279: MINOR: Fix common struct `JsonConverter` and `Schema` generation

hachikuji opened a new pull request #9279:
URL: https://github.com/apache/kafka/pull/9279


   This patch fixes two problems in the use of common structs:
   
   - `JsonConverterGenerator` does not account for common structs
   - `SchemaGenerator` class generated inline structs before common structs
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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



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

Posted by GitBox <gi...@apache.org>.
cmccabe commented on pull request #9279:
URL: https://github.com/apache/kafka/pull/9279#issuecomment-694510055


   LGTM


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



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

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [kafka] hachikuji merged pull request #9279: MINOR: Fix common struct `JsonConverter` and `Schema` generation

Posted by GitBox <gi...@apache.org>.
hachikuji merged pull request #9279:
URL: https://github.com/apache/kafka/pull/9279


   


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