Fork me on GitHub
#ring-swagger
<
2018-06-19
>
jdt14:06:31

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?

ikitommi14:06:05

@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")

ikitommi14:06:23

:formats now take either a Muuntaja instance or options.

Andreasp199417:06:09

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

ikitommi17:06:02

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

Andreasp199421:06:15

Is is possible to use compojure 2 without muutanja ??