我正在使用go-swagger為我們的 API 生成 swagger 文件我的請求在 JSON 格式中看起來像這樣:{ [ { "name": "title1", "label": "tag1", "sort": true }, { "name": "title2", "label": "tag2", "sort": true } ]}這就是我現在的評論// swagger:route POST /admin/qc QC createQC//// Creates a new QC.////// Consumes:// - application/json//// Produces:// - application/json//// Schemes: https//// Deprecated: false////// Parameters:// + name: Authorization// in: header// required: true// type: string//// + name: input// in: body// required: true// type: array// items: QC//// Responses:// 200: StatusOK這是生成的 swagger 文件/admin/qc: post: consumes: - application/json operationId: createQC parameters: - in: header name: Authorization required: true type: string - in: body name: input required: true schema: type: array produces: - application/json responses: "200": description: StatusOK schema: $ref: '#/definitions/StatusOK' schemes: - https summary: Creates a new QC. tags: - QCgo-swagger 不會選擇此注釋中的項目類型。不幸的是,更改此 API 的請求類型的選項不可用。有人知道我應該如何注釋嗎?
go-swagger - 請求正文中的對象數組
慕田峪9158850
2022-12-19 10:34:50