This fixes a bug in validation of intersections with multiple unions. If the intersection includes at least three unions, only the first schema per union is accepted. One of the unions must have an overlapping required property to hit this bug.
I have written a failing test in f4531619fa75064cd980fe4d5f6c1654da4c3186, and fixed it in f5f5fdb3ffc9630ec245f1e5b62b472b0377d0e0.
[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
[x] Have you written unit tests?
[x] Have you written unit tests that cover the negative cases (i.e.: if bad data is submitted, does the library respond properly)?
[ ] This PR is associated with an existing issue?
Closing issues
Put closes #XXXX (where XXXX is the issue number) in your comment to auto-close the issue that your PR fixes.
Test plan
I've written parameterized tests to cover all valid schema combinations, and parameterized tests for invalid inputs covering invalid dataypes, missing required properties, and excess properties.
This fixes a bug in validation of intersections with multiple unions. If the intersection includes at least three unions, only the first schema per union is accepted. One of the unions must have an overlapping required property to hit this bug.
I have written a failing test in f4531619fa75064cd980fe4d5f6c1654da4c3186, and fixed it in f5f5fdb3ffc9630ec245f1e5b62b472b0377d0e0.
There has been similar work in the past on intersection validation in https://github.com/lukeautry/tsoa/pull/888.
All Submissions:
Closing issues
Put
closes #XXXX
(where XXXX is the issue number) in your comment to auto-close the issue that your PR fixes.Test plan
I've written parameterized tests to cover all valid schema combinations, and parameterized tests for invalid inputs covering invalid dataypes, missing required properties, and excess properties.