remove unecessery description in response
This commit is contained in:
parent
c442abe674
commit
d424c9cd0b
@ -189,13 +189,12 @@ class ResponseDefinition:
|
||||
if value.startswith('[]'):
|
||||
value = '[]{}'.format(CUSTOMTYPES[version][tvalue].type)
|
||||
else:
|
||||
value = CUSTOMTYPES[version][value].type
|
||||
value = CUSTOMTYPES[version][tvalue].type
|
||||
self.description = CUSTOMTYPES[version][tvalue].description
|
||||
else:
|
||||
self._valid_type(value)
|
||||
raise Exception('only customtype is supported in response')
|
||||
elif key == 'description':
|
||||
if value.endswith('.'):
|
||||
value = value[:-1]
|
||||
value = MESSAGE_TRANSLATION(value)
|
||||
raise Exception('description is not allowed in response')
|
||||
setattr(self, key, value)
|
||||
# check mandatory keys
|
||||
for key in self.__slots__:
|
||||
@ -204,12 +203,6 @@ class ResponseDefinition:
|
||||
except AttributeError:
|
||||
raise Exception(_('mandatory key not set {}').format(key))
|
||||
|
||||
def _valid_type(self, typ):
|
||||
if typ.startswith('[]'):
|
||||
self._valid_type(typ[2:])
|
||||
elif typ not in ['Boolean', 'String', 'Number', 'File', 'Dict']:
|
||||
raise Exception(_('unknown parameter type: {}').format(typ))
|
||||
|
||||
|
||||
def _parse_parameters(raw_defs,
|
||||
version):
|
||||
|
Loading…
Reference in New Issue
Block a user