yanglint BUGFIX validate data even if the output format not specified
non-interactive mode
When data output not specified, the data files were not validated even
if provided.
@@ -767,7 +767,8 @@ main_ni(int argc, char *argv[])
if (c.list) {
/* print the list of schemas */
print_list(c.out, c.ctx, c.data_out_format);
- } else if (c.schema_out_format) {
+ } else {
+ if (c.schema_out_format) {
if (c.schema_node) {
ret = lys_print_node(c.out, c.schema_node, c.schema_out_format, 0, c.schema_print_options);
if (ret) {
@@ -784,13 +785,17 @@ main_ni(int argc, char *argv[])
}
}
}
- } else if (c.data_out_format) {
+ }
+
+ /* do the data validation despite the schema was printed */
+ if (c.data_inputs.size) {
if (process_data(c.ctx, c.data_type, c.data_merge, c.data_out_format, c.out,
c.data_parse_options, c.data_validate_options, c.data_print_options,
&c.data_operational, &c.data_inputs, &c.data_request_paths, &c.data_requests, NULL)) {
goto cleanup;
}
}
+ }
cleanup:
/* cleanup */
