Im stuck with what it seems simple question, when I create a JSON using the MariaDB/MySQL json functions going through variables, it adds double quotes which is annoying. However, if I don’t go through variables, it works fine. Unfortunately I have to go through variables as I’m building my JSON using a recursive function:
1) without variables:
declare temp_json JSON; set temp_json = json_object('data',json_object("jsonapi",json_object("version", "1.0"))); select temp_json
OUTPUT {"data": {"jsonapi": {"version": "1.0"}}}
2) with variables
declare temp_json JSON; declare jsonapiheader JSON; set jsonapiheader = json_object("jsonapi",json_object("version", "1.0")); set temp_json = json_object('data',jsonapiheader); select temp_json
OUTPUT {"data": "{\"jsonapi\": {\"version\": \"1.0\"}}"}
So how do I do like 2) but with the output of 1) ?
my system: MariaDB 10.2.9 Windows 10 pro 64bit
Thanks!