Fork me on GitHub
#ring-swagger
<
2016-09-26
>
rickmoynihan17:09:04

Perhaps a silly question, but I have a swagger.yml spec and a clojure service that implements it (not using compojure-api), and I'd like to use the swagger spec to validate the JSON responses are conformant. Is there some middleware that might make this possible?

rickmoynihan17:09:41

obviously I could port the app to use compojure api - but that's more work than I can bite off just now

juhoteperi17:09:07

Don't know about existing middlewares, or even validation against Swagger Spec

juhoteperi17:09:14

but there is JSON-Schema validator: https://github.com/metosin/scjsv

juhoteperi17:09:43

You would need to yourself select JSON Schema from Swagger spec per request uri etc.

rickmoynihan17:09:09

@juhoteperi: cool. I did consider something like that as a secondary option... but I discovered that JSON schema and swagger aren't quite the same

rickmoynihan17:09:27

so not sure if my spec strays from json schema compatibility or not

juhoteperi17:09:34

Yep, Swagger Spec contains JSON Schemas

abarylko19:09:55

@ikitommi for sure! which wiki though?