grape
grape copied to clipboard
field using types turned into array when declared(params)
It seems that the recent works on declared change the interaction between 'declared' and the 'types' field
1 Warning | |
---|---|
:warning: | Unless you’re refactoring existing code, please update CHANGELOG.md. |
Here's an example of a CHANGELOG.md entry:
* [#2112](https://github.com/ruby-grape/grape/pull/2112): Field using type turned into array when declared(params) - [@braktar](https://github.com/braktar).
Generated by :no_entry_sign: danger
what was the behavior in 1.3.x, 1.4.x?
either way looks like a bug, another one... /cc: @tlconnor
Related https://github.com/ruby-grape/grape/pull/2103
Before the integration of #2103 the spec passed successfully
Here is a fix which avoid the misinterpretation of the type
That's strange that the type of empty_typed_arr turned from Array[String] to [String] when arrived into handle_passed_param
Let's extend tests with Hash
and Set
along with Array?
Let's extend tests with
Hash
andSet
along with Array?
I don't really see what should exhibit these tests, as the only ambiguity is between types : [x, y]
and type: Array[x, y]
which both give type: [x, y] while processed.
It seems to require a deeper investigation
Let's extend tests with
Hash
andSet
along with Array?I don't really see what should exhibit these tests, as the only ambiguity is between
types : [x, y]
andtype: Array[x, y]
which both give type: [x, y] while processed.It seems to require a deeper investigation
I mean what happens if requires :bar, type: Hash do ...
?
@stanhu isn't this the same?
Yes, it's the same. I just picked the commit in https://github.com/ruby-grape/grape/pull/2117.