Merge pull request #1599 from shapeblue/independent-marvin

Marvin: Fix codegenerator to work with API discoveryThis fixes Marvin cloudstackAPI generator to work with a live running mgmt server's api discovery.

* pr/1599:
  marvin: fix codegeneration against API discovery endpoint

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2016-08-23 15:35:51 +05:30
commit 11c90dfb3b
1 changed files with 3 additions and 1 deletions

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)