jivesoftware / jive-sdk-java-jersey

This is an implementation of the Jive SDK written in Java, implemented for JEE6 using Jersey (JAX RS 2.0), Spring Core 3.2.5 and JSP.
https://community.jivesoftware.com/community/developer
Apache License 2.0
10 stars 19 forks source link

The "context" under TileAction defined as type String #10

Open yingjieg opened 9 years ago

yingjieg commented 9 years ago
{
    "text":"",
    "linkDescription": "",
    "action": {
            "text": "Open the action window",
            "url": "",
            "context" : {
                "key1": "value1",
                "key2": "value2"
            }
     }
 }
TileAction action = new TileAction();
action.setContext(String);

context under action is a object, I tried to call the method like below:

action.setContext("{\"key1\":\"value1\", \"key2\": \"value2\"}")

but the json will be parsed as "context" : "{\"key1\":\"value1\", \"key2\": \"value2\"}", I use a workaround here temporarily,

action.setContext(new ObjectMapper().readValue("{\"key\":\"value\"}", Object.class));

and change the type of context to object.

I might call the action.setContext(String) in a wrong way, Do you have any suggestion about this?

ryanrutan commented 9 years ago

Do a git pull and see if that helps. I changed the type to a Map<String,String> as it should be. Thanks for the catch =)