I'll elaborate a bit more on ChrisR awesome answer and bring images from his awesome reference.

A valid JSON always starts with either curly braces { or square brackets [, nothing else.

{ will start an object:

{ "key": value, "another key": value }

Hint: although javascript accepts single quotes ', JSON only takes double ones ".

[ will start an array:

[value, value]

Hint: spaces among elements are always ignored by any JSON parser.

And value is an object, array, string, number, bool or null:

So yeah, ["a", "b"] is a perfectly valid JSON, like you could try on the link Manish pointed.

Here are a few extra valid JSON examples, one per block:

{}

[0]

{"__comment": "json doesn't accept comments and you should not be commenting even in this way", "avoid!": "also, never add more than one key per line, like this"}

[{   "why":null} ]

{
  "not true": [0, false],
  "true": true,
  "not null": [0, 1, false, true, {
    "obj": null
  }, "a string"]
}
Answer from cregox on Stack Overflow
🌐
W3Schools
w3schools.com › js › js_json_arrays.asp
JSON Arrays
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JS Reference ... Arrays in JSON are almost the same as arrays in JavaScript. In JSON, array values must be of type string...
Discussions

Pass list of strings to json
Hello, I have a variable called: email variable "prod_ops_email_recipients" { type = list(string) default = [ "email_address_1@com","email_address_2@com" ] } I used join function and format to have an array locals { user_email = [join(", ", [for s in var.prod_ops_email_recipients : format("%q", ... More on discuss.hashicorp.com
🌐 discuss.hashicorp.com
0
0
November 22, 2021
Constructing a json string from a list of objects
I’m working on a new module to call an ansible playbook. The playbook takes a rather complex payload of various user inputs of nested lists, optional parameters, etc. The idea is that the payload is constructed by the module so we can take advantage of the built-in validation. More on discuss.hashicorp.com
🌐 discuss.hashicorp.com
0
0
February 27, 2023
How to know if string is parseable as JSON "list" or "Map"
Hi, I would like to be able to determine if a JSON string will be parseable as a LIST or as a MAP before processing it. Am I missing something, or is the only way to know is to test the first... More on b4x.com
🌐 b4x.com
0
0
October 5, 2022
apex - Parsing different JSON bodies String vs List - Salesforce Stack Exchange
Hi I have a Json body that can either send over a list vs a string. Right now I have it set to just capture a string "type" public class PackageInformation{ public String location {get;set;}... More on salesforce.stackexchange.com
🌐 salesforce.stackexchange.com
🌐
Stack Exchange
salesforce.stackexchange.com › questions › 375426 › json-array-string-into-list
apex - JSON Array String into List - Salesforce Stack Exchange
May 6, 2022 - String stringJSON = '[{"action":"ASSIGN","value":"Router"},{"action":"DISABLE","value":true},{"action":"HIDE","value":false}]'; List<Object> listOfAny = (List<Object>) JSON.deserializeUntyped(stringJSON); List<Map<String, Object>> listMap = new List<Map<String, Object>>(); for(Object obj : listOfAny) { Map<String, Object> mapObj = (Map<String, Object>) obj; listMap.add(mapObj); } System.debug(listMap); // Example: Get the two maps 'action' and 'value' from the list index 1 System.debug(listMap[1].get('action')); System.debug(listMap[1].get('value')); Share ·
🌐
Adobe
opensource.adobe.com › Spry › samples › data_region › JSONDataSetSample.html
JSON Data Set Sample
Imagine you want to show a list of the different types of items, and under each item, you also want to list the different types of batters and toppings available. Doing that with the data set used in Example 10 would require some JavaScript logic embedded in spry attribute conditionals to control when things showed up. A simpler approach would be to use NestedJSONDataSets. In this example we use the same JSON data used in Example 10, but we will use 2 nested JSON data sets to track the "batter" and "topping" data.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › javascript tutorial › json array of strings
JSON Array of Strings | How JSON Array of String Works? (Examples)
April 14, 2023 - So on a whole, the ‘JSON array of strings’ represents an ordered list of values, and It can store multiple values. This is useful to store string, Boolean, number, or an object. Here as we are particularly focusing on an Array of Strings, so let us deep dive with its syntax and few examples.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Baeldung
baeldung.com › home › java › java list › converting a java list to a json array
Converting a Java List to a Json Array | Baeldung
June 18, 2025 - In this scenario, let’s consider a Java list named “articles” that contains elements as follows: public List<String> list = Arrays.asList("Article 1", "Article 2", "Article 3"); public String expectedJsonArray = "[\"Article 1\",\"Article ...
🌐
Mkyong
mkyong.com › home › java › how to parse json array with jackson
How to parse JSON Array with Jackson - Mkyong.com
April 23, 2024 - package com.mkyong.json.jackson; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.mkyong.json.model.Person; import java.util.Arrays; import java.util.List; public class JsonArrayToObjectExample2 { public static void main(String[] args) throws JsonProcessingException { List<Person> list = Arrays.asList( new Person("mkyong", 42), new Person("ah pig", 20) ); ObjectMapper mapper = new ObjectMapper(); String result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(list); System.out.println(result); } } Output · [ { "name" : "mkyong", "age" : 42 }, { "name" : "ah pig", "age" : 20 } ] This example converts a list of Person objects to a JSON string with the list labeled as "Person": JsonArrayToObjectExample3.java ·
🌐
HashiCorp Discuss
discuss.hashicorp.com › terraform
Pass list of strings to json - Terraform - HashiCorp Discuss
November 22, 2021 - Hello, I have a variable called: email variable "prod_ops_email_recipients" { type = list(string) default = [ "email_address_1@com","email_address_2@com" ] } I used join function and format to have an array locals { user_email = [join(", ", [for s in var.prod_ops_email_recipients : format("%q", s)])] } resource "sumologic_content" "test_email" { parent_id = "000000000157AD40" config = templatefile("${path.root}/template/test_email.json", { email = local.user_email.*.id...
Find elsewhere
🌐
RestfulAPI
restfulapi.net › home › json › json array
Multi-dimensional Array in JSON - REST API Tutorial
November 4, 2023 - JSON array are ordered list of values. JSON arrays can be of multiple data types. JSON array can store string, number, boolean, object or other array inside JSON array. In JSON array, values must be separated by comma. Arrays in JSON are almost the same as arrays in JavaScript. For example, given below is a JSON document that contains a JSON array of access rights.
🌐
FlutterFlow Community
community.flutterflow.io › ask-the-community › post › create-json-array-from-list-of-strings-1A4EOYJN1pEDzRa
Create JSON array from list of strings?
April 22, 2024 - Hi all curious, I'm trying to collect a list of emails from my user collection and send that list as a JSON array in an API request. Is it possible to create a JSON array in FF for this? Hardcoding ...
🌐
Educative
educative.io › answers › how-to-convert-a-list-to-a-json-string-in-dart
How to convert a list to a JSON string in Dart
List<String> colors = ['Blue', 'Red', 'Black', 'Yellow', 'White', 'Pink']; Then, convert the List colors to a JSON string using the dart:convert library’s built-in jsonEncode() function.
🌐
Javatpoint
javatpoint.com › json-array
JSON Array - javatpoint
JSON Array for beginners and professionals with examples of JSON with java, json array of string, json array of numbers, json array of booleans, json srray of objects, json multidimentional array. Learn JSON array example with object, array, schema, encode, decode, file, date etc.
🌐
HashiCorp Discuss
discuss.hashicorp.com › terraform
Constructing a json string from a list of objects - Terraform - HashiCorp Discuss
February 27, 2023 - I’m working on a new module to call an ansible playbook. The playbook takes a rather complex payload of various user inputs of nested lists, optional parameters, etc. The idea is that the payload is constructed by the module so we can take advantage of the built-in validation.
🌐
W3Resource
w3resource.com › JSON › snippets › understanding-json-lists-with-examples-and-code.php
JSON Lists with Examples
Each dictionary in the list is accessed, and its keys (id, name, age) are used to retrieve values. ... The details of each person (ID, name, age) are displayed. ... data[0]['age'] = 26 # Update Sara's age data.append({"id": 4, "name": "Diana", "age": 28}) # Add a new person · Dumping JSON: Convert Python objects back to a JSON string: json_output = json.dumps(data, indent=4) print(json_output) Practical Guides to JSON Snippets and Examples.
🌐
Codeblogmoney
codeblogmoney.com › json-example-with-data-types-including-json-array
JSON Example with Data Types Including JSON Array
July 3, 2018 - Valid JSON Data Types String Number Object Array Boolean Null 1. JSON String Example: 1 2 3 4 5 { "firstname": "Tom", "lastname": "Cruise", "occupation": "Actor" } This example shows information about a person, and you know Tom Cruise.
🌐
GeeksforGeeks
geeksforgeeks.org › what-is-json-array
What is JSON Array? | GeeksforGeeks
September 23, 2024 - JSON array of Strings contains string elements only. For example, the array below has 6 string elements, "Ram", "Shyam", "Radhika", "Akshay", "Prashant" and "Varun", each element is separated with a comma (,).
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › convert python list to json examples
Convert Python List to JSON Examples - Spark By {Examples}
March 27, 2024 - You can use the JSON module to convert a list to a JSON object. The json.dumps() function converts a Python object, in this case, a list, into a JSON string. In the below example, first import the JSON module. Create a Python list called numbers containing some integer elements.
🌐
B4X
b4x.com › home › forums › b4j - desktop, server and raspberry pi › b4j questions
How to know if string is parseable as JSON "list" or "Map" | B4X Programming Forum
October 5, 2022 - Dim list1 As List list1.Initialize list1.Add("AAA") list1.Add("BBB") Dim map1 As Map map1.Initialize map1.Put("field1","aaa") map1.Put("field1","bbb") Dim list2 As List list2.Initialize list2.Add(map1) Log("this is the list") Log(list1.As(JSON).ToString) Log("this is the map") Log(map1.As(JSON).ToString) Log("this is the 2nd list") Log(list2.As(JSON).ToString) ps: I ve create this to remember - how starting...? I am sure that you asking because you want to pass back the values from string to list or map...
🌐
UiPath Community
forum.uipath.com › learning hub › academy feedback
How do I create a JSON string from an Array? - Academy Feedback - UiPath Community Forum
Hello, So I see plenty of examples on how to take an JSON string the bot got from another service and deserialize it into an array for it to process. But I’m trying to go in the other direction. My bot has gathered various bits of information into an array and I want to encode that into a ...
Published   July 30, 2018