如何正确配置Swagger以便Visual Studio创建" normal"码?

时间:2017-06-21 23:35:27

标签: c# rest visual-studio-2017 azure-functions swagger-2.0

我希望为我的消费者提供最佳体验,并为我的功能应用创建一个昂首阔步的端点。我刚刚运行了VS2017的添加端点功能

得到一个名为ApiTokenPolicyPublisherIDSpecificationIDpostAsync的函数调用... URL的串联:/ api / TokenPolicy / {PublisherID} / {SpecificationID}方法POST + async。

enter image description here

有什么我可以用我的招摇做得更好,或者这就是VS如何做它的代码? (如果是,that's disappointing

这是link to my swagger

1 个答案:

答案 0 :(得分:1)

看起来VS正在将你的swagger定义中的operationId转换为方法调用

更新样本招摇中的操作ID

operationId: '/api/TokenPolicy/{PublisherID}/{SpecificationID}/post'

operationId: 'CustomEnroll'

这就是我得到的

enter image description here