在JSON中为PowerAutomate Webhook设置触发类型

发布于 2025-01-20 18:49:10 字数 191 浏览 4 评论 0原文

我一直在修改swashbuckle滤波器,以在端点上添加扩展名,以添加到动力自动化。

尝试从创建的JSON创建自定义连接器,但发现未设置触发类型。我已经检查了Microsoft文档,但是(以及其他地方)似乎唯一的建议是如何通过其前端设置。

有没有办法以编程方式设置此此操作,或者我必须在导入后使用前端工具对此进行修改?

谢谢。

I have been modifying the swashbuckle filters to add extensions to the endpoints for adding to power automate.

Tried creating a custom connector from the Json created but found that the trigger type was not set. I have checked through the microsoft documentation but there (and elsewhere) it seems the only advice is how to set through their front end.

Is there a way to set this programmatically or will I have to modify this using the front end tool after import?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原谅过去的我 2025-01-27 18:49:10

我最终添加了文档窗,如下所示:

            foreach (var pathItem in document.Paths)
            {
                if (pathItem.Key.Contains(TriggerEndpointNaming))
                {
                    if (!pathItem.Key.Contains("tenantWebHookId"))
                    {                        
                        foreach (var operation in pathItem.Value.Operations)
                        {
                            if (operation.Value.OperationId != null && operation.Value.OperationId.Equals("ManageWebHookAsync"))
                            {
                                operation.Value.Extensions.Add("x-ms-trigger", new OpenApiString("single"));
                            }
                        }
                    }
                }
            }

I ended up by adding through a DocumentFilter as follows:

            foreach (var pathItem in document.Paths)
            {
                if (pathItem.Key.Contains(TriggerEndpointNaming))
                {
                    if (!pathItem.Key.Contains("tenantWebHookId"))
                    {                        
                        foreach (var operation in pathItem.Value.Operations)
                        {
                            if (operation.Value.OperationId != null && operation.Value.OperationId.Equals("ManageWebHookAsync"))
                            {
                                operation.Value.Extensions.Add("x-ms-trigger", new OpenApiString("single"));
                            }
                        }
                    }
                }
            }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文