https://hub.docker.com/r/jimschubert/swagger-codegen-cli/에서 swagger-codegen-cli Docker 컨테이너를 사용하고 있습니다.이 컨테이너는 실행되기 전에 master 브랜치에서 swagger-codegen을 가져옵니다. 나는 최근에 문서화 된 (공식적인) swagger-codegen-cli를 https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/에서 잡으려고 시도했으나 현재로서는 사용할 수없는 것으로 보인다. 이 비공식 CLI의 약자로서swagger-codegen - 생성 된 C# SDK 메서드에 본문을 어떻게 제공합니까?
, 나는 다음과 같은 포함 자신감이 문서에서 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"
}
}
}
}
}
},
그러나 내가 돈 ' public List<FileUploadGalleryItemModel> FileUploadCreateCustomerCoverGalleryItem (int? zoneId)
다음 서명을 사용하여 SDK 내에서 생성 된 메서드에 본문을 제공하는 방법을 확인하십시오.
내가 간과하거나 잘못하고있는 것에 대한 제안 사항이 있으십니까?
'payload'의 경우 파일 대신'파일 '로 문서화 해 보았습니까? ? 예 : https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml#L269-L273 –
완벽! 감사! 앞으로도 힘써주세요! – YardGnomeNinja
Np :) 내 대답을 수락하십시오. –