You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Yilialinn (via GitHub)" <gi...@apache.org> on 2026/04/14 03:07:37 UTC

[PR] docs: port request-validation plugin documentation [apisix]

Yilialinn opened a new pull request, #13219:
URL: https://github.com/apache/apisix/pull/13219

   ## Summary
   
   - Port `request-validation` plugin documentation from API7 docs to APISIX
   - Include all three tabs: Admin API, ADC, and Ingress Controller (Gateway API / APISIX CRD)
   - Add both EN and ZH translations
   - Fix original bug: URL-encoded form success response incorrectly said "400 Bad Request" instead of "200 OK"
   
   ## Related issue
   
   https://github.com/api7/docs/issues/892


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: port request-validation plugin documentation [apisix]

Posted by "Yilialinn (via GitHub)" <gi...@apache.org>.
Yilialinn merged PR #13219:
URL: https://github.com/apache/apisix/pull/13219


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: port request-validation plugin documentation [apisix]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13219:
URL: https://github.com/apache/apisix/pull/13219#discussion_r3081049972


##########
docs/en/latest/plugins/request-validation.md:
##########
@@ -30,6 +30,9 @@ description: The request-validation Plugin validates requests before forwarding
   <link rel="canonical" href="https://docs.api7.ai/hub/request-validation" />
 </head>
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';

Review Comment:
   In MDX, ESM `import` statements must be placed before any other content (including JSX/HTML like `<head>...</head>`). Keeping imports after the `<head>` block can break MDX compilation/build. Move the `import Tabs` / `import TabItem` lines to the very top of the document (typically right after frontmatter, before any markup).



##########
docs/en/latest/plugins/request-validation.md:
##########
@@ -71,6 +74,17 @@ The following example demonstrates how to validate request headers against a def
 
 Create a Route with `request-validation` Plugin as follows:
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>

Review Comment:
   The `groupId` values (`\"api\"` and elsewhere `\"k8s-api\"`) are very generic. Docusaurus persists tab selection by `groupId` across the whole site, so generic IDs can cause unrelated pages to affect each other's selected tab. Use page-/plugin-specific group IDs (e.g., `request-validation-api` and `request-validation-k8s-api`) to avoid cross-page collisions.



##########
docs/zh/latest/plugins/request-validation.md:
##########
@@ -71,6 +74,17 @@ admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed 's/"/
 
 使用 `request-validation` 插件创建路由,如下所示:
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>

Review Comment:
   This same Admin API / ADC / Ingress Controller tab block is repeated multiple times in the document (and similarly for the nested K8s tabs). To reduce duplication and the chance of sections drifting out of sync, consider extracting a small MDX component (or using an include/partial supported by your docs toolchain) that renders the common tab scaffolding and only varies the per-section content.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org