Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go snippets that use additionalData generate incorrectly #1958

Open
jasonjoh opened this issue Feb 21, 2024 · 0 comments
Open

Go snippets that use additionalData generate incorrectly #1958

jasonjoh opened this issue Feb 21, 2024 · 0 comments
Labels
area: snippets-generation Describes a required fix to the snippet generator

Comments

@jasonjoh
Copy link
Member

Context: https://github.com/microsoftgraph/microsoft-graph-docs-contrib/issues/38

Example 2 on page Create group uses additionalData to add an owner and 2 members to the new group. It shows the following invalid code:

additionalData := map[string]interface{}{
	odataBind := []string {
		"https://graph.microsoft.com/v1.0/users/26be1845-4119-4801-a799-aea79d09f1a2",
	}
	odataBind := []string {
		"https://graph.microsoft.com/v1.0/users/ff7cb387-6688-423c-8188-3da9532a73cc",
		"https://graph.microsoft.com/v1.0/users/69456242-0067-49d3-ba96-9de6f2728e14",
	}
}

Correct code should look like:

additionalData := map[string]any{
	"[email protected]": []string{
		"https://graph.microsoft.com/v1.0/users/d19d82fe-a21d-4f2e-8519-befa248ef769",
	},
	"[email protected]": []string{
		"https://graph.microsoft.com/v1.0/users/d1ac16ce-60f7-4230-b98b-6c7574bb17b6",
		"https://graph.microsoft.com/v1.0/users/37a7dc1b-812b-4336-8210-76b2180b574a",
	},
}
@millicentachieng millicentachieng added the area: snippets-generation Describes a required fix to the snippet generator label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: snippets-generation Describes a required fix to the snippet generator
Projects
None yet
Development

No branches or pull requests

2 participants