From ea5355592371d81f5ffd7b78592b8aea0bc3525c Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Sat, 24 Jun 2023 21:42:13 +0200 Subject: [PATCH] - Updated deserialization example to include `string[]` arrays --- docs/deserialization.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/deserialization.md b/docs/deserialization.md index e77c76f..513ea3b 100644 --- a/docs/deserialization.md +++ b/docs/deserialization.md @@ -14,6 +14,7 @@ struct Person public bool[] list2; public float[] list3; public double[] list4; + public string[] list5; } ``` @@ -29,7 +30,8 @@ Now, let's say we were given the following JSON: "list": [1,2,3], "list2": [true, false], "list3": [1.5, 1.4], - "list4": [1.5, 1.4] + "list4": [1.5, 1.4], + "list5": ["baba", "booey"] } ``` @@ -46,7 +48,8 @@ JSONValue json = parseJSON(`{ "list": [1,2,3], "list2": [true, false], "list3": [1.5, 1.4], -"list4": [1.5, 1.4] +"list4": [1.5, 1.4], +"list5": ["baba", "booey"] } `); @@ -63,5 +66,5 @@ writeln(person): Which will output: ``` -Person("Tristan", "Kildaire", 23, true, {"bruh":1}, [1, 2, 3], [true, false], [1.5, 1.4], [1.5, 1.4]) +Person("Tristan", "Kildaire", 23, true, {"bruh":1}, [1, 2, 3], [true, false], [1.5, 1.4], [1.5, 1.4], ["baba", "booey"]) ``` \ No newline at end of file