Discussion:
Incorrect JSON rendering by HalJsonRenderer, if creating a custom GSON TypeAdapter
Søren Berg Glasius
2014-01-11 23:29:10 UTC
Permalink
I've been trying to use Joda with the HalJsonRenderer, but got an error
where dates are quoted twice.

I have filed a Jira: http://jira.grails.org/browse/GRAILS-10977 and I have
actually attempted to create a fix for it as well.

When I registered a custom TypeAdapter for GSON, it looks like it's
escaping an already quoted value, looking like this:

{
_links: {
...
},
_embedded: {
conference: [
{
_links: {
...
}
*end: "\"2014-06-04\"",*
name: "GR8Conf Europe 2014",
*start: "\"2014-06-02\""*
}
]
}
}

The correct output should look like this:
{
_links: {
...
},
_embedded: {
conference: [
{
_links: {
...
}
*end: "2014-06-04",*
name: "GR8Conf Europe 2014",
*start: "2014-06-02"*
}
]
}
}

I think this partly has to do with this bug:
http://jira.grails.org/browse/GRAILS-10372 which has been resolved.

Med venlig hilsen / Best regards,
SÞren Berg Glasius

Hedevej 1, Gl. Rye, DK-8680 Ry, Denmark
Mobile: (+45)40449188, Skype: sbglasius
--- Press ESC once to quit - twice to save the changes.

Loading...