ring-swagger & compojure-api
igrishaev 2018-04-05T06:29:14.000235Z

@ikitommi unfortunately it’s not, I tested with the latest 3.13.2 and some previous ones with the same result. To give you more details, I was trying to connect swagger with FHIR schemas. FHIR is a medical standard to store medical information. Schemas might be found here: https://www.hl7.org/fhir/fhir.schema.json.zip My swagger file mentions just a single entity, but that’s enough to ruin swagger:

{"swagger": "2.0",
 "schemes": ["http"],
 "info": {"contact": {"email": "<mailto:test@test.com|test@test.com>"},
          "title": "sdfsdfsf"},
 "paths": {"/foo": {"get": {"description": "sdfsdfsdfdsf",
                            "responses": {200: {"description": "sdfsdf",
                                                "schema": {"$ref": "./fhir.schema.json/Practitioner.schema.json"}}}


ikitommi 2018-04-05T08:09:36.000231Z

@jmckitrick the content-type shoud be set automatically if you haven’t changed the default api options. e.g.

  (GET "/ping" []
    (ok {:kikka "kukka"})))
… encodes the response data into JSON (or whatever the client has requested) and sets the headers.

ikitommi 2018-04-05T08:10:12.000186Z

if you have a failing example, I could take a look.

ikitommi 2018-04-05T08:11:11.000078Z

@igrishaev sorry, that falls into the swagger.js domain, bug somewhere there. Could you raise issue there?

igrishaev 2018-04-05T08:12:29.000212Z

@ikitommi yes, I’ll submit one a bit later. Currently, I crafted those schemas manually.

jmckitrick 2018-04-05T12:30:39.000144Z

@ikitommi My mistake, I forgot the response headers are not keywords….

ikitommi 2018-04-05T15:35:58.000241Z

been there 🙂