Posts

Showing posts with the label swagger-akka-http

Swagger-Akka-Http: List of objects in the request body

Image
Clash Royale CLAN TAG #URR8PPP Swagger-Akka-Http: List of objects in the request body I'm using swagger-akka-http to built Swagger docs for my Akka HTTP service. My service has a POST method accepting a List of Characteristic . List Characteristic @ApiOperation(value = "Fetch offerings by characteristics", httpMethod = "POST") @ApiImplicitParams(Array( new ApiImplicitParam(name = "characteristics", required = true, dataTypeClass = classOf[List[Characteristic]], paramType = "body") )) @ApiResponses(Array( new ApiResponse(code = 200, response = classOf[Offering], responseContainer = "List") )) def fetchOfferings: Route = post { entity(as[List[Characteristic]]) { characteristics => // some logic } } dataTypeClass = classOf[List[Characteristic]] in ApiImplicitParams is not working as expected. There is the following result in the generated Swagger YAML: dataTypeClass = classOf[List[Character...