mirror of
https://gitlab.nic.cz/knot/knot-dns.git
synced 2026-02-03 18:49:28 -05:00
knotc: add OPTINT in JSON schema of configuration file
This commit is contained in:
parent
c79032e353
commit
c7474f0660
1 changed files with 22 additions and 1 deletions
|
|
@ -1175,7 +1175,28 @@ static void export_type(jsonw_t *w, const yp_item_t *item)
|
|||
);
|
||||
break;
|
||||
case YP_TOPTINT:
|
||||
// TODO
|
||||
SINGLE_OR_ARRAY(
|
||||
jsonw_list(w, "anyOf");
|
||||
jsonw_object(w, NULL);
|
||||
jsonw_str(w, "$ref", "#/$defs/int");
|
||||
jsonw_end(w);
|
||||
jsonw_object(w, NULL);
|
||||
jsonw_str(w, "$ref", "#/$defs/int_time");
|
||||
jsonw_end(w);
|
||||
jsonw_object(w, NULL);
|
||||
jsonw_str(w, "$ref", "#/$defs/int_size");
|
||||
jsonw_end(w);
|
||||
jsonw_object(w, NULL);
|
||||
jsonw_str(w, "type", "string");
|
||||
jsonw_list(w, "enum");
|
||||
for (const knot_lookup_t *o = item->var.i.opts;
|
||||
o->name != NULL; ++o) {
|
||||
jsonw_str(w, NULL, o->name);
|
||||
}
|
||||
jsonw_end(w);
|
||||
jsonw_end(w);
|
||||
jsonw_end(w);
|
||||
);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue