When parameters are invalid, yada returns an error message in the body. Unfortunately the body returned seems to be text/plain by default, even if the request has, say a accept: application/json header.
That's too bad - it is that close to be machine readable!
It means that yada/response-for is not as usable/composable as it could be as well - I would love to go towards a more REPL/data-driven webserver.
Update: it seems there is a special case for application/edn, but even there is is not easy to read since there is an #error tag inside the body (maybe https://clojuredocs.org/clojure.core/Throwable-%3Emap could help?).
When parameters are invalid, yada returns an error message in the body. Unfortunately the body returned seems to be
text/plain
by default, even if the request has, say aaccept: application/json
header.Example reply:
That's too bad - it is that close to be machine readable!
It means that
yada/response-for
is not as usable/composable as it could be as well - I would love to go towards a more REPL/data-driven webserver.Update: it seems there is a special case for
application/edn
, but even there is is not easy to read since there is an#error
tag inside the body (maybe https://clojuredocs.org/clojure.core/Throwable-%3Emap could help?).yada 1.2.9
I haven't checked, but it looks related to this file https://github.com/juxt/yada/blob/f147f052529689503f839343aab9384280f0ce2d/src/yada/body.clj#L254-L278