RicoSuter/NJsonSchema

NJsonSchema reports validation error on a missing constrained but not required array

開放

#742 建立於 2018年7月11日

 (2 則留言) (0 個反應) (0 位負責人)C# (550 個分叉)github user discovery
help wantedtype: bug

倉庫指標

星標
 (1,581 顆星)
PR 合併指標
 (平均合併 39天 6小時) (30 天內合併 1 個 PR)

描述

Hi,

I am using NJosnSchema to validate json events for an API. One of schemas provided by API is this. Note it has an array field 'prohibited' which is NOT marked as required, but has a constraint imposed on it - if it's present, it must have at least one item.

Now, I try to validate this json using that schema - and it presents me with a validation error: ArrayExpected: #/message.prohibited

I'd expect that should not be the case?

貢獻者指南