Fork me on GitHub
#ring-swagger
<
2018-06-12
>
ikitommi08:06:32

@metametadata oh, it’s not expected, Issue &/ PR welcome.

👌 1
Andreasp199418:06:50

Hey I am trying out the compojure-api but I am getting this error when doing a post request.`"title": "(not (instance? java.lang.String a-java.lang.Class))"` any ideas what this means?

ikitommi18:06:30

@andreasp1994 that’s an Schema error for wrong type. What endpoint are you trying?

Andreasp199418:06:15

I am trying to do a Todo list REST API based on the pizza example

Andreasp199418:06:49

So when I am trying to add a new TodoItem using a POST request on /todos/ I get this error

Andreasp199418:06:20

Interestingly if I set the title to an integer lets say 1 I get "title": "(not (instance? java.lang.String 1))"

ikitommi18:06:28

can you paste you endpoint code?

ikitommi19:06:18

line 49 should be (ok (add! todo)))

ikitommi19:06:46

you are returning the schema, and the response coercion fails.

ikitommi19:06:53

otherwise, looks good

ikitommi19:06:33

if you get http 500 with schema error, it's response validatipn, 400 is for request

ikitommi19:06:40

Hope this helps

Andreasp199423:06:02

Hey is it possible to use swagger with spec rather than Schema???