cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 11c90df
Date Tue, 23 Aug 2016 10:06:09 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 9555492b4 -> 11c90dfb3


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>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7a53feee
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7a53feee
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7a53feee

Branch: refs/heads/master
Commit: 7a53feee22c873c4e35c86b3fc1d4647314b62bf
Parents: d3e4551
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Tue Jun 28 15:53:20 2016 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Fri Aug 19 13:43:48 2016 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/codegenerator.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a53feee/tools/marvin/marvin/codegenerator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/codegenerator.py b/tools/marvin/marvin/codegenerator.py
index ba2a325..14f6d13 100644
--- a/tools/marvin/marvin/codegenerator.py
+++ b/tools/marvin/marvin/codegenerator.py
@@ -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)
 


Mime
View raw message