0

我需要在我的 Swagger 仪表板的请求正文中添加一个示例 Json,以便用户可以更改所需的属性值并使用 Swagger 仪表板中的“试用”按钮进行 POST 校准。其他一切工作正常。使用 scalatra-swagger。这是我的工作代码片段:

val saveFormHeaders =
(apiOperation[String]("saveFormHeaders")
  summary "Save a form header"
  notes "POST for new form header"
  parameter bodyParam[String]("body").description("Form header json to save").required  //need the syntax to insert an example JSON for the req body
)

post("/data/formHeader",operation(saveFormHeaders)) {


 **some code**}

在此处输入图像描述

我找不到使用上述无注释招摇 scalatra 语法在请求正文中添加示例 Json 的确切语法。

4

0 回答 0