Fork me on GitHub
#luminus
<
2019-06-08
>
Chris Swanson14:06:29

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

Chris Swanson15:06:02

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

Chris Swanson15:06:39

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}}}

Chris Swanson15:06:50

maybe the middleware order is wrong?

Chris Swanson15:06:54

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

Chris Swanson15:06:55

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

Chris Swanson15:06:45

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

Chris Swanson15:06:57

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

Chris Swanson15:06:15

matter of preference though , easy enough to remove