jklamer commented on code in PR #1672: URL: https://github.com/apache/avro/pull/1672#discussion_r862498801
########## lang/rust/avro/examples/test_interop_message_data.rs: ########## @@ -0,0 +1,58 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use apache_avro::{schema::AvroSchema, types::Value}; + +struct InteropMessage; + +impl AvroSchema for InteropMessage { + fn get_schema() -> apache_avro::Schema { + let schema = std::fs::read_to_string("../../share/test/data/messageV1/test_schema.json") + .expect("File should exist with schema inside"); + apache_avro::Schema::parse_str(schema.as_str()) + .expect("File should exist with schema inside") + } +} + +impl From<InteropMessage> for Value { Review Comment: In this case, for the Interop testing, there is only one `Value` that the message should ever resolve to. This pattern only makes sense for this use case where there is one message value that we're going for. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
