Exemple #1
0
        public static JsonDocument GetDocument(TextReader reader)
        {
            var jsonReader = new JsonReader(reader);
            var documentReader = new JsonDocumentReader(jsonReader);

            return documentReader.Load();
        }
Exemple #2
0
        private static JsonSchema GetSchema(string name)
        {
            Assembly assembly = typeof(JsonSchema).Assembly;
            string fullName = $"Resources.{name}";

            using (Stream stream = assembly.GetManifestResourceStream(typeof(JsonSchema), fullName))
            using (TextReader reader = new StreamReader(stream))
            {
                var jsonReader = new JsonReader(reader);
                var documentReader = new JsonDocumentReader(jsonReader);
                var document = documentReader.Load();
                var schemaReader = new JsonSchemaReader(document);

                return schemaReader.Load();
            }
        }