Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

[12:35:21 CST(-0600)] <TonyUnicon> thanks for that info Dan, I think it answers my question

[12:39:14 CST(-0600)] <TonyUnicon> What is not obvious to me is how the response JSON gets built, for example, I do not know the data_index that object status will get mapped to

[12:46:32 CST(-0600)] <TonyUnicon> is it by convention? is it always the field name?

[12:59:39 CST(-0600)] <dmccallum54> the API controllers are all tagged with @ResponseBody, which means the serialization will be handled by a HttpMessageConverter selected by Spring

[12:59:55 CST(-0600)] <dmccallum54> in our case it's almost always going to select MappingJacksonHttpMessageConverter

[13:00:06 CST(-0600)] <dmccallum54> so serialization will be whatever you get with Jackson by default

[13:00:27 CST(-0600)] <dmccallum54> easiest way to modify that behavior on a fine-grained basis would be to add Jackson annotations to the TOs in question

[13:01:18 CST(-0600)] <dmccallum54> http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/mvc.html#mvc-ann-responsebody

[13:01:38 CST(-0600)] <dmccallum54> http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/remoting.html#rest-mapping-json-converter

[13:02:32 CST(-0600)] <TonyUnicon> ok, thanks

[13:03:11 CST(-0600)] <dmccallum54> you'll see a little bit of Jackson serialization customization going on in org.jasig.ssp.transferobject.ServiceResponse

[13:03:31 CST(-0600)] <dmccallum54> i can also probably dig up a few other examples from other projects if you need 'em

[13:03:49 CST(-0600)] <TonyUnicon> do you know what the jackson default behavior is?

[13:04:01 CST(-0600)] <TonyUnicon> does the field name become the key?

[13:04:31 CST(-0600)] <TonyUnicon> it looks like that is the case

[13:05:06 CST(-0600)] <TonyUnicon> or maybe a better question

[13:05:17 CST(-0600)] <TonyUnicon> do you know a good breakpoint where I can see the response JSON?

  • No labels