Search in sources :

Example 1 with FormatSchema

use of com.fasterxml.jackson.core.FormatSchema in project camel-kamelets by apache.

the class InflightAvroSchemaResolver method resolve.

@Override
public FormatSchema resolve(Exchange exchange) {
    String schemaJson = (String) exchange.getProperty("schema");
    Boolean validate = Boolean.valueOf((String) exchange.getProperty("validate"));
    Schema raw = new Schema.Parser().setValidate(validate).parse(schemaJson);
    AvroSchema schema = new AvroSchema(raw);
    return schema;
}
Also used : AvroSchema(com.fasterxml.jackson.dataformat.avro.AvroSchema) Schema(org.apache.avro.Schema) FormatSchema(com.fasterxml.jackson.core.FormatSchema) AvroSchema(com.fasterxml.jackson.dataformat.avro.AvroSchema)

Aggregations

FormatSchema (com.fasterxml.jackson.core.FormatSchema)1 AvroSchema (com.fasterxml.jackson.dataformat.avro.AvroSchema)1 Schema (org.apache.avro.Schema)1