修复 Swagger 验证者错误

Swagger 验证者工具验证您在 GitHub 开放源代码存储库ISV 门户中提交的连接器文件。 它会检查连接器文件以确保它们正确,并遵守我们的连接器要求和指南。

使用本主题中的表来帮助您查找和修复错误。 每个表列出了此工具可能生成的错误。 对于每个错误,将有一个相应的问题和解决方案。 列出的解决方案可能会帮助您避免在提交之前期间收到错误。

如果您需要进一步指导,请发送电子邮件到 ConnectorPartnerMgmtTeam@service.microsoft.com

操作

Error 问题 解决方案
ApiAnnotationExtensionReplacementInfo
ForNonDeprecatedOperations
The 'x-ms-api-annotation' extension for operation '{0}' is invalid. The replacement property should be specified for deprecated operations only. 操作 {0} 未标记为弃用。 要使用此属性,此操作应将“deprecated”属性设置为 true。 如果不是这种情况,请删除“x-ms-api-annotation”属性。
ApiAnnotationExtensionReplacementInfo
MissingApiProperty
The 'x-ms-api-annotation' extension for operation '{0}' is invalid. The replacement property must specify 'api' property. “x-ms-api-annotation”指定了“replacement”属性,但缺少“api”属性。 要使用“replacement”属性,必须设置“api”和“operationId”属性。
ApiAnnotationExtensionReplacementInfo
MissingOperationIdProperty
The 'x-ms-api-annotation' extension for operation '{0}' is invalid. The replacement property must specify 'operationId' property. “x-ms-api-annotation”指定了“replacement”属性,但缺少“operationId”属性。 要使用“replacement”属性,必须设置“api”和“operationId”属性。
ArrayDuplicateValue The array contains duplicate values, values must be unique. 数组必须具有唯一值,但您的 Swagger 包含重复项。 删除重复项。
BodyOrFormDataParameterInFetch
OperationNotAllowed
Body or form data parameters are not supported in a fetch operation. 使用“GET”HTTP 方法的操作不能有正文或窗体数据。
ConnectionIdParameterNotAllowed A parameter cannot be named as 'connectionId'. 将此参数重命名为“connectionId”以外的值。
ConsumesMissing At least one supported MIME type must be provided in 'consumes' for operation '{0}'. 您的 Swagger 应该在消耗中为操作指定一种受支持的 MIME 类型。
DuplicateEnumValuesInExtension The 'x-ms-enum-values' extension has duplicate values. You can only have one display name mapped to a value. 枚举值应该是唯一的,不能重复。
DuplicateOperationPath The operations '{0}' and '{1}' have the path templates '{2}' and '{3}' which are duplicate and indistinguishable. They need to have a difference in static path segments for a deterministic routing. {0} 是操作 ID,{1} 是重复的操作 ID,{2} 是操作路径,{3} 是重复的操作路径。 从重复的操作路径中删除重复的操作 ID。
DynamicExtensionDefinitionNotAllowed
InParameter
Dynamic extensions are not allowed to be defined on the body parameter. It should be in the schema. 动态扩展是在正文参数上定义的,必须删除。 只允许在架构中定义。
DynamicListExtensionRequiredFor
AmbiguousReferences
The 'x-ms-dynamic-values' extension references ambiguous parameter references. You need to define the 'x-ms-dynamic-list' extension. 必须定义“x-ms-dynamic-list”。 详细信息:如何使用动态值
DynamicListExtensionRequiredFor
NonParameterReferences
The 'x-ms-dynamic-values' extension references properties within parameters. You need to define the 'x-ms-dynamic-list' extension. 必须定义“x-ms-dynamic-list”。 详细信息:如何使用动态值
DynamicPropertiesExtensionRequiredFor
AmbiguousReferences
The 'x-ms-dynamic-schema' extension references ambiguous parameter references. You need to define the 'x-ms-dynamic-properties' extension. 必须定义“x-ms-dynamic- properties”。 详细信息:如何使用动态值
DynamicPropertiesExtensionRequiredFor
NonParameterReferences
The 'x-ms-dynamic-schema' extension references properties within parameters. You need to define the 'x-ms-dynamic-properties' extension. 必须定义“x-ms-dynamic- properties”。 详细信息:如何使用动态值
DynamicPropertiesExtensionRequiredFor
PropertiesValuePath
The 'x-ms-dynamic-schema' extension property 'value-path' points to schema properties. You need to define the 'x-ms-dynamic-properties' extension, which points to schema object. 您的 Swagger 文件缺少“x-ms-dynamic-properties”,此文件是必需的,因为它定义“x-ms-dynamic-schema”。
DynamicPropertiesItemValue
PathMismatch
The 'x-ms-dynamic-properties' extension should have the same item value path as 'x-ms-dynamic-schema' extension without 'properties' ending. The expected path is '{0}'. 动态属性扩展项值路径与基于架构的预期路径不匹配。
DynamicTreeExtensionMissing The 'x-ms-dynamic-tree' extension must be defined to enable file picker support. 属性“x-ms-dynamic-tree”缺失,其必须定义以支持文件选取器。
InvalidEnumValue The type of the enum value is '{0}' but it should be '{1}' as specified in the schema. 此值必须替换为指定的类型。
InvalidEnumValuesExtensionValue The 'value' field must match one of the enums as defined in the 'enum' property of the schema. 选定的枚举尚未在枚举列表中定义。 在 enum 属性中定义值或使用在 enum 属性中定义的值。
InvalidFormDataParameterName The form data parameter name '{0}' is invalid. All characters must be part of the US-ASCII character set. 将窗体数据参数名称重命名为仅包含 US-ASCII 字符。
InvalidNextLinkNameValue The nextLinkName value for operation '{0}' is invalid. Supported values are 'nextLink' or '@odata.nextLink'. 修复属性“nextLinkName”的值,使其为“nextLink”或“@odata.nextLink”。 不允许任何其他值。
InvokedOperationShouldProduceArray The dynamic operation expects an array on the specified path '{0}' which should be defined in the successful response of the invoked operation '{1}'. {0} 是响应属性的路径,{1} 是操作 ID。在操作的响应中定义数组类型的返回。
InvokedOperationShouldProduceProperty The dynamic operation expects a property on the specified path '{0}' which should be defined in the successful response of the invoked operation '{1}'. {0} 是响应属性的路径,{1} 是操作 ID。在操作的响应中定义一个特定属性
MimeTypeNotCompatibleWithRequest
ContentSchemaType
The MIME type(s) are not compatible with the request content type '{0}' for operation '{1}'. 您尝试使用的 MIME 类型与指定操作中的请求内容不兼容。
NotificationExtensionNotSupportedIn
WebhookOperation
The 'x-ms-notification' extension must not be defined in a webhook operation. 在 webhook 操作中不允许使用“x-ms-notification”。
NotificationExtensionSupportedFor
TriggerOnly
The 'x-ms-notification' is supported for trigger operations only. “x-ms-notification”扩展只能用于触发操作。
NotificationOperationMustBeWebhook The 'operationId' property in 'x-ms-notification' extension must be for a webhook operation. 使用“x-ms-notification”时,操作 ID 必须引用 webhook 操作。
OperationFamilyHasDuplicateRevisions The operation family '{0}' has operations with duplicate revision. 您的 Swagger 定义了具有相同版本号/修订号的操作系列。 操作系列中的每个操作都应该具有唯一的版本号。
OperationFamilyHasManyActive
操作
The operation family '{0}' has more than two active operations. Extra operations must be deprecated. 操作系列仅限于两个未弃用的操作。 任何其他操作都应标记为已弃用,以减少连接器用户的混淆。
OperationFamilyHasManyActive
ProductionOperations
The operation family '{0}' has several active operations in Production status. Previous revisions should be deprecated. 操作系列在生产中有多个操作。 要减少混乱,限制一个系列中的生产操作数量并弃用其余操作。
OperationFamilyHasManyEmptyRevisions The operation family '{0}' has several operations with empty revision. Only one operation can have empty revision. 操作系列只能有一个没有修订的操作。 系列中的所有其他操作都应有修订。
OperationHasManyResponsesWithSchema The operation '{0}' has more than one response with specified schema, only one schema will be used in the designer. 设计器中的限制阻止了多个响应架构。 您的操作指定了多个,但应该只指定一个。
OperationIdNotFound The 'operationId' could not be found in this swagger document. 在您的 Swagger 中找不到 operationId。
OperationIdNotUnique The operationId '{0}' is used multiple times. Operation identifiers must be unique. 同一个 operationId 多次出现。 删除其中一个实例或将其中一个实例修复为不同实例。
OperationIdRequired The operation 'operationId' property is required. 缺少属性“operationId”,包括您的操作的属性“operationId”。
OperationIdSanitized The 'operationId' property value is different from its sanitized value '{0}'. Please avoid the useage of non-alphanumeric characters to have matching values. 提供的操作 ID 与清理版本不匹配。 更新操作 ID 以与其匹配。
OperationIdShouldEndWithRevision The operation Id '{0}' should end with revision suffix '{1}'. 带有修订的操作 ID 应该有一个带有修订后缀的名称。
OperationIdTooLong The operationId length must be less than '{0}'. 减少属性“operationId”的值,使字符长度小于 {0}。
OperationMissingPathParameter The operation '{0}' does not define the '{1}' parameter which is required by the path. 您的 Swagger 有操作未定义其路径模板似乎需要的参数。
OperationMissingRequiredProperty The target operation requires parameter '{0}'. 操作按要求定义了参数“{0}”,但不是在提供的参数中定义的。 添加此参数以解决问题。
OperationMustHaveNotification
ContentExtension
The operation '{0}' is missing notification content extension as it has '{1}' properties marked as notification URL. 您的 Swagger 包含没有通知内容扩展的操作。 (需要更多上下文)
OperationMustHaveResponse The operation is not valid, it must contain at least one response definition. 您的 Swagger 中有操作一个响应定义都没有。
OperationParameterNameIsAmbiguous The parameter name is ambiguous as it matches both a parameter name and a path to a body property. 此参数的名称被用作参数名称和参数主体路径名称。 重命名其中一个实例以解决此问题。
OperationParameterNameNotFound The parameter could not be found in operation '{0}' in the swagger document. 在您的 Swagger 中找不到操作参数名称。
OperationParameterRequiredMismatch The parameter is required, but an optional value is provided by operation '{0}'. The request cannot be made until a value for this parameter is provided. 此参数是必需的,但操作的值指示它是可选的,导致出现不匹配。
OperationParametersAreNotUnique The parameters in the operation '{0}' are not unique. 操作参数中似乎存在重复项。 您的 Swagger 需要删除操作参数重复项。
OperationParametersContain
DuplicateParameter
The operation '{0}' contains duplicate parameters with name '{1}', location '{2}'. 有一个操作参数被列出两次。 {0} 是操作名称,{1} 是重复的参数名称,{2} 是重复的参数位置(Swagger 中的“in”属性)。 删除属性的重复出现。
OperationParametersContain
MultipleBodyParameters
The operation '{0}' contains multiple parameters in the location 'body', at most one is allowed. 操作参数包含重复的正文参数。 删除正文参数之一。
OperationParameterStaticTypeMismatch The parameter has type '{0}', but a static value is provided of type '{1}'. 参数提供了不是此操作预期的静态类型。
OperationParameterTypeMismatch The parameter has type '{0}', but operation '{1}' is providing a parameter of type '{2}'. 参数和操作具有不同的类型。 让您的参数类型与您的操作匹配。
OperationPathContainsUnsupportedCharacters The operation path cannot contain wildcard character '*'. 您的一项操作指定了包含不支持字符(如通配符)的 URL 路径。
OperationPathMayNotContainQueryOrFragment The path is not valid, it must not contain a query part or fragment identifier. To include '?' or '#' characters in the path, they must be URL encoded. 操作的路径不能包含“?” 和“#”,除非它们是 URL 编码的(转换为它们的 %xx 等效项)。
OperationPathMustStartWithSlash The path is not valid, it must start with a '/' character. 如果您使用的是您在尝试到达的操作路径,需要以“/”字符开头。 在路径的开头包含“/”字符来解决此问题。
OperationPathTemplateNotValid The path is not valid, each path template variable enclosed by '{{' and '}}' characters must be contained within a single URL segment. Individual '{{' or '}}' characters which are not enclosing a path template variable must be URL encoded. 您的 Swagger 包含带有未闭合的“{”或“}”字符的操作路径。 这些字符用于引用路径中的变量,因此它们如果未闭合则不能存在于路径中。
OperationPathVariablesContainDefaults The operation path template variables cannot set default values with character '='. 您的操作之一是为包含“=”的参数指定默认值。 该参数同时也被指定为在 URL 路径中。 不允许此组合。
OperationRevisionEmpty The operation '{0}' does not specify a revision in api annotation. 操作被标记为一个系列的一部分,但没有修订。
OperationSchemaCountExceedsMaxAllowed The total number of schemas in the operation has exceeded the maximum allowed value of '{0}'. Please remove any unnecessary property or item definitions. 操作中的架构过多。 删除其中一部分,使总数回到限制值以下。
OperationShouldHaveSuccessfulResponse The operation '{0}' should have at least one successful response definition. 您的 Swagger 中有操作一个成功的响应定义都没有。
OperationStatusAheadOfConnector The operation '{0}' cannot be in a Production status ahead of the connector. 当整个连接器仍处于“预览”时,操作不能被标记为“生产”。
OperationSummaryTooLong The operation 'summary' should be fewer than {0} characters for improved readablity. 将操作“summary”属性减少到 120 个字符以内。
PartialDuplicateOperationPath The operation '{0}' has the path template '{1}' which is similar to other operation path templates, this can lead to an unexpected routing to a different operation in case an input path parameter value matches to a static value segment. It is better to have unconditional routing in all cases. Partially duplicated paths are: {2} {0} 是操作 ID,{1} 是操作路径,{2} 是部分重复的操作路径集。 更改操作路径以在共享相似性的操作路径之间呈现更大的差异。
PathParameterMustBeRequired The parameter must be marked as required as it is used in the operation path. Include the 'required' property, with the value 'true'. 参数的位置设置为“Path”,因此需要将“required”属性设置为“true”。
PathParameterNotDefinedInTemplate The 'path' parameter '{0}' is not defined in the URI path template. To include the parameter as a variable in the path, use '{{' and '}}' characters to enclose the name of the parameter in the path. 您的一项操作中有参数被标记为在操作路径中,但在路径模板中不存在。
PathParametersContain
DuplicateParameter
The path '{0}' contains duplicate parameters with name '{1}', location '{2}'. {0} 是操作路径。 {1} 是重复的参数名称。 {2} 是重复参数的位置(“in”属性)。 删除重复的路径参数。
PathParametersContainMultiple
BodyParameters
The path '{0}' contains multiple parameters in the location 'body', at most one is allowed. 一个操作不能有多个参数同时存在于正文中。 删除一个参数来修复此错误。
PathRedefined The path '{0}' is defined multiple times with different capitalization. Paths must be unique when compared case-insensitively. 同一个路径被定义了多次。 删除或重命名实例,让它们是唯一的。
RestrictedCharactersInSummary Summary string contains any of the restricted characters [{0}] 您的一项操作的摘要包含受限字符。 删除这些字符或重新表述摘要来修复此错误。
SelectedItemValuePathNotAllowedIn
ThisPosition
The 'selectedItemValuePath' property is not allowed in this position. It is allowed only in 'browse' operation of 'x-ms-dynamic-tree' extension. 不允许在任何位置放置“selectedItemValuePath”。 删除它或放在有效位置。
StringBinaryNotSupportedFor
FormUrlEncoded
String/binary parameters are not supported for operation '{0}' with 'application/x-www-form-urlencoded' consumes type. 操作在“consumes”属性中定义了“application/x-www-form-urlencoded”值。 此操作的参数不能是“‘string”或“binary”类型。
TotalOperationsCountExceedsMaxAllowed The total number of operations in the swagger exceeds the maximum allowed value of '{0}'. Swagger 中的操作太多。
UnrecognizedTypeFormat The type/format '{0}' is not recognized. 给定的类型/格式“{0}”未知。 检查是否有拼写错误或文档,确认是否是支持的类型格式。
WebhookOperationsMissingNotification
UrlProperty
The webhook operation '{0}' is missing notification URL property. 您的 Swagger 包含没有缺失通知 URL 属性的 webhook 操作。 在 webhook 操作中添加此属性可修复此操作。

数组

错误​ 问题 解决方案
ArrayHasNoItems The array should have items specified. 数组为空,但不允许使用空数组。
RequiredPropertyArrayEmpty The 'required' array requires at least one value. If no properties are required in the schema, remove the 'required' property. 您的 Swagger 有名为“required”的属性的空数组。 如果没有必需的参数,应将其删除。
SchemesArrayEmpty The 'schemes' array requires at least one value. 架构不能为空,必须至少有一个值。

不支持

错误​ 问题 解决方案
CollectionFormatValueNotSupported The 'collectionFormat' keyword value '{0}' is not supported. 仅支持某些集合格式。 您的 Swagger 包含不支持的格式。
MimeTypeNotSupported The MIME type '{0}' is not supported. The supported mime types are: '{1}'. 您尝试在 Swagger 中使用的 MIME 类型不受支持。
PathItemRefNotSuppored The '$ref' property in a path is not supported. 路径不能定义“$ref”属性。 删除此属性。
SwaggerKeywordNotSupported The '{0}' keyword is not supported. {0} 是一个 Swagger 关键字,如“uniqueItems”,在使用它的上下文中不被允许。

参数

错误​ 问题 解决方案
FileParameterMustBeInFormData Parameters of type 'file' are not valid in locations other than 'formData'. 您的 Swagger 有一个“file”类型的参数,它只能“in”“formData”。
ParameterListContainsFormDataAndBody The 'parameters' list defines both a 'body' parameter, and a 'formData' parameter. Only one of these location types can be used in an operation. 您的 Swagger 在同时定义不允许的正文参数和 formData。 删除这些参数类型之一。
ParameterReferenceNotFound The parameter reference '{0}' could not be found in the swagger document. 您的 Swagger 具有在 Swagger 文档中找不到的参数引用。 删除对此参数的引用。
ParameterReferenceNotValid The parameter reference '{0}' is not valid. Parameter references must start with '#/parameters/' and be valid JSON Pointers. 您的 Swagger 有参数引用 (“#/parameters/”) 根据 JSON 指针 RFC 规范无效。
ParameterRefLoopNotAllowed The parameter definition may not use a '$ref' to point to another definition. 您的 Swagger 有参数定义错误地使用“$ref”来指向另一个定义。
ParamtersWithSameNameMustHave
SameTypeAndVisibility
Parameters of the same name in fetch and subscribe operations must be of the same type and visibility. 如果您的 Swagger 在提取和订阅操作中有相同名称的参数,它们应该具有相同的类型和可见性。
PathParameterMissingEncoding Encoding for path parameter '{0}' is missing, which might lead to invalid requests. Use "x-ms-url-encoding": "single" to ensure the value is URL encoded. {0} 是缺少编码的参数名称。
QueryParameterEncodingNotSupported Encoding for query parameter '{0}' is not supported. All query parameters are single encoded by default. {0} 是编码不受支持的参数名称。 修复此编码。
ReservedParameterIsUsed The parameter '{0}' is reserved and cannot be used in '{1}'. 在使用此错误中所述的参数,但不能使用,保留它是用于该部分或一般情况。
ResponseRefLoopNotAllowed The response definition may not use a '$ref' to point to another definition. 您的 Swagger 有响应定义错误地使用“$ref”来指向另一个定义。
SourcePropertyInternal The parameter reference '{0}' in the source operation '{1}' is internal or one of its parent(s) are internal. Either make the property visible or update the parameter reference to a static value. 参数引用被标记为内部,但使用参数引用的操作不是内部的。 更新参数或操作来修复此问题。

属性​​

错误​ 问题 解决方案
AdditionalPropertyNotAllowed The property '{0}' is not allowed and must be removed. 您的 Swagger 中有一个额外的属性必须删除。
AdditionalPropertyNotAllowedAdjacent
ToRef
When '$ref' is defined, no other properties may be specified. 在 Swagger 中使用“$ref”时,该 JSON 对象中不应包含其他属性。
BasePathNotValid The 'basePath' property, if present, must start with a '/' character. 如果您使用基本路径,它必须以“/”开头。 无效的基本路径类似于“abc/def/ghi”或“microsoft.com/abc”。
BodyParameterPropertyNotValid The 'body' parameter cannot use property '{0}', instead, the 'schema' property should be used to define the type used by the parameter. Swagger 中的正文参数之一使用了不能在正文参数中使用的无效属性。
ConnectorMetadataPropertiesMissing The connector metadata property '{0}' is required. 连接器需要某些元数据。
ContactEmailNotValid The contact 'email' property, if present, must be a valid email address. 提供的电子邮件地址格式不正确或包含非 ASCII 字符。
DefaultValueMustMatchType The 'default' value is of type '{0}', but should match the given type '{1}'. 默认值的值与给定类型不同。 将默认值的值更改为给定类型的值来解决此问题。
EnumMustContainAtLeastOneElement The 'enum' array requires at least one value. 如果您的属性类型是枚举,应指定一个数组,其中至少包含一个枚举值。
ExtensionNameNotValid The property '{0}' is not valid. If this property is an extension, its name must begin with "x-". 作为扩展的属性必须以“x-”前缀开头。
FilterFunctionsPropertyEmpty The 'filterFunctions' property must have at least one element. 如果指定,“filterFunctions”属性不能为空。
FilterFunctionsPropertyHasDuplicates The 'filterFunctions' property cannot contain duplicates. “filterFunctions”属性不能包含重复项。
FilterFunctionsPropertyInInputSchema The 'filterFunctions' property has to be in the response schema. “filterFunctions”属性只能在响应架构中。
FilterFunctionsPropertyInvalidValue The 'filterFunctions' property supports only these values: {0}". “filterFunctions”属性不能指定不受支持的值。
HostNameNotValid The 'host' property, if present, must be a valid URI host without a scheme or path. 没有架构或路径的主机 URI 看起来像“www.microsoft.com”。 主机的无效 URI 看起来像“https://www.microsoft.com/”或“www.microsoft.com/hello”。
InternalPropertyWithDefaultOptional The internal property has a default value but is optional. Only required properties are guaranteed to be included in requests. 有属性标记为内部,并指定了默认值,但不是必需的。 如果要确保将其包含在请求中,请将其标记为必需;如果是有意未标记,可以保持原样。
InvalidConnectorCategory The connector category is invalid. Available categories are: [{0}]. 类别只能来自允许的类别值列表。
InvalidStringBinaryProperty A schema with type/format 'string/binary' can only be at the top level of a body or formData parameter. “string”和“binary”的属性“type”和“format”的值不允许在此架构位置使用。
JsonTypeIncorrect The type of the property is incorrect. Expected type '{0}', but value is of type '{1}'. Swagger 中的属性只有一种类型,实际值是另一种类型。 更改值类型以匹配预期类型。
JsonValueNotInEnum The property value must be one of the following: {0}. 枚举中的属性值与当前可用的选项不匹配。 将值更改为错误消息中所述的以下值之一。
MimeTypeNotValid The MIME type '{0}' is not valid. 您选择的用户提供的 MIME“content type”无效。 有效的 MIME 类型是:“application/json”、“text/plain”、“multipart/form-data”、“application/x-www-form-urlencoded”
MissingEnumValuesDisplayName The 'x-ms-enum-values' extension is invalid. Please specify the property 'displayName'. x-ms-enum-values 未指定“displayName”属性。
MultipleOfMustBeGreaterThanZero The 'multipleOf' value must be greater than zero. “multipleOf”属性的值应该是一个大于零的值。
OneOfPropertiesRequired At least one of the properties is required: [{0}]. {0} 是一个属性集。 此错误显示 Swagger 中需要存在的所有属性。
ProductionStatusOnBetaService The connector cannot be in Production status on a beta service. 当后端服务处于测试版时,连接器不能标记为“生产”。 必须设置为“预览”。
PropertyMustBeRequired The property is internal and has a default value, it must be required. Optional internal fields are ignored. 属性未设置,但是必需的。
RequiredPropertyDefinitionMissing The required property '{0}' is not defined in the object schema. 架构属性列在“required”下,因此必须在“properties”中定义
RequiredPropertyMissing The '{0}' property is required. 您的 Swagger 中的属性是必需的,但目前不在您的 Swagger 中。 包括此属性来修复此错误。
RequiredPropertyNotOnObject The property 'required' is applicable to schemas with 'object' type only and should be removed. “required”属性仅支持“object”类型。 删除所有其他类型的属性。
RequiredReadOnlyPropertyNotAllowed
AsInput
An input property cannot be 'readonly' and required. 您的 Swagger 包含标记为只读和必需的属性。 只读属性意味着用户不能修改值。 而必需属性则需要对值进行修改。
SchemeNotValid The 'schemes' property must only contain transfer protocols from the list: {0}. 架构属性应该是“http”或“https”之一。
SecuritySchemePropertyNotValid The security definition property '{0}' is not valid for definitions of type '{1}'. 您在 securityDefinitions 词典中包含了无效的属性名称和值。 将此属性更改为有效的属性名称来解决此问题。
SecuritySchemePropertyRequired The security definition property '{0}' is required for definitions of type '{1}'. 您没有在 securityDefinitions 词典中包含必需的属性名称和值。 添加此属性和值来解决此问题。
SpecificationVersionIncorrect The 'swagger' property must have the string value "2.0". 仅支持版本“2.0”,将 swagger 版本属性修复为“2.0”。
TagRedefined The 'tags' property defines tag '{0}' multiple times. 在“tags”属性中定义的标记必须是唯一的。 删除或替换任何有问题的标记。
TooManyConnectorCategories The maximum allowed number of categories for the connector is '{0}'. 可以为连接器设置的类别有数量限制。
UrlNotValid The 'url' property must be a valid absolute URL. 您的 Swagger 的 URL 无效。 可能是由于从某处错误地复制了 URL。

Response

错误​ 问题 解决方案
BodyParameterSchemaRequired The 'body' parameter must define a 'schema' property. 在正文参数中,必须定义架构属性。 定义架构属性来解决此问题。
BodySchemaCountExceedsMaxAllowed The total number of schemas in the object exceeds the max schema count allowed value of '{0}'. Please remove any unnecessary property or item definitions. 主体对象中的架构过多。 删除其中一部分,使总数回到限制值以下。
DefaultResponseHasSchema The 'default' response should not have schema definition. Schemas should be defined on expected responses only. 您的 Swagger 包含默认响应的架构定义。 删除默认响应的此架构定义可修复此错误。
InvalidCustomEditorExtension
DictionaryValue
The 'x-ms-editor' extension can be specified as 'dictionary' only for schema with type object and additional properties allowed. 检查 x-ms-editor 是否在架构类型为 object 并设置为允许的其他属性时仅设置为词典。
JsonPointerNotValid The JSON Pointer path is not valid. 在您的 Swagger 中使用的引用 (#ref) 无效。
NonBodyParameterSchemaNotValid The parameter cannot define a schema as it is not in the 'body'. 您的 Swagger 有使用“schema”的参数,但只有正文参数可以使用“schema”。
RequiredLoopInSchemaNotAllowed Loops of required schema properties are not allowed. 必需属性的规范不能使用引用循环。
ResponseExampleMustBeProduced
ByOperation
The response example '{0}' is not produced by the operation '{1}'. 您的 Swagger 有带有响应示例的操作,但该操作不生成具有指定 MIME 类型的响应。
ResponseHeadersAreNotUnique The response headers are not unique. 存在重复的响应标头。 响应标头应该是唯一的。
ResponseMustBeDefaultOrHttpStatusCode The response is not valid, the response must be a valid HTTP status code, or the string 'default'. 您的 Swagger 没有默认的 HTTP 状态代码或有效的 HTTP 状态代码。 将状态代码添加到您的响应中。
ResponseReferenceNotFound The response reference '{0}' could not be found in the swagger document. 您的 Swagger 有 Swagger 文档中找不到的响应引用。 删除对此响应的引用。
ResponseReferenceNotValid The response reference '{0}' is not valid. Response references must start with '#/responses/' and be valid JSON Pointers. 您的 Swagger 有根据 JSON 指针 RFC 规范属于无效的响应引用 (“#/responses/”)。
SchemaDefinitionSetIncorrectly The operation '{0}' should define an output schema on the 200 or 201 response code or in 'x-ms-notification-content' extension for a webhook to be visible in the designer. 您的操作缺少 200 或 201 响应代码的响应架构。 对于 webhook,响应架构应指定为通知内容扩展的一部分。
SchemaReferenceNotFound The schema reference '{0}' could not be found in the swagger document. 您的 Swagger 有 Swagger 文档中找不到的架构引用。
SchemaReferenceNotValid The schema reference '{0}' is not valid. Schema references must start with '#/definitions/' and be valid JSON Pointers. 您的 Swagger 有根据 JSON 指针 RFC 规范属于无效的架构引用 (‘#/definitions/’)。
SchemaRefLoopNotAllowed The schema definition may not use a '$ref' to point to another definition. 您的架构中有引用循环(A 指向 B,B 又指回 A)。
SchemaTooDeep The schema exceeds the maximum allowed depth. Schemas must not exceed a depth of '{0}', including referenced ('$ref') schemas. 架构仅限于特定的 JSON 深度。 使用更浅的架构。
SchemaTypeFileNotValid The schema type 'file' is not valid. Only parameters in 'formData' and the root response schema may be of type 'file'. 仅窗体数据中支持使用架构类型“file”,并且其必须位于响应定义的响应架构的根。
SchemeNotSupported The WebSocket transfer protocol schemes are not supported. 不支持此架构。 支持的架构是 Https 和 Http。
TotalSchemaCountExceedsMaxAllowed The maximum allowed number of schemas in the swagger is '{0}'. Please remove any unnecessary property or item definitions. Swagger 中的架构太多。

安全性

错误​ 问题 解决方案
OAuthSecurityRequirementValueMustBe
ScopeName
The OAuth security requirement '{0}' refers to scope name '{1}', but this is not defined in the 'securityDefinitions' object. 安全要求名称必须是在安全定义对象中定义的范围名称。
SecurityRequirementMustBeDefined The security requirement '{0}' is not defined in the 'securityDefinitions' object. 使用了安全要求,但未在安全定义词典中定义。
SecurityRequirementMustHaveEmptyValue The security requirement '{0}' cannot specify any scopes, an empty array should be provided. 根据当前配置,名称为“{0}”的安全要求必须是一个空数组。
SecurityRequirementMustHaveValue The security requirement '{0}' must have have a value. Provide an empty array if no OAuth scopes are required. 安全要求缺失或为 null。 如果不需要 OAuth 范围,请指定一个空数组。

Webhook

错误​ 问题 解决方案
NotificationUrlNotAllowedInThisPosition The notification URL property is not allowed in this position. It is allowed only in input body. “x-ms-notification-url”属性应该只在输入中定义。
NotificationUrlNotInternal The notification URL property itself or at least one of its parents must be internal. 您的 Swagger 目前没有将通知 URL 属性设置为内部,应该是这一原因。
NotificationUrlNotRequired The notification URL property must be required all the way through the schema chain. 您的 Swagger 目前不需要通知 URL 属性,它应该是必需的。
NotificationUrlNotString The notification URL property must be of type string. 通知 URL 属性具有不是字符串类型的值。

元数据

错误​ 问题 解决方案
AllowEmptyValueOnlyValidForQuery
FormData
The parameter cannot use the 'allowEmptyValue' keyword as it is not in the 'query' or 'formData' location. 属性“allowEmptyValue”只能在“location”属性为“query”或“formData”的参数中设置为“true”。 而“location”属性的值哪一个都不是。
DiscriminatorMustBeARequiredStringProperty The 'discriminator' value must be the name of a required string property. “discriminator”值应该是您的 Swagger 中必需字符串属性的名称。
ExclusiveMaximumRequiresMaximum The 'exclusiveMaximum' keyword can only be specified if the 'maximum' keyword is also specified. 您不能在不指定“maximum”的情况下指定“exclusiveMaximum”。
ExclusiveMinimumRequiresMinimum The 'exclusiveMinimum' keyword can only be specified if the 'minimum' keyword is also specified. 您不能在不指定“minimum”的情况下指定“exclusiveMinimum”。
FieldLengthExceeded The '{0}' value goes over the character limit '{1}' 具有在 {0} 中指定的名称的字段超出了在 {1} 中指定的字符数限制。
FieldLengthNotInRange The '{0}' value must be between '{1}' and '{2}' characters. {0} 是字段名称,{1} 是最小长度,{2} 是限制。 减少此字段中的字符长度。
MaxItemsMustBeGreaterThanOrEqual
ToZero
The 'maxItems' value must be greater than or equal to zero. “maxItems”值当前低于零,将此值更改为大于或等于零。
MaxLengthMustBeGreaterThanOrEqual
ToZero
The 'maxLength' value must be greater than or equal to zero. “maxLength”属性的值应该是一个非负数。
MaxPropertiesMustBeGreaterThanOrEqual
ToZero
The 'maxProperties' value must be greater than or equal to zero. “maxProperties”值当前低于零,将此值更改为大于或等于零。
MinimumShouldBeLessThanOrEqual
ToMaximum
The 'minimum' value should be less than or equal to the 'maximum' value. 指定最小值时,值应小于或等于最大值。
MinItemsMustBeGreaterThanOrEqual
ToZero
The 'minItems' value must be greater than or equal to zero. “minItems”值当前低于零,将此值更改为大于或等于零。
MinItemsShouldBeLessThanOrEqual
ToMaxItems
The 'minItems' value should be less than or equal to the 'maxItems' value. 指定最小项目数时,此值应小于或等于最大项目数。
MinLengthMustBeGreaterThanOrEqual
ToZero
The 'minLength' value must be greater than or equal to zero. “minLength”属性的值应该是一个非负数。
MinLengthShouldBeLessThanOrEqual
ToMaxLength
The 'minLength' value should be less than or equal to the 'maxLength' value. 指定最小长度时,此值应小于或等于最大长度。
MinPropertiesMustBeGreaterThanOrEqual
ToZero
The 'minProperties' value must be greater than or equal to zero. “minProperties”值当前低于零,将此值更改为大于或等于零。
PatternShouldBeValidRegularExpression The 'pattern' value should be a valid regular expression. “pattern”值不是有效的正则表达式,修复正则表达式将修复此错误。
RequiredValueEmpty The '{0}' property must have not empty value. 您的 Swagger 为必需属性包含了空值。 设置此必需属性的值可解决此问题。
ValueContainsRestrictedWords The value '{0}' contains at least one of the restricted words: '{1}'. Swagger 中的一个字段使用了受限词。
ValueMustBeInEnglish The '{0}' value must be written in English. 将此值替换为仅包含字母数字字符的值。
ValueMustEndWithAlphanumeric The '{0}' value must end with alphanumeric character. 将最后一个字符替换为字母数字字符