Skip to content

Conversation

lucasdk3
Copy link

@lucasdk3 lucasdk3 commented Mar 5, 2025

Hi, i have a problem to create metadata files with userdatadetails, with the current configuration it is creating only one key file and one value file, this way:
Image

current code:

if v, found := p.p["userdatadetails"]; found {

if v, found := p.p["userdatadetails"]; found {
	m := v.(map[string]string)
	for i, k := range getSortedKeysFromMap(m) {
		u.Set(fmt.Sprintf("userdatadetails[%d].key", i), k)
		u.Set(fmt.Sprintf("userdatadetails[%d].value", i), m[k])
	}
}

the cloudstack api use with this form:

Image

to fix this problem is necessary change the code for this mode:

if v, found := p.p["userdatadetails"]; found {
	m := v.(map[string]string)
	for i, k := range getSortedKeysFromMap(m) {
		u.Set(fmt.Sprintf("userdatadetails[%d].%s", i, k), m[k])
	}
}

The error have a big impact in my current work, if possible, correct it as soon as possible.
Thanks by attention, Lucas Batista - Wevy Cloud (Brazil)

@DaanHoogland DaanHoogland linked an issue Apr 11, 2025 that may be closed by this pull request
Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change needs to go in the generate.go file. Otherwise when the code is generated next time, this change will get reverted.

@sureshanaparti sureshanaparti changed the title fix(userdatadetails): Fix userdatatails to create all files fix(userdatadetails): Fix userdatadetails to create all files Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error to create metadata files with userdatadetails
2 participants