-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add required request params to metadata #114
Conversation
@@ -11,7 +11,7 @@ | |||
request, response = extract_request_response(context) | |||
return if request.nil? | |||
|
|||
path, summary, tags, raw_path_params, description, security = extract_request_attributes(request, example) | |||
path, summary, tags, required_request_params, raw_path_params, description, security = extract_request_attributes(request, example) |
Check notice
Code scanning / Rubocop
Checks that line length does not exceed the configured limit.
Thanks for your contribution! I requested a small change. |
Codecov Report
@@ Coverage Diff @@
## master #114 +/- ##
=========================================
Coverage ? 64.56%
=========================================
Files ? 31
Lines ? 649
Branches ? 0
=========================================
Hits ? 419
Misses ? 230
Partials ? 0 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks for your review! Adding "required: false" everywhere shouldn't be breaking change because OpenApi specification suggests that this parameter is default to "false" when omitted. But if you wish to preserve previous behavior we can change code to something like this so required key wouldn't be present when it is not true parameters << {
name: build_parameter_name(key, value),
in: 'query',
schema: build_property(try_cast(value)),
example: (try_cast(value) if example_enabled?),
}.tap do |hash|
hash[:required] = true if record.required_request_params.include?(key)
end.compact |
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.
Sorry for late response.
LGTM 👍
This PR adds ability to specify required request params in metadarta