Skip to content
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

Manual response validation breaking change in 1.0.0->1.1.0 upgrade #214

Closed
MrBananaLord opened this issue Jan 12, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@MrBananaLord
Copy link
Contributor

MrBananaLord commented Jan 12, 2024

Hi!

I just upgraded to 1.0.0 and then to 1.1.0. I am using the manual response validation (more or less) as follows:

# in my middleware
definition = OpenapiFirst.load(...)
response = @app.call(env)
definition.request(Rack::Request.new(env)).response(Rack::Response[*response]).validate!

My response validation breaks in 1.1.0 with NoMethodError: undefined method 'join' for #<ActionDispatch::Response::RackBody:... on @rack_response.body.join in OpenapiFirst::RuntimeRequest (here) because my @rack_response.body is a ActionDispatch::Response::RackBody.

In the rack repo I found that the body is usually expected to respond to each or call so maybe we could go back to using each? :)

@MrBananaLord MrBananaLord changed the title Manual response validation interface breaking change in 1.0.0->1.1.0 upgrade Manual response validation breaking change in 1.0.0->1.1.0 upgrade Jan 12, 2024
@ahx ahx added the bug Something isn't working label Jan 12, 2024
@ahx
Copy link
Owner

ahx commented Jan 12, 2024

Hi. Thanks for the feedback. I have to admit that I was afraid something could go wrong here, but Rack::Lint did not complain (…). My fault.
I am wondering if there is some tooling in Rack that makes this part simpler. …

I will try to come up with a fix shortly to release 1.1.1

@ahx
Copy link
Owner

ahx commented Jan 12, 2024

Fix released in 1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants