Property with type array doesn't have size or uniqueness validation

Issue #142 resolved
Former user created an issue

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)

  1. James Navin

    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.

  2. Log in to comment