I'm trying to generate a C# client from a swagger doc. For a POST endpoint that accepts a collection of files, the C# client generated client is using an IEnumerable
Using NSwagStudio v12.2.5.0
Sample swagger doc:
"/api/v3/Services/WorkItem/Ticket/Attachment": {
"post": {
"tags": [
"WorkItemTicket"
],
"operationId": "WorkItemTicket_PostAttachment",
"produces": [
"application/json"
],
"parameters": [
{
"type": "integer",
"name": "ticketId",
"in": "query",
"format": "int32",
"x-nullable": false
},
{
"type": "array",
"name": "files",
"in": "formData",
"collectionFormat": "multi",
"x-nullable": true,
"items": {
"type": "file"
}
}
],
"responses": {
"204": {
"description": ""
},
"400": {
"x-nullable": true,
"description": "",
"schema": {
"$ref": "#/definitions/ValidationProblemDetails"
}
},
"401": {
"x-nullable": true,
"description": "",
"schema": {
"$ref": "#/definitions/ProblemDetails"
}
},
"403": {
"x-nullable": true,
"description": "",
"schema": {
"$ref": "#/definitions/ProblemDetails"
}
},
"500": {
"x-nullable": true,
"description": "",
"schema": {
"$ref": "#/definitions/ProblemDetails"
}
},
"200": {
"description": ""
}
}
}
},
Sample C# generated client:
public async System.Threading.Tasks.Task PostAttachmentAsync(int? ticketId = null, System.Collections.Generic.IEnumerable<byte[]> files = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append("api/v3/Services/WorkItem/Ticket/Attachment?");
if (ticketId != null)
{
urlBuilder_.Append("ticketId=").Append(System.Uri.EscapeDataString(ConvertToString(ticketId, System.Globalization.CultureInfo.InvariantCulture))).Append("&");
}
urlBuilder_.Length--;
It should be a FileParameter
Where can I find information or documentation on how to use FileParameter?