/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonSchema.java
public byte[] encode(GenericRecord message) {
checkArgument(message instanceof GenericAvroRecord);
GenericJsonRecord gjr = (GenericJsonRecord) message;
try {
return objectMapper.writeValueAsBytes(gjr.getJsonNode().toString());
} catch (IOException ioe) {
throw new SchemaSerializationException(ioe);
}
}
I don't understand why there is a GenericAvroRecord check here in Json schema.
/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonSchema.java
public byte[] encode(GenericRecord message) {
checkArgument(message instanceof GenericAvroRecord);
GenericJsonRecord gjr = (GenericJsonRecord) message;
try {
return objectMapper.writeValueAsBytes(gjr.getJsonNode().toString());
} catch (IOException ioe) {
throw new SchemaSerializationException(ioe);
}
}
I don't understand why there is a GenericAvroRecord check here in Json schema.