Fork me on GitHub
#ring-swagger
<
2018-10-19
>
ikitommi08:10:31

@piotr2b hi. ring-mock send the body as form-encoded, you need to write the json-body yourself.

ikitommi08:10:36

(-> (assoc (mock/request :post "/application/path/endpoint" (cheshire.core/generate-string {:a 7}))
      :content-type "application/json")
    (app)
    :body
    (slurp)
    (cheshire/parse-string true))

ikitommi08:10:52

works for the first example

ikitommi08:10:37

@mping 2.0.0 uses Jsonista, which takes the encoders as explicit configuration options :encoders. The docs aren’t great, but are here: https://cljdoc.xyz/d/metosin/jsonista/0.2.2/api/jsonista

mping09:10:49

@ikitommi tks, will take a look