-
Notifications
You must be signed in to change notification settings - Fork 65
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
Hanami support #202
Hanami support #202
Conversation
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.
Awesome 🥇
The change itself LGTM.
Could you fix conflicts?
# Conflicts: # lib/rspec/openapi/schema_merger.rb # spec/apps/rails/app/controllers/additional_properties_controller.rb # spec/apps/rails/app/controllers/masters/extensions_controller.rb # spec/apps/rails/app/controllers/pages_controller.rb # spec/integration_tests/rails_test.rb # spec/integration_tests/roda_test.rb # spec/requests/rails_spec.rb # spec/requests/roda_spec.rb
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.
Rubocop found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #202 +/- ##
==========================================
+ Coverage 97.10% 97.12% +0.01%
==========================================
Files 15 15
Lines 518 521 +3
Branches 126 126
==========================================
+ Hits 503 506 +3
Misses 15 15 ☔ View full report in Codecov by Sentry. |
|
||
header_value = request.get_header(['HTTP', header_key].join('_')) || | ||
request.get_header(header_key) || | ||
request.get_header(header_key.to_s) |
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 found one problem with the new edits - https://github.com/exoego/rspec-openapi/pull/198/files#diff-a79ceb062f9ec26b6203f0b7541bd0a9b1cc2ebf3370cac3da9039f4f11dc1a7R56 - Rack test seems to send strings instead of characters in headers, so because of this edit, headers can no longer be detected.
@AlexeyMatskevich It appears that Hanami 2.0 dropped Ruby 2.7 support https://github.com/hanami/hanami/blob/main/CHANGELOG.md#changed-14 Please install Hanami v1.x when Ruby 2.7, or exclude Hanami test when Ruby 2.7. |
Hanami version 1 and version 2 are essentially two different frameworks, they are not compatible, so I would prefer to just exclude the tests for version 2.7, but I don't see how to implement that yet. |
include SpecHelper | ||
|
||
describe 'yaml output' do |
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.
include SpecHelper | |
describe 'yaml output' do | |
include SpecHelper | |
# Hanami 2.0 support Ruby 3.0+ | |
skip if RUBY_VERSION < '3.0.0' | |
describe 'yaml output' do |
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 think I've succeeded
Thanks! |
As part of this MR, I implemented initial support for Hanami version 2.
Basically I provided a Hanami application, which is a re-implementation of the Rails application, with the only difference that instead of rails engine, I provided hanami slice.
I wrote tests for hanami similarly to the tests for rails.
I have not implemented the tests on minitest as I don't know it.
If you would be interested we could finalise this MR, infuse, and after that within the new MRs I would sea implement the rest of the features.
Of the things that aren't working right now, I can see
/table/1
,/table/2
.Key changes: