gpt4 book ai didi

java - spring-mvc 中 swagger-ui (io.swagger) 的描述中出现了垃圾值 --> ��� ,如何删除它?

转载 作者:行者123 更新时间:2023-11-30 01:45:35 25 4
gpt4 key购买 nike

I have confiured io.swagger for my spring-mvc application. The problem is that the garbage values --> ��� are in the description part of the defined parameter as shown in screen shot below.

I have defined this parameter using @ApiImplicitParam

Below is my controller


@RestController
@RequestMapping("/test")
@Api(value = "TestApi", description = "Descriotion")
public class TestController {

@RequestMapping(value = "/apiTest", method = RequestMethod.GET)
@ApiOperation(notes = "The Test API", value = "Response")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "employee", value = "Test description for question purposes", dataType = "string", paramType = "query")
}
public String getTestData(HttpServletRequest request) {
return "test";
}

}

The string the "value" of @ApiImplicitParam is giving ���, Below is the screenshot

enter image description here

最佳答案

尝试在 header HTML 文件中添加以下行来启用 utf-8 编码。

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>

https://github.com/swagger-api/swagger-ui/issues/3525

关于java - spring-mvc 中 swagger-ui (io.swagger) 的描述中出现了垃圾值 --> ��� ,如何删除它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58135258/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com