更改 SwaggerWcf 中的参数类型

Change parameter type in SwaggerWcf

Swagger 允许设置 parameter type but with SwaggerWcf 我无法编辑此文件,它已生成。它默认设置为正文,但我需要它是路径。

有人可能会认为 SwaggerWcfParameterAttribute 会允许设置这个。但它只允许 DescriptionRequired.

具体怎么设置?

您是否尝试使用示例服务中的格式?

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将被传递给函数