Fork me on GitHub

@ikitommi Thanks for the suggestiong - I changed the schema to : (s/defschema Messages [s/Str]). I have tried simply outputting a list of strings ("message" "Message2") and it still get { "errors": "(not (sequential? a-java.lang.String))"} response I changed the output then to use json/write-str to output the list and I get the same error. I must be doing something really silly.


@mmer you don’t have to write the output to JSON by hand. Just return the clojure data from the route and it gets encoded based on the client accept headers. e.g. return something like (ok ["kikka" "kukka" "kakka"]) and it should work.


or (ok [{:?message "kikka"} {:?message "kukka"}]) in the first sample.


if you write JSON manually, e.g. (json/write-str ["kikka" "kukka" "kakka"]), you are returning a JSON String and the Schema validation fails: :return denotes you should return a vector of String, and returning the (JSON) String gives the error you are seeing.


hope this helps.


Thanks @ikitommi - I tried variations of what you said and eventually it has worked - much appreciated.