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