pub fn fingerprint_raw_schema(
    raw_schema: &str
) -> Result<(Schema, Vec<u8>), AvroError>
Expand description

Function to convert a raw schema into serialized Avro schema. If schema is malformed or invalid, returns an error.

Examples

use common_helpers::avro;
use common_helpers::types::*;
let raw_schema = r#"{"type": "record", "name": "User", "fields": [{"name": "name", "type": "string"}, {"name": "favorite_number", "type": "int"}]}"#;
let schema_result = avro::fingerprint_raw_schema(raw_schema);
assert!(schema_result.is_ok());
let serialized_schema = schema_result.unwrap().1;