[ 
https://issues.apache.org/jira/browse/GROOVY-11167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guillaume Laforge updated GROOVY-11167:
---------------------------------------
    Description: 
The following assertion fails:
{code:java}
import groovy.json.JsonOutput
record Person(String name) {}
assert JsonOutput.toJson([new Person('Guillaume')]) == 
'[{"name":"Guillaume"}]'{code}
All records are serialised as {{{}}}

I would expect records to be serialised as normal POGOs or Maps, etc.

  was:
The following assertion fails:

 
{code:java}
import groovy.json.JsonOutput
record Person(String name) {}
assert JsonOutput.toJson([new Person('Guillaume')]) == 
'[{"name":"Guillaume"}]'{code}
 

All records are serialized 


> JsonOutput should handle Records like POGOs
> -------------------------------------------
>
>                 Key: GROOVY-11167
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11167
>             Project: Groovy
>          Issue Type: Improvement
>          Components: JSON
>    Affects Versions: 4.0.14, 3.0.19
>            Reporter: Guillaume Laforge
>            Priority: Major
>
> The following assertion fails:
> {code:java}
> import groovy.json.JsonOutput
> record Person(String name) {}
> assert JsonOutput.toJson([new Person('Guillaume')]) == 
> '[{"name":"Guillaume"}]'{code}
> All records are serialised as {{{}}}
> I would expect records to be serialised as normal POGOs or Maps, etc.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to