Inheritance: SpecGenBase
Exemple #1
0
        static async Task Main(string[] args)
        {
            ApiSpec spec;

            if (args.Any(a => a == "online"))
            {
                var li = new LinodeClient();
                spec = await li.Api_SpecAsync();
            }
            else
            {
                var res = JsonConvert.DeserializeObject <Response <ApiSpec> >(File.ReadAllText(@"spec.json"));
                if (res.Errors.Length != 0)
                {
                    throw new LinodeException(res.Errors);
                }
                spec = res.Data;
            }

            if (args.Any(a => a == "markdown"))
            {
                printMarkdown(0, spec.Methods.OrderBy(kvp => kvp.Key));
                return;
            }

            var gen = new SpecGen(spec);

            Console.WriteLine(gen.TransformText());
            Console.ReadLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            ApiSpec spec;
            if (args.Any(a => a == "online"))
            {
                var li = new LinodeClient("~~~");
                spec = li.Api_Spec();
            }
            else
            {
                var res = JsonConvert.DeserializeObject<Response<ApiSpec>>(File.ReadAllText(@"spec.json"));
                if (res.Errors.Length != 0)
                    throw new LinodeException(res.Errors);
                spec = res.Data;
            }

            var gen = new SpecGen(spec);
            Console.WriteLine(gen.TransformText());
            Console.ReadLine();
        }