microsoft-graph-devx-api icon indicating copy to clipboard operation
microsoft-graph-devx-api copied to clipboard

Null values in anonymously generated types in snippets should include type information.

Open andrueastman opened this issue 6 months ago • 0 comments

Sourced from https://github.com/microsoftgraph/microsoft-graph-docs-contrib/pull/9067#issuecomment-1915999266

Snippet generated as below correctly places undocumented properties in addtionaldata. However, assinging values that are null in an anonymous object creates the issue on runtime.

var requestBody = new User
{
	AdditionalData = new Dictionary<string, object>
	{
		{
			"extkmpdyld2_graphLearnCourses" , new 
			{
				CourseType = "Instructor-led",
				CourseId = null,
			}
		},
	},
};

The null value/property should include some type information or an alternative to using anonymous types in the additionalData investigated.

andrueastman avatar Jan 31 '24 08:01 andrueastman