Esempio n. 1
0
        private static void RunApiGenerator()
        {
            var document = CkanApiFactory.Document();

            var sb = new StringBuilder();

            using (StringWriter sw = new StringWriter(sb))
            {
                sw.WriteLine();
                ApiGenerator.Generate(sw, document);
            }

            Console.Write(sb);

            Clipboard.SetText(sb.ToString());


            Console.WriteLine();
            Console.Write("Press any key to continue...");
            Console.ReadKey();
        }
Esempio n. 2
0
        private static void RunApiWriter()
        {
            var document = CkanApiFactory.Document();

            var sb = new StringBuilder();

            using (FileStream fs = new FileStream(FilePath2, FileMode.Create, FileAccess.Write))
                using (StreamWriter sw = new StreamWriter(fs))
                {
                    sw.WriteLine();
                    OpenApiJsonWriter writer = new OpenApiJsonWriter(sw);
                    document.SerializeAsV3(writer);
                }

            Console.Write(sb);

            Clipboard.SetText(sb.ToString());


            Console.WriteLine();
            Console.Write("Press any key to continue...");
            Console.ReadKey();
        }