diff --git a/tools/create_api_map.py b/tools/create_api_map.py index cdf03c733..924564206 100644 --- a/tools/create_api_map.py +++ b/tools/create_api_map.py @@ -854,7 +854,13 @@ def _gen_csv_line(doc_line: dict) -> str: samples: list[str] = doc_line.get("samples", []) csv_lines: list[str] = [] for sample in samples: - url, content = sample.split(";", maxsplit=1) + fragments = sample.split(";", maxsplit=1) + if len(fragments) == 2: + url, content = fragments + elif len(fragments) == 1: + url, content = fragments[0], "" + else: + raise ValueError(f"Error: sample invalide: {sample}") csv_line = f'"{entry_name}";"{url}";"{permission}";"{method}";' if content: csv_line += f'"{content}"'