Change in ovirt-engine-sdk-ruby[sdk_4.0]: Use type name as the tag for method parameters

juan.hernandez at redhat.com juan.hernandez at redhat.com
Fri Jul 8 10:13:40 UTC 2016


Juan Hernandez has submitted this change and it was merged.

Change subject: Use type name as the tag for method parameters
......................................................................


Use type name as the tag for method parameters

Currently the name of the XML tag used to represent the input parameters
of methods like "add" is the name of the parameter as described in the
model. For example, for the operation to add a disk attachment the name
of the parameter is "attachment", so the XML document generated and sent
by the SDK is something like this:

  <attachment>
    ...
  </attachment>

But the server doesn't expect this, it expects the name the XML tag
corresponding to the type of the parameter, in this case this case
"DiskAttachment", so the server expects the following:

  <disk_attachment>
    ...
  </disk_attachment>

It would be more correct to use the name of the parameter, as described
in the model, but it isn't factible to introduce such change in the
server side at this point, so we need to change the SDK to generate what
the server expects. That is what this patch does.

In the future, we will probably change the server so that it ignores the
root tag of the documents, then this patch can be reverted.

Change-Id: I2861cf05cb0a39a7f2bdbbafb72dcf0e3b56823d
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
(cherry picked from commit 52b7ff98ed4555019db93476afd03cd95a937bd7)
---
M generator/src/main/java/org/ovirt/sdk/ruby/ServicesGenerator.java
1 file changed, 2 insertions(+), 4 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/60394
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2861cf05cb0a39a7f2bdbbafb72dcf0e3b56823d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk-ruby
Gerrit-Branch: sdk_4.0
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list