This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-06
Channels
- # adventofcode (10)
- # ai (2)
- # aleph (2)
- # announcements (21)
- # beginners (25)
- # calva (7)
- # cider (19)
- # clj-kondo (28)
- # clj-on-windows (3)
- # cljdoc (6)
- # clojure (80)
- # clojure-dev (15)
- # clojure-europe (29)
- # clojure-italy (3)
- # clojure-nl (37)
- # clojure-uk (4)
- # clojurescript (3)
- # cloverage (1)
- # conjure (6)
- # core-async (2)
- # cursive (17)
- # datalevin (9)
- # datomic (7)
- # deps-new (23)
- # emacs (4)
- # figwheel-main (6)
- # fulcro (6)
- # honeysql (19)
- # improve-getting-started (4)
- # inf-clojure (2)
- # introduce-yourself (5)
- # jobs (1)
- # leiningen (6)
- # lsp (73)
- # malli (1)
- # nrepl (2)
- # off-topic (37)
- # polylith (9)
- # quil (2)
- # reitit (16)
- # releases (2)
- # remote-jobs (6)
- # rewrite-clj (38)
- # shadow-cljs (1)
- # tools-build (1)
How can I let this route match the url /api/ping
which doesn’t contain the id part? And in this case, the desirable id value would be “”.
(def router
(r/router
[["/api/ping/:id" ::ping]]))
so if you put your ping as a separate route, then with "" and "/:id" nested underneath
Hi can anyone point me to the documentation of reitit.ring.coercion? I want to inspect a header with it.
curl -X 'POST' \
'' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"success": "bar"}'
clojure.lang.ExceptionInfo: clojure.lang.ExceptionInfo in Interceptor :reitit.http.interceptors.muuntaja/format-response - Malformed application/json in :muuntaja/encode
{:execution-id 10, :stage :leave, :interceptor :reitit.http.interceptors.muuntaja/format-response, :exception-type :clojure.lang.ExceptionInfo, :exception #error {
:cause "No serializer found for class reitit.coercion.spec$create$reify__43032 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: clojure.lang.PersistentHashMap[\":exception\"]->clojure.lang.ExceptionInfo[\"data\"]->clojure.lang.PersistentArrayMap[\":coercion\"])"
I'm having this message in pedestal-swagger example with a post handler
["/custom-gql"
{:post {:handler (fn [ctx]
{:foo :bar})
:parameters {:body string?}}}]
Do you have idea what is the root cause ?Your handler should return ring response. Try to wrap like this {:status 200 :body {:foo :bar}}
I've changed to, and it remains. The message says muuntaja/format-response , I've tried to find the message on muuntaja code, I rly don't know what is happening. Probably something awful on my part. To eliminate that I've introduced this handle in pedestal-swagger example, and the result is similar
["/custom-gql"
{:post {:handler
(fn [ctx]
{:status 200 :body
{"foo" "bar"}})
:parameters {:body string?}}}]
Would it be the case that your body is spec'ed out to be a string, but you're sending a JSON object that Jackson is trying to deseralise as foo
with a value of bar
, i.e., a map like structure?
so Jackson is failing to deserialize and thus can't find any thing resembling a (java) bean
i've introduced parameters :body string? to send a string to the server, the error happen on leave stage so It does not look like it. I'm changing to :body any? to see what happens
@U11EL3P9U man you are right! thank you.
I've changed to, and it remains. The message says muuntaja/format-response , I've tried to find the message on muuntaja code, I rly don't know what is happening. Probably something awful on my part. To eliminate that I've introduced this handle in pedestal-swagger example, and the result is similar
["/custom-gql"
{:post {:handler
(fn [ctx]
{:status 200 :body
{"foo" "bar"}})
:parameters {:body string?}}}]