marvin: fix codegeneration against API discovery endpoint

This makes the commands.xml based codegeneration equivalent to the
API discovery end point based discovery.

This fixes the fields that the (api discovery based) codegenerator should
produce in the generated python classes (cmd and response classes per
api/module). The issue was that the autogenerated cloudstackAPI differed between
api-based and apidocs-based code generation. With this fix the generated classes
match exactly thereby allowing us to go with either methods to generate
cloudstackAPI.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2016-06-28 15:53:20 +05:30
parent d3e45515ee
commit 7a53feee22

View File

@ -368,6 +368,7 @@ class CodeGenerator(object):
self.constructResponseFromJSON(innerResponse)
paramProperty.subProperties.append(subProperty)
paramProperty.type = response['type']
paramProperty.dataType = response['type']
return paramProperty
def loadCmdFromJSON(self, apiStream):
@ -404,13 +405,14 @@ class CodeGenerator(object):
assert paramProperty.name
if 'required' in param:
paramProperty.required = param['required']
paramProperty.required = str(param['required']).lower()
if 'description' in param:
paramProperty.desc = param['description']
if 'type' in param:
paramProperty.type = param['type']
paramProperty.dataType = param['type']
csCmd.request.append(paramProperty)