Error - No such field 'toJson'
Closed this issue · 1 comments
vcottagiri commented
Trying out the toJson support as described - https://jactl.io/language-guide#json-support
java -cp jactl-repl-1.2.0.jar io.jactl.repl.Repl
> class Address { String street; String suburb; String state }
> class Employee { String name; int employeeId; Address homeAddress }
> def jim = new Employee('Jim Henderson', 1234, [street:'123 High St', suburb:'Downtown', state:'South Australia'])
> [name:'Jim Henderson', employeeId:1234, homeAddress:[street:'123 High St', suburb:'Downtown', state:'South Australia']]
[name:'Jim Henderson', employeeId:1234, homeAddress:[street:'123 High St', suburb:'Downtown', state:'South Australia']]
> jim.toJson()
No such field 'toJson' for type io.jactl.pkg.Employee @ line 1, column 5
jim.toJson()
^
jaccomoc commented
Hi,
The GitHub documentation is always based on the latest version (not sure if
it is possible to have different versions of the online documentation) and
the toJson() function did not exist in version 1.2.0.
If you build the latest version of the code the function will work or wait
until version 1.3 is released in a few days time.
Cheers,
James
…On Sun, Oct 8, 2023, 5:56 AM Varghese Cottagiri ***@***.***> wrote:
Trying out the toJson support as described -
https://jactl.io/language-guide#json-support
java -cp jactl-repl-1.2.0.jar io.jactl.repl.Repl
> class Address { String street; String suburb; String state }
> class Employee { String name; int employeeId; Address homeAddress }
> def jim = new Employee('Jim Henderson', 1234, [street:'123 High St', suburb:'Downtown', state:'South Australia'])
> [name:'Jim Henderson', employeeId:1234, homeAddress:[street:'123 High St', suburb:'Downtown', state:'South Australia']]
[name:'Jim Henderson', employeeId:1234, homeAddress:[street:'123 High St', suburb:'Downtown', state:'South Australia']]
> jim.toJson()
No such field 'toJson' for type io.jactl.pkg.Employee @ line 1, column 5
jim.toJson()
^
—
Reply to this email directly, view it on GitHub
<#29>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVJ54C46KRVIFY6NAYHHBY3X6IP5PAVCNFSM6AAAAAA5XMNNAWVHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZTCNRSHAZTQMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>