Javadoc
Schema Property that get and set an Avro Schema but store a String internally for serialization optimization. The set
Value accepts both Schema and json string for schema. The evaluator is also called with the Schema instance.
this is not only for optimization, because json-io fails to deserialize the avro schema here is the explanation.
1. Properties.fromSerializedPersistent() tries to deserialize component properties instance from JSON string.
It uses Json-io library.
2. During deserialization Json-io library tries to create instance of Schema$RecordSchema.
3. Schema$RecordSchema has 2 constructors
RecordSchema(Name name, String doc, boolean isError)
RecordSchema(Name name, String doc, boolean isError, List fields)
4. Json-io passes default values for primitives and null for objects as arguments:
RecordSchema(null, null, false)
RecordSchema(null, null, false, null)
5. Some exception is thrown in both constructors.
6. Json-io can't create instance and throws its own exception.