How to convert dict to json data correctly?

Hi I want to convert a dict to json data. But if I use the atom_json_dict and atom_json_term, the result is not correct.
I define convert_dict_to_json(Dict, Json) :- atom_json_dict(DictString, Dict,[]), atom_json_term(DictString, Json, []).

Then I call convert_dict_to_json(_{a:"a",b:"b"},X), it returns with X = json([a=a, b=b]).. In fact I think the result I want should be X = json([a="a", b="b"]).

If I want to convert dict to json correctly, i.e. X = json([a="a", b="b"]), how shall I write the convert_dict_to_json predicate?
Thank you.

I suspect it’s not showing the quotes in the REPL, but would with json_write/2

This worked for me:

?- json_write_dict(user_output, _{a:"A",b:"b"}, [width(0),true(#(true)),false(#(false)),null(#(null))]).
{"a":"A", "b":"b"}
true.

If you want it in a string:

?- with_output_to(string(String), json_write_dict(current_output, _{a:"A",b:"b"}, [width(0),true(#(true)),false(#(false)),null(#(null))])).
String = "{\"a\":\"A\", \"b\":\"b\"}".

Thanks for your reply. But I want to convert _{a:"a",b:"b"} to json([a="a", b="b"]). How to do it?

?- D=_{a:"A",b:"b"}, dict_pairs(D,_,P), maplist([K-V,K=V]>>true, P, J), JSON=json(J).
D = _{a:"A", b:"b"},
P = [a-"A", b-"b"],
J = [a="A", b="b"],
JSON = json([a="A", b="b"]).

Why would you want that? There are read/write predicates for both representations, so I think you always can get/use the representation you prefer.