[
https://issues.apache.org/jira/browse/KAFKA-7948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16771560#comment-16771560
]
ASF GitHub Bot commented on KAFKA-7948:
---------------------------------------
joncourt commented on pull request #6289: KAFKA-7948: Feature to enable json
field order retention in the JsonConverter
URL: https://github.com/apache/kafka/pull/6289
This change affects the JsonConverter.
Some json parsers have particular requirements for field order in a json
message. While this is not a part of the json spec and shouldn't really be
necessary it is a reality for parsers we have on our mainframe. I have made
this a configuration setting with a default of 'none' to retain the current
functionality as is while giving users the option of enabling field order
retention.
3 new test methods have been added to verify the behaviour of the setting is
as expected when not set, set to 'none' and set to 'retained'.
To engage the behaviour use:
`json.field.order=retained`
### 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 GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Feature to enable json field order retention in the JsonConverter
> -----------------------------------------------------------------
>
> Key: KAFKA-7948
> URL: https://issues.apache.org/jira/browse/KAFKA-7948
> Project: Kafka
> Issue Type: New Feature
> Components: config, KafkaConnect
> Affects Versions: 2.1.1
> Reporter: Jonathan Court
> Priority: Minor
>
> We need to maintain the order of fields in json structures that pass through
> kafka connect. To achieve this a new configuration item has been added to the
> JsonConverter to engage the retention of field order in jsons between the
> input and output.
> While the json spec doesn't require fields to be ordered it is required in
> instances where the parsers of json are primitive and difficult to correct -
> i.e. our mainframe.
> The new config item is:
> {code:java}
> json.field.order = none|retained{code}
> where the default is none and maintains the current functionality, and the
> option of 'retained' causes the underlying converter to use a LinkedHashMap
> in place of a HashMap and keeps the json fields in the order they're received
> during processing.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)