Fork me on GitHub
#ring-swagger
<
2019-01-07
>
Bao13:01:35

Hi everyone, I'm trying to include this custom type Foo (def Foo (s/named (s/pred (partial re-find #"100-\d+")) 'Foo)) into a schema:

(s/defschema Bar
  {:foo   [Foo]}) ; this does not work

(s/defschema Bar
  {:foo   Foo})   ; this works, but how do I make it an array?
Swagger shows error "Uncaught TypeError: Cannot read property '$ref' of null" for the first example. Would really appreciate any help!

ikitommi14:01:59

@baonguyen1201 would (s/defschema Foo #"100-\d") work?