connect
connect copied to clipboard
Fix schema registry encode's field "avro_raw_json"
Manually tested and it looks pretty good.
If the schema is:
{
"type": "record",
"name": "heartbeat_v3",
"namespace": "outbox_events",
"fields": [
{
"name": "heartbeat",
"type": [
"null",
"int"
],
"default": null
}
]
}
When the benthos config is:
schema_registry_encode:
url: ${SCHEMA_REGISTRY_ENDPOINT}
subject: ${! meta("EventName")}
avro_raw_json: false
If the input is:
'{"heartbeat": {"int": 1}}'
The logs show a success:

If the input is:
'{"heartbeat": 1}'
The logs show a failure:

When the benthos config is:
schema_registry_encode:
url: ${SCHEMA_REGISTRY_ENDPOINT}
subject: ${! meta("EventName")}
avro_raw_json: true
If the input is:
'{"heartbeat": {"int": 1}}'
The logs show a failure:

If the input is:
'{"heartbeat": 1}'
The logs show a success:
