Skip to content

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

Merged
Revolyssup merged 2 commits into
apache:masterfrom
Revolyssup:revolyssup/support-json
Jul 1, 2025
Merged

feat: support ctx.var.post_arg for vars based route matching on request body#12388
Revolyssup merged 2 commits into
apache:masterfrom
Revolyssup:revolyssup/support-json

Conversation

@Revolyssup

@Revolyssup Revolyssup commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

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

@membphis membphis left a comment

Copy link
Copy Markdown
Member

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