[英]Swagger - spring fox - hide password
Swagger - spring fox - hide password. Swagger - spring 狐狸 - 隐藏密码。
In one of our API I need to return alphanumeric code after verifying user id and password.在我们的 API 之一中,我需要在验证用户 ID 和密码后返回字母数字代码。
We are using springfox-swagger-ui-2.3.1 .I have a field "password" where I do not want to show password (instead i want to show "XXXX") when user types in swagger ui.我们正在使用springfox-swagger-ui-2.3.1 。当用户输入 swagger ui 时,我有一个字段“密码”,我不想在其中显示密码(相反我想显示“XXXX”)。
password is defined as @RequestParam(value = "password") String password.密码定义为@RequestParam(value = "password") 字符串密码。
any suggestion is highly appreciated.非常感谢任何建议。
To use password as a parameter type, you can simply override the format like this:要将密码用作参数类型,您可以简单地覆盖如下格式:
@ApiParam(value = "your password", type = "string", format = "password")
@QueryParam(/* normal stuff */)
Issue is fixed in 2020 release of 3.0.0问题已在 2020 版 3.0.0 中修复
https://github.com/springfox/springfox/issues/3002 https://github.com/springfox/springfox/issues/3002
https://github.com/springfox/springfox/issues/3386 https://github.com/springfox/springfox/issues/3386
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.