ServiceStack Swagger UI 和 API 版本号 [英] ServiceStack Swagger UI and API version number

查看:64
本文介绍了ServiceStack Swagger UI 和 API 版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论如何可以将版本号输入到 swagger UI 中?

Is there anyway to get the version number into the swagger UI?

所以我们可以让开发人员知道每个部署的版本是什么?

So we can let developers know what version each deployment is at?

推荐答案

这在最新版本的 ServiceStack 中是可能的,您只需在 AppHost 中设置 ServiceStack API 版本即可:

This is possible in the latest version of ServiceStack, you just set the ServiceStack API version in your AppHost thus :

public override void Configure(Container container)
{
     SetConfig(new HostConfig
     {
         ApiVersion = "1.1"
     });
{

这将被 Swagger-Ui 接收

This will then be picked up by the Swagger-Ui

这篇关于ServiceStack Swagger UI 和 API 版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆