Exemplo n.º 1
0
        private static AvroSchema ParseMapSchema(JToken jToken, IDictionary <string, NamedSchema> namedTypes, Stack <string> enclosingNamespace)
        {
            var keys = new HashSet <string>()
            {
                "type", "values"
            };

            JsonUtil.AssertKeys(jToken, keys, null, out var tags);

            JsonUtil.AssertValue(jToken, "type", "map");
            var values       = JsonUtil.GetValue <JToken>(jToken, "values");
            var valuesSchema = ParseSchema(values, namedTypes, enclosingNamespace);
            var mapSchema    = new MapSchema(valuesSchema);

            mapSchema.AddTags(tags);
            return(mapSchema);
        }