Hi All. This is hopefully a silly error I'm making but I'm trying to define a set of RESTful routes for an entity foo so I have "GET foo/new" to retrieve an empty form and "GET foo/:id" to retrieve a specific foo. Unfortunately this gives me a conflicting route path error when I define it in reitit. I'm sure I'm doing something daft but does someone have an example of a set of RESTful routes defined in reitit I could look at? cheers
"foo/new" matches the path "foo/:id" so when you try retrieve an empty form, reitit may legitimately return the specific foo with :id=new, hence the conflict.
I am still learning how content negotiation works, generally and in Clojure. I would like to use Muuntaja with Reitit to decode and encode to and from https://clojure.github.io/data.xml/ Element defrecords, is this possible? Or can one only decode and encode to and from regular Clojure maps?
You could possibly change your endpoints to "GET new/foo" and "GET foo/:id"
thanks @byrongibby - makes sense - do you know a way around this or does reitit not really handle traditional REST routes? cheers
I am learning web dev from scratch in Clojure, so unfortunately I have no experience in other languages (so its all traditional to me 🙂). You can apparently ignore conflicts by adding:
:conflicting true
to the route data of both https://metosin.github.io/reitit/basics/route_conflicts.html.thanks @byrongibby I've done web dev in a number of languages and Clojure is my absolute favourite. cheers