void CheckFields(String typeName, IDataMetadata data, TypeMetadata typeMeta) { foreach (var fv in data.Fields) { if (!typeMeta.ContainsKey(fv.Key)) { throw new TypeCheckerException($"Type '{typeName}'. Field '{fv.Key}' is in the model but not found in the description file"); } var dfm = typeMeta[fv.Key]; CheckType(typeName, dfm, fv.Value); } foreach (var fm in typeMeta.Where(x => !x.Key.StartsWith("$"))) { if (!data.Fields.ContainsKey(fm.Key)) { throw new TypeCheckerException($"Type '{typeName}'. Field '{fm.Key}' is in the description file but not found in the model"); } } }