Validate array item types strictly according to JSON Schema
- When deserializing an array, if any item has an incorrect type,
the entire array should be treated as invalid and dropped.
OpenAPI 3.1 uses JSON Schema (2020-12) for validation.
JSON Schema requires strict type validation without automatic
coercion. See "Type-specific keywords" section:
https://json-schema.org/understanding-json-schema/reference/type
According to JSON Schema specification:
* Arrays are defined with "type: array" and "items" schema
* Each array item MUST match the schema defined in "items"
* If any item fails validation, the data is non-conformant
The old implementation had two issues:
1. In fromJsonValue(QList<T>&, QJsonValue&): When iterating through
array items, if an item had wrong type, the function would still
add invalid items to the result and return true/false based on
accumulated status. This allowed partially invalid arrays.
2. In model-body.mustache for nested arrays: When an array item
was expected to be an array but wasn't, the code didn't properly
invalidate and clear the parent array.
This fix ensures:
* Any type mismatch in array items causes the entire array to be
dropped immediately
* The array is cleared and marked as invalid
* No partial data is retained
Example: If schema defines "items: {type: string}" and JSON contains
[42], the entire array is dropped because 42 is not a string.
This maintains data integrity and prevents invalid partial data from
being processed by the application.
Task-number: QTBUG-145413
Pick-to: 6.11
Change-Id: I30285aa1b900cd846f952f3bd12e72cccd728171
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>