You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/06/19 09:07:23 UTC

[GitHub] [apisix-dashboard] shuqingzai opened a new issue, #2479: 导入 OpenAPI3.0 文档,数据验证

shuqingzai opened a new issue, #2479:
URL: https://github.com/apache/apisix-dashboard/issues/2479

   ### Issue description
   
   文档: [Import OpenAPI Guide](https://apisix.apache.org/zh/docs/dashboard/IMPORT_OPENAPI_USER_GUIDE) 使用 [request-validation](https://apisix.apache.org/zh/docs/apisix/plugins/request-validation/) 插件作为验证
   请问如何为每个字段编写自定义错误信息?如: `title` 我想显示 **标题不正确**
   我似乎没有找到响应的文档
   
   ### Expected behavior
   
   可以针对每个字段设置错误信息
   
   ### How to Reproduce
   
   文档没有说明
   
   ### Screenshots
   
   _No response_
   
   ### Environment
   
   [apisix-dashboard](https://github.com/apache/apisix-dashboard) 版本 : `v2.13`
   
   ### Additional context
   
   _No response_


-- 
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.apache.org

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


[GitHub] [apisix-dashboard] shuqingzai commented on issue #2479: 导入 OpenAPI3.0 文档,数据验证

Posted by GitBox <gi...@apache.org>.
shuqingzai commented on issue #2479:
URL: https://github.com/apache/apisix-dashboard/issues/2479#issuecomment-1160182810

   > Hi, @shuqingzai
   > 
   > In the current implementation, OpenAPI import will generate the response route, which will open the request-validation plugin, and if you need to make changes to it, you can directly modify the route configuration. However, as far as I know, this plugin does not support customizing the error response for a single field. You can take a look at this document. https://apisix.apache.org/docs/apisix/plugins/request-validation
   
   这个我看过,就是没有看到自定义单个字段错误信息,所以问问,有别的方式吗?只能定义一条错误信息?字段不同,提示语应该都不同吧


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


[GitHub] [apisix-dashboard] shuqingzai commented on issue #2479: 导入 OpenAPI3.0 文档,数据验证

Posted by GitBox <gi...@apache.org>.
shuqingzai commented on issue #2479:
URL: https://github.com/apache/apisix-dashboard/issues/2479#issuecomment-1165191573

   > > 这个我看过,就是没有看到自定义单个字段错误信息,所以问问,有别的方式吗?只能定义一条错误信息?字段不同,提示语应该都不同吧
   > 
   > Sorry for the slow response. The error message will be output by the jsonschema validation engine and normally we cannot change its output unless we change the jsonschema validation engine code or override its return value in a custom plugin.
   
   所以是没有办法了吗?只能统一的错误吗?


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


[GitHub] [apisix-dashboard] shuqingzai commented on issue #2479: 导入 OpenAPI3.0 文档,数据验证

Posted by GitBox <gi...@apache.org>.
shuqingzai commented on issue #2479:
URL: https://github.com/apache/apisix-dashboard/issues/2479#issuecomment-1200859091

   > Hi, @shuqingzai
   > 
   > In the current implementation, OpenAPI import will generate the response route, which will open the request-validation plugin, and if you need to make changes to it, you can directly modify the route configuration. However, as far as I know, this plugin does not support customizing the error response for a single field. You can take a look at this document. https://apisix.apache.org/docs/apisix/plugins/request-validation
   
   请问该插件可以统一定义 `rejected_msg`,如果在 `openapi.yaml` 导入时,如果定义这个全局的`rejected_msg ` ??? 


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


[GitHub] [apisix-dashboard] bzp2010 commented on issue #2479: 导入 OpenAPI3.0 文档,数据验证

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on issue #2479:
URL: https://github.com/apache/apisix-dashboard/issues/2479#issuecomment-1165074399

   > 这个我看过,就是没有看到自定义单个字段错误信息,所以问问,有别的方式吗?只能定义一条错误信息?字段不同,提示语应该都不同吧
   
   Sorry for the slow response.
   The error message will be output by the jsonschema validation engine and normally we cannot change its output unless we change the jsonschema validation engine code or override its return value in a custom plugin.
   


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


[GitHub] [apisix-dashboard] bzp2010 commented on issue #2479: 导入 OpenAPI3.0 文档,数据验证

Posted by GitBox <gi...@apache.org>.
bzp2010 commented on issue #2479:
URL: https://github.com/apache/apisix-dashboard/issues/2479#issuecomment-1160175220

   Hi, @shuqingzai 
   
   In the current implementation, OpenAPI import will generate the response route, which will open the request-validation plugin, and if you need to make changes to it, you can directly modify the route configuration.
   However, as far as I know, this plugin does not support customizing the error response for a single field. You can take a look at this document. https://apisix.apache.org/docs/apisix/plugins/request-validation
   
   


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