RicoSuter/NJsonSchema

Empty file being generated...

开放

#311 创建于 2017年2月2日

 (2 条评论) (6 个反应) (0 位负责人)C# (549 个派生)github user discovery
help wantedtype: bug

仓库指标

星标
 (1,581 个星标)
PR 合并指标
 (平均合并 39天 6小时) (30 天内合并 1 个 PR)

描述

Hello!

I'm trying to use this sample code to generate classes from a given json schema:

static void Main(string[] args)
    {
        var schema = JsonSchema4.FromJsonAsync(GetJsonSchema()).Result;
        var settings = new CSharpGeneratorSettings { ClassStyle = CSharpClassStyle.Poco, Namespace = "ns" };
        var generator = new CSharpGenerator(schema, settings);
        var output = generator.GenerateFile("Foo");

        Console.WriteLine("Hello World!");
    }

    static string GetJsonSchema()
    {
        var url = "https://raw.githubusercontent.com/Microsoft/vscode-debugadapter-node/master/debugProtocol.json";

        var client = new HttpClient();
        return client.GetStringAsync(url).Result; 
    }

output is always an empty class with #pragma and some auto-generated xxx comment.

What is wrong with it?

Thanks!

贡献者指南