|
408 | 408 | <t> |
409 | 409 | The value of this keyword MUST be a non-negative integer. |
410 | 410 | </t> |
411 | | - <t> |
412 | | - An array instance is valid against "maxContains" if the number of |
413 | | - elements that are valid against the schema for |
414 | | - <xref target="json-schema">"contains"</xref> is |
415 | | - less than, or equal to, the value of this keyword. |
416 | | - </t> |
417 | 411 | <t> |
418 | 412 | If "contains" is not present within the same schema object, |
419 | 413 | then this keyword has no effect. |
420 | 414 | </t> |
| 415 | + <t> |
| 416 | + An array instance is valid against "maxContains" if its |
| 417 | + value is less than or equal to, the array length of the annotation |
| 418 | + result from an adjacent |
| 419 | + <xref target="json-schema">"contains"</xref> keyword where the |
| 420 | + annotation is an array, or the length of the instance array |
| 421 | + where the annotation is "true". |
| 422 | + </t> |
421 | 423 | </section> |
422 | 424 |
|
423 | 425 | <section title="minContains"> |
424 | 426 | <t> |
425 | 427 | The value of this keyword MUST be a non-negative integer. |
426 | 428 | </t> |
427 | 429 | <t> |
428 | | - An array instance is valid against "minContains" if the number of |
429 | | - elements that are valid against the schema for |
430 | | - <xref target="json-schema">"contains"</xref> is |
431 | | - greater than, or equal to, the value of this keyword. |
| 430 | + If "contains" is not present within the same schema object, |
| 431 | + then this keyword has no effect. |
| 432 | + </t> |
| 433 | + <t> |
| 434 | + An array instance is valid against "minContains" if its |
| 435 | + value is greater than or equal to, the array length of the annotation |
| 436 | + result from an adjacent |
| 437 | + <xref target="json-schema">"contains"</xref> keyword where the |
| 438 | + annotation is an array, or the length of the instance array |
| 439 | + where the annotation is "true". |
432 | 440 | </t> |
433 | 441 | <t> |
434 | 442 | A value of 0 is allowed, but is only useful for setting a range |
435 | 443 | of occurrences from 0 to the value of "maxContains". A value of |
436 | 444 | 0 with no "maxContains" causes "contains" to always pass validation. |
437 | 445 | </t> |
438 | | - <t> |
439 | | - If "contains" is not present within the same schema object, |
440 | | - then this keyword has no effect. |
441 | | - </t> |
442 | 446 | <t> |
443 | 447 | Omitting this keyword has the same behavior as a value of 1. |
444 | 448 | </t> |
|
0 commit comments