Abstract routing API sorts routes.
Fixes #1879.
Changes proposed in this pull request:
- This PR is based on comments in PR #1898
- Fix moved from
RoutingMiddlewaretoAbstractRoutingAPI
Let me know if anything else needs adjustments.
Just an FYI that I've confirmed this fixes routing bugs in connexion that exist today.
For example, attempt to add these 2 routes:
paths:
/users/{user_id}:
get:
/users/accept:
get:
In 3.1.0 GET /users/accept is routed to GET /users/{user_id}
Not sure if there's more needed in this PR to get it merged but we've had to fork connexion until it will be as AsyncApp broke our routing.
LMK if I can help out with some test cases or whatever to get this rolling.
CC: @RobbeSneyders
coverage: 94.153% (+0.003%) from 94.15% when pulling 8111037367200967155c6a56438350ccc3f1d097 on BorekZnovustvoritel:sort-routes-api into 7c4fcc4785da8ee6d671315b9e0be5499a980334 on spec-first:main.
@dkoston adding a test would be very much appreciated and will prevent us from accidentally breaking the behavior in the future.
@RobbeSneyders is there any documentation on how to run the test suite?
I added some tests but running the lines from .github/workflows/pipline.yml results in almost all tests failing even though I haven't changed any code other than adding a test.
pip install --upgrade pip
pip install "poetry<2" "tox<4" "tox-gh-actions<3" "coveralls<4"
tox
@RobbeSneyders is there any documentation on how to run the test suite?
I added some tests but running the lines from .github/workflows/pipline.yml results in almost all tests failing even though I haven't changed any code other than adding a test.
pip install --upgrade pip pip install "poetry<2" "tox<4" "tox-gh-actions<3" "coveralls<4" tox
@RobbeSneyders @jmcs LMK if you have some docs on how to run the test suite locally and I'll get these tests completed. Thanks!