connexion icon indicating copy to clipboard operation
connexion copied to clipboard

Abstract routing API sorts routes.

Open BorekZnovustvoritel opened this issue 1 year ago • 5 comments

Fixes #1879.

Changes proposed in this pull request:

  • This PR is based on comments in PR #1898
  • Fix moved from RoutingMiddleware to AbstractRoutingAPI

Let me know if anything else needs adjustments.

BorekZnovustvoritel avatar Jun 19 '24 09:06 BorekZnovustvoritel

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

dkoston avatar Oct 31 '24 21:10 dkoston

Coverage Status

coverage: 94.153% (+0.003%) from 94.15% when pulling 8111037367200967155c6a56438350ccc3f1d097 on BorekZnovustvoritel:sort-routes-api into 7c4fcc4785da8ee6d671315b9e0be5499a980334 on spec-first:main.

coveralls avatar Oct 31 '24 23:10 coveralls

@dkoston adding a test would be very much appreciated and will prevent us from accidentally breaking the behavior in the future.

RobbeSneyders avatar Oct 31 '24 23:10 RobbeSneyders

@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

dkoston avatar Nov 04 '24 23:11 dkoston

@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!

dkoston avatar Dec 03 '24 17:12 dkoston