Modified generator to generate api deprecation warnings (#527)

Signed-off-by: saimedhi <saimedhi@amazon.com>
This commit is contained in:
Sai Medhini Reddy Maryada
2023-10-09 16:47:26 -04:00
committed by GitHub
parent 2bfc409177
commit e4c59e4732
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -263,6 +263,7 @@ class API:
self.description = ""
self.doc_url = ""
self.stability = self._def.get("stability", "stable")
self.deprecation_message = self._def.get("deprecation_message")
if isinstance(definition["documentation"], str):
self.doc_url = definition["documentation"]
@@ -560,6 +561,9 @@ def read_modules():
documentation = {"description": z["description"]}
api.update({"documentation": documentation})
if "deprecation_message" not in api and "x-deprecation-message" in z:
api.update({"deprecation_message": z["x-deprecation-message"]})
if "params" not in api and "params" in z:
api.update({"params": z["params"]})
+4
View File
@@ -28,6 +28,10 @@
{% endfor %}
{% endif %}
"""
{% if api.deprecation_message %}
from warnings import warn
warn("Deprecated: {{ api.deprecation_message }}")
{% endif %}
{% include "substitutions" %}
{% include "required" %}
{% if api.body.serialize == "bulk" %}