Fork me on GitHub
#ring-swagger
<
2016-09-28
>
miikka06:09:42

@rickmoynihan, looking at your snippet, it looks like it should work, and I don't think that inline dereferencing will help here.

miikka06:09:07

How are you calling the validator, though? The error looks like you aren't passing the whole schema to scjsv

rickmoynihan09:09:58

mikka: ahh Thanks - you appear to be correct... Not sure how to resolve it though... the yaml snippet above is a small part of my swagger spec which is in a single file. How can I tell the validator to validate an array of :Users (which references :User)?

rickmoynihan09:09:55

@miikka: My swagger schema :definitions parses into this: structure ⬇️

miikka10:09:18

So if you have an array of :Users, you ultimately have array of array of :User?

miikka10:09:45

Anyway, maybe the simplest thing would be to embed those definitions into a simple JSON schema and validate against that

miikka10:09:08

{:type "array"
 :items {:$ref "#/definitions/Users" }
 :definitions { ... }}

rickmoynihan12:09:04

I was hoping to do it without any additional munging - but that makes sense - I'll give it a try

john.carnell20:09:59

hey guys does anyone have an example of how to implement a constrain swagger. I am trying to enforce that a integer value on a parameter must be greater then 60. I see a constrained option, but an example would be awesome

mtkp20:09:44

how about this? : (schema.core/constrained Int #(< 60 %) 'greater-than-60)

mtkp20:09:48

the symbol at the end is optional, can maybe give clients a more readable error message