ring-swagger

ring-swagger & compojure-api
Daouda 2018-11-28T02:44:05.127400Z

hey guys 🙂

Daouda 2018-11-28T02:45:53.128500Z

how can i achive this: :space [[s/int or s/Str]]

Daouda 2018-11-28T02:50:16.128700Z

Daouda 2018-11-28T02:54:21.130300Z

I think i should use oneOf, but i have no idea how to do it in a compojure-api project

ikitommi 2018-11-28T06:44:08.131400Z

@quieterkali try s/if or s/cond-pre, see https://github.com/plumatic/schema/blob/master/README.md#other-schema-types

😀 1
Daouda 2018-11-28T08:52:39.132Z

thank you @ikitommi 🙂

Daouda 2018-11-28T09:55:31.139300Z

hey guys, maybe i am wrong, but look like s/if or s/cond-pre are used for specifiying if you datatype will be a map or vector or whatever. What i am looking for is a way to say that something will be a vector of vector and it could have inside it schema A or schema B or nil or or even three of them at the same time. Something like (s/defschema schema-name {:name s/Str :space s/if [[A B nil]] [[A nil]] [[B nil]] [[nil]]})

Daouda 2018-11-28T09:56:37.140100Z

can anyone show me a way to achieve that with an example please?

ikitommi 2018-11-28T12:36:33.141500Z

@quieterkali there is #schema too for purely schema-related questions.

Daouda 2018-11-28T12:41:26.141900Z

thanks @ikitommi 🙂