Nathan Lincoln created KAFKA-12794:
--------------------------------------

             Summary: Trailing JSON tokens in DescribeProducersRequest.json can 
cause parse errors in some JSON parsers
                 Key: KAFKA-12794
                 URL: https://issues.apache.org/jira/browse/KAFKA-12794
             Project: Kafka
          Issue Type: Task
          Components: clients
         Environment: I am specifically trying to parse the files with the rust 
serde_json library.
            Reporter: Nathan Lincoln


The schema definition for the DescribeProducersRequest see 
[here|https://github.com/apache/kafka/blob/3b6599c600f6e7fbeb000a088591f1cf9aba107d/clients/src/main/resources/common/message/DescribeProducersRequest.json]
 has trailing tokens - specifically, the last two lines in the commit in that 
link.

This does not cause problems for the generator, because Jackson will ignore 
trailing input by default.

However, some JSON parsers cannot be configured to ignore trailing characters, 
and so they fail on that file. This can cause problems for users wishing to use 
the official schema definitions to generate clients in other languages.

The fix here is pretty simple - just remove the trailing tokens, and optionally 
configure jackson to fail on trailing tokens. I'll be submitting a patch for 
the former on GitHub, and I can also submit a patch for the former if there is 
interest.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to