Announcement

Collapse
No announcement yet.

Easy way to work with JSON with C++

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Easy way to work with JSON with C++

    Hi guys, i maked little tool which can optimize your work with json, as you know write by hands structures for json is annoying, it's repeatable boring work. I was trying automize it. I made it as online tool by url https://json2ue4.com.

    I hope you will enjoy it.
    This tool generate structures by example json with serialization. I planing also making deserialization if this will be in demand.
    You can ask me or give me some feedback here. If you find some issues you also can tell me about it here.

    #2
    Cool tool, thanks for sharing

    Comment


      #3
      Thats neat, Thx !

      Comment


        #4
        This is great!!

        I looked forever to find out why I could not load a JSON into a UStruct until I found your solution!

        It appeared I just had a small syntax issue with the JSON, but it did not warn me at all in the code. Using your system, I could perfectly load it into Unreal.

        PS:
        I changed a bunch of things mainly to accommodate Enums. But this already helped me 80% on the way and fixed my base issue.

        Congrats! You saved my day :-)

        Comment


          #5
          How do you handle enums ?

          Comment


            #6
            Originally posted by PrHangs View Post
            How do you handle enums ?
            At now, it not. I'll make this feature until the end of the current year, i hope.

            Expected logic: Analyzer will find repeatable values for json string fields in arrays. If any value repeated more than 2 times and count of all unique strings less then N(this will be custimizable) times then it will generate enums.

            If you have better solution, please tell me.

            Comment


              #7
              I was more talking about String (.json) to Enum (unreal) conversion.
              I guess for a clean way to detect whats an enum you would need to switch to a validation template or so.

              What would also be nice to have a switch to use the Values of the .json as Defaults.
              Code:
               UPROPERTY(EditAnywhere, BlueprintReadWrite)
               FString name = "John";

              Comment


                #8
                Originally posted by PrHangs View Post
                I was more talking about String (.json) to Enum (unreal) conversion.
                I guess for a clean way to detect whats an enum you would need to switch to a validation template or so.
                I am not really understand what did you mean. Give me example, what json you have, and what output you want to get.

                Originally posted by PrHangs View Post
                What would also be nice to have a switch to use the Values of the .json as Defaults.
                Yes, thx good idea. Will make it.

                Comment


                  #9
                  Pin this! asd

                  Comment

                  Working...
                  X