jsons printer CHANGE print info about import's target
besides information from the schema, print also how the import is
actually resolved in the context (revison of the module when the import
is specified without revision).
diff --git a/src/printer_json_schema.c b/src/printer_json_schema.c
index 3d75b45..394c72b 100644
--- a/src/printer_json_schema.c
+++ b/src/printer_json_schema.c
@@ -471,6 +471,7 @@
const struct lys_import *imp, uint8_t imp_size, char **label)
{
int i, j = 1, f;
+ char *str;
if (imp_size && (*label)) {
ly_print(out, *label);
@@ -489,6 +490,9 @@
ly_print(out, ",\"from-submodule\":\"%s%s%s\"", submodule->name,
submodule->rev_size ? "@" : "", submodule->rev_size ? submodule->rev[0].date : "");
}
+ asprintf(&str, "%s%s%s", imp[i].module->name, imp[i].module->rev_size ? "@" : "", imp[i].module->rev_size ? imp[i].module->rev[0].date : "");
+ jsons_print_text(out, "resolves-to", "module", str, 1, &f);
+ free(str);
ly_print(out, "}");
}
}