grape-swagger
grape-swagger copied to clipboard
memory issues with large ranges
I had an API definition that looked like:
requires :blahvalue, :type => Integer, values: 1262358112..3000000000, :desc => "foo"
This was designed to use a range to check to do basic validation. However, this blows up in the following code:
enum_values = enum_values.to_a if enum_values && enum_values.is_a?(Range)
to_a expands the range completely into an array. Which is very dangerous :)
This has been discussed and is definitely a problem, I'd appreciate a PR/fix.
Actually dup with https://github.com/tim-vandecasteele/grape-swagger/issues/235.