skip to Main Content

Parsing nested JSON errors

I have a JSON file I am trying to extract data from and I keep getting errors that I cannot resolve for some reason, any advice? Here is how I am running it in playgrounds import UIKit struct GETprojects: Codable…

VIEW QUESTION

convert a string of objects, from a jsonString

"{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"a":{"type":"string","dataType":"TEXT","validation":"TEXT"},"object":{"type":"object","properties":{"fname":{"type":"string","dataType":"TEXT","validation":"TEXT"},"lname":{"type":"string","dataType":"TEXT","validation":"TEXT"}},"additionalProperties":false,"required":["fname","lname"],"dataType":"OBJECT","validation":"OBJECT"}},"additionalProperties":false,"required":["a","object"],"dataType":"OBJECT","validation":"OBJECT"},"fieldRequirements":{"name":"object1","type":"object","required":true,"subfields":[{"name":"a","type":"text","required":true,"subfields":[]},{"name":"object","type":"object","required":true,"subfields":[{"name":"fname","type":"text","required":true,"subfields":[]},{"name":"lname","type":"text","required":true,"subfields":[]}]}]}}" This is my json string, i want to get a string from properties in above json string like this "{"a":"b","object":{"fname":"Sho","lname":"Sho"}}", any idea how to do? i tried using field names but i m just getting fields and not able…

VIEW QUESTION

How to see tag key of json with go struct?

I am learning https://www.digitalocean.com/community/tutorials/how-to-use-json-in-go#using-a-struct-to-generate-json (old version of Go). I use go 1.20.1 , Windows 11 x64, GoLand 2022.3.2 . package sample3 import ( foo "encoding/json" "fmt" "time" ) type myJSON struct { IntValue int `json:"intValue"` BoolValue bool `json:"boolValue"` StringValue string…

VIEW QUESTION

flatten a json using json_normalize

I have the following nested dictionary with lists inside: [{ "id": 467, "status": 2, "leavePeriod": { "owner": { "employeeNumber": "2620", "firstName": "fn_467", "lastName": "ln_467" }, "ownerId": 46, "leaves": [ { "leaveAccount": { "id": 1121, "name": "Vacation days 2021/2022", "url": "https://some_link/1121"…

VIEW QUESTION
Back To Top
Search