Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.8.4
-
Fix Version/s: None
-
Component/s: JSON
-
Labels:
-
Number of attachments :
Description
Consider the attached Groovy script. It defines two classes. Each has public properties explicitly defined. When I send the resulting objects to JsonOutput.toJson(), I expect the public properties of the object to be serialized into the JSON output. This is not working as expected. The only properties that get serialized are those created via "def propName" and those that seem to have getter methods (this in not actually the case).
Attached is a screenshot of GroovyConsole running the attached script.
Activity
umang bhatt
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | screenshot.png [ 62441 ] |
umang bhatt
made changes -
| Attachment | MetaClassImpl.java [ 62442 ] |
blackdrag blackdrag
made changes -
| Attachment | MetaClassImpl.patch [ 62443 ] |
umang bhatt
made changes -
| Attachment | MetaClassImpl.java [ 62442 ] |
umang bhatt
made changes -
| Attachment | 0001-solving-bug-GROOVY-5169.patch [ 62444 ] | |
| Attachment | MetaClassImpl.java [ 62445 ] |
umang bhatt
made changes -
| Attachment | 0001-solving-GROOVY-5169.patch [ 62446 ] |
umang bhatt
made changes -
| Attachment | 0001-solving-bug-GROOVY-5169.patch [ 62444 ] |
umang bhatt
made changes -
| Attachment | 0001-solving-GROOVY-5169.patch [ 62446 ] |
umang bhatt
made changes -
| Attachment | 0001-bugfix.patch [ 62447 ] |
Yes. I think JsonOutput.toJson(Object) should be generally in sync with object.dump(), which it is not currently.