Comments (7)
Thank you for reporting this. Since you already have a small reproduction code, could you also turn the issue directory into a working test case first that can be merged as is? Being able to see it as a draft PR would be even more helpful.
from rspec-openapi.
It looks like none of your currently open pull requests has a test case at this point. If you accidentally dropped it, could you resurrect it? I think this repository should have a test that runs a Rails engine.
from rspec-openapi.
It looks like none of your currently open pull requests has a test case at this point. If you accidentally dropped it, could you resurrect it? I think this repository should have a test that runs a Rails engine.
You are right, I have just updated the PR with an engine test.
Please check the PR carefully when you have some time 🙏
It looks correct to me but it's a tricky part.
from rspec-openapi.
Thank you for reporting this. Since you already have a small reproduction code, could you also turn the issue directory into a working test case first that can be merged as is? Being able to see it as a draft PR would be even more helpful.
Sure => #38
It contains also a change to support the case where there's no controller (ex. a route with only a block) and the case of 404 routes (without raising an exception).
BTW, I'm not 100% convinced right now of the third commit (the engine fix) because if the relevant route is the first one it could be ignored in the iterations of the recognize
block.
Also, at the moment, I don't know why recognize
catch more routes than expected.
Investigating a bit:
app.routes.recognize_path(request.path_info, method: request.method)
# => {:controller=>"hello", :action=>"world"}
routes = []; app.routes.router.recognize(request) { |route| routes << route }; routes.count
# => 2
routes.map(&:name)
# => ["my_engine", "hello_world"]
routes.map(&:defaults)
# => [{}, {:controller=>"hello", :action=>"world"}]
from rspec-openapi.
Thank you for filing it. You're still not so sure about your current approach and you expect me to think about it, right? I don't have time to do that right away, so please allow me to find time to work on it.
from rspec-openapi.
Thank you for filing it. You're still not so sure about your current approach and you expect me to think about it, right? I don't have time to do that right away, so please allow me to find time to work on it.
Yeah, I think that the proposed fix is not optimal.
Perhaps I already found a failing edge case with it (I'm making my tests on a project with a lot of different requests).
But I will probably look for a better solution and keep you posted.
from rspec-openapi.
Update: I think I found a better solution - PR updated.
I made some trials and it looks good now.
Please let me know your opinion.
from rspec-openapi.
Related Issues (20)
- Support for OAS 3.1? HOT 2
- Support Minitest's parallel execution HOT 1
- Generated Request Body for Path is using 422 Response HOT 3
- Is there any way to define additionalProperties? or Free-Form Object HOT 5
- Suggestion for the readOnly property HOT 1
- Getting invalid byte sequence in UTF-8 when the response is a pdf HOT 3
- Difference in Empty Values Handling in Examples HOT 3
- Dealing with responses with different possible bodies for the same status code HOT 1
- requestBody should not merge examples for error HOT 2
- Setting additionalProperties = false HOT 1
- Include property descriptions in response schema? HOT 1
- Regenerating (remove file and run rspec) the schema without changing the code, generates different file. HOT 1
- Authorization HTTP header is inserted as parameter even though there is securityScheme defined HOT 2
- Using `RSpec::OpenAPI.path = ->` but for different audiences HOT 1
- Evaluate proc for RSpec::OpenAPI.title HOT 2
- Manually edited oneOf in response schema is overridden HOT 4
- Referenced components in "items" not generated?
- API schema that is not subject to rspec execution is deleted. HOT 1
- Minitest support HOT 2
- Can we support 'required' ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspec-openapi.