Json2CSharp / Json2CSharpCodeGenerator

Microsoft Reciprocal License
292 stars 81 forks source link

Convert Incorect Syntax (I think) #73

Closed NexushasTaken closed 2 years ago

NexushasTaken commented 2 years ago

C# Language I got this json file in the game called AoTTG (Attack On Titan Tribute Game, Here is the download link if you wan't to http://aotrc.weebly.com/download.html), it a settings that are serialized in json files

When i convert this Json file/Text (CustomSkins.json) https://pastebin.com/raw/3qEUQU3z this is the output which is wrong https://pastebin.com/raw/7BMPkhX3

The output that i expected (when i manually modified it) https://pastebin.com/raw/YPKgtPD8

pls fix this

Json2CSharp commented 2 years ago

What you did manually is just map TitanSkinSet to Sets in the json text, whereas the json2csharp code included the propoerties of the class "sets" from both ends , this one and

"SelectedSetIndex" : 0, "Sets" : [ { "Hair" : "", "Eye" : "", "Glass" : "", "Face" : "", "Skin" : "", "Costume" : "", "Logo" : "", "GearL" : "", "GearR" : "", "Gas" : "", "Hoodie" : "", "WeaponTrail" : "", "Horse" : "", "ThunderSpearL" : "", "ThunderSpearR" : "", "Name" : "Set 1", "Preset" : false }

and these ones

            "RandomizedPairs" : false,
            "Hairs" : [
                "",
                "",
                "",
                "",
                ""
            ],
            "HairModels" : [
                0,
                0,
                0,
                0,
                0
            ],
            "Bodies" : [
                "",
                "",
                "",
                "",
                ""
            ],
            "Eyes" : [
                "",
                "",
                "",
                "",
                ""
            ],
            "Name" : "Set 1",
            "Preset" : false
Json2CSharp commented 2 years ago

I think you can do it both ways if you want to reduce class repetitions, you might use the json2csharp one, or you can customize it however you want doesn't matter

Json2CSharp commented 2 years ago

I will close this cause its not an issue