diff --git a/CHANGELOG.md b/CHANGELOG.md index 993e2891..342ba1c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Removed - Removed support for Python 3.6, 3.7 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717)) ### Fixed -- Updated code generator to use new version of OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721)) +- Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721)) ### Updated APIs ### Security ### Dependencies diff --git a/utils/changelog_updater.py b/utils/changelog_updater.py index 9acd4001..7021c10c 100644 --- a/utils/changelog_updater.py +++ b/utils/changelog_updater.py @@ -26,10 +26,11 @@ def main() -> None: or "Changes not staged for commit:" in git_status.decode() or "Untracked files:" in git_status.decode() ): - print("Changes detected") - response = requests.get( - "https://api.github.com/repos/opensearch-project/opensearch-api-specification/commits" - ) + print("Changes detected; updating changelog.") + + base_url = "https://api.github.com/repos/opensearch-project/opensearch-api-specification/commits" + url_with_per_page = base_url + "?per_page=1" + response = requests.get(url_with_per_page) if response.ok: commit_info = response.json()[0] commit_url = commit_info["html_url"] diff --git a/utils/generate_api.py b/utils/generate_api.py index 3d4bdc2a..6d6fa4ea 100644 --- a/utils/generate_api.py +++ b/utils/generate_api.py @@ -386,6 +386,22 @@ def all_parts(self) -> Dict[str, str]: if self.namespace == "tasks" and self.name == "get": parts["task_id"]["required"] = False + # Workaround to prevent lint error: invalid escape sequence '\`' + if ( + self.namespace == "indices" + and self.name == "create_data_stream" + and part == "name" + ): + replace_str = r"`\`, " + # Replace the string in the description + parts["name"]["description"] = parts["name"]["description"].replace( + replace_str, "" + ) + if "backslash" not in parts["name"]["description"]: + parts["name"]["description"] = parts["name"]["description"].replace( + "`:`", "`:`, backslash" + ) + for k, sub in SUBSTITUTIONS.items(): if k in parts: parts[sub] = parts.pop(k) @@ -645,7 +661,7 @@ def read_modules() -> Any: if "description" in part: parts_dict.update( - {"description": part["description"].replace("\n", "")} + {"description": part["description"].replace("\n", " ")} ) if "x-enum-options" in part["schema"]: