ruby-grape / grape-swagger

Add OAPI/swagger v2.0 compliant documentation to your grape API
MIT License
1.09k stars 471 forks source link

Document the min/max Items/Length fields if the attribute uses the length validator #934

Closed dhruvCW closed 3 months ago

dhruvCW commented 3 months ago

Grape 2.1.0 Introduced the length validator . We can now use the length validator to specify the min/maxItems (for array types) and min/maxLength (for String types) for the attributes that use the validator in the generated swagger document.

Fixed test that was broken with rack 3 and restricted rack < 3 for grape < 2

dhruvCW commented 3 months ago

Test failures seem unrelated to this PR 🤔 fixed the broken tests.

There grape < 2.0 seems to require rack < 3.0 and there was a test that didn't set it's body that was breaking with rack 3.