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

Uri template rewrite #10921

Merged
merged 3 commits into from
Jun 24, 2024
Merged

Uri template rewrite #10921

merged 3 commits into from
Jun 24, 2024

Conversation

dstepanov
Copy link
Contributor

This is an attempt to get rid of the old UriTemplate, UriMatchTemplate, and UriTypeMatchTemplate (not used in Core). The implementation of matching/expanding is very confusing and hard to understand, with all the things being changed in the inherited constructor methods, etc. It does not allow adding any changes that we might need.

The new implementation is split into a parser, an expander, and an alternative URI template matcher. The matcher now matches segments of the path, allowing to match without always using the regexp; this should improve the performance of matching basic /hello or /hello/{world}. In the future, we can implement routing, which will combine similar segments into one, reducing the complexity for N to something better, considering most routes share the same prefix.

The new matcher passes previous tests and is now used to match the routes. However, there are still some cases where the old template is used: resolving conflicts and the URI builder. Next, I will investigate what needs to be aligned with the JAX-RS implementation.

Unfortunately, the classes are public and cannot be removed or changed, so we have a new implementation until v5.

Copy link

sonarcloud bot commented Jun 19, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
2 New Bugs (required ≤ 0)
1 New Critical Issues (required ≤ 0)
1 New Blocker Issues (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@dstepanov
Copy link
Contributor Author

@graemerocher Pls merge

@graemerocher graemerocher merged commit 7fae865 into 4.6.x Jun 24, 2024
16 of 17 checks passed
@graemerocher graemerocher deleted the urire branch June 24, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants