While trying to get a particular response with the code below, i am not getting that.
I am getting this as an output:
{"name": Bull,"age": 30,"city": Nowhere}
The output i want:
{"name": "John","age": "30","city": "Nowhere"}
Below is the code snippet:
(defun create-json-object (key value)
(format nil ""~a": ~a" key value))
(defun example-json-encode ()
(let ((name "Bull")
(age 30)
(city "Nowhere"))
(let ((json-object (list (create-json-object "name" name)
(create-json-object "age" age)
(create-json-object "city" city))))
(format t "{~{~a~^,~}}" json-object))))
(print(example-json-encode))