You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Cassie Doll (JIRA)" <ji...@apache.org> on 2008/09/24 01:37:47 UTC

[jira] Commented: (SHINDIG-617) Add support for integer and boolean primitives to BeanJsonConverter

    [ https://issues.apache.org/jira/browse/SHINDIG-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633971#action_12633971 ] 

Cassie Doll commented on SHINDIG-617:
-------------------------------------

Booleans and Integers should be covered by lines 334 and 332. (just if cases up from your patch)
I have written a test for this which currently passes:

  public void testJsonToPerson() throws Exception {
    String jsonPerson = "{age : '10', hasApp : 'true'}";
    Person result = beanJsonConverter.convertToObject(jsonPerson, Person.class);

    assertEquals(10, result.getAge().intValue());
    assertEquals(true, result.getHasApp().booleanValue());
  }

So, without your patch, does this still not work for you?
If not, can you write a failing test case to go along with your patch so that we can figure out exactly what's going on?

Thanks!

> Add support for integer and boolean primitives to BeanJsonConverter
> -------------------------------------------------------------------
>
>                 Key: SHINDIG-617
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-617
>             Project: Shindig
>          Issue Type: Improvement
>          Components: RESTful API (Java)
>            Reporter: Dave Johnson
>            Priority: Minor
>         Attachments: fix-beanjsonconv-bug.patch
>
>
> The JSON to Java object conversion does not support primitive integers or booleans.
> No sure why this has not been noticed before, perhaps it is because Shindig never converts JSON to Person?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.