Fix prevent [] in filename

This commit is contained in:
Johan van Eck 2025-07-26 11:55:51 +03:00
parent 6d3fce1018
commit 91821f4c51
5 changed files with 4 additions and 1 deletions

View file

@ -29,7 +29,10 @@ def collect_regex_pattern(service, file_name, input_json, output_dir):
}
# Output path
output_path = os.path.join(output_dir, f"{name.replace('/', '-')}.yml")
output_path = os.path.join(
output_dir,
f"{name.replace('/', '-').replace('[', '(').replace(']', ')')}.yml",
)
with open(output_path, "w", encoding="utf-8") as f:
yaml.dump(yml_data, f, sort_keys=False, allow_unicode=True)
print(f"Generated: {output_path}")