From 54048b15e5be7e3e4717bb4bf6fee7d3444f3fc9 Mon Sep 17 00:00:00 2001 From: Ashutosh Kumar Date: Wed, 3 Feb 2021 19:18:54 +0530 Subject: [PATCH] provide empty _TYPES because snappi deserializer expects it in some cases --- snappi/snappigenerator.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snappi/snappigenerator.py b/snappi/snappigenerator.py index 4221664f..44cc352b 100644 --- a/snappi/snappigenerator.py +++ b/snappi/snappigenerator.py @@ -403,6 +403,11 @@ def _write_snappi_object(self, ref, choice_method_name=None): self._write(2, "'%s': '%s'," % (name, value)) self._write(1, '}') self._write() + else: + # TODO: provide empty types as workaround because deserializer + # in snappicommon.py currently expects it + self._write(1, '_TYPES = {}') + self._write() # write constants # search for all simple properties with enum or @@ -1087,6 +1092,6 @@ def _get_inline_ref(self, base_dir, filename, inline_key): if __name__ == '__main__': - openapi_filename = None + openapi_filename = 'openapi.yaml' # openapi_filename = os.path.normpath('../../models/openapi.yaml') SnappiGenerator(dependencies=False, openapi_filename=openapi_filename)