简体   繁体   English

逻辑应用 HTTP 请求触发器能否根据提供的 JSON 架构进行验证?

[英]Can the Logic App HTTP Request trigger validate against a provided JSON Schema?

Can the Logic App HTTP Request trigger validate against a provided JSON Schema?逻辑应用 HTTP 请求触发器能否根据提供的 JSON 架构进行验证?

Added a minimal JSON schema to the Request Body JSON Schema, and I get the various element ...向请求正文 JSON 模式添加了一个最小的 JSON 模式,我得到了各种元素......

"Correlation": {
  "id": "/properties/Correlation",
  "properties": {
    "CaseNumber": {
      "id": "/properties/Correlation/properties/CaseNumber",
      "type": "string"
    },
    "ProviderCaseNumber": {
      "id": "/properties/Correlation/properties/ProviderCaseNumber",
      "type": "string"
    }
  },
  "required": ["CaseNumber"],
  "type": "object"
}, ... etc. ...

Read through the blog post, Logic Apps – Json Schema Verify , which shows how to use an Azure Function to handle the validation.读博文 Logic Apps – Json Schema Verify ,其中展示了如何使用 Azure 函数来处理验证。

BUT Json.NET Schema is now a commerical product但是 Json.NET Schema 现在是一个商业产品

Is there anyway in the actual trigger to validate, and even better, return a 400 Bad Request ?无论如何,在实际触发器中是否有验证,甚至更好的是返回400 Bad Request

It is now built-in它现在是内置的

In the HTTP request triggers Settings, enable the "Schema Validation" option在 HTTP 请求触发器设置中,启用“架构验证”选项

Schema Validation
Validate request body against the schema provided. 
In case there is a mismatch, HTTP 400 will be returned.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM