Skip to content

Fix Open Api: issue with multiple required fields #438

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

Merged

Conversation

rennanoliveira
Copy link
Contributor

Issue #429
When multiple required fields were set, only one of them would show on the Open Api schema.
The required list would only be populated by the first required value.
This PR changes it so that multiple required values are able to be set on the schema

before:

fields.each do |field|
#...
  current[:required] ||= [] << field[:name] if field[:required]
end

after:

fields.each do |field|
#... 
  if field[:required]
    current[:required] ||= []
    current[:required] << field[:name]
  end
end

@rennanoliveira rennanoliveira changed the title Fix issue with multiple required fields for open api Fix Open Api: issue with multiple required fields Apr 15, 2019
@rennanoliveira
Copy link
Contributor Author

Hello @oestrich

Does this fix make sense to you? Is there anything you feel needs change on this?

@oestrich oestrich merged commit 54fbfda into zipmark:master Apr 24, 2019
@oestrich
Copy link
Contributor

Looks good. Thanks! Sorry for the delay

@rennanoliveira rennanoliveira deleted the fix-open-api-writer-required branch March 25, 2020 14:08
@StanisLove
Copy link

It will be great if such fixes are released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants