-
Notifications
You must be signed in to change notification settings - Fork 473
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
Patch to handle Array Declaration #237 #268
Conversation
@@ -47,6 +47,12 @@ def parse_params(params, path, method) | |||
'double' | |||
when 'Symbol' | |||
'string' | |||
when /^\[(.*)\]$/ |
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 use a named field here, like type. That avoids having a last_match[1]
and is probably clearer.
If it's OK I can squash them. |
when /^\[(?<type>.*)\]$/ | ||
items[:type] = Regexp.last_match[:type].downcase | ||
if PRIMITIVE_MAPPINGS.key?(items[:type]) | ||
items[:type], items[:format] = PRIMITIVE_MAPPINGS[items[:type]] |
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.
I re-read this and find it a bit strange (or at least looks like a side-effect) that we're assigning items[]
inside the case statement. Feels like this logic belongs below where we deal with items
? I am not sure though, what do you think?
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.
Later we deal with parsed_params[:type], not items[:type], items just affected into parsed_params[:items].
Please squash and update CHANGELOG. Thanks. |
Squashed + changelog done |
Patch to handle Array Declaration #237
Merged. |
Patch to handle Array Declaration #237