Skip to content

Instantly share code, notes, and snippets.

@mattgu74
Created November 10, 2011 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattgu74/1354762 to your computer and use it in GitHub Desktop.
Save mattgu74/1354762 to your computer and use it in GitHub Desktop.
test json opa
/*
Test Json in opa
@author Matthieu Guffroy
*/
int_json : RPC.Json.json = {Int = 2}
float_json : RPC.Json.json = {Float = 2.0}
string_json : RPC.Json.json = {String = "test"}
bool_json : RPC.Json.json = {Bool = true}
list_json : RPC.Json.json = {List = [int_json, float_json, string_json, bool_json]}
record_json : RPC.Json.json = {Record = [("int", int_json), ("float", float_json), ("list", list_json)]}
do jlog("test serialize")
do jlog(Json.serialize(record_json))
do jlog("")
do jlog("test serialize_to_js")
do jlog(Json.serialize_to_js(record_json))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment