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 2025/02/06 09:33:42 UTC

[PR] docs: improve public-api plugin docs [apisix]

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

   ### Description
   
   <!-- Please include a summary of the change and which issue is fixed. -->
   <!-- Please also include relevant motivation and context. -->
   
   Fixes # (issue)
   
   ### 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](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


-- 
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: improve public-api plugin docs [apisix]

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


##########
docs/en/latest/plugins/public-api.md:
##########
@@ -42,6 +42,8 @@ The `public-api` Plugin exposes an internal API endpoint, making it publicly acc
 
 ## Example

Review Comment:
   ```suggestion
   ## Examples
   ```



-- 
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: improve public-api plugin docs [apisix]

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


##########
docs/en/latest/plugins/public-api.md:
##########
@@ -26,189 +26,78 @@ description: The public-api is used for exposing an API endpoint through a gener
 #
 -->
 
-## Description
-
-The `public-api` is used for exposing an API endpoint through a general HTTP API router.
-
-When you are using custom Plugins, you can use the `public-api` Plugin to define a fixed, public API for a particular functionality. For example, you can create a public API endpoint `/apisix/batch-requests` for grouping multiple API requests in one request using the [batch-requests](./batch-requests.md) Plugin.
+<head>
+  <link rel="canonical" href="https://docs.api7.ai/hub/public-api" />
+</head>
 
-:::note
-
-The public API added in a custom Plugin is not exposed by default and the user should manually configure a Route and enable the `public-api` Plugin on it.
+## Description
 
-:::
+The `public-api` Plugin exposes an internal API endpoint, making it publicly accessible. One of the primary use cases of this Plugin is to expose internal endpoints created by other Plugins.
 
 ## Attributes
 
-| Name | Type   | Required | Default | Description                                                                                                                                                  |
-|------|--------|----------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| uri  | string | False    | ""      | URI of the public API. When setting up a Route, use this attribute to configure the original public API URI. |
+| Name    | Type      | Required | Default | Valid Values | Description |
+|---------|-----------|----------|---------|--------------|-------------|
+| uri     | string    | False    | -       | -            | Internal endpoint to expose. If not configured, expose the Route URI. |

Review Comment:
   no need to put `-` for nil values



##########
docs/en/latest/plugins/public-api.md:
##########
@@ -4,7 +4,7 @@ keywords:
   - Apache APISIX
   - API Gateway
   - Public API
-description: The public-api is used for exposing an API endpoint through a general HTTP API router.
+description: The `public-api` plugin exposes an internal API endpoint, making it publicly accessible. One of the primary use cases of this plugin is to expose internal endpoints created by other plugins.

Review Comment:
   remove ticks



##########
docs/zh/latest/plugins/public-api.md:
##########
@@ -4,7 +4,7 @@ keywords:
   - APISIX
   - API 网关
   - Public API
-description: 本文介绍了 public-api 的相关操作,你可以使用 public-api 插件保护你需要暴露的 API 的端点。
+description: `public-api` 插件公开了一个内部 API 端点,使其可被公开访问。该插件的主要用途之一是公开由其他插件创建的内部端点。

Review Comment:
   ditto, let's see if it resolves this error
   
   <img width="1045" alt="image" src="https://github.com/user-attachments/assets/84dfdc22-d544-4fc2-bcc1-f470ca243993" />
   



##########
docs/zh/latest/plugins/public-api.md:
##########
@@ -26,202 +26,78 @@ description: 本文介绍了 public-api 的相关操作,你可以使用 public
 #
 -->
 
-## 描述
-
-`public-api` 插件可用于通过创建路由的方式暴露用户自定义的 API。
-
-你可以通过在路由中添加 `public-api` 插件,来保护**自定义插件为了实现特定功能**而暴露的 API。例如,你可以使用 [batch-requests](./batch-requests.md) 插件创建一个公共 API 端点 `/apisix/batch-requests` 用于在一个请求中组合多个 API 请求。
+<head>
+  <link rel="canonical" href="https://docs.api7.ai/hub/public-api" />
+</head>
 
-:::note 注意
-
-默认情况下,在自定义插件中添加的公共 API 不对外暴露的,你需要手动配置一个路由并启用 `public-api` 插件。
+## 描述
 
-:::
+`public-api` 插件公开了一个内部 API 端点,使其可被公开访问。该插件的主要用途之一是公开由其他插件创建的内部端点。
 
 ## 属性
 
-| 名称  | 类型   | 必选项    | 默认值   | 描述                                                        |
-|------|--------|----------|---------|------------------------------------------------------------|
-| uri  | string | 否       | ""      | 公共 API 的 URI。在设置路由时,使用此属性来配置初始的公共 API URI。 |
+| 名称  | 类型   | 必选项 | 默认值 | 有效值 | 描述 |
+|------|--------|-------|-------|------|------|
+| uri  | string | 否    | -  | -  | 内部端点的 URI。如果未配置,则暴露路由的 URI。|

Review Comment:
   remove dashes for empty values



-- 
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: improve public-api plugin docs [apisix]

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


-- 
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: improve public-api plugin docs [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on PR #11951:
URL: https://github.com/apache/apisix/pull/11951#issuecomment-2670407420

   Should add the batch processing example back. Do not merge yet.


-- 
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