Skip to content

docs(router): explain priority for overlapping parameterized routes - #14282

Open
Zi-Yi-Ming wants to merge 1 commit into
apache:masterfrom
Zi-Yi-Ming:docs/radixtree-parameter-priority
Open

Zi-Yi-Ming wants to merge 1 commit into
apache:masterfrom
Zi-Yi-Ming:docs/radixtree-parameter-priority

Conversation

@Zi-Yi-Ming

Copy link
Copy Markdown

Description

Add an example to the English and Chinese Radixtree guides that uses priority to resolve an overlap between /languages/:tenant/all and /languages/:tenant/:language. The two requests show how the literal all route handles /all while the parameter route handles /en.

Send the existing /hello priority check to the APISIX listener on port 9080 so the example exercises route selection.

Related issue

Refs #13439.

Validation

  • Applied the route definitions and ran the verification requests extracted from each guide against APISIX on OpenResty 1.31.9.1 with an isolated etcd prefix. All eight route definitions and six documented response checks passed.
  • Increased the priority of the second /hello route and verified that the gateway selected its backend. Lowered the priority of the literal all route and verified that the parameter route handled the overlap.
  • markdownlint-cli@0.25.0, the Chinese line segmentation and copywriting checks, and git diff --check passed.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect the changes made in the PR
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

The validation above runs the documented commands against APISIX.

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.

1 participant