私は、multipart/form-dataパラメータを使用してPostリクエストを使ってApiControllerの完全なヘルプページを生成するためにSwashbuckle 5を取得しようとしています。アクションのヘルプページがブラウザに表示されますが、フォームに渡されるパラメータに関する情報は含まれていません。私は操作フィルタを作成し、それをSwaggerConfigで有効にしました。これはURIパラメータを含むWebページ、戻り値の型およびブラウザのヘルプページに表示されるXMLコメントから得られるその他の情報です。ただし、操作フィルターにはパラメーターについては何も指定されておらず、ヘルプ・ページにはパラメーターに関する情報は含まれていません。Swashbuckle 5とmultipart/form-data HelpPages
私は何かが欠けている必要があります。私が逃したかもしれないことについて何か提案がありますか?
オペレーションフィルターコード:
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"
}
};
}
}
}
コントローラーのメソッドのコードを質問に追加できますか? – venerik
あなたはswagger設定で操作フィルタを添付していたと思います。 –