Thanks to you @fdutton for the fix.
I encountered some strange behavior with it.
I have tested the minContains with a very simple schema, but the error is a "contains" error and not a "minContains" error.
This is the sample schema :
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schemas/samples/sample.mincontains.schema.json",
"properties": {
"myArray": {
"type": "array",
"minContains": 2,
"contains": {"properties": {"itemType": {"const": "type A"}}
},
"items": {"properties": {"itemType": {"type": "string"}}}
}
}
}
And this is the document to validate with this schema :
{
"$schema": "schemas/samples/sample.mincontains.schema.json",
"myArray": [{"itemType": "type A"}]
}
This is the com.networknt.schema.ValidationMessage I have as result:
| Attribute |
Value |
| type |
"contains" |
| code |
"1043" |
| path |
"$.myArray" |
| schemaPath |
"#/properties/myArray/contains" |
| arguments |
["2", "{"properties":{..."] |
| details |
null |
The ValidationMessage should have "minContains" as type value
I have tested the "normal" behavior on https://www.jsonschemavalidator.net/s/4KTe05B9
Originally posted by @tripple-v in #512 (comment)
Thanks to you @fdutton for the fix.
I encountered some strange behavior with it.
I have tested the minContains with a very simple schema, but the error is a "contains" error and not a "minContains" error.
This is the sample schema :
And this is the document to validate with this schema :
This is the
com.networknt.schema.ValidationMessageI have as result:The ValidationMessage should have "minContains" as
typevalueI have tested the "normal" behavior on https://www.jsonschemavalidator.net/s/4KTe05B9
Originally posted by @tripple-v in #512 (comment)