Skip to content

Commit 63b6db3

Browse files
authored
KAFKA-12800: Configure generator to fail on trailing JSON tokens (#10717)
Reviewers: David Jacot <[email protected]>
1 parent 33df5c6 commit 63b6db3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

generator/src/main/java/org/apache/kafka/message/MessageGenerator.java

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public final class MessageGenerator {
165165
JSON_SERDE = new ObjectMapper();
166166
JSON_SERDE.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
167167
JSON_SERDE.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
168+
JSON_SERDE.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
168169
JSON_SERDE.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
169170
JSON_SERDE.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
170171
}

0 commit comments

Comments
 (0)