I currently have a Phoenix application that has both JSON and HTML endpoints.
I would like to return the errors that are the most appropriate for the given request, but it always defaults to the render("XXX.html, _) function even when the request's format is application/json.
Is there a way to return JSON for requests of type application/json and HTML for everything else?