Property with type array doesn't have size or uniqueness validation
Issue #142
resolved
Hi all,
I have a property with type array, specified under an object like so:
places:
type: array
minItems: 0
maxItems: 1
items:
$ref: "#/definitions/Place"
However, when I run a request with 2 items in this particular Places array in the body, the validator doesn't catch this and I'm getting an empty validation report. I'm also not getting a uniqueness catch when I put in two of the same items (e.g. [ {placeId: 123}, {placeId: 123}]).
Not sure if I'm writing the Swagger wrong or if this isn't supported.
Thanks in advance!
Comments (2)
-
-
- changed status to resolved
I have tested in 2.0.0-rc3 and min/max/uniqueness appear to be working ok, even for non-primitive array items.
Can you please test against this version - if you still have the problem feel free to re-open this issue and I'll investigate further.
Thanks.
- Log in to comment
Hi - thanks for raising this.
Can I please check what version you're using. Thanks.