-
Notifications
You must be signed in to change notification settings - Fork 472
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
Fix array_use_braces for body params #757
Fix array_use_braces for body params #757
Conversation
277831b
to
bf22627
Compare
Previously this is what was generated: `"attr":{"type":"array","items":{"type":"object","properties":{"":{"type":"string"}}}}` instead of `"attr":{"type":"array","items":{"type":"string"}}` in case this attribute was nested in a Hash attribute with "body" in `param_type`
bf22627
to
89f113b
Compare
def array_use_braces?(options) | ||
settings[:array_use_braces] && !(options[:documentation] && options[:documentation][:param_type] == 'body') | ||
def array_use_braces? | ||
@array_use_braces ||= settings[:array_use_braces] && !includes_body_param? |
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.
where are the settings come from, is it configurable?
if yes, then it should be described in the README
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.
It's described here: https://github.com/ruby-grape/grape-swagger#array_use_braces
thanks @bikolya … |
Previously this is what was generated: `"attr":{"type":"array","items":{"type":"object","properties":{"":{"type":"string"}}}}` instead of `"attr":{"type":"array","items":{"type":"string"}}` in case this attribute was nested in a Hash attribute with "body" in `param_type`
Previously this is what was generated:
"attr":{"type":"array","items":{"type":"object","properties":{"":{"type":"string"}}}}
instead of
"attr":{"type":"array","items":{"type":"string"}}
in case this attribute was nested in a Hash attribute with "body" in
param_type
Definition:
Here is how it looked like it Swagger UI:
instead of