SchemaRegistry serialization logic moved to one class, manual serializer creation removed
This commit is contained in:
parent
cbb0b023e2
commit
74d2b7fdbb
1 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ class Serialize {
|
|||
throw new ValidationException(
|
||||
String.format("'%s' does not fit schema: %s", value, e.getAllMessages()));
|
||||
}
|
||||
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
||||
try (var out = new ByteArrayOutputStream()) {
|
||||
out.write(MAGIC);
|
||||
out.write(schemaId(schemaId));
|
||||
out.write(JSON_SERIALIZE_MAPPER.writeValueAsBytes(json));
|
||||
|
@ -95,7 +95,7 @@ class Serialize {
|
|||
@SneakyThrows
|
||||
static byte[] serializeAvro(AvroSchema schema, int schemaId, String input) {
|
||||
var avroObject = JsonAvroConversion.convertJsonToAvro(input, schema.rawSchema());
|
||||
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
||||
try (var out = new ByteArrayOutputStream()) {
|
||||
out.write(MAGIC);
|
||||
out.write(schemaId(schemaId));
|
||||
Schema rawSchema = schema.rawSchema();
|
||||
|
|
Loading…
Add table
Reference in a new issue