首页 > 解决方案 > Visual Studio 中的未知 JSON 警告

问题描述

鉴于此 JSON:

{
  "generatedBy": "Microsoft.NET.Sdk.Functions-1.0.24",
  "configurationSource": "attributes",
  "bindings": [
    {
      "authLevel": "function",
      "methods": [
        "get",
        "post"
      ],
      "name": "req",
      "type": "httpTrigger"
    }
  ],
  "disabled": false,
  "scriptFile": "../FunctionTest.dll",
  "entryPoint": "FunctionTest.Function1.Run"
}

Visual Studio 在第 5 行发出此警告:

OneOf (Require 1 match, following 14 not matched):
    Exactly 1 match required, but found more than 1
    Value must be one of the following values: "manualTrigger"
    Value must be one of the following values: "timerTrigger"
    Value must be one of the following values: "mobileTable"
    Value must be one of the following values: "documentDB"
    Value must be one of the following values: "table"
    Value must be one of the following values: "notificationHub"
    Value must be one of the following values: "twilioSms"
    Value must be one of the following values: "sendGrid"
    OneOf (Require 1 match, following 2 not matched):
        Value must be one of the following values: "serviceBusTrigger"
        Value must be one of the following values: "serviceBus"
    OneOf (Require 1 match, following 2 not matched):
        Value must be one of the following values: "blobTrigger"
        Value must be one of the following values: "blob"
    OneOf (Require 1 match, following 2 not matched):
        Value must be one of the following values: "eventHubTrigger"
        Value must be one of the following values: "eventHub"
    OneOf (Require 1 match, following 2 not matched):
        Value must be one of the following values: "queueTrigger"
        Value must be one of the following values: "queue"
    Value must be one of the following values: "http" FunctionTest  D:\Dev\Projects\Testing\FunctionTest\FunctionTest\Function1\Function.json

我不知道该怎么做。我在搜索上空了。看起来它可能与模式验证有关,但我在原始 JSON 中没有看到对模式的任何引用。

有人能指出我如何识别、破译和解决这个问题吗?

标签: jsonazure-functionsvisual-studio-2019

解决方案


推荐阅读