RicoSuter/NJsonSchema

Empty file being generated...

オープン

#311 opened on 2017/02/02

 (2 件のコメント) (6 件のリアクション) (0 人の担当者)C# (549 件のフォーク)github user discovery
help wantedtype: bug

Repository metrics

Stars
 (1,581 個のスター)
PR merge metrics
 (平均マージ 39d 6h) (30d で 1 merged 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!

コントリビューターガイド