Fork me on GitHub
#ring-swagger
<
2016-11-22
>
evilbubu05:11:49

I wonder if I found an oddity from compojure-api (or ring-swagger). When using a prismatic schema predicate as a type for member of array, the swagger UI crashes 😕 I wonder what we do wrong. Indeed the resulting $ref in swagger.json is null. Though, s/Any for example is shown as Array[Inline Model 1].

ikitommi06:11:22

Hi! One cant determine type of s/pred. You could try (s/constrained s/Str seq 'not-empty). pred could give better error thou...

evilbubu06:11:55

hiya! ha! thought we did something we weren't supposed to 🙂

evilbubu06:11:00

and it's the same with (s/maybe) etc too, should not be used I recon.

evilbubu09:11:36

ah, thank yoouse. One of these days I learn to read documentation properly.

evilbubu09:11:51

though, the problem seems to be with Arrays. otherwise things work fine indeed.

ikitommi09:11:01

ah, the primitive-array support is kinda new, please write issues &/ fix 'em with PRs ;)

evilbubu09:11:25

ha, thought about something like that. was one of the reasons I asked if something like that should work for now. Will investigate and would gladly contribute 🙂

evilbubu10:11:34

ha, now I got it, the s/constrained works beautifully in schema for arrays, gives nice documentation too.