有没有一种方法可以从预先使用的C#Azure函数自动生成Swagger标记? [英] Is there a way to automatically generate Swagger tags from precomipled C# Azure Functions?

查看:50
本文介绍了有没有一种方法可以从预先使用的C#Azure函数自动生成Swagger标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道任何可用于注释预编译的C#Azure函数的.NET属性,以便它可以自动生成Swagger标记吗?例如,我想在Swagger中自动生成标签"条目:

Is anyone aware of any .NET attributes that can be used to annotate a precompiled C# Azure Function so it can generate Swagger tags automatically? For example, I would like to auto-generate the "tags" entry in Swagger:

/api/v1/revision:
    get:
      operationId: /api/v1/revision/get
      tags:
        - System
      produces: []
      consumes: []
      parameters: []
      description: Gets the API version
      responses:
        '200':
          description: Success operation
      security:
        - apikeyQuery: []

这是我的C#函数:

 public static class VersioningService
    {
        [FunctionName("ApiVersion")]
        public static async Task<HttpResponseMessage> ApiVersion([HttpTrigger(AuthorizationLevel.Function, "get", Route = "v1/revision")]HttpRequestMessage req, TraceWriter log)
        {
            return req.CreateResponse(HttpStatusCode.OK, "<p>API Version: 1.0340");
        }
    }

推荐答案

找到了这篇文章:

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