On 3/13/2014 19:16, Yanick Champoux wrote:
On 14-03-13 08:57 PM, Warren Young wrote:
Is there a way I can fix this without going back to manual JSON encoding?

My first thought is: do something with the 'before_serializer' hook.

While Lee's solution works for me, it would be nice if Dancer would let me restrict the automatic serializer to a route prefix:

    serializer:
        format: JSON
        prefix: /api

That would entirely replace Lee's solution.

This wouldn't break backwards compatibility. If you give 'serializer' a scalar, it can use its current global behavior.

Passing an array of hashes instead of a hash could allow different serializers for different parts of your route scheme:

    serializer:
        - format: JSON
          prefix: /api

        - format: Data::Dumper
          prefix: /debug

_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to