True if the schema's required[] array contains `key`. */
| 12206 | |
| 12207 | /* True if the schema's required[] array contains `key`. */ |
| 12208 | static bool cli_schema_required_has(yyjson_val *required, const char *key) { |
| 12209 | if (!required || !yyjson_is_arr(required)) { |
| 12210 | return false; |
| 12211 | } |
| 12212 | size_t idx; |
| 12213 | size_t max; |
| 12214 | yyjson_val *v; |
| 12215 | yyjson_arr_foreach(required, idx, max, v) { |
| 12216 | if (yyjson_is_str(v) && strcmp(yyjson_get_str(v), key) == 0) { |
| 12217 | return true; |
| 12218 | } |
| 12219 | } |
| 12220 | return false; |
| 12221 | } |
| 12222 | |
| 12223 | /* Look up a property's JSON-schema "type" string (string/integer/number/ |
| 12224 | * boolean/array). Returns NULL when the schema or property is unknown — the |
no outgoing calls
no test coverage detected