This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-14
Channels
- # beginners (53)
- # boot (93)
- # cider (13)
- # cljs-dev (17)
- # cljsrn (20)
- # clojars (1)
- # clojure (349)
- # clojure-austin (1)
- # clojure-gamedev (5)
- # clojure-italy (1)
- # clojure-nl (16)
- # clojure-poland (1)
- # clojure-russia (26)
- # clojure-spec (57)
- # clojure-uk (6)
- # clojurebridge (5)
- # clojurescript (145)
- # code-reviews (2)
- # core-async (88)
- # cursive (1)
- # datomic (3)
- # defnpodcast (10)
- # events (7)
- # hoplon (20)
- # instaparse (1)
- # jobs-discuss (15)
- # keechma (26)
- # lein-figwheel (2)
- # leiningen (1)
- # liberator (11)
- # lumo (40)
- # off-topic (54)
- # om (32)
- # onyx (11)
- # pedestal (6)
- # perun (4)
- # planck (6)
- # re-frame (4)
- # reagent (12)
- # ring (3)
- # ring-swagger (10)
- # rum (1)
- # testing (4)
- # timbre (1)
- # unrepl (20)
- # untangled (111)
- # vim (1)
Hi all! I have a liberator newbie question: I am using liberator together with formidable and I have a sign up form which after validating the fields would lead to an account entry creation. However I would like to flash the validation errors on the same form if not correct so the user tries again. Any idea what is the right handler for this. I tried a few but without success plus conceptual dont seem right to me (like processable and malformed)
I would say return a 401 Unauthorized. Which means the :authorized?
decision
@bostonaholic thanks for your answer. I am wondering if thats the right way cause the error can be that the user didnt fill in the name for instance. Is this unauthorised? Or malformed?
could be
seems like personal preference to me
I might agree that not sending a required field is 400
Personally I'd prefer 422 because the form data in the request body is the entity that cannot be processed. But 400 is also wildly considered ok.
422 is another good option
By the words of the specification 400 is for request that are malformed on the network/encoding level but 422 is not in core http but only in webdav. Key advantage of using 422 is that you can interpret 400 as a software error (malformed JSON) and 422 as an application layer problem (invalid field value). The former is hardly fixable for the user, the latter is.