True if the schema's required[] array contains `key`. */
| 4519 | |
| 4520 | /* True if the schema's required[] array contains `key`. */ |
| 4521 | static bool cli_schema_required_has(yyjson_val *required, const char *key) { |
| 4522 | if (!required || !yyjson_is_arr(required)) { |
| 4523 | return false; |
| 4524 | } |
| 4525 | size_t idx; |
| 4526 | size_t max; |
| 4527 | yyjson_val *v; |
| 4528 | yyjson_arr_foreach(required, idx, max, v) { |
| 4529 | if (yyjson_is_str(v) && strcmp(yyjson_get_str(v), key) == 0) { |
| 4530 | return true; |
| 4531 | } |
| 4532 | } |
| 4533 | return false; |
| 4534 | } |
| 4535 | |
| 4536 | /* Look up a property's JSON-schema "type" string (string/integer/number/ |
| 4537 | * boolean/array). Returns NULL when the schema or property is unknown — the |
no outgoing calls
no test coverage detected