Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/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
Scala 如何为akka http web套接字路由生成swagger文档? 如何为akka http web套接字路由生成swagger文档?_Scala_Swagger_Akka Http - Fatal编程技术网

Scala 如何为akka http web套接字路由生成swagger文档? 如何为akka http web套接字路由生成swagger文档?

Scala 如何为akka http web套接字路由生成swagger文档? 如何为akka http web套接字路由生成swagger文档?,scala,swagger,akka-http,Scala,Swagger,Akka Http,我能写AKKAHTTPGET,put,post,delete。比如说 @Path("/postPing") @ApiOperation(value = "Find a ping", notes = "Returns a pong", httpMethod = "POST",response = classOf[String]) @ApiImplicitParams(Array( new ApiImplicitParam(name = "data", value = "\"data\"

我能写AKKAHTTPGET,put,post,delete。比如说

 @Path("/postPing")
 @ApiOperation(value = "Find a ping", notes = "Returns a pong",
 httpMethod = "POST",response = classOf[String])
 @ApiImplicitParams(Array(
 new ApiImplicitParam(name = "data", value = "\"data\" to sum",     required = true,
  dataType = "string", paramType = "query"),
new ApiImplicitParam(name = "file", required = true,
  dataType = "file", paramType = "query")
))
@ApiResponses(Array(
new ApiResponse(code = 404, message = "websocket not found"),
new ApiResponse(code = 200, message = "websocket found"),
new ApiResponse(code = 400, message = "Invalid websocket supplied")))
def postRoute = path("postPing") {
complete("post pong")
}
但我需要Akka web套接字

比如说 连接websocket服务器的步骤

/连接ws://echo.websocket.org/websocket

将数据发送到websocket服务器

/发送Hello\world

提前谢谢

def webSocketRoute: Route = path("websocket") {
handleWebSocketMessages(broadcast)
}
def broadcast: Flow[Message, Message, Any] = {
Flow[Message].mapConcat {
  case tm: TextMessage =>
    TextMessage(tm.textStream) :: Nil
 }
 }