Fork me on GitHub
#ring-swagger
<
2019-09-13
>
awb9917:09:54

This is what I get with (ok 123)

awb9917:09:17

Is it possible to return integers in the metosin compojure sweet library?

awb9917:09:01

My usecase is a simple one: I have to re-create the api that one of my frontend componets uses,

awb9917:09:11

I have the complete api implemented with compojure,

awb9917:09:31

and returning integer only (without a map as a wrapper) fucks up.

ikitommi18:09:00

@hoertlehner Hi. I recall you can force the response encoding by defining a :return definition. E.g. with Schema add :return Long to the route. Also validates the response

ikitommi18:09:41

If you don't want the response validation & swagger docs, you can either a) encode it manually b) add a hint to response that it needs to be encoded

ikitommi18:09:56

By default, only collections are auto-encoded.

awb9918:09:08

Oh nice!!!

awb9918:09:10

It is working!

awb9918:09:31

I tried that before with :return {:result Long}

awb9918:09:47

but obviously that meant I return a map with :result property of Type Long.

awb9918:09:49

🙂

awb9918:09:53

THANK YOU SO MUCH!!

4