我正在使用来自https://hub.docker.com/r/jimschubert/swagger-codegen-cli/的(非官方)swagger-codegen-cli Docker 容器,它在运行之前从主分支中提取 swagger-codegen。我尝试从https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/获取最近记录的(官方)swagger-codegen-cli ,但目前似乎不可用。
与非官方 cli 一样,我从 swagger 文档中生成了一个 C# SDK,其中包含以下内容:
/api/customer/{zoneId}/files/cover/gallery: {
get: {
tags: [
"FileUpload"
],
summary: "Get all files in customer cover gallery",
operationId: "FileUpload_GetCustomerCoverFiles",
consumes: [ ],
produces: [
"application/json",
"text/json"
],
parameters: [
{
name: "zoneId",
in: "path",
description: "",
required: true,
type: "integer",
format: "int32"
}
],
responses: {
200: {
description: "OK",
schema: {
type: "array",
items: {
$ref: "#/definitions/FileUploadGalleryItemModel"
}
}
}
}
},
post: {
tags: [
"FileUpload"
],
summary: "Upload file to customer cover gallery",
operationId: "FileUpload_CreateCustomerCoverGalleryItem",
consumes: [
"application/octet-stream"
],
produces: [
"application/json",
"text/json"
],
parameters: [
{
name: "zoneId",
in: "path",
description: "",
required: true,
type: "integer",
format: "int32"
},
{
name: "payload",
in: "body",
description: "",
required: true,
type: "byte[]",
format: "binary"
}
],
responses: {
200: {
description: "OK",
schema: {
type: "array",
items: {
$ref: "#/definitions/FileUploadGalleryItemModel"
}
}
}
}
}
},
“有效负载”是在请求的正文中提供的,但是我看不到任何方法可以将正文提供给 SDK 中生成的具有以下签名的方法:public List<FileUploadGalleryItemModel> FileUploadCreateCustomerCoverGalleryItem (int? zoneId)
.
关于我可能忽略或做错的任何建议?