True if the schema's required[] array contains `key`. */
| 11748 | |
| 11749 | /* True if the schema's required[] array contains `key`. */ |
| 11750 | static bool cli_schema_required_has(yyjson_val *required, const char *key) { |
| 11751 | if (!required || !yyjson_is_arr(required)) { |
| 11752 | return false; |
| 11753 | } |
| 11754 | size_t idx; |
| 11755 | size_t max; |
| 11756 | yyjson_val *v; |
| 11757 | yyjson_arr_foreach(required, idx, max, v) { |
| 11758 | if (yyjson_is_str(v) && strcmp(yyjson_get_str(v), key) == 0) { |
| 11759 | return true; |
| 11760 | } |
| 11761 | } |
| 11762 | return false; |
| 11763 | } |
| 11764 | |
| 11765 | /* Look up a property's JSON-schema "type" string (string/integer/number/ |
| 11766 | * boolean/array). Returns NULL when the schema or property is unknown — the |
no outgoing calls
no test coverage detected