True if the schema's required[] array contains `key`. */
| 12494 | |
| 12495 | /* True if the schema's required[] array contains `key`. */ |
| 12496 | static bool cli_schema_required_has(yyjson_val *required, const char *key) { |
| 12497 | if (!required || !yyjson_is_arr(required)) { |
| 12498 | return false; |
| 12499 | } |
| 12500 | size_t idx; |
| 12501 | size_t max; |
| 12502 | yyjson_val *v; |
| 12503 | yyjson_arr_foreach(required, idx, max, v) { |
| 12504 | if (yyjson_is_str(v) && strcmp(yyjson_get_str(v), key) == 0) { |
| 12505 | return true; |
| 12506 | } |
| 12507 | } |
| 12508 | return false; |
| 12509 | } |
| 12510 | |
| 12511 | /* Look up a property's JSON-schema "type" string (string/integer/number/ |
| 12512 | * boolean/array). Returns NULL when the schema or property is unknown — the |
no outgoing calls
no test coverage detected