wcf - 更改 SwaggerWcf 中的参数类型

标签 wcf configuration swagger swagger-wcf

Swagger 允许设置 parameter type但与 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 将传递给函数

关于wcf - 更改 SwaggerWcf 中的参数类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43872506/

相关文章:

.net - WCF maxReceivedMessageSize 无法通过 HTTPS 工作

.net - 如何通过 service/WebInvoke 方法控制 JSON 反序列化对象的属性名称(大小写)

wcf - 为什么开发人员应该使用 Web 服务而不是直接连接到数据库?

spring-boot - 具有 url 模式的端点的 swagger 文档

c# - 将 Swagger 与命名空间版本化的 WebApi 结合使用

WCF - 将 HTTP 转换为命名管道

php - 尝试运行Behat测试时出错。 usr/bin/env参数无效

java - PropertyPlaceholderConfigurer 与 Hibernate.cfg.xml

logging - 记录单独的日志级别以分隔 log4j2 属性文件中的文件

django - Django REST Swagger 在哪里生成架构文件?