Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rest 显示招摇过市验证信息_Rest_Api_Swagger - Fatal编程技术网

Rest 显示招摇过市验证信息

Rest 显示招摇过市验证信息,rest,api,swagger,Rest,Api,Swagger,Swagger UI不显示请求参数的验证信息。 我想显示参数的最小值、最大值、格式、模式(regex)。有人知道我如何在Swagger UI上表示参数的验证信息吗?假设您使用Swagger UI 3.x(最新版本),请将showCommonExtensions:true添加到index.html文件中的Swagger UI初始化代码中: const ui=SwaggerUIBundle({ “dom_id”:“招摇过市用户界面”, url:“https://petstore.swagger.io

Swagger UI不显示请求参数的验证信息。
我想显示参数的最小值、最大值、格式、模式(regex)。有人知道我如何在Swagger UI上表示参数的验证信息吗?

假设您使用Swagger UI 3.x(最新版本),请将
showCommonExtensions:true
添加到
index.html
文件中的Swagger UI初始化代码中:

const ui=SwaggerUIBundle({
“dom_id”:“招摇过市用户界面”,
url:“https://petstore.swagger.io/v2/swagger.json",

showCommonExtensions:true,//通过使用openapi 3.0.0,我得到了一个包含中显示的验证信息的UI。从openapi 2到openapi 3的转换可以通过以下URL完成。

您是如何安装Swagger UI的?您是否使用从下载(或通过npm安装)的普通版本,或者您是否使用与某些框架/库(例如Swashback或Springfox)捆绑的Swagger UI?