Skip to content

feat: support ctx.var.post_arg for vars based route matching on request body #12388

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

Merged
merged 2 commits into from
Jul 1, 2025

Conversation

Revolyssup
Copy link
Contributor

@Revolyssup Revolyssup commented Jun 30, 2025

Description

Currently post_arg doesn't support matching ctx.var based on the JSON body of a request or constructing complex query to match nested JSON on the request body . This PR adds support for it.

ctx.var.post_arg can be used to match on the basis of request body for three formats - JSON, multipart and url-encoded.

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 this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jun 30, 2025
@Revolyssup Revolyssup changed the title feat: ctx.var.post_arg support application/json feat: support multiple content type on ctx.var.post_arg Jun 30, 2025
@Revolyssup Revolyssup changed the title feat: support multiple content type on ctx.var.post_arg feat: support multiple content type on ctx.var.post_arg for vars based route matching Jun 30, 2025
@Revolyssup Revolyssup changed the title feat: support multiple content type on ctx.var.post_arg for vars based route matching feat: support ctx.var.post_arg for vars based route matching on request body Jun 30, 2025
Copy link
Member

@membphis membphis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Revolyssup Revolyssup merged commit 152077c into apache:master Jul 1, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants