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

Property names statring from number : C# + JAVA #22

Closed
Burakovivan opened this issue Oct 15, 2020 · 2 comments
Closed

Property names statring from number : C# + JAVA #22

Burakovivan opened this issue Oct 15, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Burakovivan
Copy link

Sample json:

 {
      "1_star": 7,
      "2_star": 6,
      "3_star": 10,
      "4_star": 19,
      "5_star": 151
}

C# Converted:

public class Root    {
        public int 1_star { get; set; } 
        public int 2_star { get; set; } 
        public int 3_star { get; set; } 
        public int 4_star { get; set; } 
        public int 5_star { get; set; } 
}

C# does not allow name of anything have digit at start.

Expected results:

public class Root    {
       //varinat 1 
        [JsonProperty("1_star ")]
        public int One_star { get; set; } 
        //varinat 2 
        [JsonProperty("2_star ")]
        public int d2_star { get; set; } 
}
@Json2CSharp Json2CSharp added the bug Something isn't working label Oct 15, 2020
@Json2CSharp
Copy link
Owner

wow thanks so much for the heads, had no idea about this scenario, will see how this will be fixed, cheers :)

@Json2CSharp Json2CSharp pinned this issue Oct 15, 2020
@Json2CSharp Json2CSharp changed the title Property names statring from number Property names statring from number : C# + JAVA Dec 31, 2020
@Json2CSharp Json2CSharp unpinned this issue Jan 1, 2021
@Json2CSharp
Copy link
Owner

e4a0a8e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants