[Solved] Swagger Error: Whitelabel Error Page status=405

The swagger link is accessed with the following error

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Mar 17 20:14:30 CST 2022
There was an unexpected error (type=Method Not Allowed, status=405).
Request method ‘GET’ not supported

The reason is that @PostMapping does not have a configured path

    public UserInfoResponse queryUserNameById(@RequestBody UserInfoRequest request){
        log.info("Query user name request parameters",request);
        UserInfoResponse response = userService.selectUserNameById(request);
        log.info("Query user name return parameters",request);
        return response;

Read More: