module.web icon indicating copy to clipboard operation
module.web copied to clipboard

Issue with nested reitit routes in upcoming version

Open branch14 opened this issue 7 months ago • 4 comments

In the upcoming version there seems to be an issue with nested reitit routes.

Flat routes work

:routes
   [["/ping" :my-test/ping]
    ["/pong" :my-test/pong]]

But when specified in nested form

:routes
   [["/v1"
     ["/ping" :my-test/ping]
     ["/pong" :my-test/pong]]]

only the first route works. The /v1/pong route results in a 404.

I checkd with

(require '[reitit.core :as r])
(-> "duct.edn"
        slurp
        (str/replace "#ig/ref" "")
        read-string
        :system
        :duct.module/web
        :routes
        r/router
        r/routes)

and the result seems fine.

Addendum:

Well at least the error message leads to the conclusion that it wants to respond with a 404. What I actually get is Error 500 java.lang.IllegalArgumentException: No implementation of method: :write-body-to-stream of protocol: #&apos;ring.core.protocols/StreamableResponseBody found for class: clojure.lang.PersistentArrayMap and then SERVLET:</th><td>org.eclipse.jetty.servlet.ServletHandler$Default404Servlet.

This is with

org.duct-framework/main {:mvn/version "0.1.8"}
org.duct-framework/module.web {:mvn/version "0.12.7"}

branch14 avatar May 09 '25 20:05 branch14