Fork me on GitHub

@jablub: yes there is, multiple ways to do that - could you tell more about your use case? but anyway, these alla work: 1) per endpoint, document the endpoint using :swagger meda-data ( 2) disable the input&output coercion, either per route (via :coercion) or per whole api (via options) 3) 1.0.2-SNAPSHOT has the resource abstraction, currently eager, but could make it optionally just to produce docs => could be used to easily document things like Liberator resources


I have an compojure-api which takes a message and puts it on a queue and returns a 200 - even for invalid messages. The message gets validated with schema on the consumer side of the queue, but the external group also wants swagger docs available.


I would like to keep the schemas as the single source of documentation so options 2 and 3 seem good. I haven't looked into it yet but 2 seems simplest. If you feel option 3 would be a better call I will go for that. Our project is still at the stage where working off current development branches is still allowed. I will try both.


I think option 1 makes most sense in that usecase


I've got an issue with compojure and schema where it works from swagger but not from any other source (I'm calling http post), the error isn't very useful - {"errors":"(not (map? nil))"}


ive copied my request body into the endpoint test at /swagger-ui and the request goes through fine from there


does @juhoteperi have a idea how to Fix that in an elegantti way?


my issue is a bit different in that the only place the request works is from the swagger endpoint, when I try to make the call from the frontend it fails with that error


I've inspected the headers, etc and those are fine


I guess we should merge empty map when *-params is used.


if the client doesn't send any body, e.g. invalid json headers, which causes the body not to be parsed (in ring-middleware-format), it is send as nil. Body is expected to be a Map, so thus the schema error.


Merging an empty map with the parsed body would give a lot of missing-required-key errors. Adding logging to request-coercion might help to find the cause.


yes that would help, I've been trying to inject some logging


@ysealy08: content-type is invalid. application-json vs. application/json


😕 hmm good catch, I'm setting application/json on the frontend end code for sure, I'll investigate why this is happening