Swagger允许设置parameter type但是SwaggerWcf我无法编辑此文件,它已生成。它默认设置为body,但我需要它为path。
有人可能认为SwaggerWcfParameterAttribute
会允许设置此项。但它只允许Description
和Required
。
如何具体设置?
答案 0 :(得分:2)
您是否尝试使用示例服务中的格式?
https://github.com/abelsilva/swaggerwcf/blob/master/src/SwaggerWcf.Test.Service/IStore.cs#L48
[SwaggerWcfPath("Get book author", "Retrieve the author of a book using the book id")]
[WebGet(UriTemplate = "/books/{id}/author", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
Author ReadBookAuthor(string id);
路径中的参数id将传递给函数