English 中文(简体)
创建JSON的档案结构
原标题:Creating JSON nested file structure
  • 时间:2023-11-28 16:33:28
  •  标签:
  • json

我正试图把一年和月的时间添加到一名JSON的档案中,这样,我就可以把各方和事件分成一个月,而不必在每次活动中提供这一信息,但当我把信息放在档案上时,我会在这里某个地方发行一个星子。

{    
"year": 2023,
"month": 12
 {
  "Parties": [
    {
      "Event1": 67.7,
      "Event2": 5.1,
      "Event3": 3.3    
    },        
    {
       "Event1": 89.7,
       "Event2": 4.3,
       "Event3": 3.2        
    },
    {
       "Event1": 69.3,
       "Event2": 4.2,
       "Event3": 0.0        
    }
   ]
 }
}
最佳回答

There is a typo (comma is missing after month) and extra curly bracket { you have.

The working JSON is:

{
  "Year": 2023,
  "Month": 12,
  "Parties": [
    {
      "Event1": 67.7,
      "Event2": 5.1,
      "Event3": 3.3
    },
    {
      "Event1": 89.7,
      "Event2": 4.3,
      "Event3": 3.2
    },
    {
      "Event1": 69.3,
      "Event2": 4.2,
      "Event3": 0
    }
  ]
}

或者如果你想要使用nes子,则在“缔约方”之前添加一个财产名称。

{
  "Year": 2023,
  "Month": 12,
  "PartyData": {
    "Parties": [
      {
        "Event1": 67.7,
        "Event2": 5.1,
        "Event3": 3.3
      },
      {
        "Event1": 89.7,
        "Event2": 4.3,
        "Event3": 3.2
      },
      {
        "Event1": 69.3,
        "Event2": 4.2,
        "Event3": 0
      }
    ]
  }
}
问题回答

暂无回答




相关问题
JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

jQuery quicksearch plug-in tinkering with JSON

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if ...

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

PHP json_decode question

i m trying to use json_decode to combine a few json objects and then re-encode it. my json looks like: { "core": { "segment": [ { "id": 7, "...

Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string ...

热门标签