This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-21
Channels
- # aws (14)
- # babashka (35)
- # beginners (163)
- # boot (2)
- # calva (5)
- # cider (30)
- # clojure (143)
- # clojure-colombia (1)
- # clojure-europe (5)
- # clojure-nl (11)
- # clojure-spec (1)
- # clojure-uk (16)
- # clojurescript (71)
- # community-development (2)
- # conjure (1)
- # cursive (6)
- # datomic (30)
- # duct (4)
- # figwheel-main (11)
- # fulcro (28)
- # graalvm (3)
- # graphql (23)
- # hoplon (36)
- # jackdaw (24)
- # kaocha (16)
- # lambdaisland (1)
- # leiningen (4)
- # luminus (3)
- # meander (4)
- # observability (1)
- # off-topic (10)
- # pathom (5)
- # re-frame (27)
- # reitit (7)
- # remote-jobs (1)
- # sci (17)
- # shadow-cljs (22)
- # spacemacs (14)
- # sql (61)
- # testing (3)
- # tools-deps (27)
- # vim (2)
- # xtdb (18)
- # yada (2)
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.
You could possibly change your endpoints to "GET new/foo" and "GET foo/:id"
thanks @U9KLJ8N0Z - 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 @U9KLJ8N0Z I've done web dev in a number of languages and Clojure is my absolute favourite. cheers
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?