Fork me on GitHub

Having some difficulty, I want to disable YAML in body-param input. This is a project using compojure-api 1.2.0-alpha4 In my call to compojure.api.sweet/api my options include :formats (dissoc (:formats (:formats compojure.api.api/api-defaults)) "application/x-yaml") to try to get the relevant portions of the muntaaja setup in defaults but the swagger page still accepts yaml inputs and attempts to decode it. Other :formats values, like those in the doc-string of compojure.api.sweet/api, don't work at all and result in runtime exceptions. (The documentation shows :formats [:json-kw :edn :transit-msgpack :transit-json]). Any pointers here?


@dave.tenny the docs-string was fixes just few days ago. I would recommend to update to 2.0.0-alpha20 and use something like :formats (update m/default-formats :formats dissoc "application/x-yaml")


:formats now take either a Muuntaja instance or options.


Hey how can I set the content-type header when using compojure api?


@andreasp1994 it's normal ring, so for example (content-type (ok "{\"a\": 1}") "application/json") should do it


Is is possible to use compojure 2 without muutanja ??