Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #104
Details
This pull request updates the way
userdatadetailsare serialized to URL parameters across several CloudStack API parameter structs. Instead of using fixed.keyand.valuefields, the code now dynamically uses the map key as the parameter name, improving flexibility and aligning with expected API conventions. The code generator is also updated to reflect this change, ensuring future code generation remains consistent.Parameter serialization changes:
userdatadetailsintoURLValues()methods to serialize each key-value pair asuserdatadetails[i].<key>=<value>instead ofuserdatadetails[i].key=<key>anduserdatadetails[i].value=<value>. This affects:DeployVirtualMachineParams(cloudstack/VirtualMachineService.go)UpdateVirtualMachineParams(cloudstack/VirtualMachineService.go)ResetUserDataForVirtualMachineParams(cloudstack/VirtualMachineService.go)DeployVnfApplianceParams(cloudstack/VirtualNetworkFunctionsService.go)CreateAutoScaleVmProfileParams(cloudstack/AutoScaleService.go)UpdateAutoScaleVmProfileParams(cloudstack/AutoScaleService.go)Code generation update:
generate/generate.go) to emit the new serialization logic foruserdatadetails, ensuring future generated code uses the correct format.I used the below script for testing.
Used this to create the VM before and after the changes.

7 is after the changes
8 is before