Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sporadic absence of generated property types for C# #27

Open
Korporal opened this issue Mar 3, 2018 · 0 comments
Open

Sporadic absence of generated property types for C# #27

Korporal opened this issue Mar 3, 2018 · 0 comments

Comments

@Korporal
Copy link

Korporal commented Mar 3, 2018

I hit an example of where a C# class was generated but a couple of properties had their type missing and so the code will not compile until manually edited.

Here is the sample input from GitHub documentation about their Webhooks. If you paste that into the jsonutils website it generates a bunch of classes including these two:

    public class Commit
    {
        public string id { get; set; }
        public string tree_id { get; set; }
        public bool distinct { get; set; }
        public string message { get; set; }
        public DateTime timestamp { get; set; }
        public string url { get; set; }
        public Author author { get; set; }
        public Committer committer { get; set; }
        public IList<object> added { get; set; }
        public IList<object> removed { get; set; }
        public IList<string> modified { get; set; }
    }

    public class HeadCommit
    {
        public string id { get; set; }
        public string tree_id { get; set; }
        public bool distinct { get; set; }
        public string message { get; set; }
        public DateTime timestamp { get; set; }
        public string url { get; set; }
        public  author { get; set; }
        public  committer { get; set; }
        public IList<object> added { get; set; }
        public IList<object> removed { get; set; }
        public IList<string> modified { get; set; }
    }


As you can see the author and committer properties in the HeadCommit class have no type whereas in the Commit class they are correct.

Also these class are identical and so I wonder if the utility could detect (some final step in the processing) that it has created duplicate classes and then remove the dupes and adjust the final class structure to use that one type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant