skip to Main Content

Json – Converting jarray to IEnumerable gives "does not contain a definition for Concat"

I've got the following code: using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; public class Program { public static void Main() { var json = JsonConvert.DeserializeObject<dynamic>("["test1", "test2"]"); var list = json.ToObject<IEnumerable<string>>().Concat(new[] { "test3" }); Console.WriteLine(string.Join(", ", list)); } } I…

VIEW QUESTION

Json – Can this jq map be simplified?

Given this JSON: { "key": "/books/OL1000072M", "source_records": [ "ia:daywithtroubadou00pern", "bwb:9780822519157", "marc:marc_loc_2016/BooksAll.2016.part25.utf8:103836014:1267" ] } Can the following jq code be simplified? jq -r '.key as $olid | .source_records | map([$olid, .])[] | @tsv' The use of variable assignment feels like cheating…

VIEW QUESTION

Replace new JSON in javascript

I want to make JSON look like this: {"tokenId":1,"uri":"ipfs://bafy...","minPrice":{"type":"BigNumber","hex":"0x1a"},"signature":"0x51xxx"} This is my currently output: { "tokenId": "1", "uri": "ipfs://baf...", "minPrice": 0.26, "signature": "0x..." } This is the retrieve code. async function redeem(cid) { fetch(`http://localhost:4000/getDetails/${cid}`).then(response => { return response.json() }).then((async output=>…

VIEW QUESTION
Back To Top
Search