<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 11:37 AM, Nuno Carvalho <span dir="ltr"><<a href="mailto:smash@cpan.org" target="_blank">smash@cpan.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Oct 12, 2015 at 8:16 PM, Pedro Melo <<a href="mailto:melo@simplicidade.org">melo@simplicidade.org</a>> wrote:<br>><br>
> need to build a REST API with Dancer2. Any recommendations on what plugins,<br>
> if any, to use?<br>
><br>
> I see Dancer2::Plugin::REST, is that the recommended one? It looks good… any<br>
> experiences with it?<br>
<br>
</span> I always end up doing serialization "myself", instead of relying in<br>
plugins. Because many times there will be some edge cases that using<br>
the plugin will require a huge workaround. While handling the<br>
serialization yourself it's always easier to adapt. And even so I<br>
usually end up with very simple and clean applications like:<br>
<br>
sub '/users' => sub {<br>
to_json MyModel->users;<br>
};<br>
<br>
If you prefer you can also use the "set serializer" option, to omit<br>
the to_json parts, or if you intend to have more than one serializer<br>
possible<br></blockquote><div><br></div><div>Yeah… I have a base class for all my models so I'll probably take that route.</div><div><br></div><div>Thank you all,</div><div>-- <br></div></div><div class="gmail_signature">Pedro Melo<br>@pedromelo<br><a href="http://www.simplicidade.org/" target="_blank">http://www.simplicidade.org/</a><br><a href="mailto:xmpp%3Amelo@simplicidade.org" target="_blank">xmpp:melo@simplicidade.org</a><br>mailto:<a href="mailto:melo@simplicidade.org" target="_blank">melo@simplicidade.org</a></div>
</div></div>