c# - Autogenerate OpenAPI documentation with Azure Functions
问题描述
is it possible to auto-generate OpenAPI documentation with Azure Functions e.g. like how it's possible with the SwaggerGen when using Swashbuckle with ASP .NET Core? The documentation should contain the different endpoints with their possible input and response models and StatusCodes. It would be awesome if I could view the docs in a web ui.
At the moment, I found two possible packages:
- A Swashbuckle Adaption for Azure Functions: https://github.com/vitalybibikov/AzureExtensions.Swashbuckle
- An official OpenAPI Extension from Microsoft: https://github.com/Azure/azure-functions-openapi-extension
With the first one, it's only possible to detect my models/DTOs and the different endpoints. But the relation between endpoints and models and the possible response codes have to be manually set by attributes on the several functions.
For the second one, there is no auto-detection at all. Everything only works with attributes. Additionally the package is still in preview.
解决方案
推荐阅读
- node.js - .catch(error=>{}) 在我响应时没有显示我的错误。但是当我控制台它显示错误
- amazon-web-services - 将传感器连接到 aws iot
- java - 在不重新链接节点的情况下对链接列表进行排序
- python - 为模拟测试添加返回参数
- java - java - 在使用java中的crealytics/spark-excel将多个org.apache.spark.sql.Dataset写入.xls文件时如何提及单个工作表名称?
- android - 如何在片段xamarin android中打开对话框片段
- scala - 在 Spring Boot 中从服务器上的资源文件夹中读取 .html 文件
- javascript - Jest测试框架能否在TS调用java函数时测试java写的代码
- mysql - MySQL突然崩溃
- javascript - React Native State 正在延迟更新 1 个按键