Skip to content

Commit

Permalink
Use JSON as default data content type for structured JSON encoded events
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <[email protected]>
(cherry picked from commit 6890b10)
  • Loading branch information
matejvasek authored and gsmet committed Jan 18, 2022
1 parent ce7dc1a commit 48a44e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ private static Stream<Arguments> provideBinaryEncodingTestArgs() {
" \"type\": \"test-type\", " +
" \"extclient\": \"ext-client-val\", " +
" \"dataschema\": \"test-dataschema-client\", " +
" \"datacontenttype\": \"application/json\", " +
" \"data\": { \"i\" : 21, \"s\" : \"abc\" } " +
"}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public T data() {
if (data != null) {
return data;
}
if (dataContentType() != null && dataContentType().startsWith("application/json") && !byte[].class.equals(dataType)) {
if ((dataContentType() == null || dataContentType().startsWith("application/json")) && !byte[].class.equals(dataType)) {
try {
data = reader.readValue(event.get("data"));
return data;
Expand Down

0 comments on commit 48a44e0

Please sign in to comment.