Modified generator to generate api deprecation warnings (#527)
Signed-off-by: saimedhi <saimedhi@amazon.com>
This commit is contained in:
@@ -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"]})
|
||||
|
||||
|
||||
@@ -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" %}
|
||||
|
||||
Reference in New Issue
Block a user