[dancer-users] JSON Serialiser

Zahir Lalani ZahirLalani at oliver.agency
Fri Jul 10 11:39:20 BST 2015

Hi All

Just came across this previous message whilst debugging an issue:

John Barrett john at jbrt.org <mailto:dancer-users%40dancer.pm?Subject=Re%3A%20%5Bdancer-users%5D%20JSON%20serializer%2C%0A%20returning%20object%20instances%20form%20route%20handlers%2C%20convert_blessed&In-Reply-To=%3C20150416102503.3b16541b%40rimmer.home.fuzzix.org%3E>
Thu Apr 16 10:25:03 BST 2015

  *   Previous message: [dancer-users] JSON serializer, returning object instances form route handlers, convert_blessed<http://lists.preshweb.co.uk/pipermail/dancer-users/2015-April/004499.html>
  *   Next message: [dancer-users] Dancer training at YAPC::NA<http://lists.preshweb.co.uk/pipermail/dancer-users/2015-April/004506.html>
  *   Messages sorted by: [ date ]<http://lists.preshweb.co.uk/pipermail/dancer-users/2015-April/date.html#4505> [ thread ]<http://lists.preshweb.co.uk/pipermail/dancer-users/2015-April/thread.html#4505> [ subject ]<http://lists.preshweb.co.uk/pipermail/dancer-users/2015-April/subject.html#4505> [ author ]<http://lists.preshweb.co.uk/pipermail/dancer-users/2015-April/author.html#4505>


On Wed, 15 Apr 2015 17:55:11 +0100

John Barrett <john at jbrt.org<http://lists.preshweb.co.uk/mailman/listinfo/dancer-users>> wrote:


> get '/object' => sub {

>     AnObject->new;

> };


Quick follow up on this,

Wrapping the instance in a hashref constructor performs as expected:

get '/object' => sub {

    { object => AnObject->new };


...which I guess is what I should have been doing in the first place.

Sorry for noise.

There was no confirmation of the final message. I have the exact same issue - the return of an object used to work fine - the code I have was tested 2 months ago with no issues. We have of course been updating modules and dancer, and coming back to this project, the serialiser now gives the Route Exception error just like for John. I will test out his solution - can I get confirmation that this is indeed the way to properly handle it, or is this a bug?

Zahir Lalani
Head of Development & Architecture


2 Tabernacle Street,
London, EC2A 4LU

m: +44 (0)7956 455168
t: +44 (0)203 142 3619
e: zahirlalani at oliver-marketing.com<mailto:zahirlalani at oliver-marketing.com>
w: www.oliver-marketing.com<http://www.oliver-marketing.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150710/3977120a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2166 bytes
Desc: image001.png
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150710/3977120a/attachment.png>

More information about the dancer-users mailing list