Çok satırlı/form-data parametrelerini kullanarak bir Post isteği içeren bir ApiController için tam yardım sayfaları oluşturmak için Swashbuckle 5'i almaya çalışıyorum. Eylem için yardım sayfası tarayıcıda gelir, ancak formda geçirilen parametreler hakkında bilgi dahil değildir. Bir işletme filtresi oluşturdum ve bunu, SwaggerConfig'te, URI parametrelerini içeren web sayfasında, dönüş türünde ve tarayıcı yardım sayfalarında gösterilen XML yorumlarından türetilen diğer bilgilerde etkinleştirdim; Ancak, işlem filtresinde parametrelerle ilgili hiçbir şey belirtilmemiştir ve yardım sayfası parametreler hakkında hiçbir bilgi içermemektedir.Swashbuckle 5 ve multipart/form-data Yardımlar
Bir şeyleri kaçırmam gerekir. Neleri kaçırdığım hakkında bir öneri var mı?
Operasyon filtre:
public class AddFormDataUploadParamTypes : IOperationFilter
{
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) {
if (operation.operationId == "Documents_Upload")
{
operation.consumes.Add("multipart/form-data");
operation.parameters = new[]
{
new Parameter
{
name = "anotherid",
@in = "formData",
description = "Optional identifier associated with the document.",
required = false,
type = "string",
format = "uuid"
},
new Parameter
{
name = "documentid",
@in = "formData",
description = "The document identifier of the slot reserved for the document.",
required = false,
type = "string",
format = "uuid"
},
new Parameter
{
name = "documenttype",
@in = "formData",
description = "Specifies the kind of document being uploaded. This is not a file name extension.",
required = true,
type = "string"
},
new Parameter
{
name = "emailfrom",
@in = "formData",
description = "A optional email origination address used in association with the document if it is emailed to a receiver.",
required = false,
type = "string"
},
new Parameter
{
name = "emailsubject",
@in = "formData",
description = "An optional email subject line used in association with the document if it is emailed to a receiver.",
required = false,
type = "string"
},
new Parameter
{
name = "file",
@in = "formData",
description = "File to upload.",
required = true,
type = "file"
}
};
}
}
}
Denetleyicinin yönteminin kodunu soruna ekleyebilir misiniz? – venerik
İşletim filtresini swagger konfigürasyonuna bağladığınızı umuyoruz. –