KAFKA-12794: Fix trailing json tokens in DescribeProducersRequest.json#10709
Merged
dajac merged 2 commits intoapache:trunkfrom May 17, 2021
Merged
KAFKA-12794: Fix trailing json tokens in DescribeProducersRequest.json#10709dajac merged 2 commits intoapache:trunkfrom
dajac merged 2 commits intoapache:trunkfrom
Conversation
dajac
reviewed
May 17, 2021
| { "name": "PartitionIndexes", "type": "[]int32", "versions": "0+", | ||
| "about": "The indexes of the partitions to list producers for." } | ||
| ]} | ||
| ]} |
Member
There was a problem hiding this comment.
Good catch. Could we re-indent the Topics (L24) block now that we have removed the trailing json? We usually two spaces.
Contributor
|
Nice Catch. 👍👍👍 |
Member
|
@NLincoln Regarding your suggesting to configure Jackson to not ignore trailing tokens, that might be a good idea. Could you file a separate JIRA for it? |
Contributor
Author
|
@dajac done! https://issues.apache.org/jira/browse/KAFKA-12800 I can't edit the assignee field of that ticket, but I can submit a patch for it tonight :) |
Member
Awesome, thanks. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The schema definition for the DescribeProducersRequest see here 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. This patch is for the former, and I'll be happy to submit a patch that configures jackson so this won't happen again :).
Committer Checklist (excluded from commit message)