Allow Mutable serializer to render templates?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the Mutable serializer behavior for Accept headers and the linked Mojolicious respond_to helper. The issue does not identify files or tests; the work is done when the project has agreed on an API and clear template-selection behavior for HTML alongside JSON/XML responses.
Written by the indexing model from the issue text.
Description
It could be useful to return a data structure from a route handler and have it automatically serialized to JSON/XML or rendered in a template depending on Accept: header supplied by the user. Right now we have a Mutable serializer which chooses a serializer based on headers, but no way to render a template if user asks for text/html instead.
Mojolicious has respond_to helper which achieves this. Could Mutable serializer be extended to allow similar things? Right now it's not obvious how it would determine the template to render.
Feel free to point out the obvious solution I am missing, talk me out of returning HTML or JSON from the same route, or suggest alternative API designs. I can help with the implementation too, once there is consensus on how it should behave.
- Dominant language
- Perl
- Stars
- 604
- Forks
- 287
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PerlDancer/Dancer2
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutPossibly taken @sadhana-s-codez claimed this 1 day ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
PerlDancer/Dancer2#1854 · 1 comment ·
Maintainers usually reply within 1 day
-
dancer2 gen -c writes the Dockerfile outside the app directoryPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1851 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PerlDancer/Dancer2#1850 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
PerlDancer/Dancer2#1820 ·
Maintainers usually reply within 1 day
-
Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1819 ·
Maintainers usually reply within 1 day
All issues in PerlDancer/Dancer2
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
major/MySQLTuner-perl#1007 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
bioconda/bioconda-recipes#70187 ·
Maintainers usually reply within 2 days
-
documentation Needs Triage
Difficulty 1/5 Under an hour Newbie friendliness 93/100
Maintainers usually reply within 1 day