tok is the JSON schema member for an object */
| 2008 | |
| 2009 | /* tok is the JSON schema member for an object */ |
| 2010 | static void add_table_object(tablemap *tablemap, |
| 2011 | struct table_desc *td, const jsmntok_t *tok) |
| 2012 | { |
| 2013 | const jsmntok_t *t, *properties, *allof, *cond; |
| 2014 | size_t i; |
| 2015 | |
| 2016 | /* This might not exist inside allOf, for example */ |
| 2017 | properties = json_get_member(schemas, tok, "properties"); |
| 2018 | if (properties) |
| 2019 | add_table_properties(tablemap, td, properties); |
| 2020 | |
| 2021 | allof = json_get_member(schemas, tok, "allOf"); |
| 2022 | if (allof) { |
| 2023 | json_for_each_arr(i, t, allof) |
| 2024 | add_table_object(tablemap, td, t); |
| 2025 | } |
| 2026 | /* We often find interesting things in then and else branches! */ |
| 2027 | cond = json_get_member(schemas, tok, "then"); |
| 2028 | if (cond) |
| 2029 | add_table_object(tablemap, td, cond); |
| 2030 | cond = json_get_member(schemas, tok, "else"); |
| 2031 | if (cond) |
| 2032 | add_table_object(tablemap, td, cond); |
| 2033 | } |
| 2034 | |
| 2035 | /* plugin is NULL if we're just doing --print-docs */ |
| 2036 | static void init_tablemap(struct plugin *plugin, tablemap *tablemap) |
no test coverage detected