Azure Functions V2中的OpenAPI(又名Swagger) [英] OpenAPI (aka Swagger) in Azure Functions V2

查看:138
本文介绍了Azure Functions V2中的OpenAPI(又名Swagger)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建V2函数应用程序,并想为文档使用Swagger/Open API,但是Azure门户对于V2函数尚不支持.

I'm creating a V2 Function App and want to use Swagger/Open API for docs, however it is not yet supported in the Azure Portal for V2 Functions.

关于如何在VSTS中将Swagger与V2函数一起使用以在每个版本上创建文档的任何建议?

Any suggestions on how I can use Swagger with V2 Functions in VSTS to create the docs on each build?

推荐答案

TL; DR-使用NuGet包通过Azure函数呈现Open API文档和Swagger UI.

TL;DR - use the NuGet package to render Open API document and Swagger UI through Azure Functions.

-

Microsoft尚未正式开始支持Open API(或Swagger).但是目前有一个社区驱动的NuGet软件包:

Microsoft hasn’t officially started supporting Open API (or Swagger) yet. But there is a community-driven NuGet package currently available:

https://www.nuget.org/packages/Aliencube.AzureFunctions .Extensions.OpenApi/

这是它的博客文章:

https://devkimchi.com/2019 /02/02/introducing-swagger-ui-on-azure-functions/

基本上,它的用法类似于Swashbuckle,即使用装饰器.它同时支持Azure Functions V1和V2.

Basically its usage is similar to Swashbuckle — using decorators. And it supports both Azure Functions V1 and V2.

致谢:我是NuGet软件包的所有者.

Acknowledgement: I am the owner of the NuGet package.

这篇关于Azure Functions V2中的OpenAPI(又名Swagger)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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