@evilbubu has joined the channel
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].
Hi! One cant determine type of s/pred. You could try (s/constrained s/Str seq 'not-empty). pred could give better error thou...
hiya! ha! thought we did something we weren't supposed to 🙂
and it's the same with (s/maybe) etc too, should not be used I recon.
s/maybe should work fine. The rules for extracting the types from predicates are in the README: https://github.com/metosin/ring-swagger#out-of-the-box-supported-schema-elements & in the source: https://github.com/metosin/ring-swagger/blob/master/src/ring/swagger/json_schema.clj#L143-L243
ah, thank yoouse. One of these days I learn to read documentation properly.
though, the problem seems to be with Arrays. otherwise things work fine indeed.
ah, the primitive-array support is kinda new, please write issues &/ fix 'em with PRs ;)
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 🙂
ha, now I got it, the s/constrained works beautifully in schema for arrays, gives nice documentation too.