We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20ae626 commit 284d7dbCopy full SHA for 284d7db
1 file changed
kafka/protocol/new/api_struct.py
@@ -9,17 +9,18 @@
9
class ApiStruct(Field):
10
@classmethod
11
def parse_json(cls, json):
12
- if json['type'] in ('request', 'response', 'header') or json['type'][0].isupper():
13
- if 'fields' in json:
14
- return cls(json)
+ if 'type' not in json or json['type'].startswith('[]'):
+ return
+ if 'fields' in json:
15
+ return cls(json)
16
17
# Cases
18
# oldschool - standard types, no tagged fields
19
# newschool - compact types, tagged fields
20
# nested tag - compact types, no (nested) tagged fields
21
def __init__(self, json):
22
super().__init__(json)
- self._field_map = {field.name: field for field in self._fields if field is not None}
23
+ self._field_map = {field.name: field for field in self._fields}
24
self._data_class = None
25
26
@property
0 commit comments