-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed the range :values options, now it does not fail with float range #234
Fixed the range :values options, now it does not fail with float range #234
Conversation
00627be
to
20b87e9
Compare
Grape below 0.11.0 has same bug: it tried to iterate through range without checking if it can be done. |
The tests for these older versions of Grape should be skipped. I think you can just condition the tests on the version of Grape and I would be ok to merge. |
@@ -9,6 +9,7 @@ | |||
#### Fixes | |||
|
|||
* [#232](https://github.com/tim-vandecasteele/grape-swagger/pull/232): Fixed missing raw array params - [@u2](https://github.com/u2). | |||
* [#234](https://github.com/tim-vandecasteele/grape-swagger/pull/234): Fixed the range :values options, now it does not fail with float range - [@azhi](https://github.com/azhi). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe simpler: "Fixed range :values with float" or something like that?
As you pointed out in #233 you cannot be converting ranges into arrays - it would be eating a lot of memory and take a very long time. We need a better solution. |
now range values is exposed as array in enum field only if it is Integer or String range float range or procs returning non-array values is exposed as string fixes ruby-grape#233
20b87e9
to
7b5573d
Compare
Updated. @dblock i think the proper solution would be not to convert ranges to enums at all. However, this feature was in the release and some people might be using it. Also we could try some dirty hack like convert to an array only if Range#size is less then some amount (say, 50). But that seems very odd to me. |
I am going to merge this. Could you open a new issue regarding the Range problem? Thanks. |
Fixed the range :values options, now it does not fail with float range
now range values is exposed as array in enum field only if it is Integer or
String range
float range or procs returning non-array values is exposed as string
fixes #233