swagger-ui的postTran接口补充可接受application/json的数据格式

This commit is contained in:
brightestboy 2021-01-27 10:41:21 +08:00
parent 00542995eb
commit da76a41f08

View File

@ -538,8 +538,9 @@ class TransactionService(ra: RestRouter)(implicit executionContext: ExecutionCon
@POST @POST
@Path("/postTran") @Path("/postTran")
@Operation(tags = Array("transaction"), summary = "提交交易", description = "postTransaction", method = "POST", @Operation(tags = Array("transaction"), summary = "提交交易", description = "postTransaction", method = "POST",
requestBody = new RequestBody(description = "描述交易的xml", required = true, requestBody = new RequestBody(description = "描述交易的xml/json", required = true,
content = Array(new Content(mediaType = MediaType.APPLICATION_XML, schema = new Schema(implementation = classOf[CSpec], description = "描述交易的xml"))))) content = Array(new Content(mediaType = MediaType.APPLICATION_XML, schema = new Schema(implementation = classOf[CSpec], description = "描述交易的xml")),
new Content(mediaType = MediaType.APPLICATION_JSON, schema = new Schema(implementation = classOf[CSpec], description = "描述交易的json")))))
// @Parameters(Array( // @Parameters(Array(
// new Parameter(name = "body", value = "交易内容", required = true, // new Parameter(name = "body", value = "交易内容", required = true,
// dataTypeClass = classOf[CSpec], paramType = "body"))) // dataTypeClass = classOf[CSpec], paramType = "body")))