Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Question about how to put data in JSON format

Hello i have categories with answers data, e.g.:

  • Europe: Germany, Austria, Hungary
  • Asia: China, Japan, Cambodia

And I need to put it in json:

{
"correctAnswers": {
  "category": {
    "name" : "Europe", 
    "categoryAnswers": ["Germany", "Austria", "Hungary"]
  }
 }
}

How i can add the second category Asia with answers?
I understand that my question is very simple and my suggested variant may be not optimal but i am total new in Json and haven’t get the right answer in Google.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

{
    "correctAnswers": {
        "Europe": {
           "name": "Europe",
           "categoryAnswers": ["Germany", "Austria", "Hungary"]
         },
 
        "Asia": {
           "name": "Asia",
           "categoryAnswers": ["China", "Japan", "India"]
         }
     }
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading