ring-swagger

ring-swagger & compojure-api
seantempesta 2018-04-29T15:59:10.000036Z

Anyone had issues rendering the swagger-ui on non-localhost? Everything was working perfectly on my laptop, I deployed it to my server and now all of the CSS is broken. The actual API seems to be working, but I’m also getting a small error button that is the results from <http://online.swagger.io|online.swagger.io> validating my api:

{"messages":["attribute paths.'/api/v1/groups/list'(get).return is unexpected","attribute paths.'/api/v1/groups/kids'(get).return is unexpected","attribute paths.'/api/v1/kids/lookup'(get).return is unexpected"],"schemaValidationMessages":[{"level":"error","domain":"validation","keyword":"additionalProperties","message":"object instance has properties which are not allowed by the schema: [\"return\"]","schema":{"loadingURI":"<http://swagger.io/v2/schema.json#>","pointer":"/definitions/operation"},"instance":{"pointer":"/paths/~1api~1v1~1groups~1kids/get"}}]}

seantempesta 2018-04-29T16:34:44.000019Z

I got the validation error to go away by passing this flag: :options {:ui {:validatorUrl nil}}, but the CSS is still screwed up. 😕

seantempesta 2018-04-29T17:02:27.000028Z

So I fixed the CSS error by upgrading to the latest ring-swagger-ui. Unfortunately, now the authorization token isn’t being passed in anymore.

ikitommi 2018-04-29T18:10:06.000130Z

the old swagger-ui is IMO much better than the 3.*. Haven’t seen any css-errors with that. hmm.