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

Further improvements to path matching #64

Merged
merged 1 commit into from
Mar 27, 2015

Conversation

pipermerriam
Copy link
Owner

cc @alvarocavalcanti

What is the problem / feature ?

Trying to match the path /v1/accounts/23 against a schema with the following paths throws an error.

paths:
    - "/v1/accounts/{account_id}"
    - "/v1/accounts/{account_id}/subscriptions"

How did it get fixed / implemented ?

Changed the logic around picking from multiple matches to choose the longest api path. This doesn't actually fix #58 but it still improves the situation.

How can someone test / see it ?

Match the path /v1/accounts/23 against a schema with the following paths and see that it matches the /subscriptions one correctly.

paths:
    - "/v1/accounts/{account_id}"
    - "/v1/accounts/{account_id}/subscriptions"

Here is a cute animal picture for your troubles...

tumblr_n85i8amqlh1s8mgkyo1_500

pipermerriam added a commit that referenced this pull request Mar 27, 2015
…-matching

Further improvements to path matching
@pipermerriam pipermerriam merged commit 62507f6 into master Mar 27, 2015
@pipermerriam pipermerriam deleted the piper/issues-58-improve-path-matching branch March 27, 2015 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve api path matching
1 participant