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

Some C# classes created from Json have invalid name #113

Open
JaySchwarz opened this issue Dec 25, 2023 · 1 comment
Open

Some C# classes created from Json have invalid name #113

JaySchwarz opened this issue Dec 25, 2023 · 1 comment

Comments

@JaySchwarz
Copy link

I'm trying to interface with an API that uses lots of field names that are all numeric. In most cases, the Json->C# tool does a great job of starting the field or class name with an underscore, but not always.

Here is a sample of what I'm seeing in Visual Studio after I copy in the class from the clipboard. This is my first project using JSON with a 3rd Party API, so maybe I'm doing something wrong. Thanks. Otherwise, I love the tool!

public class _949956117
{
public string value { get; set; }
public string name { get; set; }
}

public class 1216986445
{
public string field_type { get; set; }
public string street_address { get; set; }
public string city { get; set; }
public string state { get; set; }
public string zip { get; set; }
public string longitude { get; set; }
public string latitude { get; set; }
public string is_primary { get; set; }
public string is_private { get; set; }
}

public class 1995837313
{
    public string address { get; set; }

public string is_primary { get; set; }

@hilalhakla
Copy link
Owner

yeah this is a problem with dictionaries, the tool does not detect dictionaries, it can be done using markov chain or some AI technique but this needs development

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

2 participants