Sha256: 60011930765f8764dd71e1d8c0260ae3336ede94a16ea316e91c804e99b11218
Contents?: true
Size: 803 Bytes
Versions: 52
Compression:
Stored size: 803 Bytes
Contents
using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; namespace Generators.Input { public class CanonicalDataParser { private readonly CanonicalDataFile _canonicalDataFile; public CanonicalDataParser(CanonicalDataOptions options) { _canonicalDataFile = new CanonicalDataFile(options); _canonicalDataFile.DownloadData(); } public CanonicalData Parse(Exercise exercise) { var canonicalDataJson = _canonicalDataFile.Contents(exercise.Name); var canonicalData = JsonConvert.DeserializeObject<CanonicalData>(canonicalDataJson); Validator.ValidateObject(canonicalData, new ValidationContext(canonicalData)); return canonicalData; } } }
Version data entries
52 entries across 52 versions & 1 rubygems