Scala 如何为akka http web套接字路由生成swagger文档? 如何为akka http web套接字路由生成swagger文档?
我能写AKKAHTTPGET,put,post,delete。比如说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\"
@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
}
}