luminus

2019-06-08T14:59:29.002200Z

has anyone else noticed broken spec coercion test with swagger app profile?

2019-06-08T15:00:02.002800Z

just "lein new luminus myapp +swagger && cd myapp && lein test"

2019-06-08T15:00:39.003200Z

coughs up this :

Request coercion failed: #reitit.coercion.CoercionError{:spec #Spec{:form (clojure.spec.alpha/keys :req-un [:spec$18482/x :spec$18482/y]), :type :map, :leaf? false}, :problems #:clojure.spec.alpha{:problems ({:path [:y], :pred clojure.core/int?, :val "invalid", :via [:spec$18482/y], :in [:y]}), :spec #Spec{:form (clojure.spec.alpha/keys :req-un [:spec$18482/x :spec$18482/y]), :type :map, :leaf? false}, :value {:y "invalid", :x 10}}}

2019-06-08T15:00:50.003400Z

maybe the middleware order is wrong?

2019-06-08T15:01:54.004100Z

And to be clear , it's not just a failed test, it's actually throwing an Exception and interrupting the test run - correction , the tests don't get interrupted, it's working as designed

2019-06-08T15:09:55.004600Z

ahh you know what I think I figured it out - it's as designed

2019-06-08T15:10:45.005600Z

it dumps the stacktrack to the console in the exception handler code, but it actually does then hand off the correct response code, and the total errors in the test report is 0

2019-06-08T15:11:57.007Z

just could look prettier , imho the stacktrack (while useful) also makes it look like something's broken , not just a failed test

2019-06-08T15:12:15.007300Z

matter of preference though , easy enough to remove