summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi/vapi_json_parser.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2020-05-01 10:09:58 -0400
committerOle Trøan <otroan@employees.org>2020-05-04 17:26:28 +0000
commitd7a32ebd9948ff37c15d8b6e0e5d9cf243026239 (patch)
tree9b396469c0d6a418b99ff4281019571cea0049bd /src/vpp-api/vapi/vapi_json_parser.py
parent4ec36c5535849a4e456ed99b57968d54d5e03b62 (diff)
vapi: add support for defaults in typedefs
refactored out of Neale's change: https://gerrit.fd.io/r/c/vpp/+/26276 Type: refactor Change-Id: Ibb0c019856dc44640e94d6d80a5d119a6296d95c Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com> (cherry picked from commit a751d8d61fe5880f6d447e63b81e2df30561e9f9)
Diffstat (limited to 'src/vpp-api/vapi/vapi_json_parser.py')
-rw-r--r--src/vpp-api/vapi/vapi_json_parser.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vpp-api/vapi/vapi_json_parser.py b/src/vpp-api/vapi/vapi_json_parser.py
index 2a03bd04c03..6d2db422c96 100644
--- a/src/vpp-api/vapi/vapi_json_parser.py
+++ b/src/vpp-api/vapi/vapi_json_parser.py
@@ -29,6 +29,10 @@ class Field(object):
def __str__(self):
if self.len is None:
return "Field(name: %s, type: %s)" % (self.name, self.type)
+ elif type(self.len) == dict:
+ return "Field(name: %s, type: %s, length: %s)" % (self.name,
+ self.type,
+ self.len)
elif self.len > 0:
return "Field(name: %s, type: %s, length: %s)" % (self.name,
self.type,