I am trying to export json-schema to be used outside of Clojure in javascript. I am able to generate this:
{:type "object",
:properties {:$class {:type "string"},
:name {:type "string"},
:clauseId {:type "string"},
:$identifier {:type "string"}},
:required [:$class :name :clauseId :$identifier]}
Which is fine for Clojure
With Cheshire using generate-string I can get to:
"{
\"type\" : \"object\",
\"properties\" : {
\"$class\" : {
\"type\" : \"string\"
},
\"name\" : {
\"type\" : \"string\"
},
\"clauseId\" : {
\"type\" : \"string\"
},
\"$identifier\" : {
\"type\" : \"string\"
}
},
\"required\" : [ \"$class\", \"name\", \"clauseId\", \"$identifier\" ]
}"
Which is basically what I want but without the quotes. I tried parse-string from Cheshire on the above and I get:
{"type" "object",
"properties" {"$class" {"type" "string"},
"name" {"type" "string"},
"clauseId" {"type" "string"},
"$identifier" {"type" "string"}},
"required" ["$class" "name" "clauseId" "$identifier"]}
Closer but it has the colons stripped out. I want
{"type" : "object",
"properties" : {"$class" : {"type" "string"},
"name" : {"type" "string"},
"clauseId" : {"type" "string"},
"$identifier" : {"type" "string"}},
"required" : ["$class" "name" "clauseId" "$identifier"]}
I feel like this should be easy and I am missing something. I don't see how it is valid json without the :
How do I create the json with colons?